From 2a90e0c55f8038d827ea12638d6d7c3d2ed65dcc Mon Sep 17 00:00:00 2001 From: David Regla Date: Mon, 26 Dec 2022 20:38:18 -0600 Subject: [PATCH 01/11] Remove extra trailing space in JSON file --- frontend/public/locales/common/ru.json | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/public/locales/common/ru.json b/frontend/public/locales/common/ru.json index 919d648291..65c61b4cbf 100644 --- a/frontend/public/locales/common/ru.json +++ b/frontend/public/locales/common/ru.json @@ -51,4 +51,3 @@ "statusLoadingModel": "Загрузка модели", "statusModelChanged": "Модель изменена" } - From f173e0a0850fcfef749763d11bf755364253c286 Mon Sep 17 00:00:00 2001 From: David Regla Date: Mon, 26 Dec 2022 21:03:36 -0600 Subject: [PATCH 02/11] i18n: add Spanish (es) translations --- frontend/public/locales/common/de.json | 1 + frontend/public/locales/common/en.json | 1 + frontend/public/locales/common/es.json | 58 +++++ frontend/public/locales/common/it.json | 1 + frontend/public/locales/common/pl.json | 1 + frontend/public/locales/common/pt_br.json | 1 + frontend/public/locales/common/ru.json | 1 + frontend/public/locales/gallery/es.json | 16 ++ frontend/public/locales/hotkeys/es.json | 207 ++++++++++++++++++ frontend/public/locales/modelmanager/es.json | 53 +++++ frontend/public/locales/options/es.json | 62 ++++++ frontend/public/locales/settings/es.json | 13 ++ frontend/public/locales/toast/es.json | 32 +++ frontend/public/locales/tooltip/es.json | 15 ++ frontend/public/locales/unifiedcanvas/es.json | 59 +++++ .../system/components/LanguagePicker.tsx | 1 + 16 files changed, 522 insertions(+) create mode 100644 frontend/public/locales/common/es.json create mode 100644 frontend/public/locales/gallery/es.json create mode 100644 frontend/public/locales/hotkeys/es.json create mode 100644 frontend/public/locales/modelmanager/es.json create mode 100644 frontend/public/locales/options/es.json create mode 100644 frontend/public/locales/settings/es.json create mode 100644 frontend/public/locales/toast/es.json create mode 100644 frontend/public/locales/tooltip/es.json create mode 100644 frontend/public/locales/unifiedcanvas/es.json diff --git a/frontend/public/locales/common/de.json b/frontend/public/locales/common/de.json index b6c396356e..a1b1a12739 100644 --- a/frontend/public/locales/common/de.json +++ b/frontend/public/locales/common/de.json @@ -15,6 +15,7 @@ "langPortuguese": "Portugiesisch", "langFrench": "Französich", "langGerman": "Deutsch", + "langSpanish": "Spanisch", "text2img": "Text zu Bild", "img2img": "Bild zu Bild", "unifiedCanvas": "Unified Canvas", diff --git a/frontend/public/locales/common/en.json b/frontend/public/locales/common/en.json index 2faf983696..aed5882710 100644 --- a/frontend/public/locales/common/en.json +++ b/frontend/public/locales/common/en.json @@ -18,6 +18,7 @@ "langFrench": "French", "langPolish": "Polish", "langSimplifiedChinese": "Simplified Chinese", + "langSpanish": "Spanish", "text2img": "Text To Image", "img2img": "Image To Image", "unifiedCanvas": "Unified Canvas", diff --git a/frontend/public/locales/common/es.json b/frontend/public/locales/common/es.json new file mode 100644 index 0000000000..f4259cdaf2 --- /dev/null +++ b/frontend/public/locales/common/es.json @@ -0,0 +1,58 @@ +{ + "hotkeysLabel": "Atajos de teclado", + "themeLabel": "Tema", + "languagePickerLabel": "Selector de idioma", + "reportBugLabel": "Reportar errores", + "githubLabel": "GitHub", + "discordLabel": "Discord", + "settingsLabel": "Ajustes", + "darkTheme": "Oscuro", + "lightTheme": "Claro", + "greenTheme": "Verde", + "langEnglish": "Inglés", + "langRussian": "Ruso", + "langItalian": "Italiano", + "langBrPortuguese": "Portugués (Brasil)", + "langGerman": "Alemán", + "langPortuguese": "Portugués", + "langFrench": "French", + "langPolish": "Polish", + "langSpanish": "Español", + "text2img": "Texto a Imagen", + "img2img": "Imagen a Imagen", + "unifiedCanvas": "Lienzo Unificado", + "nodes": "Nodos", + "nodesDesc": "Un sistema de generación de imágenes basado en nodos, actualmente se encuentra en desarrollo. Mantente pendiente a nuestras actualizaciones acerca de esta fabulosa funcionalidad.", + "postProcessing": "Post-procesamiento", + "postProcessDesc1": "Invoke AI ofrece una gran variedad de funciones de post-procesamiento, El aumento de tamaño y Restauración de Rostros ya se encuentran disponibles en la interfaz web, puedes acceder desde el menú de Opciones Avanzadas en las pestañas de Texto a Imagen y de Imagen a Imagen. También puedes acceder a estas funciones directamente mediante el botón de acciones en el menú superior de la imagen actual o en el visualizador", + "postProcessDesc2": "Una interfaz de usuario dedicada se lanzará pronto para facilitar flujos de trabajo de postprocesamiento más avanzado.", + "postProcessDesc3": "La Interfaz de Línea de Comandos de Invoke AI ofrece muchas otras características, incluyendo -Embiggen-.", + "training": "Entrenamiento", + "trainingDesc1": "Un flujo de trabajo dedicado para el entrenamiento de sus propios -embeddings- y puntos de control utilizando Inversión Textual y Dreambooth desde la interfaz web.", + "trainingDesc2": "InvokeAI already supports training custom embeddings using Textual Inversion using the main script.", + "trainingDesc2": "InvokeAI ya soporta el entrenamiento de -embeddings- personalizados utilizando la Inversión Textual mediante el script principal.", + "upload": "Subir imagen", + "close": "Cerrar", + "load": "Cargar", + "statusConnected": "Conectado", + "statusDisconnected": "Desconectado", + "statusError": "Error", + "statusPreparing": "Preparando", + "statusProcessingCanceled": "Procesamiento Cancelado", + "statusProcessingComplete": "Procesamiento Completo", + "statusGenerating": "Generando", + "statusGeneratingTextToImage": "Generando Texto a Imagen", + "statusGeneratingImageToImage": "Generando Imagen a Imagen", + "statusGeneratingInpainting": "Generando pintura interior", + "statusGeneratingOutpainting": "Generando pintura exterior", + "statusGenerationComplete": "Generación Completa", + "statusIterationComplete": "Iteración Completa", + "statusSavingImage": "Guardando Imagen", + "statusRestoringFaces": "Restaurando Rostros", + "statusRestoringFacesGFPGAN": "Restaurando Rostros (GFPGAN)", + "statusRestoringFacesCodeFormer": "Restaurando Rostros (CodeFormer)", + "statusUpscaling": "Aumentando Tamaño", + "statusUpscalingESRGAN": "Restaurando Rostros(ESRGAN)", + "statusLoadingModel": "Cargando Modelo", + "statusModelChanged": "Modelo cambiado" +} diff --git a/frontend/public/locales/common/it.json b/frontend/public/locales/common/it.json index f0aa150447..293edf3f86 100644 --- a/frontend/public/locales/common/it.json +++ b/frontend/public/locales/common/it.json @@ -18,6 +18,7 @@ "langFrench": "Francese", "langPolish": "Polacco", "langSimplifiedChinese": "Cinese semplificato", + "langSpanish": "Spagnolo", "text2img": "Testo a Immagine", "img2img": "Immagine a Immagine", "unifiedCanvas": "Tela unificata", diff --git a/frontend/public/locales/common/pl.json b/frontend/public/locales/common/pl.json index 604fb52af6..2b9f3b5903 100644 --- a/frontend/public/locales/common/pl.json +++ b/frontend/public/locales/common/pl.json @@ -15,6 +15,7 @@ "langPortuguese": "Portugalski", "langFrench": "Francuski", "langPolish": "Polski", + "langSpanish": "Hiszpański", "text2img": "Tekst na obraz", "img2img": "Obraz na obraz", "unifiedCanvas": "Tryb uniwersalny", diff --git a/frontend/public/locales/common/pt_br.json b/frontend/public/locales/common/pt_br.json index 7362624a29..295bcf8184 100644 --- a/frontend/public/locales/common/pt_br.json +++ b/frontend/public/locales/common/pt_br.json @@ -15,6 +15,7 @@ "langBrPortuguese": "Português do Brasil", "langPortuguese": "Portuguese", "langFrench": "French", + "langSpanish": "Spanish", "text2img": "Texto Para Imagem", "img2img": "Imagem Para Imagem", "unifiedCanvas": "Tela Unificada", diff --git a/frontend/public/locales/common/ru.json b/frontend/public/locales/common/ru.json index 65c61b4cbf..efa54fcd47 100644 --- a/frontend/public/locales/common/ru.json +++ b/frontend/public/locales/common/ru.json @@ -14,6 +14,7 @@ "langItalian": "Italian", "langPortuguese": "Portuguese", "langFrench": "French", + "langSpanish": "Spanish", "text2img": "Изображение из текста (text2img)", "img2img": "Изображение в изображение (img2img)", "unifiedCanvas": "Универсальный холст", diff --git a/frontend/public/locales/gallery/es.json b/frontend/public/locales/gallery/es.json new file mode 100644 index 0000000000..a87ac65c70 --- /dev/null +++ b/frontend/public/locales/gallery/es.json @@ -0,0 +1,16 @@ +{ + "generations": "Generaciones", + "showGenerations": "Mostrar Generaciones", + "uploads": "Subidas de archivos", + "showUploads": "Mostar Subidas", + "galleryImageSize": "Tamaño de la imagen", + "galleryImageResetSize": "Restablecer tamaño de la imagen", + "gallerySettings": "Ajustes de la galería", + "maintainAspectRatio": "Mantener relación de aspecto", + "autoSwitchNewImages": "Auto seleccionar Imágenes nuevas", + "singleColumnLayout": "Diseño de una columna", + "pinGallery": "Fijar galería", + "allImagesLoaded": "Todas las imágenes cargadas", + "loadMore": "Cargar más", + "noImagesInGallery": "Sin imágenes en la galería" +} diff --git a/frontend/public/locales/hotkeys/es.json b/frontend/public/locales/hotkeys/es.json new file mode 100644 index 0000000000..2651a7c19f --- /dev/null +++ b/frontend/public/locales/hotkeys/es.json @@ -0,0 +1,207 @@ +{ + "keyboardShortcuts": "Atajos de teclado", + "appHotkeys": "Atajos de applicación", + "generalHotkeys": "Atajos generales", + "galleryHotkeys": "Atajos de galería", + "unifiedCanvasHotkeys": "Atajos de lienzo unificado", + "invoke": { + "title": "Invocar", + "desc": "Generar una imagen" + }, + "cancel": { + "title": "Cancelar", + "desc": "Cancelar el proceso de generación de imagen" + }, + "focusPrompt": { + "title": "Mover foco a Entrada de texto", + "desc": "Mover foco hacia el campo de texto de la Entrada" + }, + "toggleOptions": { + "title": "Alternar opciones", + "desc": "Mostar y ocultar el panel de opciones" + }, + "pinOptions": { + "title": "Fijar opciones", + "desc": "Fijar el panel de opciones" + }, + "toggleViewer": { + "title": "Alternar visor", + "desc": "Mostar y ocultar el visor de imágenes" + }, + "toggleGallery": { + "title": "Alternar galería", + "desc": "Mostar y ocultar la galería de imágenes" + }, + "maximizeWorkSpace": { + "title": "Maximizar espacio de trabajo", + "desc": "Cerrar otros páneles y maximizar el espacio de trabajo" + }, + "changeTabs": { + "title": "Cambiar", + "desc": "Cambiar entre áreas de trabajo" + }, + "consoleToggle": { + "title": "Alternar consola", + "desc": "Mostar y ocultar la consola" + }, + "setPrompt": { + "title": "Establecer Entrada", + "desc": "Usar el texto de entrada de la imagen actual" + }, + "setSeed": { + "title": "Establecer semilla", + "desc": "Usar la semilla de la imagen actual" + }, + "setParameters": { + "title": "Establecer parámetros", + "desc": "Usar todos los parámetros de la imagen actual" + }, + "restoreFaces": { + "title": "Restaurar rostros", + "desc": "Restaurar rostros en la imagen actual" + }, + "upscale": { + "title": "Aumentar resolución", + "desc": "Aumentar la resolución de la imagen actual" + }, + "showInfo": { + "title": "Mostrar información", + "desc": "Mostar metadatos de la imagen actual" + }, + "sendToImageToImage": { + "title": "Enviar hacia Imagen a Imagen", + "desc": "Enviar imagen actual hacia Imagen a Imagen" + }, + "deleteImage": { + "title": "Eliminar imagen", + "desc": "Eliminar imagen actual" + }, + "closePanels": { + "title": "Cerrar páneles", + "desc": "Cerrar los páneles abiertos" + }, + "previousImage": { + "title": "Imagen anterior", + "desc": "Muetra la imagen anterior en la galería" + }, + "nextImage": { + "title": "Imagen siguiente", + "desc": "Muetra la imagen siguiente en la galería" + }, + "toggleGalleryPin": { + "title": "Alternar fijado de galería", + "desc": "Fijar o desfijar la galería en la interfaz" + }, + "increaseGalleryThumbSize": { + "title": "Aumentar imagen en galería", + "desc": "Aumenta el tamaño de las miniaturas de la galería" + }, + "decreaseGalleryThumbSize": { + "title": "Reducir imagen en galería", + "desc": "Reduce el tamaño de las miniaturas de la galería" + }, + "selectBrush": { + "title": "Seleccionar pincel", + "desc": "Selecciona el pincel en el lienzo" + }, + "selectEraser": { + "title": "Seleccionar borrador", + "desc": "Selecciona el borrador en el lienzo" + }, + "decreaseBrushSize": { + "title": "Disminuir tamaño de herramienta", + "desc": "Disminuye el tamaño del pincel/borrador en el lienzo" + }, + "increaseBrushSize": { + "title": "Aumentar tamaño del pincel", + "desc": "Aumenta el tamaño del pincel en el lienzo" + }, + "decreaseBrushOpacity": { + "title": "Disminuir opacidad del pincel", + "desc": "Disminuye la opacidad del pincel en el lienzo" + }, + "increaseBrushOpacity": { + "title": "Aumentar opacidad del pincel", + "desc": "Aumenta la opacidad del pincel en el lienzo" + }, + "moveTool": { + "title": "Herramienta de movimiento", + "desc": "Permite navegar por el lienzo" + }, + "fillBoundingBox": { + "title": "Rellenar Caja contenedora", + "desc": "Rellena la caja contenedora con el color seleccionado" + }, + "eraseBoundingBox": { + "title": "Borrar Caja contenedora", + "desc": "Borra el contenido dentro de la caja contenedora" + }, + "colorPicker": { + "title": "Selector de color", + "desc": "Selecciona un color del lienzo" + }, + "toggleSnap": { + "title": "Alternar ajuste de cuadrícula", + "desc": "Activa o desactiva el ajuste automático a la cuadrícula" + }, + "quickToggleMove": { + "title": "Alternar movimiento rápido", + "desc": "Activa momentáneamente la herramienta de movimiento" + }, + "toggleLayer": { + "title": "Alternar capa", + "desc": "Alterna entre las capas de máscara y base" + }, + "clearMask": { + "title": "Limpiar máscara", + "desc": "Limpia toda la máscara actual" + }, + "hideMask": { + "title": "Ocultar máscara", + "desc": "Oculta o muetre la máscara actual" + }, + "showHideBoundingBox": { + "title": "Alternar caja contenedora", + "desc": "Muestra u oculta la caja contenedora" + }, + "mergeVisible": { + "title": "Consolida capas visibles", + "desc": "Consolida todas las capas visibles en una sola" + }, + "saveToGallery": { + "title": "Guardar en galería", + "desc": "Guardar la imagen actual del lienzo en la galería" + }, + "copyToClipboard": { + "title": "Copiar al portapapeles", + "desc": "Copiar el lienzo actual al portapapeles" + }, + "downloadImage": { + "title": "Descargar imagen", + "desc": "Descargar la imagen actual del lienzo" + }, + "undoStroke": { + "title": "Deshar trazo", + "desc": "Desahacer el último trazo del pincel" + }, + "redoStroke": { + "title": "Rehacer trazo", + "desc": "Rehacer el último trazo del pincel" + }, + "resetView": { + "title": "Restablecer vista", + "desc": "Restablecer la vista del lienzo" + }, + "previousStagingImage": { + "title": "Imagen anterior", + "desc": "Imagen anterior en el área de preparación" + }, + "nextStagingImage": { + "title": "Imagen siguiente", + "desc": "Siguiente imagen en el área de preparación" + }, + "acceptStagingImage": { + "title": "Aceptar imagen", + "desc": "Aceptar la imagen actual en el área de preparación" + } +} diff --git a/frontend/public/locales/modelmanager/es.json b/frontend/public/locales/modelmanager/es.json new file mode 100644 index 0000000000..963acf5b13 --- /dev/null +++ b/frontend/public/locales/modelmanager/es.json @@ -0,0 +1,53 @@ +{ + "modelManager": "Gestor de Modelos", + "model": "Modelo", + "modelAdded": "Modelo añadido", + "modelUpdated": "Modelo actualizado", + "modelEntryDeleted": "Endrada de Modelo eliminada", + "cannotUseSpaces": "No se pueden usar Spaces", + "addNew": "Añadir nuevo", + "addNewModel": "Añadir nuevo modelo", + "addManually": "Añadir manualmente", + "manual": "Manual", + "name": "Nombre", + "nameValidationMsg": "Introduce un nombre para tu modelo", + "description": "Descripción", + "descriptionValidationMsg": "Introduce una descripción para tu modelo", + "config": "Config", + "configValidationMsg": "Ruta del archivo de configuración del modelo", + "modelLocation": "Ubicación del Modelo", + "modelLocationValidationMsg": "Ruta del archivo de modelo", + "vaeLocation": "Ubicación VAE", + "vaeLocationValidationMsg": "Ruta del archivo VAE", + "width": "Ancho", + "widthValidationMsg": "Ancho predeterminado de tu modelo", + "height": "Alto", + "heightValidationMsg": "Alto predeterminado de tu modelo", + "addModel": "Añadir Modelo", + "updateModel": "Actualizar Modelo", + "availableModels": "Modelos disponibles", + "search": "Búsqueda", + "load": "Cargar", + "active": "activo", + "notLoaded": "no cargado", + "cached": "en caché", + "checkpointFolder": "Directorio de Checkpoint", + "clearCheckpointFolder": "Limpiar directorio de checkpoint", + "findModels": "Buscar modelos", + "scanAgain": "Escanear de nuevo", + "modelsFound": "Modelos encontrados", + "selectFolder": "Selecciona un directorio", + "selected": "Seleccionado", + "selectAll": "Seleccionar todo", + "deselectAll": "Deseleccionar todo", + "showExisting": "Mostrar existentes", + "addSelected": "Añadir seleccionados", + "modelExists": "Modelo existente", + "selectAndAdd": "Selecciona de la lista un modelo para añadir", + "noModelsFound": "No se encontró ningún modelo", + "delete": "Eliminar", + "deleteModel": "Eliminar Modelo", + "deleteConfig": "Eliminar Configuración", + "deleteMsg1": "¿Estás seguro de querer eliminar esta entrada de modelo de InvokeAI?", + "deleteMsg2": "El checkpoint del modelo no se eliminará de tu disco. Puedes volver a añadirlo si lo deseas." +} diff --git a/frontend/public/locales/options/es.json b/frontend/public/locales/options/es.json new file mode 100644 index 0000000000..e722d99dbe --- /dev/null +++ b/frontend/public/locales/options/es.json @@ -0,0 +1,62 @@ +{ + "images": "Imágenes", + "steps": "Pasos", + "cfgScale": "Escala CFG", + "width": "Ancho", + "height": "Alto", + "sampler": "Muestreo", + "seed": "Semilla", + "randomizeSeed": "Semilla aleatoria", + "shuffle": "Aleatorizar", + "noiseThreshold": "Umbral de Ruido", + "perlinNoise": "Ruido Perlin", + "variations": "Variaciones", + "variationAmount": "Cantidad de Variación", + "seedWeights": "Peso de las semillas", + "faceRestoration": "Restauración de Rostros", + "restoreFaces": "Restaurar rostros", + "type": "Tipo", + "strength": "Fuerza", + "upscaling": "Aumento de resolución", + "upscale": "Aumentar resolución", + "upscaleImage": "Aumentar la resolución de la imagen", + "scale": "Escala", + "otherOptions": "Otras opciones", + "seamlessTiling": "Mosaicos sin parches", + "hiresOptim": "Optimización de Alta Resolución", + "imageFit": "Ajuste tamaño de imagen inicial al tamaño objetivo", + "codeformerFidelity": "Fidelidad", + "seamSize": "Tamaño del parche", + "seamBlur": "Desenfoque del parche", + "seamStrength": "Fuerza del parche", + "seamSteps": "Pasos del parche", + "inpaintReplace": "Reemplazar impresión interior", + "scaleBeforeProcessing": "Redimensionar antes de procesar", + "scaledWidth": "Ancho escalado", + "scaledHeight": "Alto escalado", + "infillMethod": "Método de relleno", + "tileSize": "Tamaño del mosaico", + "boundingBoxHeader": "Caja contenedora", + "seamCorrectionHeader": "Corrección de parches", + "infillScalingHeader": "Remplazo y escalado", + "img2imgStrength": "Peso de Imagen a Imagen", + "toggleLoopback": "Alternar Retroalimentación", + "invoke": "Invocar", + "cancel": "Cancelar", + "promptPlaceholder": "Ingrese la entrada aquí. [símbolos negativos], (subir peso)++, (bajar peso)--, también disponible alternado y mezclado (ver documentación)", + "sendTo": "Enviar a", + "sendToImg2Img": "Enviar a Imagen a Imagen", + "sendToUnifiedCanvas": "Enviar a Lienzo Unificado", + "copyImageToLink": "Copiar imagen a enlace", + "downloadImage": "Descargar imagen", + "openInViewer": "Abrir en Visor", + "closeViewer": "Cerrar Visor", + "usePrompt": "Usar Entrada", + "useSeed": "Usar Semilla", + "useAll": "Usar Todo", + "useInitImg": "Usar Imagen Inicial", + "info": "Información", + "deleteImage": "Eliminar Imagen", + "initialImage": "Imagen Inicial", + "showOptionsPanel": "Mostrar panel de opciones" +} diff --git a/frontend/public/locales/settings/es.json b/frontend/public/locales/settings/es.json new file mode 100644 index 0000000000..4fadf79977 --- /dev/null +++ b/frontend/public/locales/settings/es.json @@ -0,0 +1,13 @@ +{ + "models": "Modelos", + "displayInProgress": "Mostrar imágenes en progreso", + "saveSteps": "Guardar imágenes cada n pasos", + "confirmOnDelete": "Confirmar antes de eliminar", + "displayHelpIcons": "Mostrar iconos de ayuda", + "useCanvasBeta": "Usar versión beta del Lienzo", + "enableImageDebugging": "Habilitar depuración de imágenes", + "resetWebUI": "Restablecer interfaz web", + "resetWebUIDesc1": "Al restablecer la interfaz web, solo se restablece la caché local del navegador de sus imágenes y la configuración guardada. No se elimina ninguna imagen de su disco duro.", + "resetWebUIDesc2": "Si las imágenes no se muestran en la galería o algo más no funciona, intente restablecer antes de reportar un incidente en GitHub.", + "resetComplete": "La interfaz web se ha restablecido. Actualice la página para recargarla." +} diff --git a/frontend/public/locales/toast/es.json b/frontend/public/locales/toast/es.json new file mode 100644 index 0000000000..fe544d4f50 --- /dev/null +++ b/frontend/public/locales/toast/es.json @@ -0,0 +1,32 @@ +{ + "tempFoldersEmptied": "Directorio temporal vaciado", + "uploadFailed": "Error al subir archivo", + "uploadFailedMultipleImagesDesc": "Únicamente se puede subir una imágen a la vez", + "uploadFailedUnableToLoadDesc": "No se pudo cargar la imágen", + "downloadImageStarted": "Descargando imágen", + "imageCopied": "Imágen copiada", + "imageLinkCopied": "Enlace de imágen copiado", + "imageNotLoaded": "No se cargó la imágen", + "imageNotLoadedDesc": "No se encontró imagen para enviar al módulo Imagen a Imagen", + "imageSavedToGallery": "Imágen guardada en la galería", + "canvasMerged": "Lienzo consolidado", + "sentToImageToImage": "Enviar hacia Imagen a Imagen", + "sentToUnifiedCanvas": "Enviar hacia Lienzo Consolidado", + "parametersSet": "Parámetros establecidos", + "parametersNotSet": "Parámetros no establecidos", + "parametersNotSetDesc": "No se encontraron metadatos para esta imágen.", + "parametersFailed": "Error cargando parámetros", + "parametersFailedDesc": "No fue posible cargar la imagen inicial.", + "seedSet": "Semilla establecida", + "seedNotSet": "Semilla no establecida", + "seedNotSetDesc": "No se encontró una semilla para esta imágen.", + "promptSet": "Entrada establecida", + "promptNotSet": "Entrada no establecida", + "promptNotSetDesc": "No se encontró una entrada para esta imágen.", + "upscalingFailed": "Error al aumentar tamaño de imagn", + "faceRestoreFailed": "Restauración de rostro fallida", + "metadataLoadFailed": "Error al cargar metadatos", + "initialImageSet": "Imágen inicial establecida", + "initialImageNotSet": "Imagen inicial no establecida", + "initialImageNotSetDesc": "Error al establecer la imágen inicial" +} diff --git a/frontend/public/locales/tooltip/es.json b/frontend/public/locales/tooltip/es.json new file mode 100644 index 0000000000..543aad6a8c --- /dev/null +++ b/frontend/public/locales/tooltip/es.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "Este campo tomará todo el texto de entrada, incluidos tanto los términos de contenido como los estilísticos. Si bien se pueden incluir pesos en la solicitud, los comandos/parámetros estándar de línea de comandos no funcionarán.", + "gallery": "Conforme se generan nuevas invocaciones, los archivos del directorio de salida se mostrarán aquí. Las generaciones tienen opciones adicionales para configurar nuevas generaciones.", + "other": "Estas opciones habilitarán modos de procesamiento alternativos para Invoke. El modo sin costuras funciona para generar patrones repetitivos en la salida. La optimización de alta resolución realiza un ciclo de generación de dos pasos y debe usarse en resoluciones más altas cuando desee una imagen/composición más coherente.", + "seed": "Los valores de semilla proporcionan un conjunto inicial de ruido que guían el proceso de eliminación de ruido y se pueden aleatorizar o rellenar con una semilla de una invocación anterior. La función Umbral se puede usar para mitigar resultados indeseables a valores CFG más altos (intente entre 0-10), y Perlin se puede usar para agregar ruido Perlin al proceso de eliminación de ruido. Ambos sirven para agregar variación a sus salidas.", + "variations": "Pruebe una variación con una cantidad entre 0 y 1 para cambiar la imagen de salida para la semilla establecida. Se encuentran variaciones interesantes en la semilla entre 0.1 y 0.3.", + "upscale": "Usando ESRGAN, puede aumentar la resolución de salida sin requerir un ancho/alto más alto en la generación inicial.", + "faceCorrection": "Usando GFPGAN o Codeformer, la corrección de rostros intentará identificar rostros en las salidas y corregir cualquier defecto/anormalidad. Los valores de fuerza más altos aplicarán una presión correctiva más fuerte en las salidas, lo que resultará en rostros más atractivos. Con Codeformer, una mayor fidelidad intentará preservar la imagen original, a expensas de la fuerza de corrección de rostros.", + "imageToImage": "Imagen a Imagen permite cargar una imagen inicial, que InvokeAI usará para guiar el proceso de generación, junto con una solicitud. Un valor más bajo para esta configuración se parecerá más a la imagen original. Se aceptan valores entre 0-1, y se recomienda un rango de .25-.75.", + "boundingBox": "La caja delimitadora es análoga a las configuraciones de Ancho y Alto para Texto a Imagen o Imagen a Imagen. Solo se procesará el área en la caja.", + "seamCorrection": "Controla el manejo de parches visibles que pueden ocurrir cuando se pega una imagen generada de nuevo en el lienzo.", + "infillAndScaling": "Administra los métodos de relleno (utilizados en áreas enmascaradas o borradas del lienzo) y la escala (útil para tamaños de caja delimitadora pequeños)." + } +} diff --git a/frontend/public/locales/unifiedcanvas/es.json b/frontend/public/locales/unifiedcanvas/es.json new file mode 100644 index 0000000000..0cef74984e --- /dev/null +++ b/frontend/public/locales/unifiedcanvas/es.json @@ -0,0 +1,59 @@ +{ + "layer": "Capa", + "base": "Base", + "mask": "Máscara", + "maskingOptions": "Opciones de máscara", + "enableMask": "Habilitar Máscara", + "preserveMaskedArea": "Preservar área enmascarada", + "clearMask": "Limpiar máscara", + "brush": "Pincel", + "eraser": "Borrador", + "fillBoundingBox": "Rellenar Caja Contenedora", + "eraseBoundingBox": "Eliminar Caja Contenedora", + "colorPicker": "Selector de color", + "brushOptions": "Opciones de pincel", + "brushSize": "Tamaño", + "move": "Mover", + "resetView": "Restablecer vista", + "mergeVisible": "Consolidar vista", + "saveToGallery": "Guardar en galería", + "copyToClipboard": "Copiar al portapapeles", + "downloadAsImage": "Descargar como imagen", + "undo": "Deshacer", + "redo": "Rehacer", + "clearCanvas": "Limpiar lienzo", + "canvasSettings": "Ajustes de lienzo", + "showIntermediates": "Mostrar intermedios", + "showGrid": "Mostrar cuadrícula", + "snapToGrid": "Ajustar a cuadrícula", + "darkenOutsideSelection": "Oscurecer fuera de la selección", + "autoSaveToGallery": "Guardar automáticamente en galería", + "saveBoxRegionOnly": "Guardar solo región dentro de la caja", + "limitStrokesToBox": "Limitar trazos a la caja", + "showCanvasDebugInfo": "Mostrar información de depuración de lienzo", + "clearCanvasHistory": "Limpiar historial de lienzo", + "clearHistory": "Limpiar historial", + "clearCanvasHistoryMessage": "Limpiar el historial de lienzo también restablece completamente el lienzo unificado. Esto incluye todo el historial de deshacer/rehacer, las imágenes en el área de preparación y la capa base del lienzo.", + "clearCanvasHistoryConfirm": "¿Está seguro de que desea limpiar el historial del lienzo?", + "emptyTempImageFolder": "Vaciar directorio de imágenes temporales", + "emptyFolder": "Vaciar directorio", + "emptyTempImagesFolderMessage": "Vaciar el directorio de imágenes temporales también restablece completamente el lienzo unificado. Esto incluye todo el historial de deshacer/rehacer, las imágenes en el área de preparación y la capa base del lienzo.", + "emptyTempImagesFolderConfirm": "¿Está seguro de que desea vaciar el directorio temporal?", + "activeLayer": "Capa activa", + "canvasScale": "Escala de lienzo", + "boundingBox": "Caja contenedora", + "scaledBoundingBox": "Caja contenedora escalada", + "boundingBoxPosition": "Posición de caja contenedora", + "canvasDimensions": "Dimensiones de lienzo", + "canvasPosition": "Posición de lienzo", + "cursorPosition": "Posición del cursor", + "previous": "Anterior", + "next": "Siguiente", + "accept": "Aceptar", + "showHide": "Mostrar/Ocultar", + "discardAll": "Descartar todo", + "betaClear": "Limpiar", + "betaDarkenOutside": "Oscurecer fuera", + "betaLimitToBox": "Limitar a caja", + "betaPreserveMasked": "Preservar área enmascarada" +} diff --git a/frontend/src/features/system/components/LanguagePicker.tsx b/frontend/src/features/system/components/LanguagePicker.tsx index 3bd6f72452..29c6f9071a 100644 --- a/frontend/src/features/system/components/LanguagePicker.tsx +++ b/frontend/src/features/system/components/LanguagePicker.tsx @@ -19,6 +19,7 @@ export default function LanguagePicker() { de: t('common:langGerman'), pl: t('common:langPolish'), zh_cn: t('common:langSimplifiedChinese'), + es: t('common:langSpanish'), }; const renderLanguagePicker = () => { From 7c4544f95e8d360897cfacdbd818c479c53df26a Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 30 Dec 2022 07:58:48 +1300 Subject: [PATCH 03/11] Fix Seed Shuffle layout to adjust to localization text --- .../features/options/components/AdvancedOptions/Seed/Seed.tsx | 2 +- .../options/components/AdvancedOptions/Seed/ShuffleSeed.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx index b6f5679aa5..ff949ac1ca 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx @@ -33,7 +33,7 @@ export default function Seed() { isInvalid={seed < 0 && shouldGenerateVariations} onChange={handleChangeSeed} value={seed} - width="10rem" + width="auto" /> ); } diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx index 41d1859f5b..f8491f31b6 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx @@ -22,6 +22,7 @@ export default function ShuffleSeed() { size={'sm'} isDisabled={shouldRandomizeSeed} onClick={handleClickRandomizeSeed} + padding="0 1.5rem" >

{t('options:shuffle')}

From da6c690d7b6885d08b031265e8354c2bebec7a2c Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 30 Dec 2022 08:00:35 +1300 Subject: [PATCH 04/11] WebUI 2.2.5 Build --- ...y-b741077f.js => index-legacy-3415d492.js} | 2 +- .../{index.21ff81eb.js => index.dca51560.js} | 38 ++-- frontend/dist/index.html | 4 +- frontend/dist/locales/common/de.json | 1 + frontend/dist/locales/common/en.json | 1 + frontend/dist/locales/common/es.json | 58 +++++ frontend/dist/locales/common/it.json | 1 + frontend/dist/locales/common/pl.json | 1 + frontend/dist/locales/common/pt_br.json | 1 + frontend/dist/locales/common/ru.json | 2 +- frontend/dist/locales/gallery/es.json | 16 ++ frontend/dist/locales/hotkeys/es.json | 207 ++++++++++++++++++ frontend/dist/locales/modelmanager/es.json | 53 +++++ frontend/dist/locales/modelmanager/zh_cn.json | 51 ++++- frontend/dist/locales/options/es.json | 62 ++++++ frontend/dist/locales/options/ru.json | 2 +- frontend/dist/locales/settings/es.json | 13 ++ frontend/dist/locales/settings/pl.json | 2 +- frontend/dist/locales/toast/es.json | 32 +++ frontend/dist/locales/tooltip/de.json | 1 + frontend/dist/locales/tooltip/en-US.json | 15 ++ frontend/dist/locales/tooltip/en.json | 15 ++ frontend/dist/locales/tooltip/es.json | 15 ++ frontend/dist/locales/tooltip/it.json | 1 + frontend/dist/locales/tooltip/pl.json | 15 ++ frontend/dist/locales/tooltip/pt_br.json | 1 + frontend/dist/locales/tooltip/ru.json | 1 + frontend/dist/locales/unifiedcanvas/es.json | 59 +++++ 28 files changed, 644 insertions(+), 26 deletions(-) rename frontend/dist/assets/{index-legacy-b741077f.js => index-legacy-3415d492.js} (63%) rename frontend/dist/assets/{index.21ff81eb.js => index.dca51560.js} (76%) create mode 100644 frontend/dist/locales/common/es.json create mode 100644 frontend/dist/locales/gallery/es.json create mode 100644 frontend/dist/locales/hotkeys/es.json create mode 100644 frontend/dist/locales/modelmanager/es.json create mode 100644 frontend/dist/locales/options/es.json create mode 100644 frontend/dist/locales/settings/es.json create mode 100644 frontend/dist/locales/toast/es.json create mode 100644 frontend/dist/locales/tooltip/de.json create mode 100644 frontend/dist/locales/tooltip/en-US.json create mode 100644 frontend/dist/locales/tooltip/en.json create mode 100644 frontend/dist/locales/tooltip/es.json create mode 100644 frontend/dist/locales/tooltip/it.json create mode 100644 frontend/dist/locales/tooltip/pl.json create mode 100644 frontend/dist/locales/tooltip/pt_br.json create mode 100644 frontend/dist/locales/tooltip/ru.json create mode 100644 frontend/dist/locales/unifiedcanvas/es.json diff --git a/frontend/dist/assets/index-legacy-b741077f.js b/frontend/dist/assets/index-legacy-3415d492.js similarity index 63% rename from frontend/dist/assets/index-legacy-b741077f.js rename to frontend/dist/assets/index-legacy-3415d492.js index 36a40d2a18..7a5e0b8470 100644 --- a/frontend/dist/assets/index-legacy-b741077f.js +++ b/frontend/dist/assets/index-legacy-3415d492.js @@ -26,7 +26,7 @@ var Y=a.exports,Z=G.exports;function X(e){for(var t="https://reactjs.org/docs/er * 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="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",y="[object Array]",b="[object Boolean]",x="[object Date]",w="[object Error]",k="[object Function]",S="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",P="[object Promise]",L="[object RegExp]",O="[object Set]",M="[object String]",T="[object Symbol]",A="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",F="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,Z=RegExp(q.source),X=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Me="['’]",Te="["+Se+"]",Ae="["+Oe+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+Se+Oe+Re+_e+Ee+Pe+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+Se+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Pe+"]",Ve="\\u200d",$e="(?:"+De+"|"+ze+")",Ue="(?:"+We+"|"+ze+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ie+"|"+Be+")"+"?",Ze="["+Le+"]?",Xe=Ze+Ye+("(?:"+Ve+"(?:"+[je,Fe,He].join("|")+")"+Ze+Ye+")*"),Ke="(?:"+[Ne,Fe,He].join("|")+")"+Xe,Qe="(?:"+[je+Ie+"?",Ie,Fe,He,Te].join("|")+")",Je=RegExp(Me,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+Ge+"(?="+[Ae,We,"$"].join("|")+")",Ue+"+"+qe+"(?="+[Ae,We+$e,"$"].join("|")+")",We+"?"+$e+"+"+Ge,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ve+Se+Ce+Le+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[j]=st[F]=st[H]=st[W]=st[V]=!0,st[v]=st[y]=st[I]=st[b]=st[R]=st[x]=st[w]=st[k]=st[C]=st[_]=st[E]=st[L]=st[O]=st[M]=st[A]=!1;var lt={};lt[v]=lt[y]=lt[I]=lt[R]=lt[b]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[j]=lt[C]=lt[_]=lt[E]=lt[L]=lt[O]=lt[M]=lt[T]=lt[F]=lt[H]=lt[W]=lt[V]=!0,lt[w]=lt[k]=lt[A]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof o&&o&&o.Object===Object&&o,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,yt=vt&&ht.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(B2){}}(),xt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,kt=bt&&bt.isMap,St=bt&&bt.isRegExp,Ct=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var yn=function e(t){var o,ae=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,Se=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Pe=t.Object,Le=t.RegExp,Oe=t.String,Me=t.TypeError,Te=ae.prototype,Ae=_e.prototype,Ie=Pe.prototype,Re=t["__core-js_shared__"],Ne=Ae.toString,De=Ie.hasOwnProperty,ze=0,Be=(o=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",je=Ie.toString,Fe=Ne.call(Pe),He=pt._,We=Le("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=vt?t.Buffer:n,$e=t.Symbol,Ue=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:n,qe=un(Pe.getPrototypeOf,Pe),Ye=Pe.create,Ze=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=$e?$e.isConcatSpreadable:n,Qe=$e?$e.iterator:n,tt=$e?$e.toStringTag:n,rt=function(){try{var e=pi(Pe,"defineProperty");return e({},"",{}),e}catch(B2){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Se&&Se.now!==pt.Date.now&&Se.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,yt=Pe.getOwnPropertySymbols,bt=Ve?Ve.isBuffer:n,jt=t.isFinite,qt=Te.join,bn=un(Pe.keys,Pe),xn=Ee.max,wn=Ee.min,kn=Se.now,Sn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Pn=pi(t,"Map"),Ln=pi(t,"Promise"),On=pi(t,"Set"),Mn=pi(t,"WeakMap"),Tn=pi(Pe,"create"),An=Mn&&new Mn,In={},Rn=Hi(En),Nn=Hi(Pn),Dn=Hi(Ln),zn=Hi(On),Bn=Hi(Mn),jn=$e?$e.prototype:n,Fn=jn?jn.valueOf:n,Hn=jn?jn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Un(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ao(e,s)}else{var h=vi(e),f=h==k||h==S;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:bi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Po(e);case b:case x:return new r(+e);case R:return function(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case j:case F:case H:case W:case V:return Lo(e,n);case C:return new r;case _:case M:return new r(e);case L:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case T:return o=e,Fn?Pe(Fn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Lt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Pe(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,o){if("function"!=typeof e)throw new Me(r);return Ri((function(){e.apply(n,o)}),t)}function fr(e,t,n,r){var o=-1,i=At,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Pn||Yn),string:new qn}},Zn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return hi(this,e).get(e)},Zn.prototype.has=function(e){return hi(this,e).has(e)},Zn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(kr),gr=Do(Sr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?br(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,Rs)}function Sr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=ko(t,e)).length;null!=e&&rt}function Or(e,t){return null!=e&&De.call(e,t)}function Mr(e,t){return null!=e&&t in Pe(e)}function Tr(e,t,r){for(var o=r?It:At,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Oi(e,t,al),e+"")}function Jr(e){return Jn(Vs(e))}function eo(e,t){var n=Vs(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=ko(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Lo(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Oo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&ki(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Pe(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var o=t.length,i=o,a=Un.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Me(r);if(a&&!l&&"wrapper"==ci(s))var l=new Un([],!0)}for(i=l?i:o;++i1&&y.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Lt(m,(function(n){var r="_."+n[0];t&n[1]&&!At(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=kn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Gn&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Un(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ya=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ho(Gi),xa=Ho(qi);function wa(e,t){return(qa(e)?Lt:pr)(e,di(t,3))}function ka(e,t){return(qa(e)?Ot:gr)(e,di(t,3))}var Sa=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Za(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Ar(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var Pa=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var La=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,br(t,1),[])})),Oa=ht||function(){return pt.Date.now()};function Ma(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var o;if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Aa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Aa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,o){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Me(r);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(y,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function y(){var e=Oa();if(v(e))return b(e);c=Ri(y,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function b(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Oa(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(y,t),g(u)}return c===n&&(c=Ri(y,t)),l}return t=bs(t)||0,rs(o)&&(h=!!o.leading,s=(f="maxWait"in o)?xn(bs(o.maxWait)||0,t):s,p="trailing"in o?!!o.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:b(Oa())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,bs(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Zn),n}function Ba(e){if("function"!=typeof e)throw new Me(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Zn;var ja=So((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(br(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),Ga=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ze.call(e,"callee")},qa=ae.isArray,Ya=xt?Qt(xt):function(e){return os(e)&&Pr(e)==I};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Za(e)}var Ka=bt||bl,Qa=wt?Qt(wt):function(e){return os(e)&&Pr(e)==x};function Ja(e){if(!os(e))return!1;var t=Pr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Pr(e);return t==k||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=kt?Qt(kt):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Pr(e)==_}function ss(e){if(!os(e)||Pr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ls=St?Qt(St):function(e){return os(e)&&Pr(e)==L};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==O};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Pr(e)==M}function ds(e){return"symbol"==typeof e||os(e)&&Pr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Pr(e)]};var fs=Zo(Fr),ps=Zo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Za(e))return us(e)?gn(e):Ao(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==O?hn:Vs)(e)}function ms(e){return e?(e=bs(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?cr(vs(e),0,g):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||ye.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var ks=No((function(e,t){if(Ei(t)||Za(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),Ss=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ps=Qr((function(e,t){e=Pe(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&ki(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var js=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Vs(e){return null==e?[]:Jt(e,Rs(e))}var $s=jo((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=jo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=jo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Bo("toLowerCase");var Xs=jo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=jo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=jo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(B2){return Ja(B2)?B2:new Ce(B2)}})),nl=ii((function(e,t){return Lt(t,(function(t){t=Fi(t),sr(e,t,Aa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Ao(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=Go(Rt),fl=Go(Mt),pl=Go(Bt);function gl(e){return Si(e)?Gt(Fi(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Yo(),vl=Yo(!0);function yl(){return[]}function bl(){return!1}var xl=Uo((function(e,t){return e+t}),0),wl=Ko("ceil"),kl=Uo((function(e,t){return e/t}),1),Sl=Ko("floor");var Cl,_l=Uo((function(e,t){return e*t}),1),El=Ko("round"),Pl=Uo((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Ma,Wn.assign=ks,Wn.assignIn=Ss,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Aa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?ki(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:ys(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Me(r);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Me(r);return rs(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:o,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,Fi):ds(e)?[e]:Ao(ji(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Vn(qe(e)):{}}return(o?Lt:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Ma(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Vs,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return Fa(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return bo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return bo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=Ss,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=$s,Wn.capitalize=Us,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),cr(bs(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=Gs,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=kl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Va,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Y,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?Mt:mr;return r&&ki(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ba,Wn.findIndex=Gi,Wn.findKey=function(e,t){return Ft(e,di(t,3),kr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return Ft(e,di(t,3),Sr)},Wn.floor=Sl,Wn.forEach=wa,Wn.forEachRight=ka,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&kr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&Sr(e,di(t,3))},Wn.get=Os,Wn.gt=$a,Wn.gte=Ua,Wn.has=function(e,t){return null!=e&&yi(e,t,Or)},Wn.hasIn=Ms,Wn.head=Zi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Za(e)?e:Vs(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==A},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Pr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,$t,i,!0)},Wn.lowerCase=Ys,Wn.lowerFirst=Zs,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Lr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Lr):n},Wn.mean=function(e){return Ut(e,al)},Wn.meanBy=function(e,t){return Ut(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,Fr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Fr):n},Wn.stubArray=yl,Wn.stubFalse=bl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Ur(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Oa,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?ki(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Le(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Z.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=ka,Wn.first=Zi,ul(Wn,(Cl={},kr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Lt(["drop","take"],(function(e,t){Gn.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new Gn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(di(e)))},Gn.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},kr(Gn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Un(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Vo(n,2).name]=[{name:"wrapper",func:n}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Ao(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ao(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ao(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=yn)._=yn,gt._=yn):pt._=yn}).call(o)}(MU,MU.exports);const TU=MU.exports,AU=AV({name:"gallery",initialState:{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,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=MU.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].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},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:IU,clearIntermediateImage:RU,removeImage:NU,setCurrentImage:DU,addGalleryImages:zU,setIntermediateImage:BU,selectNextImage:jU,selectPrevImage:FU,setShouldPinGallery:HU,setShouldShowGallery:WU,setGalleryScrollPosition:VU,setGalleryImageMinimumWidth:$U,setGalleryImageObjectFit:UU,setShouldHoldGalleryOpen:GU,setShouldAutoSwitchToNewImages:qU,setCurrentCategory:YU,setGalleryWidth:ZU,setShouldUseSingleGalleryColumn:XU}=AU.actions,KU=AU.reducer;function QU(e){return QU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QU(e)}function JU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eG(e){var t=function(e,t){if("object"!==QU(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==QU(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===QU(t)?t:String(t)}function tG(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.init(t,n)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fG,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function wG(e,t,n){var r=xG(e,t,Object);r.obj[r.k]=n}function kG(e,t){var n=xG(e,t),r=n.obj,o=n.k;if(r)return r[o]}function SG(e,t,n){var r=kG(e,n);return void 0!==r?r:kG(t,n)}function CG(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):CG(e[r],t[r],n):e[r]=t[r]);return e}function _G(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var EG={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function PG(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return EG[e]})):e}var LG="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,OG=[" ",",","?","!",";"];function MG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TG(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?IG(l,c,n):void 0}o=o[r[i]]}return o}}var RG=function(e){iG(n,e);var t=AG(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return nG(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=kG(this.data,a);return s||!i||"string"!=typeof n?s:IG(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),wG(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=kG(this.data,a)||{};r?CG(s,n,o):s=TG(TG({},s),n),wG(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?TG(TG({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(mG),NG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function DG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zG(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),bG(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,rG(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gG.create("translator"),r}return nG(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=OG.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==QU(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),g=p&&p.res,m=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(g),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(w&&g&&k&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,g,zG(zG({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?v:m;for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,zG(zG({},t),{joinArrays:!1,ns:c})),_[P]===L&&(_[P]=g[P])}g=_}}else if(w&&"string"==typeof x&&"[object Array]"===y)(g=g.join(x))&&(g=this.extendTranslation(g,e,t,r));else{var O=!1,M=!1,T=void 0!==t.count&&"string"!=typeof t.count,A=n.hasDefaultValue(t),I=T?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(g)&&A&&(O=!0,g=R),this.isValidLookup(g)||(M=!0,g=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&M?void 0:g,z=A&&R!==g&&this.options.updateMissing;if(M||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,u,l,z?R:g),a){var B=this.resolve(l,zG(zG({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!jG["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(jG["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var g="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(g),d&&(l.push(g+u),h&&l.push(g+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(mG);function HG(e){return e.charAt(0).toUpperCase()+e.slice(1)}var WG=function(){function e(t){JU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gG.create("languageUtils")}return nG(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=HG(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),VG=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},UG=["v1","v2","v3"],GG={zero:0,one:1,two:2,few:3,many:4,other:5};function qG(){var e={};return VG.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:$G[t.fc]}}))})),e}var YG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.languageUtils=t,this.options=n,this.logger=gG.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=qG()}return nG(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return GG[e]-GG[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!UG.includes(this.options.compatibilityJSON)}}]),e}();function ZG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return nG(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:PG,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_G(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_G(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?_G(t.nestingPrefix):t.nestingPrefixEscaped||_G("$t("),this.nestingSuffix=t.nestingSuffix?_G(t.nestingSuffix):t.nestingSuffixEscaped||_G(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=SG(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,XG(XG(XG({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(SG(t,l,a),c,n,XG(XG(XG({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yG(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),h?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=XG(XG({},t),o))}catch(B2){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),B2),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=XG({},a)).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yG(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,XG(XG({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function QG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("formatter"),this.options=t,this.formats={number:eq((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:eq((function(e,t){var n=new Intl.NumberFormat(e,JG(JG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:eq((function(e,t){var n=new Intl.DateTimeFormat(e,JG({},t));return function(e){return n.format(e)}})),relativetime:eq((function(e,t){var n=new Intl.RelativeTimeFormat(e,JG({},t));return function(e){return n.format(e,t.range||"day")}})),list:eq((function(e,t){var n=new Intl.ListFormat(e,JG({},t));return function(e){return n.format(e)}}))},this.init(t)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=eq(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=uG(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,JG(JG(JG({},s),r),c))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function nq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rq(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return JU(this,n),i=t.call(this),LG&&mG.call(rG(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=gG.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return nG(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=xG(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=rq(rq({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var c;(c=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(Hhe){a(Hhe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(mG);function aq(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===QU(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===QU(e[2])||"object"===QU(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function sq(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(JU(this,n),e=t.call(this),LG&&mG.call(rG(e)),e.options=sq(r),e.services={},e.logger=gG,e.modules={external:[]},hq(rG(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),aG(e,rG(e));setTimeout((function(){e.init(r,o)}),0)}return e}return nG(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=aq();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=cq(cq(cq({},r),this.options),sq(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=cq(cq({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?gG.init(o(this.modules.logger),this.options):gG.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=tq);var a=new WG(this.options);this.store=new RG(this.options.resources,this.options);var s=this.services;s.logger=gG,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new YG(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new KG(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new iq(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=vG(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=vG();return e||(e=this.languages),t||(t=this.options.ns),n||(n=dq),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&NG.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=vG();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==QU(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=vG();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=vG();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new WG(aq());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,o=cq(cq(cq({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=cq({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new FG(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fq(e,t)}));var pq=fq.createInstance();function gq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mq(e){return mq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mq(e)}function vq(e){var t=function(e,t){if("object"!==mq(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==mq(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mq(t)?t:String(t)}function yq(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Sq.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Sq.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},_q=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=Cq(e,encodeURIComponent(t),o)},Eq=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},Oq=null,Mq=function(){if(null!==Oq)return Oq;try{Oq="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(B2){Oq=!1}return Oq},Tq={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Mq()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Mq()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Aq=null,Iq=function(){if(null!==Aq)return Aq;try{Aq="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(B2){Aq=!1}return Aq},Rq={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Iq()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Iq()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},Nq={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Dq={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},zq={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},Bq={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var jq=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};gq(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=kq(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Pq),this.addDetector(Lq),this.addDetector(Tq),this.addDetector(Rq),this.addDetector(Nq),this.addDetector(Dq),this.addDetector(zq),this.addDetector(Bq)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&yq(t.prototype,n),r&&yq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fq(e){return Fq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fq(e)}jq.type="languageDetector";var Hq=[],Wq=Hq.forEach,Vq=Hq.slice;function $q(e){return Wq.call(Vq.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function Uq(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Fq(XMLHttpRequest))}function Gq(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qq,Yq={exports:{}},Zq={exports:{}};function Xq(){return qq||(qq=1,function(e,t){var n="undefined"!=typeof self?self:o,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(B2){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];w.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(Hhe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Zq,Zq.exports)),Zq.exports}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==o&&o.fetch?o.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==Gq&&("undefined"==typeof window||void 0===window.document)){var r=n||Xq();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(Yq,Yq.exports);const Kq=Yq.exports,Qq=r({__proto__:null,default:Kq},[Yq.exports]);function Jq(e){return Jq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jq(e)}var eY,tY,nY;"function"==typeof fetch&&(eY="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),Uq()&&("undefined"!=typeof global&&global.XMLHttpRequest?tY=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(tY=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?nY=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(nY=window.ActiveXObject)),eY||!Qq||tY||nY||(eY=Kq||Qq),"function"!=typeof eY&&(eY=void 0);var rY=function(e,t){if(t&&"object"===Jq(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},oY=function(e,t,n){eY(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},iY=!1,aY=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},eY&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=rY(t,e.queryStringParams));var o=$q({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=$q({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},iY?{}:i);try{oY(t,a,r)}catch(B2){if(!i||0===Object.keys(i).length||!B2.message||B2.message.indexOf("not implemented")<0)return r(B2);try{Object.keys(i).forEach((function(e){delete a[e]})),oY(t,a,r),iY=!0}catch(Hhe){r(Hhe)}}}(e,t,n,r):Uq()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===Jq(n)&&(n=rY("",n).slice(1)),e.queryStringParams&&(t=rY(t,e.queryStringParams));try{var o;(o=tY?new tY:new nY("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(B2){console&&console.log(B2)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function sY(e){return sY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sY(e)}function lY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cY(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};lY(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=$q(n,this.options||{},dY()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(B2){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var u=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,u,a,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&cY(t.prototype,n),r&&cY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fY(e){return fY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fY(e)}function pY(e){var t=function(e,t){if("object"!==fY(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fY(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fY(t)?t:String(t)}function gY(e,t,n){return(t=pY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mY(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function wY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return yY("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):xY(e,t,n)}var kY=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SY={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},CY=function(e){return SY[e]};function _Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function EY(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};LY=EY(EY({},LY),e)}(e.options.react),function(e){PY=e}(e)}},IY=a.exports.createContext(),RY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&TY(t.prototype,n),r&&TY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function NY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=a.exports.useContext(IY)||{},o=r.i18n,i=r.defaultNS,s=n||o||MY();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new RY),!s){yY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&yY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BY(BY(BY({},OY()),s.options.react),t),d=u.useSuspense,h=u.keyPrefix,f=e||i||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var p=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return wY(e,s,u)}));function g(){return s.getFixedT(null,"fallback"===u.nsMode?f:f[0],h)}var m=a.exports.useState(g),v=DY(m,2),y=v[0],b=v[1],x=f.join(),w=jY(x),k=a.exports.useRef(!0);a.exports.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&b(g)}return k.current=!0,p||d||bY(s,f,(function(){k.current&&b(g)})),p&&w&&w!==x&&k.current&&b(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){k.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var S=a.exports.useRef(!0);a.exports.useEffect((function(){k.current&&!S.current&&b(g),S.current=!1}),[s,h]);var C=[y,s,p];if(C.t=y,C.i18n=s,C.ready=p,p)return C;if(!p&&!d)return C;throw new Promise((function(e){bY(s,f,(function(){e()}))}))}pq.use(hY).use(jq).use(AY).init({fallbackLng:"en",debug:!1,ns:["common","options","unifiedcanvas","gallery","toast","hotkeys","settings","modelmanager"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const HY=AV({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:pq.isInitialized?pq.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=pq.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?pq.t("common:statusConnected"):pq.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},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=pq.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=pq.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=pq.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:WY,setIsProcessing:VY,addLogEntry:$Y,setShouldShowLogViewer:UY,setIsConnected:GY,setSocketId:qY,setShouldConfirmOnDelete:YY,setOpenAccordions:ZY,setSystemStatus:XY,setCurrentStatus:KY,setSystemConfig:QY,setShouldDisplayGuides:JY,processingCanceled:eZ,errorOccurred:tZ,errorSeen:nZ,setModelList:rZ,setIsCancelable:oZ,modelChangeRequested:iZ,setSaveIntermediatesInterval:aZ,setEnableImageDebugging:sZ,generationRequested:lZ,addToast:cZ,clearToastQueue:uZ,setProcessingIndeterminateTask:dZ,setSearchFolder:hZ,setFoundModels:fZ,setOpenModel:pZ}=HY.actions,gZ=HY.reducer,mZ=(e,t)=>Math.floor(e/t)*t,vZ=(e,t)=>Math.round(e/t)*t,yZ=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),bZ=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},xZ=.95,wZ=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),kZ=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=vZ(a/o,64)):o<1&&(r.height=a,r.width=vZ(a*o,64)),i=r.width*r.height}return r},SZ=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],CZ=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],_Z=e=>"line"===e.kind&&"mask"===e.layer,EZ=e=>"image"===e.kind&&"base"===e.layer,PZ=e=>"line"===e.kind,LZ={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},OZ=AV({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:LZ,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!_Z(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:mZ(TU.clamp(n.width,64,512),64),height:mZ(TU.clamp(n.height,64,512),64)},i={x:vZ(n.width/2-o.width/2,64),y:vZ(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState={...LZ,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=bZ(r.width,r.height,n.width,n.height,xZ),s=yZ(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:vZ(r.width,64),height:vZ(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=kZ(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=wZ(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(PZ);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(TU.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState=LZ,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(EZ),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=bZ(o.width,o.height,512,512,xZ),n=yZ(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=kZ(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=bZ(t,n,i,a,.95),l=yZ(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=wZ(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(EZ)){const t=bZ(r.width,r.height,512,512,xZ),n=yZ(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=bZ(r,o,s,l,xZ),n=yZ(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=bZ(r,o,512,512,xZ),n=yZ(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=kZ(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:mZ(TU.clamp(i,64,512),64),height:mZ(TU.clamp(a,64,512),64)},n={x:vZ(i/2-t.width/2,64),y:vZ(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=kZ(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=kZ(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:MZ,addFillRect:TZ,addImageToStagingArea:AZ,addLine:IZ,addPointToCurrentLine:RZ,clearCanvasHistory:NZ,clearMask:DZ,commitColorPickerColor:zZ,commitStagingAreaImage:BZ,discardStagedImages:jZ,fitBoundingBoxToStage:FZ,mouseLeftCanvas:HZ,nextStagingAreaImage:WZ,prevStagingAreaImage:VZ,redo:$Z,resetCanvas:UZ,resetCanvasInteractionState:GZ,resetCanvasView:qZ,resizeAndScaleCanvas:YZ,resizeCanvas:ZZ,setBoundingBoxCoordinates:XZ,setBoundingBoxDimensions:KZ,setBoundingBoxPreviewFill:QZ,setBoundingBoxScaleMethod:JZ,setBrushColor:eX,setBrushSize:tX,setCanvasContainerDimensions:nX,setColorPickerColor:rX,setCursorPosition:oX,setDoesCanvasNeedScaling:iX,setInitialCanvasImage:aX,setInpaintReplace:sX,setIsDrawing:lX,setIsMaskEnabled:cX,setIsMouseOverBoundingBox:uX,setIsMoveBoundingBoxKeyHeld:dX,setIsMoveStageKeyHeld:hX,setIsMovingBoundingBox:fX,setIsMovingStage:pX,setIsTransformingBoundingBox:gX,setLayer:mX,setMaskColor:vX,setMergedCanvas:yX,setShouldAutoSave:bX,setShouldCropToBoundingBoxOnSave:xX,setShouldDarkenOutsideBoundingBox:wX,setShouldLockBoundingBox:kX,setShouldPreserveMaskedArea:SX,setShouldShowBoundingBox:CX,setShouldShowBrush:_X,setShouldShowBrushPreview:EX,setShouldShowCanvasDebugInfo:PX,setShouldShowCheckboardTransparency:LX,setShouldShowGrid:OX,setShouldShowIntermediates:MX,setShouldShowStagingImage:TX,setShouldShowStagingOutline:AX,setShouldSnapToGrid:IX,setShouldUseInpaintReplace:RX,setStageCoordinates:NX,setStageScale:DX,setTool:zX,toggleShouldLockBoundingBox:BX,toggleTool:jX,undo:FX,setScaledBoundingBoxDimensions:HX,setShouldRestrictStrokesToBox:WX}=OZ.actions,VX=OZ.reducer,$X=Object.create(null);$X.open="0",$X.close="1",$X.ping="2",$X.pong="3",$X.message="4",$X.upgrade="5",$X.noop="6";const UX=Object.create(null);Object.keys($X).forEach((e=>{UX[$X[e]]=e}));const GX={type:"error",data:"parser error"},qX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YX="function"==typeof ArrayBuffer,ZX=({type:e,data:t},n,r)=>qX&&t instanceof Blob?n?r(t):XX(t,r):YX&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):XX(new Blob([t]),r):r($X[e]+(t||"")),XX=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},KX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QX="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:nK(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:tK(e.substring(1),t)};return UX[n]?e.length>1?{type:UX[n],data:e.substring(1)}:{type:UX[n]}:GX},tK=(e,t)=>{if(JX){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return nK(n,t)}return{base64:!0,data:e}},nK=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,rK=String.fromCharCode(30);function oK(e){if(e)return function(e){for(var t in oK.prototype)e[t]=oK.prototype[t];return e}(e)}oK.prototype.on=oK.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},oK.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},oK.prototype.off=oK.prototype.removeListener=oK.prototype.removeAllListeners=oK.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const sK=setTimeout,lK=clearTimeout;function cK(e,t){t.useNativeTimers?(e.setTimeoutFn=sK.bind(iK),e.clearTimeoutFn=lK.bind(iK)):(e.setTimeoutFn=setTimeout.bind(iK),e.clearTimeoutFn=clearTimeout.bind(iK))}function uK(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class dK extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class hK extends oK{constructor(e){super(),this.writable=!1,cK(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new dK(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=eK(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pK={};let gK,mK=0,vK=0;function yK(e){let t="";do{t=fK[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function bK(){const e=yK(+new Date);return e!==gK?(mK=0,gK=e):e+"."+yK(mK++)}for(;vK<64;vK++)pK[fK[vK]]=vK;function xK(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let wK=!1;try{wK="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Hhe){}const kK=wK;function SK(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||kK))return new XMLHttpRequest}catch(B2){}if(!t)try{return new(iK[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(B2){}}function CK(){}const _K=null!=new SK({xdomain:!1}).responseType;class EK extends oK{constructor(e,t){super(),cK(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=aK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new SK(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(B2){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(B2){}try{t.setRequestHeader("Accept","*/*")}catch(B2){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(B2){return void this.setTimeoutFn((()=>{this.onError(B2)}),0)}"undefined"!=typeof document&&(this.index=EK.requestsCount++,EK.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=CK,e)try{this.xhr.abort()}catch(B2){}"undefined"!=typeof document&&delete EK.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(EK.requestsCount=0,EK.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",PK);else if("function"==typeof addEventListener){addEventListener("onpagehide"in iK?"pagehide":"unload",PK,!1)}function PK(){for(let e in EK.requests)EK.requests.hasOwnProperty(e)&&EK.requests[e].abort()}const LK="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),OK=iK.WebSocket||iK.MozWebSocket,MK="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const TK={websocket:class extends hK{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=MK?{}:aK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=MK?new OK(e,t,n):t?new OK(e,t):new OK(e)}catch(Hhe){return this.emitReserved("error",Hhe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(B2){}r&&LK((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||(e.b64=1);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!OK}},polling:class extends hK{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=_K&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(rK),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZX(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(rK))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new EK(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},AK=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RK(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=AK.exec(e||""),i={},a=14;for(;a--;)i[IK[a]]=o[a]||"";return-1!=n&&-1!=r&&(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=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class NK extends oK{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=RK(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=RK(t.host).host),cK(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new TK[e](n)}open(){let e;if(this.opts.rememberUpgrade&&NK.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(B2){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;NK.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;NK.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",NK.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){NK.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||BK&&e instanceof Blob||jK&&e instanceof File}function HK(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case GK.ACK:case GK.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class YK{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=$K(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ZK=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return GK},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==GK.EVENT&&e.type!==GK.ACK||!HK(e)?[this.encodeAsString(e)]:(e.type=e.type===GK.EVENT?GK.BINARY_EVENT:GK.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==GK.BINARY_EVENT&&e.type!==GK.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=WK(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:qK},Symbol.toStringTag,{value:"Module"}));function XK(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const KK=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class QK extends oK{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[XK(e,"open",this.onopen.bind(this)),XK(e,"packet",this.onpacket.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(KK.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:GK.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:GK.CONNECT,data:e})})):this.packet({type:GK.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case GK.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}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 GK.EVENT:case GK.BINARY_EVENT:this.onevent(e);break;case GK.ACK:case GK.BINARY_ACK:this.onack(e);break;case GK.DISCONNECT:this.ondisconnect();break;case GK.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:GK.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:GK.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}JK.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=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},JK.prototype.reset=function(){this.attempts=0},JK.prototype.setMin=function(e){this.ms=e},JK.prototype.setMax=function(e){this.max=e},JK.prototype.setJitter=function(e){this.jitter=e};class eQ extends oK{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,cK(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new JK({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||ZK;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new NK(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=XK(t,"open",(function(){n.onopen(),e&&e()})),o=XK(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(XK(e,"ping",this.onping.bind(this)),XK(e,"data",this.ondata.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this)),XK(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(B2){this.onclose("parse error",B2)}}ondecoded(e){LK((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new QK(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const tQ={};function nQ(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=RK(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=tQ[o]&&i in tQ[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new eQ(r,t):(tQ[o]||(tQ[o]=new eQ(r,t)),s=tQ[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}let rQ;Object.assign(nQ,{Manager:eQ,Socket:QK,io:nQ,connect:nQ});const oQ=new Uint8Array(16);function iQ(){if(!rQ&&(rQ="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rQ))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rQ(oQ)}const aQ=[];for(let e=0;e<256;++e)aQ.push((e+256).toString(16).slice(1));const sQ={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lQ(e,t,n){if(sQ.randomUUID&&!t&&!e)return sQ.randomUUID();const r=(e=e||{}).random||(e.rng||iQ)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(aQ[e[t+0]]+aQ[e[t+1]]+aQ[e[t+2]]+aQ[e[t+3]]+"-"+aQ[e[t+4]]+aQ[e[t+5]]+"-"+aQ[e[t+6]]+aQ[e[t+7]]+"-"+aQ[e[t+8]]+aQ[e[t+9]]+"-"+aQ[e[t+10]]+aQ[e[t+11]]+aQ[e[t+12]]+aQ[e[t+13]]+aQ[e[t+14]]+aQ[e[t+15]]).toLowerCase()}(r)}var cQ=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,uQ=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,dQ=/[^-+\dA-Z]/g;function hQ(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(fQ[t]||t||fQ.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return vQ(e)},m=function(){return yQ(e)},v={d:function(){return a()},dd:function(){return gQ(a())},ddd:function(){return pQ.dayNames[s()]},DDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()],short:!0})},dddd:function(){return pQ.dayNames[s()+7]},DDDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return gQ(l()+1)},mmm:function(){return pQ.monthNames[l()]},mmmm:function(){return pQ.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return gQ(c(),4)},h:function(){return u()%12||12},hh:function(){return gQ(u()%12||12)},H:function(){return u()},HH:function(){return gQ(u())},M:function(){return d()},MM:function(){return gQ(d())},s:function(){return h()},ss:function(){return gQ(h())},l:function(){return gQ(f(),3)},L:function(){return gQ(Math.floor(f()/10))},t:function(){return u()<12?pQ.timeNames[0]:pQ.timeNames[1]},tt:function(){return u()<12?pQ.timeNames[2]:pQ.timeNames[3]},T:function(){return u()<12?pQ.timeNames[4]:pQ.timeNames[5]},TT:function(){return u()<12?pQ.timeNames[6]:pQ.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":bQ(e)},o:function(){return(p()>0?"-":"+")+gQ(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+gQ(Math.floor(Math.abs(p())/60),2)+":"+gQ(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return gQ(g())},N:function(){return m()}};return t.replace(cQ,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var fQ={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"},pQ={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"]},gQ=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},mQ=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},vQ=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},yQ=function(e){var t=e.getDay();return 0===t&&(t=7),t},bQ=function(e){return(String(e).match(uQ)||[""]).pop().replace(dQ,"").replace(/GMT\+0000/g,"UTC")};const xQ=MV("socketio/generateImage"),wQ=MV("socketio/runESRGAN"),kQ=MV("socketio/runFacetool"),SQ=MV("socketio/deleteImage"),CQ=MV("socketio/requestImages"),_Q=MV("socketio/requestNewImages"),EQ=MV("socketio/cancelProcessing"),PQ=MV("socketio/requestSystemConfig"),LQ=MV("socketio/searchForModels"),OQ=MV("socketio/addNewModel"),MQ=MV("socketio/deleteModel"),TQ=MV("socketio/requestModelChange"),AQ=MV("socketio/saveStagingAreaImageToGallery"),IQ=MV("socketio/requestEmptyTempFolder"),RQ=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],NQ=[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],DQ=[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],zQ=[{key:"2x",value:2},{key:"4x",value:4}],BQ=4294967295,jQ=["gfpgan","codeformer"],FQ=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],HQ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var WQ=Math.PI/180;const VQ="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},$Q={_global:VQ,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>$Q.angleDeg?e*WQ: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:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>$Q.DD.isDragging,isDragReady:()=>!!$Q.DD.node,releaseCanvasOnDestroy:!0,document:VQ.document,_injectGlobal(e){VQ.Konva=e}},UQ=e=>{$Q[e.prototype.getClassName()]=e};$Q._injectGlobal($Q);class GQ{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 GQ(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=eJ._getRotation(i.rotation),i}}var qQ=Math.PI/180,YQ=180/Math.PI,ZQ="Konva error: ",XQ={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]},KQ=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,QQ=[];const JQ="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},eJ={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){QQ.push(e),1===QQ.length&&JQ((function(){const e=QQ;QQ=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(B2){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=eJ.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in XQ?{r:(t=XQ[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=KQ.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=>(e=e||"black",eJ._namedColorToRBA(e)||eJ._hex3ColorToRGBA(e)||eJ._hex6ColorToRGBA(e)||eJ._rgbColorToRGBA(e)||eJ._rgbaColorToRGBA(e)||eJ._hslColorToRGBA(e)),_namedColorToRBA(e){var t=XQ[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)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]&&4===e.length)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,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*qQ,radToDeg:e=>e*YQ,_degToRad:e=>(eJ.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),eJ.degToRad(e)),_radToDeg:e=>(eJ.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),eJ.radToDeg(e)),_getRotation:e=>$Q.angleDeg?eJ.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(ZQ+e)},error(e){console.error(ZQ+e)},warn(e){$Q.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=eJ.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=eJ._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){$Q.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function tJ(e){return eJ._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||eJ._isBoolean(e)?e:Object.prototype.toString.call(e)}function nJ(e){return e>255?255:e<0?0:Math.round(e)}function rJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function oJ(e){if($Q.isUnminified)return function(t,n){let r=eJ._isNumber(t),o=eJ._isArray(t)&&t.length==e;return r||o||eJ.warn(tJ(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function iJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||"auto"===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function aJ(){if($Q.isUnminified)return function(e,t){return eJ._isString(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function sJ(){if($Q.isUnminified)return function(e,t){const n=eJ._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function lJ(){if($Q.isUnminified)return function(e,t){return!0===e||!1===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var cJ="get",uJ="set";const dJ={addGetterSetter(e,t,n,r,o){dJ.addGetter(e,t,n),dJ.addSetter(e,t,r,o),dJ.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cJ+eJ._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]||dJ.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=eJ._capitalize,c=cJ+l(t),u=uJ+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},dJ.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=eJ._capitalize(t),r=uJ+n,o=cJ+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){eJ.error("Adding deprecated "+t);var o=cJ+eJ._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){eJ.error(i);var e=this.attrs[t];return void 0===e?n:e},dJ.addSetter(e,t,r,(function(){eJ.error(i)})),dJ.addOverloadedGetterSetter(e,t)},backCompat(e,t){eJ.each(t,(function(t,n){var r=e.prototype[n],o=cJ+eJ._capitalize(t),i=uJ+eJ._capitalize(t);function a(){r.apply(this,arguments),eJ.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function hJ(e){var t,n,r=[],o=e.length,i=eJ;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=fJ.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=hJ(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return wJ._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];wJ._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=eJ._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];wJ._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(wJ.justDragged=!0,$Q._mouseListenClick=!1,$Q._touchListenClick=!1,$Q._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof $Q.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){wJ._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&wJ._dragElements.delete(n)}))}};$Q.isBrowser&&(window.addEventListener("mouseup",wJ._endDragBefore,!0),window.addEventListener("touchend",wJ._endDragBefore,!0),window.addEventListener("mousemove",wJ._drag),window.addEventListener("touchmove",wJ._drag),window.addEventListener("mouseup",wJ._endDragAfter,!1),window.addEventListener("touchend",wJ._endDragAfter,!1));var kJ="absoluteOpacity",SJ="allEventListeners",CJ="absoluteTransform",_J="absoluteScale",EJ="canvas",PJ="listening",LJ="mouseenter",OJ="mouseleave",MJ="Shape",TJ=" ",AJ="stage",IJ="transform",RJ="visible",NJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(TJ);let DJ=1;class zJ{constructor(e){this._id=DJ++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==IJ&&e!==CJ||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===IJ||e===CJ)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(TJ);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(EJ)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===CJ&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(EJ)){const{scene:e,filter:t,hit:n}=this._cache.get(EJ);eJ.releaseCanvas(e,t,n),this._cache.delete(EJ)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new bJ({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new bJ({pixelRatio:i,width:0,height:0}),f=new xJ({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(EJ),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(kJ),this._clearSelfAndDescendantCache(_J),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(EJ,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}eJ.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(EJ)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+eJ._capitalize(t),eJ._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(PJ,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(RJ,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;wJ._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!$Q.hitOnDragEnabled&&r;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 e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new GQ,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(IJ);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={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,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return eJ.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return eJ.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&eJ.warn("Unexpected value "+e+" 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 t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(kJ,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],eJ.isObject(t)&&!eJ._isPlainObject(t)&&!eJ._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),eJ._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,eJ._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():$Q.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;wJ._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=wJ._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&wJ._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return eJ.haveIntersection(n,this.getClientRect())}static create(e,t){return eJ._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=zJ.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),$Q[i]||(eJ.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,$Q[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=zJ.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=zJ.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",m0=e=>{const t=g0(e);return"pointer"===t?$Q.pointerEventsEnabled&&p0.pointer:"touch"===t?p0.touch:"mouse"===t?p0.mouse:void 0};function v0(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&eJ.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const y0=[];class b0 extends jJ{constructor(e){super(v0(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),y0.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{v0(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||eJ.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&y0.splice(t,1),eJ.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(eJ.warn("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);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new bJ({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&eJ.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),$Q.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}getLayers(){return this.children}_bindContentEvents(){$Q.isBrowser&&f0.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!wJ.isDragging||$Q.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);wJ.justDragged=!1,$Q["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;$Q.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=m0(e.type),n=g0(e.type);if(!t)return;if(wJ.isDragging&&wJ.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!wJ.isDragging||$Q.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=WJ(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=m0(e.type),n=g0(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=WJ(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;$Q["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):wJ.justDragged||($Q["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){$Q["_"+n+"InDblClickWindow"]=!1}),$Q.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),$Q["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,$Q["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),$Q["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(s0,{evt:e}):this._fire(s0,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(h0,{evt:e}):this._fire(h0,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=WJ(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(t0,VJ(e)),GJ(e.pointerId)}_lostpointercapture(e){GJ(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}])}_setPointerPosition(e){eJ.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new bJ({width:this.width(),height:this.height()}),this.bufferHitCanvas=new xJ({pixelRatio:1,width:this.width(),height:this.height()}),$Q.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return eJ.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(e){e.batchDraw()})),this}}b0.prototype.nodeType="Stage",UQ(b0),dJ.addGetterSetter(b0,"container");var x0="hasShadow",w0="shadowRGBA",k0="patternImage",S0="linearGradient",C0="radialGradient";let _0;function E0(){return _0||(_0=eJ.createCanvasElement().getContext("2d"),_0)}const P0={};class L0 extends zJ{constructor(e){let t;for(super(e);t=eJ.getRandomColor(),!t||t in P0;);this.colorKey=t,P0[t]=this}getContext(){return eJ.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return eJ.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(x0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(k0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=E0().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new GQ;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate($Q.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(S0,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=E0(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return zJ.prototype.destroy.call(this),delete P0[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){eJ.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||eJ.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()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=eJ._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(B2){eJ.error("Unable to draw hit graph from cached scene canvas. "+B2.message)}return this}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}}L0.prototype._fillFunc=function(e){e.fill()},L0.prototype._strokeFunc=function(e){e.stroke()},L0.prototype._fillFuncHit=function(e){e.fill()},L0.prototype._strokeFuncHit=function(e){e.stroke()},L0.prototype._centroid=!1,L0.prototype.nodeType="Shape",UQ(L0),L0.prototype.eventListeners={},L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(x0)})),L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(w0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(k0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(S0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(C0)})),dJ.addGetterSetter(L0,"stroke",void 0,sJ()),dJ.addGetterSetter(L0,"strokeWidth",2,rJ()),dJ.addGetterSetter(L0,"fillAfterStrokeEnabled",!1),dJ.addGetterSetter(L0,"hitStrokeWidth","auto",iJ()),dJ.addGetterSetter(L0,"strokeHitEnabled",!0,lJ()),dJ.addGetterSetter(L0,"perfectDrawEnabled",!0,lJ()),dJ.addGetterSetter(L0,"shadowForStrokeEnabled",!0,lJ()),dJ.addGetterSetter(L0,"lineJoin"),dJ.addGetterSetter(L0,"lineCap"),dJ.addGetterSetter(L0,"sceneFunc"),dJ.addGetterSetter(L0,"hitFunc"),dJ.addGetterSetter(L0,"dash"),dJ.addGetterSetter(L0,"dashOffset",0,rJ()),dJ.addGetterSetter(L0,"shadowColor",void 0,aJ()),dJ.addGetterSetter(L0,"shadowBlur",0,rJ()),dJ.addGetterSetter(L0,"shadowOpacity",1,rJ()),dJ.addComponentsGetterSetter(L0,"shadowOffset",["x","y"]),dJ.addGetterSetter(L0,"shadowOffsetX",0,rJ()),dJ.addGetterSetter(L0,"shadowOffsetY",0,rJ()),dJ.addGetterSetter(L0,"fillPatternImage"),dJ.addGetterSetter(L0,"fill",void 0,sJ()),dJ.addGetterSetter(L0,"fillPatternX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternY",0,rJ()),dJ.addGetterSetter(L0,"fillLinearGradientColorStops"),dJ.addGetterSetter(L0,"strokeLinearGradientColorStops"),dJ.addGetterSetter(L0,"fillRadialGradientStartRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientEndRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientColorStops"),dJ.addGetterSetter(L0,"fillPatternRepeat","repeat"),dJ.addGetterSetter(L0,"fillEnabled",!0),dJ.addGetterSetter(L0,"strokeEnabled",!0),dJ.addGetterSetter(L0,"shadowEnabled",!0),dJ.addGetterSetter(L0,"dashEnabled",!0),dJ.addGetterSetter(L0,"strokeScaleEnabled",!0),dJ.addGetterSetter(L0,"fillPriority","color"),dJ.addComponentsGetterSetter(L0,"fillPatternOffset",["x","y"]),dJ.addGetterSetter(L0,"fillPatternOffsetX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternOffsetY",0,rJ()),dJ.addComponentsGetterSetter(L0,"fillPatternScale",["x","y"]),dJ.addGetterSetter(L0,"fillPatternScaleX",1,rJ()),dJ.addGetterSetter(L0,"fillPatternScaleY",1,rJ()),dJ.addComponentsGetterSetter(L0,"fillLinearGradientStartPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientStartPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillLinearGradientEndPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientEndPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientStartPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientEndPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientEndPointY",0),dJ.addGetterSetter(L0,"fillPatternRotation",0),dJ.backCompat(L0,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var O0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],M0=O0.length;class T0 extends jJ{constructor(e){super(e),this.canvas=new bJ,this.hitCanvas=new xJ({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),jJ.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),jJ.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return eJ.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}T0.prototype.nodeType="Layer",UQ(T0),dJ.addGetterSetter(T0,"imageSmoothingEnabled",!0),dJ.addGetterSetter(T0,"clearBeforeDraw",!0),dJ.addGetterSetter(T0,"hitGraphEnabled",!0,lJ());class A0 extends T0{constructor(e){super(e),this.listening(!1),eJ.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}A0.prototype.nodeType="FastLayer",UQ(A0);class I0 extends jJ{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&eJ.throw("You may only add groups and shapes to groups.")}}I0.prototype.nodeType="Group",UQ(I0);var R0=VQ.performance&&VQ.performance.now?function(){return VQ.performance.now()}:function(){return(new Date).getTime()};class N0{constructor(e,t){this.id=N0.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:R0(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class F0{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||H0.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=z0++;var l=o.getLayer()||(o instanceof $Q.Stage?o.getLayers():null);for(n in l||eJ.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new N0((function(){r.tween.onEnterFrame()}),l),this.tween=new j0(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),F0.attrs[i]||(F0.attrs[i]={}),F0.attrs[i][this._id]||(F0.attrs[i][this._id]={}),F0.tweens[i]||(F0.tweens[i]={}),e)void 0===D0[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=F0.tweens[d][e])&&delete F0.attrs[d][o][e],n=u.getAttr(e),eJ._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=eJ._prepareArrayForTween(n,t,u.closed())):(s=t,t=eJ._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.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(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=F0.tweens[t];for(e in this.pause(),r)delete F0.tweens[t][e];delete F0.attrs[t][n]}}F0.attrs={},F0.tweens={},zJ.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new F0(e).play()};const H0={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-H0.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},W0=eJ._assign($Q,{Util:eJ,Transform:GQ,Node:zJ,Container:jJ,Stage:b0,stages:y0,Layer:T0,FastLayer:A0,Group:I0,DD:wJ,Shape:L0,shapes:P0,Animation:N0,Tween:F0,Easings:H0,Context:pJ,Canvas:yJ});class V0 extends L0{_sceneFunc(e){var t=$Q.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=$Q.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function $0(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function U0(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=q0.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return q0.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return q0.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return q0.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,q0.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,y,b,x,w,k,S,C,_,E,P=null,L=[],O=l,M=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),P="L",L.push(l,c);break;case"L":l=f.shift(),c=f.shift(),L.push(l,c);break;case"m":var T=f.shift(),A=f.shift();if(l+=T,c+=A,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+A;break}L.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),P="M",L.push(l,c),h="L";break;case"h":l+=f.shift(),P="L",L.push(l,c);break;case"H":l=f.shift(),P="L",L.push(l,c);break;case"v":c+=f.shift(),P="L",L.push(l,c);break;case"V":c=f.shift(),P="L",L.push(l,c);break;case"C":L.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"c":L.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"S":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,f.shift(),f.shift()),l=f.shift(),c=f.shift(),P="C",L.push(l,c);break;case"s":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"Q":L.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"q":L.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="Q",L.push(l,c);break;case"T":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l=f.shift(),c=f.shift(),P="Q",L.push(y,b,l,c);break;case"t":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),P="Q",L.push(y,b,l,c);break;case"A":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k);break;case"a":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k)}a.push({command:P||h,points:L,start:{x:O,y:M},pathLength:this.calcLength(O,M,P||h,L)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=q0;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}q0.prototype.className="Path",q0.prototype._attrsAffectingSize=["data"],UQ(q0),dJ.addGetterSetter(q0,"data");class Y0 extends G0{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=q0.calcLength(r[r.length-4],r[r.length-3],"C",e),o=q0.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}Y0.prototype.className="Arrow",UQ(Y0),dJ.addGetterSetter(Y0,"pointerLength",10,rJ()),dJ.addGetterSetter(Y0,"pointerWidth",10,rJ()),dJ.addGetterSetter(Y0,"pointerAtBeginning",!1),dJ.addGetterSetter(Y0,"pointerAtEnding",!0);class Z0 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Z0.prototype._centroid=!0,Z0.prototype.className="Circle",Z0.prototype._attrsAffectingSize=["radius"],UQ(Z0),dJ.addGetterSetter(Z0,"radius",0,rJ());class X0 extends L0{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}X0.prototype.className="Ellipse",X0.prototype._centroid=!0,X0.prototype._attrsAffectingSize=["radiusX","radiusY"],UQ(X0),dJ.addComponentsGetterSetter(X0,"radius",["x","y"]),dJ.addGetterSetter(X0,"radiusX",0,rJ()),dJ.addGetterSetter(X0,"radiusY",0,rJ());class K0 extends L0{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=eJ.createImageElement();r.onload=function(){var e=new K0({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}K0.prototype.className="Image",UQ(K0),dJ.addGetterSetter(K0,"image"),dJ.addComponentsGetterSetter(K0,"crop",["x","y","width","height"]),dJ.addGetterSetter(K0,"cropX",0,rJ()),dJ.addGetterSetter(K0,"cropY",0,rJ()),dJ.addGetterSetter(K0,"cropWidth",0,rJ()),dJ.addGetterSetter(K0,"cropHeight",0,rJ());var Q0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],J0="up",e1="right",t1="down",n1="left",r1=Q0.length;class o1 extends I0{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}s1.prototype.className="RegularPolygon",s1.prototype._centroid=!0,s1.prototype._attrsAffectingSize=["radius"],UQ(s1),dJ.addGetterSetter(s1,"radius",0,rJ()),dJ.addGetterSetter(s1,"sides",0,rJ());var l1=2*Math.PI;class c1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,l1,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),l1,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}c1.prototype.className="Ring",c1.prototype._centroid=!0,c1.prototype._attrsAffectingSize=["innerRadius","outerRadius"],UQ(c1),dJ.addGetterSetter(c1,"innerRadius",0,rJ()),dJ.addGetterSetter(c1,"outerRadius",0,rJ());class u1 extends L0{constructor(e){super(e),this._updated=!0,this.anim=new N0((()=>{var e=this._updated;return this._updated=!1,e})),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(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=eJ._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===p1||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===p1||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return eJ.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=S1(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+b1+this.fontVariant()+b1+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===g1&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return S1().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==p1&&void 0!==o,s=i!==p1&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==x1,p=this.ellipsis();this.textArr=[],S1().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;y.length>0;){for(var x=0,w=y.length,k="",S=0;x>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,k=_,S=E):w=C}if(!k)break;if(f){var P,L=y[k.length];(P=(L===b1||"-"===L)&&S<=c?k.length:Math.max(k.lastIndexOf(b1),k.lastIndexOf("-"))+1)>0&&(x=P,k=k.slice(0,x),S=this._getTextWidth(k))}if(k=k.trimRight(),this._addTextLine(k),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(x)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=c){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==p1&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==x1)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==p1&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=h1(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=q0.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],y=d.points[5],b=d.points[4]+y;0===g?g=v+1e-8:o>s?g+=Math.PI/180*y/Math.abs(y):g-=Math.PI/360*y/Math.abs(y),(y<0&&g=0&&g>b)&&(g=b,p=!0),u=q0.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=q0.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=q0.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=q0.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;be+`.${O1}`)).join(" "),T1="nodesRect",A1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],I1={"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 R1="ontouchstart"in $Q._global;var N1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function D1(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=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:o})}function z1(e,t){const n=function(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)}}(e);return D1(e,t,n)}class B1 extends I0{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(M1,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return eJ.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return O1+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(A1.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(T1),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(T1,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=($Q.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return D1({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-$Q.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new GQ;var n,r,o,i;t.rotate(-$Q.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:$Q.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(),N1.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new a1({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:R1?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=$Q.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=eJ.degToRad(I1[e]||0);var n=(eJ.radToDeg(t)%360+360)%360;return eJ._inRange(n,337.5,360)||eJ._inRange(n,0,22.5)?"ns-resize":eJ._inRange(n,22.5,67.5)?"nesw-resize":eJ._inRange(n,67.5,112.5)?"ew-resize":eJ._inRange(n,112.5,157.5)?"nwse-resize":eJ._inRange(n,157.5,202.5)?"ns-resize":eJ._inRange(n,202.5,247.5)?"nesw-resize":eJ._inRange(n,247.5,292.5)?"ew-resize":eJ._inRange(n,292.5,337.5)?"nwse-resize":(eJ.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new L0({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*eJ._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(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 i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(eJ._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(eJ._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new GQ;if(o.rotate($Q.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:eJ.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new GQ;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new GQ;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new GQ;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(eJ._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(eJ._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*eJ._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),I0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return zJ.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}B1.prototype.className="Transformer",UQ(B1),dJ.addGetterSetter(B1,"enabledAnchors",N1,(function(e){return e instanceof Array||eJ.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===N1.indexOf(e)&&eJ.warn("Unknown anchor name: "+e+". Available names are: "+N1.join(", "))})),e||[]})),dJ.addGetterSetter(B1,"flipEnabled",!0,lJ()),dJ.addGetterSetter(B1,"resizeEnabled",!0),dJ.addGetterSetter(B1,"anchorSize",10,rJ()),dJ.addGetterSetter(B1,"rotateEnabled",!0),dJ.addGetterSetter(B1,"rotationSnaps",[]),dJ.addGetterSetter(B1,"rotateAnchorOffset",50,rJ()),dJ.addGetterSetter(B1,"rotationSnapTolerance",5,rJ()),dJ.addGetterSetter(B1,"borderEnabled",!0),dJ.addGetterSetter(B1,"anchorStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"anchorStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"anchorFill","white"),dJ.addGetterSetter(B1,"anchorCornerRadius",0,rJ()),dJ.addGetterSetter(B1,"borderStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"borderStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"borderDash"),dJ.addGetterSetter(B1,"keepRatio",!0),dJ.addGetterSetter(B1,"centeredScaling",!1),dJ.addGetterSetter(B1,"ignoreStroke",!1),dJ.addGetterSetter(B1,"padding",0,rJ()),dJ.addGetterSetter(B1,"node"),dJ.addGetterSetter(B1,"nodes"),dJ.addGetterSetter(B1,"boundBoxFunc"),dJ.addGetterSetter(B1,"anchorDragBoundFunc"),dJ.addGetterSetter(B1,"shouldOverdrawWholeArea",!1),dJ.addGetterSetter(B1,"useSingleNodeRotation",!0),dJ.backCompat(B1,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class j1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,$Q.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function F1(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}j1.prototype.className="Wedge",j1.prototype._centroid=!0,j1.prototype._attrsAffectingSize=["radius"],UQ(j1),dJ.addGetterSetter(j1,"radius",0,rJ()),dJ.addGetterSetter(j1,"angle",0,rJ()),dJ.addGetterSetter(j1,"clockwise",!1),dJ.backCompat(j1,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var H1=[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],W1=[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];dJ.addGetterSetter(zJ,"blurRadius",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"brightness",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"contrast",0,rJ(),dJ.afterSetFilter);function V1(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}dJ.addGetterSetter(zJ,"embossStrength",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossWhiteLevel",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossDirection","top-left",null,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossBlend",!1,null,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"enhance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"luminance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"value",0,rJ(),dJ.afterSetFilter);function $1(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function U1(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}dJ.addGetterSetter(zJ,"kaleidoscopePower",2,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"kaleidoscopeAngle",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"threshold",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"noise",.2,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"pixelSize",8,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"levels",.5,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));dJ.addGetterSetter(zJ,"threshold",.5,rJ(),dJ.afterSetFilter);const G1=W0.Util._assign(W0,{Arc:V0,Arrow:Y0,Circle:Z0,Ellipse:X0,Image:K0,Label:o1,Tag:i1,Line:G0,Path:q0,Rect:a1,RegularPolygon:s1,Ring:c1,Sprite:u1,Star:d1,Text:C1,TextPath:L1,Transformer:B1,Wedge:j1,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,y,b,x,w,k,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,M=P-1,T=L-1,A=t+1,I=A*(A+1)/2,R=new F1,N=null,D=R,z=null,B=null,j=H1[t],F=W1[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(c*j>>F)*C,E[s+1]=(u*j>>F)*C,E[s+2]=(d*j>>F)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(c*j>>F)*C,E[i+1]=(u*j>>F)*C,E[i+2]=(d*j>>F)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+A)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:eJ.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var y=p+4*(g-1+v),b=s[m]-s[y],x=s[m+1]-s[y+1],w=s[m+2]-s[y+2],k=b,S=k>0?k:-k;if((x>0?x:-x)>S&&(k=x),(w>0?w:-w)>S&&(k=w),k*=t,o){var C=s[m]+k,_=s[m+1]+k,E=s[m+2]+k;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var P=n-k;P<0?P=0:P>255&&(P=255),s[m]=s[m+1]=s[m+2]=P}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,y,b,x,w,k;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),y=u+f*(255-u),b=c-f*(c-0),w=h+f*(255-h),k=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),y=u+f*(u-(v=.5*(u+c))),b=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),k=d+f*(d-x)),o=0;ov?a:v;var y,b,x,w,k=u,S=c,C=360/S*Math.PI/180;for(b=0;bu&&(b=y,x=0,w=-1),n=0;nb?l:b;var x,w,k,S=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;tq1,X1=()=>Y1,K1=e=>{const t=Z1(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:y,seamBlur:b,seamless:x,seamSize:w,seamSteps:k,seamStrength:S,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:P,shouldRandomizeSeed:L,shouldRunESRGAN:O,shouldRunFacetool:M,steps:T,threshold:A,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:j,enableImageDebugging:F}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:A,perlin:m,height:u,width:z,sampler_name:y,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:j,generation_mode:n,init_mask:""};let W=!1,V=!1;if(H.seed=L?HQ(0,BQ):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,O&&(W={level:R,strength:N}),M&&(V={type:c,strength:l},"codeformer"===c&&(V.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new G1.Stage({container:o,width:n,height:r}),a=new G1.Layer,s=new G1.Layer;a.add(new G1.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new G1.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(_Z):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),y=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});F&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:y,caption:"image sent as init_img"}]),t.scale(m),H.init_img=y,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=b,H.seam_strength=S,H.seam_steps=k,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return P?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,F&&(H.enable_image_debugging=F),{generationParameters:H,esrganParameters:W,facetoolParameters:V}},Q1=()=>{const{origin:e}=new URL(window.location.href),t=nQ(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onFoundModels:v,onNewModelAdded:y,onModelDeleted:b,onModelChangeFailed:x,onTempFolderEmptied:w}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(GY(!0)),t(KY(pq.t("common:statusConnected"))),t(PQ());const e=n().gallery;e.categories.result.latest_mtime?t(_Q("result")):t(CQ("result")),e.categories.user.latest_mtime?t(_Q("user")):t(CQ("user"))}catch(B2){console.error(B2)}},onDisconnect:()=>{try{t(GY(!1)),t(KY(pq.t("common:statusDisconnected"))),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(B2){console.error(B2)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:lQ(),...l};if(["txt2img","img2img"].includes(s)&&t(IU({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(AZ({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(IU({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===P$[i]&&t(G$(c)),t(RU()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onIntermediateResult:e=>{try{t(BU({uuid:lQ(),...e,category:"result"})),e.isBase64||t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onPostprocessingResult:e=>{try{t(IU({category:"result",image:{uuid:lQ(),...e,category:"result"}})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(B2){console.error(B2)}},onProgressUpdate:e=>{try{t(VY(!0)),t(XY(e))}catch(B2){console.error(B2)}},onError:e=>{const{message:n,additionalData:r}=e;try{t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(tZ()),t(RU())}catch(B2){console.error(B2)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:lQ(),...e})));t(zU({images:i,areMoreImagesAvailable:r,category:o})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(eZ());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(IU({category:"result",image:e})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(RU())),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(NU(e));const{initialImage:o,maskPath:i}=n().options;o!==r&&o?.url!==r||t(M$()),i===r&&t(Z$("")),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(QY(e)),e.infill_methods.includes("patchmatch")||t(U$(e.infill_methods[0]))},onFoundModels:e=>{const{search_folder:n,found_models:r}=e;t(hZ(n)),t(fZ(r))},onNewModelAdded:e=>{const{new_model_name:n,model_list:r,update:o}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model Added: ${n}`,level:"info"})),t(cZ({title:o?`${pq.t("modelmanager:modelUpdated")}: ${n}`:`${pq.t("modelmanager:modelAdded")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:e=>{const{deleted_model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`${pq.t("modelmanager:modelAdded")}: ${n}`,level:"info"})),t(cZ({title:`${pq.t("modelmanager:modelEntryDeleted")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(KY(pq.t("common:statusModelChanged"))),t(VY(!1)),t(oZ(!0)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t(oZ(!0)),t(tZ()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(cZ({title:pq.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:k,emitRunESRGAN:S,emitRunFacetool:C,emitDeleteImage:_,emitRequestImages:E,emitRequestNewImages:P,emitCancelProcessing:L,emitRequestSystemConfig:O,emitSearchForModels:M,emitAddNewModel:T,emitDeleteModel:A,emitRequestModelChange:I,emitSaveStagingAreaImageToGallery:R,emitRequestEmptyTempFolder:N}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n(VY(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(lZ());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=K1(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n(VY(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n(VY(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(NU(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:e=>{t.emit("searchForModels",e)},emitAddNewModel:e=>{t.emit("addNewModel",e)},emitDeleteModel:e=>{t.emit("deleteModel",e)},emitRequestModelChange:e=>{n(iZ()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("foundModels",(e=>{v(e)})),t.on("newModelAdded",(e=>{y(e)})),t.on("modelDeleted",(e=>{b(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{x(e)})),t.on("tempFolderEmptied",(()=>{w()})),n=!0),o.type){case"socketio/generateImage":k(o.payload);break;case"socketio/runESRGAN":S(o.payload);break;case"socketio/runFacetool":C(o.payload);break;case"socketio/deleteImage":_(o.payload);break;case"socketio/requestImages":E(o.payload);break;case"socketio/requestNewImages":P(o.payload);break;case"socketio/cancelProcessing":L();break;case"socketio/requestSystemConfig":O();break;case"socketio/searchForModels":M(o.payload);break;case"socketio/addNewModel":T(o.payload);break;case"socketio/deleteModel":A(o.payload);break;case"socketio/requestModelChange":I(o.payload);break;case"socketio/saveStagingAreaImageToGallery":R(o.payload);break;case"socketio/requestEmptyTempFolder":N()}r(o)}},J1=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),e2=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((e=>`system.${e}`)),t2=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),n2=nV({options:OU,gallery:KU,system:gZ,canvas:VX}),r2=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||QV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=o$(h,["_persist"]);if(d.type===VV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=XV(e)),f)return n$({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)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 d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),n$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===$V)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:jV).concat(e.key);return t.removeItem(n,e$)}(e)),n$({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),n$({},t(p,d),{_persist:f});if(d.type===WV)l=!0;else if(d.type===HV){if(s)return n$({},p,{_persist:n$({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),y=d.payload,b=n$({},!1!==r&&void 0!==y?r(y,u,v,e):v,{_persist:n$({},f,{rehydrated:!0})});return c(b)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(n$({},x,{_persist:f}))}}(x$.getPersistConfig({key:"root",storage:y$,rootReducer:n2,blacklist:[...J1,...e2,...t2],debounce:300}),n2),o2=function(e){var t,n=OV(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=nV(i)}var p=s;"function"==typeof p&&(p=p(n));var g=oV.apply(void 0,p),m=rV;c&&(m=EV(CV({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=mV([g],f):"function"==typeof f&&(v=f(v)),tV(t,d,m.apply(void 0,v))}({reducer:r2,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Q1()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var i2={exports:{}},a2={},s2=a.exports;var l2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c2=s2.useState,u2=s2.useEffect,d2=s2.useLayoutEffect,h2=s2.useDebugValue;function f2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!l2(e,n)}catch(nue){return!0}}var p2="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=c2({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return d2((function(){o.value=n,o.getSnapshot=t,f2(o)&&i({inst:o})}),[e,n,t]),u2((function(){return f2(o)&&i({inst:o}),e((function(){f2(o)&&i({inst:o})}))}),[e]),h2(n),n};a2.useSyncExternalStore=void 0!==s2.useSyncExternalStore?s2.useSyncExternalStore:p2,function(e){e.exports=a2}(i2);var g2={exports:{}},m2={},v2=a.exports,y2=i2.exports;var b2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},x2=y2.useSyncExternalStore,w2=v2.useRef,k2=v2.useEffect,S2=v2.useMemo,C2=v2.useDebugValue;m2.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=w2(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=S2((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,b2(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var s=x2(e,i[0],i[1]);return k2((function(){a.hasValue=!0,a.value=s}),[s]),C2(s),s},function(e){e.exports=m2}(g2);let _2=function(e){e()};const E2=()=>_2,P2=a.exports.createContext(null);function L2(){return a.exports.useContext(P2)}let O2=()=>{throw new Error("uSES not initialized!")};const M2=(e,t)=>e===t;function T2(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(e,n=M2){const{store:r,subscription:o,getServerState:i}=t(),s=O2(o.addNestedSub,r.getState,i||r.getState,e,n);return a.exports.useDebugValue(s),s}}const A2=T2();var I2,R2={},N2=Symbol.for("react.element"),D2=Symbol.for("react.portal"),z2=Symbol.for("react.fragment"),B2=Symbol.for("react.strict_mode"),j2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),H2=Symbol.for("react.context"),W2=Symbol.for("react.server_context"),V2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),G2=Symbol.for("react.memo"),q2=Symbol.for("react.lazy"),Y2=Symbol.for("react.offscreen");function Z2(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N2:switch(e=e.type){case z2:case j2:case B2:case $2:case U2:return e;default:switch(e=e&&e.$$typeof){case W2:case H2:case V2:case q2:case G2:case F2:return e;default:return t}}case D2:return t}}}I2=Symbol.for("react.module.reference"),R2.ContextConsumer=H2,R2.ContextProvider=F2,R2.Element=N2,R2.ForwardRef=V2,R2.Fragment=z2,R2.Lazy=q2,R2.Memo=G2,R2.Portal=D2,R2.Profiler=j2,R2.StrictMode=B2,R2.Suspense=$2,R2.SuspenseList=U2,R2.isAsyncMode=function(){return!1},R2.isConcurrentMode=function(){return!1},R2.isContextConsumer=function(e){return Z2(e)===H2},R2.isContextProvider=function(e){return Z2(e)===F2},R2.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N2},R2.isForwardRef=function(e){return Z2(e)===V2},R2.isFragment=function(e){return Z2(e)===z2},R2.isLazy=function(e){return Z2(e)===q2},R2.isMemo=function(e){return Z2(e)===G2},R2.isPortal=function(e){return Z2(e)===D2},R2.isProfiler=function(e){return Z2(e)===j2},R2.isStrictMode=function(e){return Z2(e)===B2},R2.isSuspense=function(e){return Z2(e)===$2},R2.isSuspenseList=function(e){return Z2(e)===U2},R2.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===z2||e===j2||e===B2||e===$2||e===U2||e===Y2||"object"==typeof e&&null!==e&&(e.$$typeof===q2||e.$$typeof===G2||e.$$typeof===F2||e.$$typeof===H2||e.$$typeof===V2||e.$$typeof===I2||void 0!==e.getModuleId)},R2.typeOf=Z2,function(e){e.exports=R2}({exports:{}});const X2={notify(){},get:()=>[]};function K2(e,t){let n,r=X2;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=E2();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=X2)},getListeners:()=>r};return a}const Q2=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?a.exports.useLayoutEffect:a.exports.useEffect;function J2({store:e,context:t,children:n,serverState:r}){const o=a.exports.useMemo((()=>{const t=K2(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=a.exports.useMemo((()=>e.getState()),[e]);Q2((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);return ld((t||P2).Provider,{value:o,children:n})}function e5(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(){const{store:e}=t();return e}}const t5=e5();function n5(e=P2){const t=e===P2?t5:e5(e);return function(){return t().dispatch}}const r5=n5();var o5;function i5(e){return i5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i5(e)}function a5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s5(e,t){for(var n=0;n{O2=e})(g2.exports.useSyncExternalStoreWithSelector),o5=$.exports.unstable_batchedUpdates,_2=o5;var f5=function(e){function t(){var e,n;a5(this,t);for(var r=arguments.length,o=new Array(r),i=0;ild(CI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:ld(hT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),m5=r5,v5=A2,y5=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),b5=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=v5(y5),o=t?Math.round(100*t/n):0;return ld(eF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};var x5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w5=H.createContext&&H.createContext(x5),k5=globalThis&&globalThis.__assign||function(){return k5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return ld(YH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:ld(zT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function S3(e){const{title:t,hotkey:n,description:r}=e;return cd("div",{className:"hotkey-modal-item",children:[cd("div",{className:"hotkey-info",children:[ld("p",{className:"hotkey-title",children:t}),r&&ld("p",{className:"hotkey-description",children:r})]}),ld("div",{className:"hotkey-key",children:n})]})}function C3({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY(),i=[{title:o("hotkeys:invoke.title"),desc:o("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys:cancel.title"),desc:o("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys:focusPrompt.title"),desc:o("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys:toggleOptions.title"),desc:o("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys:pinOptions.title"),desc:o("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys:toggleViewer.title"),desc:o("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys:toggleGallery.title"),desc:o("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys:maximizeWorkSpace.title"),desc:o("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys:changeTabs.title"),desc:o("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys:consoleToggle.title"),desc:o("hotkeys:consoleToggle.desc"),hotkey:"`"}],s=[{title:o("hotkeys:setPrompt.title"),desc:o("hotkeys:setPrompt.desc"),hotkey:"P"},{title:o("hotkeys:setSeed.title"),desc:o("hotkeys:setSeed.desc"),hotkey:"S"},{title:o("hotkeys:setParameters.title"),desc:o("hotkeys:setParameters.desc"),hotkey:"A"},{title:o("hotkeys:restoreFaces.title"),desc:o("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys:upscale.title"),desc:o("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys:showInfo.title"),desc:o("hotkeys:showInfo.desc"),hotkey:"I"},{title:o("hotkeys:sendToImageToImage.title"),desc:o("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys:deleteImage.title"),desc:o("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys:closePanels.title"),desc:o("hotkeys:closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys:previousImage.title"),desc:o("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextImage.title"),desc:o("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:toggleGalleryPin.title"),desc:o("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys:increaseGalleryThumbSize.title"),desc:o("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys:decreaseGalleryThumbSize.title"),desc:o("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],c=[{title:o("hotkeys:selectBrush.title"),desc:o("hotkeys:selectBrush.desc"),hotkey:"B"},{title:o("hotkeys:selectEraser.title"),desc:o("hotkeys:selectEraser.desc"),hotkey:"E"},{title:o("hotkeys:decreaseBrushSize.title"),desc:o("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys:increaseBrushSize.title"),desc:o("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys:decreaseBrushOpacity.title"),desc:o("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys:increaseBrushOpacity.title"),desc:o("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys:moveTool.title"),desc:o("hotkeys:moveTool.desc"),hotkey:"V"},{title:o("hotkeys:fillBoundingBox.title"),desc:o("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys:eraseBoundingBox.title"),desc:o("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys:colorPicker.title"),desc:o("hotkeys:colorPicker.desc"),hotkey:"C"},{title:o("hotkeys:toggleSnap.title"),desc:o("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys:quickToggleMove.title"),desc:o("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys:toggleLayer.title"),desc:o("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys:clearMask.title"),desc:o("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys:hideMask.title"),desc:o("hotkeys:hideMask.desc"),hotkey:"H"},{title:o("hotkeys:showHideBoundingBox.title"),desc:o("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys:mergeVisible.title"),desc:o("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys:saveToGallery.title"),desc:o("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys:copyToClipboard.title"),desc:o("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys:downloadImage.title"),desc:o("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys:undoStroke.title"),desc:o("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys:redoStroke.title"),desc:o("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys:resetView.title"),desc:o("hotkeys:resetView.desc"),hotkey:"R"},{title:o("hotkeys:previousStagingImage.title"),desc:o("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextStagingImage.title"),desc:o("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:acceptStagingImage.title"),desc:o("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=e=>{const t=[];return e.forEach(((e,n)=>{t.push(ld(S3,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),ld("div",{className:"hotkey-modal-category",children:t})};return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,children:[ld(GB,{}),cd(WB,{className:" modal hotkeys-modal",children:[ld(DB,{className:"modal-close-btn"}),ld("h1",{children:"Keyboard Shorcuts"}),ld("div",{className:"hotkeys-modal-items",children:cd(uT,{allowMultiple:!0,children:[cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:appHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(i)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:generalHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(s)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:galleryHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(l)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:unifiedCanvasHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(c)})]})]})})]})]})]})}const _3=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return cd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...o,children:[ld(eA,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...i,children:t}),ld(nH,{className:"invokeai__switch-root",...s})]})},E3=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="sm",styleClass:l,...c}=e;return cd(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&ld(eA,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),ld(YH,{label:o,...i,children:ld(rF,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?ld("option",{value:e,className:"invokeai__select-option",children:e},e):ld("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},P3=/^-?(0\.)?\.?$/,L3=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:o=!1,showStepper:i=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:b,...x}=e,[w,k]=a.exports.useState(String(u));a.exports.useEffect((()=>{w.match(P3)||u===Number(w)||k(String(u))}),[u,w]);return ld(YH,{...b,children:cd(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&ld(eA,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...m,children:t}),cd(fj,{className:"invokeai__number-input-root",value:w,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{k(e),e.match(P3)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=TU.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);k(String(t)),d(t)},width:s,...x,children:[ld(gj,{className:"invokeai__number-input-field",textAlign:l,...v}),i&&cd("div",{className:"invokeai__number-input-stepper",children:[ld(yj,{...y,className:"invokeai__number-input-stepper-button"}),ld(vj,{...y,className:"invokeai__number-input-stepper-button"})]})]})]})})},O3=e=>e.system,M3=e=>e.system.toastQueue,T3=uV((e=>e.options),(e=>P$[e.activeTab]),{memoizeOptions:{equalityCheck:TU.isEqual}});uV((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});const A3=e=>e.options,I3=uV([O3,A3],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:TU.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),R3=({children:e})=>{const t=m5(),{t:n}=FY(),r=v5((e=>e.options.steps)),{isOpen:o,onOpen:i,onClose:s}=QA(),{isOpen:l,onOpen:c,onClose:u}=QA(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:f,saveIntermediatesInterval:p,enableImageDebugging:g,shouldUseCanvasBetaLayout:m}=v5(I3);return cd(sd,{children:[a.exports.cloneElement(e,{onClick:i}),cd(RB,{isOpen:o,onClose:s,size:"lg",children:[ld(GB,{}),cd(WB,{className:"modal settings-modal",children:[ld($B,{className:"settings-modal-header",children:n("common:settingsLabel")}),ld(DB,{className:"modal-close-btn"}),cd(NB,{className:"settings-modal-content",children:[cd("div",{className:"settings-modal-items",children:[cd("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[ld(E3,{label:n("settings:displayInProgress"),validValues:FQ,value:d,onChange:e=>t(WY(e.target.value))}),"full-res"===d&&ld(L3,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:e=>{e>r&&(e=r),e<1&&(e=1),t(aZ(e))},value:p,width:"auto",textAlign:"center"})]}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:e=>t(YY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:f,onChange:e=>t(JY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:m,onChange:e=>t(PU(e.target.checked))})]}),cd("div",{className:"settings-modal-items",children:[ld("h2",{style:{fontWeight:"bold"},children:"Developer"}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:g,onChange:e=>t(sZ(e.target.checked))})]}),cd("div",{className:"settings-modal-reset",children:[ld(LI,{size:"md",children:n("settings:resetWebUI")}),ld(RT,{colorScheme:"red",onClick:()=>{p5.purge().then((()=>{s(),c()}))},children:n("settings:resetWebUI")}),ld(VI,{children:n("settings:resetWebUIDesc1")}),ld(VI,{children:n("settings:resetWebUIDesc2")})]})]}),ld(VB,{children:ld(RT,{onClick:s,className:"modal-close-btn",children:n("common:close")})})]})]}),cd(RB,{closeOnOverlayClick:!1,isOpen:l,onClose:u,isCentered:!0,children:[ld(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),ld(WB,{children:ld(NB,{pb:6,pt:6,children:ld(CI,{justifyContent:"center",children:ld(VI,{fontSize:"lg",children:ld(VI,{children:n("settings:resetComplete")})})})})})]})]})},N3=uV((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:MU.exports.isEqual}}),D3=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=v5(N3),s=m5(),{t:l}=FY();let c;c=e&&!i?"status-good":"status-bad";let u=o;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(u)&&(c="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`);return ld(YH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:ld(VI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(nZ())},className:`status ${c}`,children:l(u)})})},z3=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return cd(Aj,{...i,children:[ld(Wj,{children:t}),cd(Fj,{className:`invokeai__popover-content ${r}`,children:[o&&ld(Ij,{className:"invokeai__popover-arrow"}),n]})]})},B3=ok(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return ld(YH,{label:r,...o,children:ld(RT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function j3(){const{t:e}=FY(),{setColorMode:t,colorMode:n}=dd(),r=m5(),o=v5((e=>e.options.currentTheme)),i={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};a.exports.useEffect((()=>{n!==o&&t(o)}),[t,n,o]);return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(o3,{})}),children:ld(WI,{align:"stretch",children:(()=>{const e=[];return Object.keys(i).forEach((t=>{e.push(ld(B3,{style:{width:"6rem"},leftIcon:o===t?ld(z5,{}):void 0,size:"sm",onClick:()=>(e=>{r(j$(e))})(t),children:i[t]},t))})),e})()})})}const F3=uV([O3],(e=>{const{isProcessing:t,model_list:n}=e,r=TU.map(n,((e,t)=>t)),o=TU.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),H3=()=>{const e=m5(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=v5(F3);return ld(CI,{style:{paddingLeft:"0.3rem"},children:ld(E3,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(TQ(t.target.value))}})})};function W3(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:o="sm",width:i,size:a="sm",isInvalid:s,...l}=e;return cd(GT,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[""!==t&&ld(eA,{fontSize:o,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),ld(eI,{...l,className:"input-entry",size:a,width:i})]})}var V3=Array.isArray,$3=Object.keys,U3=Object.prototype.hasOwnProperty,G3="undefined"!=typeof Element;function q3(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,o,i=V3(e),a=V3(t);if(i&&a){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!q3(e[n],t[n]))return!1;return!0}if(i!=a)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!=u)return!1;if(c&&u)return e.toString()==t.toString();var d=$3(e);if((r=d.length)!==$3(t).length)return!1;for(n=r;0!=n--;)if(!U3.call(t,d[n]))return!1;if(G3&&e instanceof Element&&t instanceof Element)return e===t;for(n=r;0!=n--;)if(!("_owner"===(o=d[n])&&e.$$typeof||q3(e[o],t[o])))return!1;return!0}return e!=e&&t!=t}var Y3=function(e,t){try{return q3(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}},Z3=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===X3}(e)}(e)};var X3="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K3(e,t){return!1!==t.clone&&t.isMergeableObject(e)?J3((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Q3(e,t,n){return e.concat(t).map((function(e){return K3(e,n)}))}function J3(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Q3,n.isMergeableObject=n.isMergeableObject||Z3;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=K3(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=J3(e[o],t[o],n):r[o]=K3(t[o],n)})),r}(e,t,n):K3(t,n)}J3.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return J3(e,n,t)}),{})};var e4=J3;const t4="object"==typeof global&&global&&global.Object===Object&&global;var n4="object"==typeof self&&self&&self.Object===Object&&self;const r4=t4||n4||Function("return this")();const o4=r4.Symbol;var i4=Object.prototype,a4=i4.hasOwnProperty,s4=i4.toString,l4=o4?o4.toStringTag:void 0;var c4=Object.prototype.toString;var u4=o4?o4.toStringTag:void 0;function d4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u4&&u4 in Object(e)?function(e){var t=a4.call(e,l4),n=e[l4];try{e[l4]=void 0;var r=!0}catch(B2){}var o=s4.call(e);return r&&(t?e[l4]=n:delete e[l4]),o}(e):function(e){return c4.call(e)}(e)}function h4(e,t){return function(n){return e(t(n))}}const f4=h4(Object.getPrototypeOf,Object);function p4(e){return null!=e&&"object"==typeof e}var g4=Function.prototype,m4=Object.prototype,v4=g4.toString,y4=m4.hasOwnProperty,b4=v4.call(Object);function x4(e){if(!p4(e)||"[object Object]"!=d4(e))return!1;var t=f4(e);if(null===t)return!0;var n=y4.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&v4.call(n)==b4}function w4(e,t){return e===t||e!=e&&t!=t}function k4(e,t){for(var n=e.length;n--;)if(w4(e[n][0],t))return n;return-1}var S4=Array.prototype.splice;function C4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},C4.prototype.set=function(e,t){var n=this.__data__,r=k4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function E4(e){if(!_4(e))return!1;var t=d4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}const P4=r4["__core-js_shared__"];var L4,O4=(L4=/[^.]+$/.exec(P4&&P4.keys&&P4.keys.IE_PROTO||""))?"Symbol(src)_1."+L4:"";var M4=Function.prototype.toString;function T4(e){if(null!=e){try{return M4.call(e)}catch(B2){}try{return e+""}catch(B2){}}return""}var A4=/^\[object .+?Constructor\]$/,I4=Function.prototype,R4=Object.prototype,N4=I4.toString,D4=R4.hasOwnProperty,z4=RegExp("^"+N4.call(D4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B4(e){return!(!_4(e)||(t=e,O4&&O4 in t))&&(E4(e)?z4:A4).test(T4(e));var t}function j4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B4(n)?n:void 0}const F4=j4(r4,"Map");const H4=j4(Object,"create");var W4=Object.prototype.hasOwnProperty;var V4=Object.prototype.hasOwnProperty;function $4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var f6={};function p6(e){return function(t){return e(t)}}f6["[object Float32Array]"]=f6["[object Float64Array]"]=f6["[object Int8Array]"]=f6["[object Int16Array]"]=f6["[object Int32Array]"]=f6["[object Uint8Array]"]=f6["[object Uint8ClampedArray]"]=f6["[object Uint16Array]"]=f6["[object Uint32Array]"]=!0,f6["[object Arguments]"]=f6["[object Array]"]=f6["[object ArrayBuffer]"]=f6["[object Boolean]"]=f6["[object DataView]"]=f6["[object Date]"]=f6["[object Error]"]=f6["[object Function]"]=f6["[object Map]"]=f6["[object Number]"]=f6["[object Object]"]=f6["[object RegExp]"]=f6["[object Set]"]=f6["[object String]"]=f6["[object WeakMap]"]=!1;var g6="object"==typeof t&&t&&!t.nodeType&&t,m6=g6&&"object"==typeof n&&n&&!n.nodeType&&n,v6=m6&&m6.exports===g6&&t4.process,y6=function(){try{var e=m6&&m6.require&&m6.require("util").types;return e||v6&&v6.binding&&v6.binding("util")}catch(B2){}}();const b6=y6;var x6=b6&&b6.isTypedArray,w6=x6?p6(x6):function(e){return p4(e)&&h6(e.length)&&!!f6[d4(e)]};const k6=w6;var S6=Object.prototype.hasOwnProperty;function C6(e,t){var n=i6(e),r=!n&&o6(e),o=!n&&!r&&c6(e),i=!n&&!r&&!o&&k6(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function q7(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Y7=function(e){return Array.isArray(e)&&0===e.length},Z7=function(e){return"function"==typeof e},X7=function(e){return null!==e&&"object"==typeof e},K7=function(e){return String(Math.floor(Number(e)))===e},Q7=function(e){return"[object String]"===Object.prototype.toString.call(e)},J7=function(e){return 0===a.exports.Children.count(e)},e9=function(e){return X7(e)&&Z7(e.then)};function t9(e,t,n,r){void 0===r&&(r=0);for(var o=V7(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function r9(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;t9(t,a.path)||(t=n9(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),_=a.exports.useCallback((function(e,t){return new Promise((function(n){return n(b.current[e].validate(t))}))}),[]),E=a.exports.useCallback((function(e){var t=Object.keys(b.current).filter((function(e){return Z7(b.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,t9(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=n9(e,t[r],n)),e}),{})}))}),[_]),P=a.exports.useCallback((function(e){return Promise.all([E(e),f.validationSchema?C(e):{},f.validate?S(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return e4.all([t,n,r],{arrayMerge:f9})}))}),[f.validate,f.validationSchema,E,S,C]),L=g9((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return y.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));a.exports.useEffect((function(){s&&!0===y.current&&Y3(p.current,f.initialValues)&&L(p.current)}),[s,L]);var O=a.exports.useCallback((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:g.current?g.current:f.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:f.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:f.initialStatus;p.current=t,g.current=n,m.current=r,v.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);e9(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);a.exports.useEffect((function(){!0!==y.current||Y3(p.current,f.initialValues)||(u&&(p.current=f.initialValues,O()),s&&L(p.current))}),[u,f.initialValues,O,s,L]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(g.current,f.initialErrors)&&(g.current=f.initialErrors||l9,k({type:"SET_ERRORS",payload:f.initialErrors||l9}))}),[u,f.initialErrors]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(m.current,f.initialTouched)&&(m.current=f.initialTouched||c9,k({type:"SET_TOUCHED",payload:f.initialTouched||c9}))}),[u,f.initialTouched]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(v.current,f.initialStatus)&&(v.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var M=g9((function(e){if(b.current[e]&&Z7(b.current[e].validate)){var t=t9(w.values,e),n=b.current[e].validate(t);return e9(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),C(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),T=a.exports.useCallback((function(e,t){var n=t.validate;b.current[e]={validate:n}}),[]),A=a.exports.useCallback((function(e){delete b.current[e]}),[]),I=g9((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?L(w.values):Promise.resolve()})),R=a.exports.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),N=g9((function(e,t){var r=Z7(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?L(r):Promise.resolve()})),D=a.exports.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),z=g9((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?L(n9(w.values,e,t)):Promise.resolve()})),B=a.exports.useCallback((function(e,t){var n,r=t,o=e;if(!Q7(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,c=i.value,u=i.checked,d=(i.outerHTML,i.options),h=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(t9(w.values,r),u,c):d&&h?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):c}r&&z(r,o)}),[z,w.values]),j=g9((function(e){if(Q7(e))return function(t){return B(t,e)};B(e)})),F=g9((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?L(w.values):Promise.resolve()})),H=a.exports.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));F(i,!0)}),[F]),W=g9((function(e){if(Q7(e))return function(t){return H(t,e)};H(e)})),V=a.exports.useCallback((function(e){Z7(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),$=a.exports.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=a.exports.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=g9((function(){return k({type:"SUBMIT_ATTEMPT"}),L().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return y.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(y.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(y.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:O,validateForm:L,validateField:M,setErrors:R,setFieldError:D,setFieldTouched:F,setFieldValue:z,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,setFormikState:V,submitForm:G},Z=g9((function(){return d(w.values,Y)})),X=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),O()})),K=a.exports.useCallback((function(e){return{value:t9(w.values,e),error:t9(w.errors,e),touched:!!t9(w.touched,e),initialValue:t9(p.current,e),initialTouched:!!t9(m.current,e),initialError:t9(g.current,e)}}),[w.errors,w.touched,w.values]),Q=a.exports.useCallback((function(e){return{setValue:function(t,n){return z(e,t,n)},setTouched:function(t,n){return F(e,t,n)},setError:function(t){return D(e,t)}}}),[z,F,D]),J=a.exports.useCallback((function(e){var t=X7(e),n=t?e.name:e,r=t9(w.values,n),o={name:n,value:r,onChange:j,onBlur:W};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[W,j,w.values]),ee=a.exports.useMemo((function(){return!Y3(p.current,w.values)}),[p.current,w.values]),te=a.exports.useMemo((function(){return void 0!==l?ee?w.errors&&0===Object.keys(w.errors).length:!1!==l&&Z7(l)?l(f):l:w.errors&&0===Object.keys(w.errors).length}),[l,ee,w.errors,f]);return U7({},w,{initialValues:p.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:W,handleChange:j,handleReset:X,handleSubmit:q,resetForm:O,setErrors:R,setFormikState:V,setFieldTouched:F,setFieldValue:z,setFieldError:D,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,submitForm:G,validateForm:L,validateField:M,isValid:te,dirty:ee,unregisterField:A,registerField:T,getFieldProps:J,getFieldMeta:K,getFieldHelpers:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:s})}function d9(e){var t=u9(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return a.exports.useImperativeHandle(i,(function(){return t})),a.exports.createElement(i9,{value:t},n?a.exports.createElement(n,t):o?o(t):r?Z7(r)?r(t):J7(r)?null:a.exports.Children.only(r):null)}function h9(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||x4(e)?h9(e):""!==e?e:void 0})):x4(e[r])?t[r]=h9(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function f9(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?e4(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=e4(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var p9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.exports.useLayoutEffect:a.exports.useEffect;function g9(e){var t=a.exports.useRef(e);return p9((function(){t.current=e})),a.exports.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(U7({},e,{length:t+1}))}return[]},b9=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=n9(n.values,i,e(t9(n.values,i))),l=r?o(t9(n.errors,i)):void 0,c=t?a(t9(n.touched,i)):void 0;return Y7(l)&&(l=void 0),Y7(c)&&(c=void 0),U7({},n,{values:s,errors:r?n9(n.errors,i,l):n.errors,touched:t?n9(n.touched,i,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(y9(t),[$7(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return v9(n,e,t)}),(function(t){return v9(t,e,null)}),(function(t){return v9(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(q7(n)),n.pop=n.pop.bind(q7(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Y3(t9(e.formik.values,e.name),t9(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?y9(n):[];return t||(t=r[e]),Z7(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,s=U7({},e,{form:G7(t.formik,["validate","validationSchema"]),name:i});return n?a.exports.createElement(n,s):r?r(s):o?"function"==typeof o?o(s):J7(o)?null:a.exports.Children.only(o):null},r}(a.exports.Component);b9.defaultProps={validateOnChange:!0};const x9=uV([O3],(e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function w9(){const{openModel:e,model_list:t}=v5(x9),n=v5((e=>e.system.isProcessing)),r=m5(),{t:o}=FY(),[i,s]=a.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});a.exports.useEffect((()=>{if(e){const n=TU.pickBy(t,((t,n)=>TU.isEqual(n,e)));s({name:e,description:n[e]?.description,config:n[e]?.config,weights:n[e]?.weights,vae:n[e]?.vae,width:n[e]?.width,height:n[e]?.height,default:n[e]?.default})}}),[t,e]);return e?cd(CI,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[ld(CI,{alignItems:"center",children:ld(VI,{fontSize:"lg",fontWeight:"bold",children:e})}),ld(CI,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:ld(d9,{enableReinitialize:!0,initialValues:i,onSubmit:e=>{r(OQ(e))},children:({handleSubmit:e,errors:t,touched:r})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",alignItems:"start",children:[cd(GT,{isInvalid:!!t.description&&r.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"lg"}),t.description&&r.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&r.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"lg"}),t.config&&r.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&r.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"lg"}),t.weights&&r.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&r.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"lg"}),t.vae&&r.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&r.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&r.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&r.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&r.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelmanager:updateModel")})]})})})})]}):ld(CI,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:ld(VI,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const k9=e=>{const{label:t,styleClass:n,...r}=e;return ld(TA,{className:`invokeai__checkbox ${n}`,...r,children:t})};function S9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function C9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function _9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function E9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function P9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function L9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function O9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function M9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function T9(e){return _5({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 A9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function I9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function R9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function N9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const D9=uV([O3],(e=>{const{model_list:t}=e,n=[];return TU.forEach(t,(e=>{n.push(e.weights)})),n}));function z9(){const{t:e}=FY();return ld(mI,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function B9({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=v5(D9);return cd(mI,{position:"relative",children:[r.includes(e.location)?ld(z9,{}):null,ld(k9,{value:e.name,label:ld(sd,{children:cd(WI,{alignItems:"start",children:[ld("p",{style:{fontWeight:"bold"},children:e.name}),ld("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:e=>{t.includes(e.target.value)?n(TU.remove(t,(t=>t!==e.target.value))):n([...t,e.target.value])},padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function j9(){const e=m5(),{t:t}=FY(),n=v5((e=>e.system.searchFolder)),r=v5((e=>e.system.foundModels)),o=v5(D9),i=v5((e=>e.options.shouldShowExistingModelsInSearch)),a=v5((e=>e.system.isProcessing)),[s,l]=H.useState([]);return cd(sd,{children:[n?cd(CI,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),ld(k3,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:ld(T9,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(LQ(n))}),ld(k3,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:ld(a3,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:()=>{e(hZ(null)),e(fZ(null)),l([])}})]}):ld(d9,{initialValues:{checkpointFolder:""},onSubmit:t=>{(t=>{e(LQ(t.checkpointFolder))})(t)},children:({handleSubmit:e})=>ld("form",{onSubmit:e,children:cd(HI,{columnGap:"0.5rem",children:[ld(GT,{isRequired:!0,width:"max-content",children:ld(m9,{as:W3,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),ld(k3,{icon:ld(S9,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&cd(CI,{flexDirection:"column",rowGap:"1rem",children:[cd(CI,{justifyContent:"space-between",alignItems:"center",children:[cd("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),cd("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),cd(CI,{columnGap:"0.5rem",justifyContent:"space-between",children:[cd(CI,{columnGap:"0.5rem",children:[ld(B3,{isDisabled:s.length===r.length,onClick:()=>{l([]),r&&r.forEach((e=>{o.includes(e.location)||l((t=>[...t,e.name]))}))},children:t("modelmanager:selectAll")}),ld(B3,{isDisabled:0===s.length,onClick:()=>{l([])},children:t("modelmanager:deselectAll")}),ld(k9,{label:t("modelmanager:showExisting"),isChecked:i,onChange:()=>e(LU(!i))})]}),ld(B3,{isDisabled:0===s.length,onClick:()=>{const t=r?.filter((e=>s.includes(e.name)));t?.forEach((t=>{const n={name:t.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:t.location,vae:"",width:512,height:512,default:!1};e(OQ(n))})),l([])},backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),cd(CI,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?0===s.length&&ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),(()=>{const e=[],t=[];return r&&r.forEach(((n,r)=>{o.includes(n.location)?t.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r)):e.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r))})),cd(sd,{children:[e,i&&t]})})()]})]})]})}function F9(){const{isOpen:e,onOpen:t,onClose:n}=QA(),r=m5(),{t:o}=FY(),i=v5((e=>e.system.isProcessing));function a(e){let t;return function(e){return/\\s/g.test(e)}(e)&&(t=o("modelmanager:cannotUseSpaces")),t}const[s,l]=H.useState(!1);return cd(sd,{children:[ld(B3,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:cd(CI,{columnGap:"0.5rem",alignItems:"center",children:[ld(a3,{}),o("modelmanager:addNew")]})}),cd(RB,{isOpen:e,onClose:()=>{n()},size:"3xl",closeOnOverlayClick:!1,children:[ld(GB,{}),cd(WB,{className:"modal add-model-modal",children:[ld($B,{children:o("modelmanager:addNewModel")}),ld(DB,{}),cd(NB,{className:"add-model-modal-body",children:[ld(j9,{}),ld(k9,{label:o("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&ld(d9,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},onSubmit:e=>{r(OQ(e)),n()},children:({handleSubmit:e,errors:t,touched:n})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",children:[ld(VI,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:o("modelmanager:manual")}),cd(GT,{isInvalid:!!t.name&&n.name,isRequired:!0,children:[ld(eA,{htmlFor:"name",fontSize:"sm",children:o("modelmanager:name")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"name",name:"name",type:"text",validate:a,width:"2xl"}),t.name&&n.name?ld(QT,{children:t.name}):ld(qT,{margin:0,children:o("modelmanager:nameValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.description&&n.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"2xl"}),t.description&&n.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&n.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"2xl"}),t.config&&n.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&n.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"2xl"}),t.weights&&n.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&n.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"2xl"}),t.vae&&n.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&n.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&n.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&n.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&n.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:i,children:o("modelmanager:addModel")})]})})})]})]})]})]})}Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"SunIcon",path:cd("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[ld("circle",{cx:"12",cy:"12",r:"5"}),ld("path",{d:"M12 1v2"}),ld("path",{d:"M12 21v2"}),ld("path",{d:"M4.22 4.22l1.42 1.42"}),ld("path",{d:"M18.36 18.36l1.42 1.42"}),ld("path",{d:"M1 12h2"}),ld("path",{d:"M21 12h2"}),ld("path",{d:"M4.22 19.78l1.42-1.42"}),ld("path",{d:"M18.36 5.64l1.42-1.42"})]})}),Sk({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"}),Sk({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"ViewIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("circle",{cx:"12",cy:"12",r:"2"})]})}),Sk({displayName:"ViewOffIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"});var H9=Sk({displayName:"DeleteIcon",path:ld("g",{fill:"currentColor",children:ld("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"})})});Sk({displayName:"RepeatIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"RepeatClockIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})});var W9=Sk({displayName:"EditIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ld("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});Sk({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),Sk({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),Sk({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),Sk({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Sk({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),Sk({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),Sk({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),Sk({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"}),Sk({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var V9=Sk({displayName:"ExternalLinkIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ld("path",{d:"M15 3h6v6"}),ld("path",{d:"M10 14L21 3"})]})});Sk({displayName:"LinkIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"PlusSquareIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),ld("path",{d:"M12 8v8"}),ld("path",{d:"M8 12h8"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"TimeIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowRightIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowLeftIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"EmailIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"SpinnerIcon",path:cd(sd,{children:[ld("defs",{children:cd("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[ld("stop",{stopColor:"currentColor",offset:"0%"}),ld("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),cd("g",{transform:"translate(2)",fill:"none",children:[ld("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),ld("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),ld("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),Sk({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"}),Sk({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"InfoOutlineIcon",path:cd("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[ld("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),ld("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),ld("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"QuestionOutlineIcon",path:cd("g",{stroke:"currentColor",strokeWidth:"1.5",children:[ld("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"}),ld("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),ld("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),Sk({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"}),Sk({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"}),Sk({viewBox:"0 0 14 14",path:ld("g",{fill:"currentColor",children:ld("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Sk({displayName:"MinusIcon",path:ld("g",{fill:"currentColor",children:ld("rect",{height:"4",width:"20",x:"2",y:"10"})})}),Sk({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"});const $9=ok(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:i,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=QA(),f=a.exports.useRef(null);return cd(sd,{children:[a.exports.cloneElement(c,{onClick:d,ref:t}),ld(qB,{isOpen:u,leastDestructiveRef:f,onClose:h,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:l}),ld(NB,{children:s}),cd(VB,{children:[ld(RT,{ref:f,onClick:()=>{i&&i(),h()},className:"modal-close-btn",children:o}),ld(RT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})}));function U9(e){const{isProcessing:t,isConnected:n}=v5((e=>e.system)),r=v5((e=>e.system.openModel)),{t:o}=FY(),i=m5(),{name:a,status:s,description:l}=e,c=()=>{i(pZ(a))};return cd(CI,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[ld(mI,{onClick:c,cursor:"pointer",children:ld(YH,{label:l,hasArrow:!0,placement:"bottom",children:ld(VI,{fontWeight:"bold",children:a})})}),ld(zI,{onClick:c,cursor:"pointer"}),cd(CI,{gap:2,alignItems:"center",children:[ld(VI,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),ld(RT,{size:"sm",onClick:()=>{i(TQ(a))},isDisabled:"active"===s||t||!n,className:"modal-close-btn",children:o("modelmanager:load")}),ld(k3,{icon:ld(W9,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===s||t||!n,className:" modal-close-btn"}),ld($9,{title:o("modelmanager:deleteModel"),acceptCallback:()=>{i(MQ(a)),i(pZ(null))},acceptButtonText:o("modelmanager:delete"),triggerComponent:ld(k3,{icon:ld(H9,{}),size:"sm","aria-label":o("modelmanager:deleteConfig"),isDisabled:"active"===s||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:cd(CI,{rowGap:"1rem",flexDirection:"column",children:[ld("p",{style:{fontWeight:"bold"},children:o("modelmanager:deleteMsg1")}),ld("p",{style:{color:"var(--text-color-secondary"},children:o("modelmanager:deleteMsg2")})]})})]})]})}const G9=uV((e=>e.system),(e=>{const t=TU.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),q9=()=>{const{models:e}=v5(G9),[t,n]=a.exports.useState(""),{t:r}=FY(),o=TU.debounce((e=>{n(e.target.value)}),400);return cd(CI,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[cd(CI,{justifyContent:"space-between",children:[ld(VI,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),ld(F9,{})]}),ld(W3,{onChange:o,label:r("modelmanager:search")}),ld(CI,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:(()=>{const n=[],r=[];return e.forEach(((e,o)=>{e.name.startsWith(t)&&r.push(ld(U9,{name:e.name,status:e.status,description:e.description},o)),n.push(ld(U9,{name:e.name,status:e.status,description:e.description},o))})),""!==t?r:n})()})]})};function Y9({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY();return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,size:"6xl",children:[ld(GB,{}),cd(WB,{className:" modal",children:[ld(DB,{className:"modal-close-btn"}),ld($B,{children:o("modelmanager:modelManager")}),cd(CI,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[ld(q9,{}),ld(w9,{})]})]})]})]})}function Z9(){const{t:e,i18n:t}=FY(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese")};return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:ld(J5,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:ld(WI,{children:(()=>{const e=[];return Object.keys(n).forEach((r=>{e.push(ld(B3,{"data-selected":localStorage.getItem("i18nextLng")===r,onClick:()=>t.changeLanguage(r),className:"modal-close-btn lang-select-btn","aria-label":n[r],tooltip:n[r],size:"sm",minWidth:"200px",children:n[r]},r))})),e})()})})}const X9=()=>{const{t:e}=FY();return cd("div",{className:"site-header",children:[cd("div",{className:"site-header-left-side",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),cd("div",{className:"site-header-right-side",children:[ld(D3,{}),ld(H3,{}),ld(Y9,{children:ld(k3,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(H5,{})})}),ld(C3,{children:ld(k3,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(Q5,{})})}),ld(j3,{}),ld(Z9,{}),ld(k3,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:ld(D5,{})})}),ld(k3,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:ld(L5,{})})}),ld(k3,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:ld(P5,{})})}),ld(R3,{children:ld(k3,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:ld(_9,{})})})]})]})};var K9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q9=globalThis&&globalThis.__assign||function(){return Q9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n()=>(t||e((t={exports:{}}).exports,t),t.exports),C8=(e,t,n)=>(n=null!=e?v8(w8(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of x8(t))!k8.call(e,o)&&o!==n&&y8(e,o,{get:()=>t[o],enumerable:!(r=b8(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:y8(n,"default",{value:e,enumerable:!0}),e)),_8=S8(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),E8=S8(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),P8=S8(((e,t)=>{var n=E8();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),L8=S8(((e,t)=>{var n=P8(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),O8=S8(((e,t)=>{var n=P8();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),M8=S8(((e,t)=>{var n=P8();t.exports=function(e){return n(this.__data__,e)>-1}})),T8=S8(((e,t)=>{var n=P8();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),A8=S8(((e,t)=>{var n=_8(),r=L8(),o=O8(),i=M8(),a=T8();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8();t.exports=function(){this.__data__=new n,this.size=0}})),R8=S8(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),N8=S8(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),D8=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),z8=S8(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),B8=S8(((e,t)=>{var n=z8(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),j8=S8(((e,t)=>{var n=B8().Symbol;t.exports=n})),F8=S8(((e,t)=>{var n=j8(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),H8=S8(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),W8=S8(((e,t)=>{var n=j8(),r=F8(),o=H8(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),V8=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),$8=S8(((e,t)=>{var n=W8(),r=V8();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),U8=S8(((e,t)=>{var n=B8()["__core-js_shared__"];t.exports=n})),G8=S8(((e,t)=>{var n=U8(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),q8=S8(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),Y8=S8(((e,t)=>{var n=$8(),r=G8(),o=V8(),i=q8(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),Z8=S8(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),X8=S8(((e,t)=>{var n=Y8(),r=Z8();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),K8=S8(((e,t)=>{var n=X8()(B8(),"Map");t.exports=n})),Q8=S8(((e,t)=>{var n=X8()(Object,"create");t.exports=n})),J8=S8(((e,t)=>{var n=Q8();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),eee=S8(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),tee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),nee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),ree=S8(((e,t)=>{var n=Q8();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),oee=S8(((e,t)=>{var n=J8(),r=eee(),o=tee(),i=nee(),a=ree();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=oee(),r=A8(),o=K8();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),aee=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),see=S8(((e,t)=>{var n=aee();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),lee=S8(((e,t)=>{var n=see();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),cee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).get(e)}})),uee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).has(e)}})),dee=S8(((e,t)=>{var n=see();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),hee=S8(((e,t)=>{var n=iee(),r=lee(),o=cee(),i=uee(),a=dee();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8(),r=K8(),o=hee();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),pee=S8(((e,t)=>{var n=A8(),r=I8(),o=R8(),i=N8(),a=D8(),s=fee();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),gee=S8(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),mee=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),vee=S8(((e,t)=>{var n=hee(),r=gee(),o=mee();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),xee=S8(((e,t)=>{var n=vee(),r=yee(),o=bee();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=B8().Uint8Array;t.exports=n})),kee=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),See=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),Cee=S8(((e,t)=>{var n=j8(),r=wee(),o=E8(),i=xee(),a=kee(),s=See(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),_ee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),Pee=S8(((e,t)=>{var n=_ee(),r=Eee();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),Lee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),Mee=S8(((e,t)=>{var n=Lee(),r=Oee(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),Tee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),Iee=S8(((e,t)=>{var n=W8(),r=Aee();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),Ree=S8(((e,t)=>{var n=Iee(),r=Aee(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),Nee=S8(((e,t)=>{t.exports=function(){return!1}})),Dee=S8(((e,t)=>{var n=B8(),r=Nee(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),zee=S8(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),jee=S8(((e,t)=>{var n=W8(),r=Bee(),o=Aee(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),Fee=S8(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Hee=S8(((e,t)=>{var n=z8(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),Wee=S8(((e,t)=>{var n=jee(),r=Fee(),o=Hee(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Vee=S8(((e,t)=>{var n=Tee(),r=Ree(),o=Eee(),i=Dee(),a=zee(),s=Wee(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),$ee=S8(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),Uee=S8(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),Gee=S8(((e,t)=>{var n=Uee()(Object.keys,Object);t.exports=n})),qee=S8(((e,t)=>{var n=$ee(),r=Gee(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),Yee=S8(((e,t)=>{var n=$8(),r=Bee();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),Zee=S8(((e,t)=>{var n=Vee(),r=qee(),o=Yee();t.exports=function(e){return o(e)?n(e):r(e)}})),Xee=S8(((e,t)=>{var n=Pee(),r=Mee(),o=Zee();t.exports=function(e){return n(e,o,r)}})),Kee=S8(((e,t)=>{var n=Xee(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=X8()(B8(),"DataView");t.exports=n})),Jee=S8(((e,t)=>{var n=X8()(B8(),"Promise");t.exports=n})),ete=S8(((e,t)=>{var n=X8()(B8(),"Set");t.exports=n})),tte=S8(((e,t)=>{var n=X8()(B8(),"WeakMap");t.exports=n})),nte=S8(((e,t)=>{var n=Qee(),r=K8(),o=Jee(),i=ete(),a=tte(),s=W8(),l=q8(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),y=l(a),b=s;(n&&b(new n(new ArrayBuffer(1)))!=f||r&&b(new r)!=c||o&&b(o.resolve())!=u||i&&b(new i)!=d||a&&b(new a)!=h)&&(b=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case y:return h}return t}),t.exports=b})),rte=S8(((e,t)=>{var n=pee(),r=xee(),o=Cee(),i=Kee(),a=nte(),s=Eee(),l=Dee(),c=Wee(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var y=s(e),b=s(t),x=y?d:a(e),w=b?d:a(t),k=(x=x==u?h:x)==h,S=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;y=!0,k=!1}if(C&&!k)return v||(v=new n),y||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=k&&f.call(e,"__wrapped__"),E=S&&f.call(t,"__wrapped__");if(_||E){var P=_?e.value():e,L=E?t.value():t;return v||(v=new n),m(P,L,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),ote=S8(((e,t)=>{var n=rte(),r=Aee();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),ite=S8(((e,t)=>{var n=ote();t.exports=function(e,t){return n(e,t)}})),ate=["ctrl","shift","alt","meta","mod"],ste={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function lte(e,t=","){return"string"==typeof e?e.split(t):e}function cte(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>ste[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!ate.includes(e)));return{...r,keys:o}}function ute({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var dte=a.exports.createContext(void 0),hte=a.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),fte=C8(ite());var pte=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function gte(e,t,n,r){let o=a.exports.useRef(null),{current:i}=a.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=a.exports.useCallback(t,[...l]),u=function(e){let t=a.exports.useRef(void 0);return(0,fte.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=a.exports.useContext(hte),h=a.exports.useContext(dte);return a.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return ute(e,["input","textarea","select"])}(t)||ute(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void pte(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||lte(e,u?.splitKey).forEach((e=>{let n=cte(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,i)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void pte(t);c(t,n)}}))}},n=e=>{i.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.addHotkey(cte(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.removeHotkey(cte(e,u?.combinationKey))))}}),[e,c,u,d]),o}C8(ite());var mte=new Set;window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>mte.add(cte(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=cte(e);for(let n of mte)n.keys?.every((e=>t.keys?.includes(e)))&&mte.delete(n)}))}(e.key)}))}));const vte=uV((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),yte=uV((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),bte=()=>{const e=m5(),t=v5(vte),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=v5(yte),[i,s]=a.exports.useState(!0),l=a.exports.useRef(null);a.exports.useLayoutEffect((()=>{null!==l.current&&i&&(l.current.scrollTop=l.current.scrollHeight)}),[i,t,n]);gte("`",(()=>{e(UY(!n))}),[n]),gte("esc",(()=>{e(UY(!1))}));return cd(sd,{children:[n&&ld(m8,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:ld("div",{className:"console",ref:l,onScroll:()=>{l.current&&i&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return cd("div",{className:`console-entry console-${o}-color`,children:[cd("p",{className:"console-timestamp",children:[n,":"]}),ld("p",{className:"console-message",children:r})]},t)}))})}),n&&ld(YH,{hasArrow:!0,label:i?"Autoscroll On":"Autoscroll Off",children:ld(zT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":i,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:ld(O5,{}),onClick:()=>s(!i)})}),ld(YH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:ld(zT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:ld(n?n3:B5,{}),onClick:()=>{e(nZ()),e(UY(!n))}})})]})};function xte(){const{t:e}=FY();return cd("div",{className:"work-in-progress nodes-work-in-progress",children:[ld("h1",{children:e("common:nodes")}),ld("p",{children:e("common:nodesDesc")})]})}const wte=()=>{const{t:e}=FY();return cd("div",{className:"work-in-progress post-processing-work-in-progress",children:[ld("h1",{children:e("common:postProcessing")}),ld("p",{children:e("common:postProcessDesc1")}),ld("p",{children:e("common:postProcessDesc2")}),ld("p",{children:e("common:postProcessDesc3")})]})},kte=Sk({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:ld("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"})})}),Ste=Sk({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),Cte=Sk({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),_te=Sk({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:ld("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 Ete=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Ete||{});const Pte={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:"Image to Image 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"},8:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},Lte=uV((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ote=uV((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Mte=()=>{const e=m5(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=v5(Lte),{isGFPGANAvailable:o}=v5(Ote),{t:i}=FY();return cd(CI,{direction:"column",gap:2,children:[ld(E3,{label:i("options:type"),validValues:jQ.concat(),value:n,onChange:t=>e(H$(t.target.value))}),ld(L3,{isDisabled:!o,label:i("options:strength"),step:.05,min:0,max:1,onChange:t=>e(F$(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&ld(L3,{isDisabled:!o,label:i("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:t=>e(B$(t)),value:r,width:"90px",isInteger:!1})]})};function Tte(){const e=v5((e=>e.system.isGFPGANAvailable)),t=v5((e=>e.options.shouldRunFacetool)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(gU(e.target.checked))})}function Ate(){const e=m5(),t=v5((e=>e.options.shouldFitToWidthHeight)),{t:n}=FY();return ld(_3,{label:n("options:imageFit"),isChecked:t,onChange:t=>e(lU(t.target.checked))})}function Ite(e){const[t,n]=a.exports.useState(!1),{label:r,value:o,min:i=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5rem",inputReadOnly:y=!0,withReset:b=!1,hideTooltip:x=!1,isCompact:w=!1,handleReset:k,isResetDisabled:S,isSliderDisabled:C,isInputDisabled:_,styleClass:E,sliderFormControlProps:P,sliderFormLabelProps:L,sliderMarkProps:O,sliderTrackProps:M,sliderThumbProps:T,sliderNumberInputProps:A,sliderNumberInputFieldProps:I,sliderNumberInputStepperProps:R,sliderTooltipProps:N,sliderIAIIconButtonProps:D,...z}=e,[B,j]=a.exports.useState(String(o)),F=a.exports.useMemo((()=>A?.max?A.max:s),[s,A?.max]);a.exports.useEffect((()=>{String(o)!==B&&""!==B&&j(String(o))}),[o,B,j]);const H=e=>{j(String(e)),c(Number(e))};return cd(GT,{className:E?`invokeai__slider-component ${E}`:"invokeai__slider-component","data-markers":h,style:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...P,children:[ld(eA,{className:"invokeai__slider-component-label",...L,children:r}),cd(HI,{w:"100%",gap:2,alignItems:"center",children:[cd(ZF,{"aria-label":r,value:o,min:i,max:s,step:l,onChange:H,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:C,width:u,...z,children:[h&&cd(sd,{children:[ld(JF,{value:i,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...O,children:i}),ld(JF,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...O,children:s})]}),ld(KF,{className:"invokeai__slider_track",...M,children:ld(QF,{className:"invokeai__slider_track-filled"})}),ld(YH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...N,children:ld(XF,{className:"invokeai__slider-thumb",...T})})]}),g&&cd(fj,{min:i,max:F,step:l,value:B,onChange:H,onBlur:e=>{const t=TU.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),i,F);j(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:_,...A,children:[ld(gj,{className:"invokeai__slider-number-input",width:v,readOnly:y,...I}),cd(pj,{...R,children:[ld(yj,{className:"invokeai__slider-number-stepper"}),ld(vj,{className:"invokeai__slider-number-stepper"})]})]}),b&&ld(k3,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:ld(T9,{}),onClick:()=>{k&&k()},isDisabled:S,...D})]})]})}function Rte(e){const{t:t}=FY(),{label:n=`${t("options:strength")}`,styleClass:r}=e,o=v5((e=>e.options.img2imgStrength)),i=m5();return ld(Ite,{label:n,step:.01,min:.01,max:.99,onChange:e=>i($$(e)),value:o,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i($$(.75))}})}const Nte=()=>{const e=m5(),t=v5((e=>e.options.seamless)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:t=>e(nU(t.target.checked))})})},Dte=()=>ld(CI,{gap:2,direction:"column",children:ld(Nte,{})});function zte(){const e=m5(),{t:t}=FY(),n=v5((e=>e.options.shouldRandomizeSeed));return ld(_3,{label:t("options:randomizeSeed"),isChecked:n,onChange:t=>e(fU(t.target.checked))})}function Bte(){const e=v5((e=>e.options.seed)),t=v5((e=>e.options.shouldRandomizeSeed)),n=v5((e=>e.options.shouldGenerateVariations)),{t:r}=FY(),o=m5();return ld(L3,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:0,max:BQ,isDisabled:t,isInvalid:e<0&&n,onChange:e=>o(aU(e)),value:e,width:"10rem"})}function jte(){const e=m5(),t=v5((e=>e.options.shouldRandomizeSeed)),{t:n}=FY();return ld(RT,{size:"sm",isDisabled:t,onClick:()=>e(aU(HQ(0,BQ))),children:ld("p",{children:n("options:shuffle")})})}function Fte(){const e=m5(),t=v5((e=>e.options.threshold)),{t:n}=FY();return ld(L3,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:t=>e(wU(t)),value:t,isInteger:!1})}function Hte(){const e=m5(),t=v5((e=>e.options.perlin)),{t:n}=FY();return ld(L3,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:t=>e(Q$(t)),value:t,isInteger:!1})}const Wte=()=>cd(CI,{gap:2,direction:"column",children:[ld(zte,{}),cd(CI,{gap:2,children:[ld(Bte,{}),ld(jte,{})]}),ld(CI,{gap:2,children:ld(Fte,{})}),ld(CI,{gap:2,children:ld(Hte,{})})]}),Vte=uV((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),$te=uV((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ute=()=>{const e=m5(),{upscalingLevel:t,upscalingStrength:n}=v5(Vte),{isESRGANAvailable:r}=v5($te),{t:o}=FY();return cd("div",{className:"upscale-options",children:[ld(E3,{isDisabled:!r,label:o("options:scale"),value:t,onChange:t=>e(SU(Number(t.target.value))),validValues:zQ}),ld(L3,{isDisabled:!r,label:o("options:strength"),step:.05,min:0,max:1,onChange:t=>e(CU(t)),value:n,isInteger:!1})]})};function Gte(){const e=v5((e=>e.system.isESRGANAvailable)),t=v5((e=>e.options.shouldRunESRGAN)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(pU(e.target.checked))})}function qte(){const e=v5((e=>e.options.shouldGenerateVariations)),t=m5();return ld(_3,{isChecked:e,width:"auto",onChange:e=>t(cU(e.target.checked))})}function Yte(){const e=v5((e=>e.options.seedWeights)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(W3,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(_$(e)||""===e),isDisabled:!t,onChange:e=>r(sU(e.target.value))})}function Zte(){const e=v5((e=>e.options.variationAmount)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(L3,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>r(_U(e)),isInteger:!1})}const Xte=()=>cd(CI,{gap:2,direction:"column",children:[ld(Zte,{}),ld(Yte,{})]});function Kte(){const e=m5(),t=v5((e=>e.options.cfgScale)),{t:n}=FY();return ld(L3,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:t=>e(z$(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function Qte(){const e=v5((e=>e.options.height)),t=v5(T3),n=m5(),{t:r}=FY();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:r("options:height"),value:e,flexGrow:1,onChange:e=>n(W$(Number(e.target.value))),validValues:DQ,styleClass:"main-option-block"})}const Jte=uV([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function ene(){const e=m5(),{iterations:t}=v5(Jte),{t:n}=FY();return ld(L3,{label:n("options:images"),step:1,min:1,max:9999,onChange:t=>e(Y$(t)),value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function tne(){const e=v5((e=>e.options.sampler)),t=m5(),{t:n}=FY();return ld(E3,{label:n("options:sampler"),value:e,onChange:e=>t(eU(e.target.value)),validValues:RQ,styleClass:"main-option-block"})}function nne(){const e=m5(),t=v5((e=>e.options.steps)),{t:n}=FY();return ld(L3,{label:n("options:steps"),min:1,max:9999,step:1,onChange:t=>e(xU(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function rne(){const e=v5((e=>e.options.width)),t=v5(T3),{t:n}=FY(),r=m5();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:n("options:width"),value:e,flexGrow:1,onChange:e=>r(EU(Number(e.target.value))),validValues:NQ,styleClass:"main-option-block"})}function one(){return ld("div",{className:"main-options",children:cd("div",{className:"main-options-list",children:[cd("div",{className:"main-options-row",children:[ld(ene,{}),ld(nne,{}),ld(Kte,{})]}),cd("div",{className:"main-options-row",children:[ld(rne,{}),ld(Qte,{}),ld(tne,{})]})]})})}const ine=uV((e=>e.system),(e=>e.shouldDisplayGuides)),ane=({children:e,feature:t})=>{const n=v5(ine),{text:r}=Pte[t];return n?cd(Aj,{trigger:"hover",children:[ld(Wj,{children:ld(mI,{children:e})}),cd(Fj,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[ld(Ij,{className:"guide-popover-arrow"}),ld("div",{className:"guide-popover-guide-content",children:r})]})]}):null},sne=ok((({feature:e,icon:t=C9},n)=>ld(ane,{feature:e,children:ld(mI,{ref:n,children:ld(kk,{marginBottom:"-.15rem",as:t})})})));function lne(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return cd(lT,{className:"advanced-settings-item",children:[ld(nT,{className:"advanced-settings-header",children:cd(CI,{width:"100%",gap:"0.5rem",align:"center",children:[ld(mI,{flexGrow:1,textAlign:"left",children:t}),o,n&&ld(sne,{feature:n}),ld(sT,{})]})}),ld(cT,{className:"advanced-settings-panel",children:r})]})}const cne=e=>{const{accordionInfo:t}=e,n=v5((e=>e.system.openAccordions)),r=m5();return ld(uT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(ZY(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(ld(lne,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})},une=e=>e.canvas,dne=uV([une,T3,O3],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),hne=e=>e.canvas.layerState.objects.find(EZ),fne=uV([e=>e.options,e=>e.system,hne,T3],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!_$(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:TU.isEqual,resultEqualityCheck:TU.isEqual}});function pne(e){const{iconButton:t=!1,...n}=e,r=m5(),{isReady:o}=v5(fne),i=v5(T3),a=()=>{r(xQ(i))},{t:s}=FY();return gte(["ctrl+enter","meta+enter"],(()=>{r(xQ(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),ld("div",{style:{flexGrow:4},children:t?ld(k3,{"aria-label":s("options:invoke"),type:"submit",icon:ld(i3,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):ld(B3,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const gne=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function mne(e){const{...t}=e,n=m5(),{isProcessing:r,isConnected:o,isCancelable:i}=v5(gne),a=()=>n(EQ()),{t:s}=FY();return gte("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),ld(k3,{icon:ld(O9,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const vne=uV((e=>e.options),(e=>e.shouldLoopback)),yne=()=>{const e=m5(),t=v5(vne),{t:n}=FY();return ld(k3,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:ld(l3,{}),onClick:()=>{e(dU(!t))}})},bne=()=>{const e=v5(T3);return cd("div",{className:"process-buttons",children:[ld(pne,{}),"img2img"===e&&ld(yne,{}),ld(mne,{})]})},xne=uV([e=>e.options,T3],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),wne=()=>{const e=m5(),{prompt:t,activeTabName:n}=v5(xne),{isReady:r}=v5(fne),o=a.exports.useRef(null),{t:i}=FY();gte("alt+a",(()=>{o.current?.focus()}),[]);return ld("div",{className:"prompt-bar",children:ld(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:ld(_H,{id:"prompt",name:"prompt",placeholder:i("options:promptPlaceholder"),size:"lg",value:t,onChange:t=>{e(J$(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(xQ(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function kne(e){return _5({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 Sne(e){return _5({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function Cne(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const _ne=!1,Ene=H.createContext(null);var Pne=function(e){return e.scrollTop},Lne="unmounted",One="exited",Mne="entering",Tne="entered",Ane="exiting",Ine=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=One,r.appearStatus=Mne):o=Tne:o=t.unmountOnExit||t.mountOnEnter?Lne:One,r.state={status:o},r.nextCallback=null,r}DD(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Lne?{status:One}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Mne&&n!==Tne&&(t=Mne):n!==Mne&&n!==Tne||(t=Ane)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Mne){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&Pne(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===One&&this.setState({status:Lne})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||_ne?this.safeSetState({status:Tne},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Mne},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:Tne},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!_ne?(this.props.onExit(r),this.safeSetState({status:Ane},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:One},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:One},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Lne)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=gD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ld(Ene.Provider,{value:null,children:"function"==typeof n?n(e,r):H.cloneElement(H.Children.only(n),r)})},t}(H.Component);function Rne(){}Ine.contextType=Ene,Ine.propTypes={},Ine.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rne,onEntering:Rne,onEntered:Rne,onExit:Rne,onExiting:Rne,onExited:Rne},Ine.UNMOUNTED=Lne,Ine.EXITED=One,Ine.ENTERING=Mne,Ine.ENTERED=Tne,Ine.EXITING=Ane;const Nne=Ine;var Dne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},zne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Cne(n.className,r):n.setAttribute("class",Cne(n.className&&n.className.baseVal||"",r)));var n,r}))},Bne=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Hne=e=>{const t=m5(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=v5(Fne),i=a.exports.useRef(null),s=a.exports.useRef(null),l=a.exports.useRef(null),{children:c}=e;gte("o",(()=>{t(vU(!n)),o&&setTimeout((()=>t(iX(!0))),400)}),[n,o]),gte("esc",(()=>{t(vU(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),gte("shift+o",(()=>{h(),t(iX(!0))}),[o]);const u=a.exports.useCallback((()=>{o||(t(X$(s.current?s.current.scrollTop:0)),t(vU(!1)),t(uU(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(hU(!o)),t(iX(!0))};return a.exports.useEffect((()=>{function e(e){i.current&&!i.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),ld(jne,{nodeRef:i,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:ld("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:i,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:ld("div",{className:"options-panel-margin",children:cd("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[ld(YH,{label:"Pin Options Panel",children:ld("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:ld(o?kne:Sne,{})})}),!o&&cd("div",{className:"invoke-ai-logo-wrapper",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),c]})})})})};function Wne(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Dte,{})}},n=m5(),r=v5(T3);return a.exports.useEffect((()=>{if("img2img"===r){(()=>n(V$(!1)))()}}),[r,n]),cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(Ate,{}),ld(cne,{accordionInfo:t})]})}const Vne=a.exports.createContext(null),$ne=e=>{const{styleClass:t}=e,n=a.exports.useContext(Vne);return ld("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:cd("div",{className:"image-upload-button",children:[ld(y3,{}),ld(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},Une=uV((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Gne=a.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:i}=QA(),s=m5(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=v5(Une),d=a.exports.useRef(null),h=()=>{c&&!u&&e&&s(SQ(e)),i()};gte("delete",(()=>{l?o():h()}),[e,l]);return cd(sd,{children:[a.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),ld(qB,{isOpen:r,leastDestructiveRef:d,onClose:i,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),ld(NB,{children:cd(CI,{direction:"column",gap:5,children:[ld(VI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),ld(GT,{children:cd(CI,{alignItems:"center",children:[ld(eA,{mb:0,children:"Don't ask me again"}),ld(nH,{checked:!l,onChange:e=>s(YY(!e.target.checked))})]})})]})}),cd(VB,{children:[ld(RT,{ref:d,onClick:i,className:"modal-close-btn",children:"Cancel"}),ld(RT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),qne=uV([e=>e.system,e=>e.options,e=>e.gallery,T3],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Yne=()=>{const e=m5(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=v5(qne),h=zH(),{t:f}=FY(),p=()=>{c&&(u&&e(q$(!1)),e(G$(c)),e(I$("img2img")))};gte("shift+i",(()=>{c?(p(),h({title:f("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:imageNotLoaded"),description:f("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c&&(c.metadata&&e(N$(c.metadata)),"img2img"===c.metadata?.image.type?e(I$("img2img")):"txt2img"===c.metadata?.image.type&&e(I$("txt2img")))};gte("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(g(),h({title:f("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:parametersNotSet"),description:f("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>{c?.metadata&&e(aU(c.metadata.image.seed))};gte("s",(()=>{c?.metadata?.image?.seed?(m(),h({title:f("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:seedNotSet"),description:f("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>c?.metadata?.image?.prompt&&e(J$(c.metadata.image.prompt));gte("p",(()=>{c?.metadata?.image?.prompt?(v(),h({title:f("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:promptNotSet"),description:f("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const y=()=>{c&&e(wQ(c))};gte("Shift+U",(()=>{o&&!s&&n&&!t&&i?y():h({title:f("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(kQ(c))};gte("Shift+R",(()=>{r&&!s&&n&&!t&&a?b():h({title:f("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const x=()=>e(mU(!l));gte("i",(()=>{c?x():h({title:f("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[c,l]);return cd("div",{className:"current-image-options",children:[cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":`${f("options:sendTo")}...`,icon:ld(h3,{})}),children:cd("div",{className:"current-image-send-to-popover",children:[ld(B3,{size:"sm",onClick:p,leftIcon:ld(f3,{}),children:f("options:sendToImg2Img")}),ld(B3,{size:"sm",onClick:()=>{c&&(u&&e(q$(!1)),e(aX(c)),e(iX(!0)),"unifiedCanvas"!==d&&e(I$("unifiedCanvas")),h({title:f("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:ld(f3,{}),children:f("options:sendToUnifiedCanvas")}),ld(B3,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:f("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:ld(j5,{}),children:f("options:copyImageToLink")}),ld(B3,{leftIcon:ld(W5,{}),size:"sm",children:ld(MI,{download:!0,href:c?.url,children:f("options:downloadImage")})})]})}),ld(k3,{icon:ld(U5,{}),tooltip:u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"aria-label":u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"data-selected":u,onClick:()=>{e(q$(!u))}})]}),cd(DT,{isAttached:!0,children:[ld(k3,{icon:ld(s3,{}),tooltip:`${f("options:usePrompt")} (P)`,"aria-label":`${f("options:usePrompt")} (P)`,isDisabled:!c?.metadata?.image?.prompt,onClick:v}),ld(k3,{icon:ld(d3,{}),tooltip:`${f("options:useSeed")} (S)`,"aria-label":`${f("options:useSeed")} (S)`,isDisabled:!c?.metadata?.image?.seed,onClick:m}),ld(k3,{icon:ld(N5,{}),tooltip:`${f("options:useAll")} (A)`,"aria-label":`${f("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:g})]}),cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld(X5,{}),"aria-label":f("options:restoreFaces")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Mte,{}),ld(B3,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:f("options:restoreFaces")})]})}),ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld($5,{}),"aria-label":f("options:upscale")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Ute,{}),ld(B3,{isDisabled:!(o&&c&&n&&!t&&i),onClick:y,children:f("options:upscaleImage")})]})})]}),ld(DT,{isAttached:!0,children:ld(k3,{icon:ld(B5,{}),tooltip:`${f("options:info")} (I)`,"aria-label":`${f("options:info")} (I)`,"data-selected":l,onClick:x})}),ld(Gne,{image:c,children:ld(k3,{icon:ld(m3,{}),tooltip:`${f("options:deleteImage")} (Del)`,"aria-label":`${f("options:deleteImage")} (Del)`,isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function Zne(e){return _5({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 Xne=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>cd(CI,{gap:2,children:[n&&ld(YH,{label:`Recall ${e}`,children:ld(zT,{"aria-label":"Use this parameter",icon:ld(Zne,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&ld(YH,{label:`Copy ${e}`,children:ld(zT,{"aria-label":`Copy ${e}`,icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),cd(CI,{direction:o?"column":"row",children:[cd(VI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?cd(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",ld(V9,{mx:"2px"})]}):ld(VI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Kne=a.exports.memo((({image:e,styleClass:t})=>{const n=m5();gte("esc",(()=>{n(mU(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:y,steps:b,strength:x,threshold:w,type:k,variations:S,width:C}=r,_=JSON.stringify(e.metadata,null,2);return ld("div",{className:`image-metadata-viewer ${t}`,children:cd(CI,{gap:1,direction:"column",width:"100%",children:[cd(CI,{gap:2,children:[ld(VI,{fontWeight:"semibold",children:"File:"}),cd(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,ld(V9,{mx:"2px"})]})]}),Object.keys(r).length>0?cd(sd,{children:[k&&ld(Xne,{label:"Generation type",value:k}),e.metadata?.model_weights&&ld(Xne,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(k)&&ld(Xne,{label:"Original image",value:d}),"gfpgan"===k&&void 0!==x&&ld(Xne,{label:"Fix faces strength",value:x,onClick:()=>n(F$(x))}),"esrgan"===k&&void 0!==m&&ld(Xne,{label:"Upscaling scale",value:m,onClick:()=>n(SU(m))}),"esrgan"===k&&void 0!==x&&ld(Xne,{label:"Upscaling strength",value:x,onClick:()=>n(CU(x))}),p&&ld(Xne,{label:"Prompt",labelPosition:"top",value:C$(p),onClick:()=>n(J$(p))}),void 0!==y&&ld(Xne,{label:"Seed",value:y,onClick:()=>n(aU(y))}),void 0!==w&&ld(Xne,{label:"Noise Threshold",value:w,onClick:()=>n(wU(w))}),void 0!==h&&ld(Xne,{label:"Perlin Noise",value:h,onClick:()=>n(Q$(h))}),g&&ld(Xne,{label:"Sampler",value:g,onClick:()=>n(eU(g))}),b&&ld(Xne,{label:"Steps",value:b,onClick:()=>n(xU(b))}),void 0!==i&&ld(Xne,{label:"CFG scale",value:i,onClick:()=>n(z$(i))}),S&&S.length>0&&ld(Xne,{label:"Seed-weight pairs",value:E$(S),onClick:()=>n(sU(E$(S)))}),v&&ld(Xne,{label:"Seamless",value:v,onClick:()=>n(nU(v))}),l&&ld(Xne,{label:"High Resolution Optimization",value:l,onClick:()=>n(V$(l))}),C&&ld(Xne,{label:"Width",value:C,onClick:()=>n(EU(C))}),s&&ld(Xne,{label:"Height",value:s,onClick:()=>n(W$(s))}),c&&ld(Xne,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(G$(c))}),u&&ld(Xne,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Z$(u))}),"img2img"===k&&x&&ld(Xne,{label:"Image to image strength",value:x,onClick:()=>n($$(x))}),a&&ld(Xne,{label:"Image to image fit",value:a,onClick:()=>n(lU(a))}),f&&f.length>0&&cd(sd,{children:[ld(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),ld(Xne,{label:"Scale",value:r,onClick:()=>n(SU(r))}),ld(Xne,{label:"Strength",value:o,onClick:()=>n(CU(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("codeformer"))}}),o&&ld(Xne,{label:"Fidelity",value:o,onClick:()=>{n(B$(o)),n(H$("codeformer"))}})]},t)}}))]}),o&&ld(Xne,{withCopy:!0,label:"Dream Prompt",value:o}),cd(CI,{gap:2,direction:"column",children:[cd(CI,{gap:2,children:[ld(YH,{label:"Copy metadata JSON",children:ld(zT,{"aria-label":"Copy metadata JSON",icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),ld(VI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),ld("div",{className:"image-json-viewer",children:ld("pre",{children:_})})]})]}):ld(bI,{width:"100%",pt:10,children:ld(VI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),Qne=uV([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function Jne(){const e=m5(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return cd("div",{className:"current-image-preview",children:[o&&ld(ET,{src:o.url,width:o.width,height:o.height,style:{imageRendering:i?"pixelated":"initial"}}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),r&&o&&ld(Kne,{image:o,styleClass:"current-image-metadata"})]})}const ere=uV([e=>e.gallery,e=>e.options,T3],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),tre=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=v5(ere);return ld("div",{className:"current-image-area","data-tab-name":t,children:e?cd(sd,{children:[ld(Yne,{}),ld(Jne,{})]}):ld("div",{className:"current-image-display-placeholder",children:ld(L9,{})})})},nre=()=>{const e=a.exports.useContext(Vne);return ld(k3,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:ld(y3,{}),onClick:e||void 0})};function rre(){const e=v5((e=>e.options.initialImage)),{t:t}=FY(),n=m5(),r=zH();return cd(sd,{children:[cd("div",{className:"init-image-preview-header",children:[ld("h2",{children:t("options:initialImage")}),ld(nre,{})]}),e&&ld("div",{className:"init-image-preview",children:ld(ET,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(M$())}})})]})}const ore=()=>{const e=v5((e=>e.options.initialImage)),{currentImage:t}=v5((e=>e.gallery));return cd("div",{className:"workarea-split-view",children:[ld("div",{className:"workarea-split-view-left",children:e?ld("div",{className:"image-to-image-area",children:ld(rre,{})}):ld($ne,{})}),t&&ld("div",{className:"workarea-split-view-right",children:ld(tre,{})})]})};function ire(e){return _5({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 are(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function sre(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>a.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return a.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=a.exports.createContext(r),i=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][i])||o,c=a.exports.useMemo((()=>s),Object.values(s));return a.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||o,c=a.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},lre(r,...t)]}function lre(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return a.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function cre(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function ure(...e){return a.exports.useCallback(cre(...e),e)}const dre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=a.exports.Children.toArray(n),i=o.find(pre);if(i){const e=i.props.children,n=o.map((t=>t===i?a.exports.Children.count(e)>1?a.exports.Children.only(null):a.exports.isValidElement(e)?e.props.children:null:t));return a.exports.createElement(hre,vp({},r,{ref:t}),a.exports.isValidElement(e)?a.exports.cloneElement(e,void 0,n):null)}return a.exports.createElement(hre,vp({},r,{ref:t}),n)}));dre.displayName="Slot";const hre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return a.exports.isValidElement(n)?a.exports.cloneElement(n,{...gre(r,n.props),ref:cre(t,n.ref)}):a.exports.Children.count(n)>1?a.exports.Children.only(null):null}));hre.displayName="SlotClone";const fre=({children:e})=>a.exports.createElement(a.exports.Fragment,null,e);function pre(e){return a.exports.isValidElement(e)&&e.type===fre}function gre(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]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const mre=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=a.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?dre:t;return a.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),a.exports.createElement(i,vp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function vre(e,t){e&&$.exports.flushSync((()=>e.dispatchEvent(t)))}function yre(e){const t=e+"CollectionProvider",[n,r]=sre(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=H.useRef(null),i=H.useRef(new Map).current;return H.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:H.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=ure(t,i(a,n).collectionRef);return H.createElement(dre,{ref:o},r)})),ItemSlot:H.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=H.useRef(null),c=ure(t,a),u=i(s,n);return H.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),H.createElement(dre,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=H.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const bre=a.exports.createContext(void 0);function xre(e){const t=a.exports.useContext(bre);return e||t||"ltr"}function wre(e){const t=a.exports.useRef(e);return a.exports.useEffect((()=>{t.current=e})),a.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const kre="dismissableLayer.update",Sre="dismissableLayer.pointerDownOutside",Cre="dismissableLayer.focusOutside";let _re;const Ere=a.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pre=a.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=a.exports.useContext(Ere),[h,f]=a.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=a.exports.useState({}),m=ure(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,S=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1),o=a.exports.useRef((()=>{}));return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){Ore(Sre,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1);return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Ore(Cre,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e);a.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),a.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_re=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Lre(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_re)}}),[h,p,r,d]),a.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Lre())}),[h,d]),a.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(kre,e),()=>document.removeEventListener(kre,e)}),[]),a.exports.createElement(mre.div,vp({},u,{ref:m,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:are(e.onFocusCapture,C.onFocusCapture),onBlurCapture:are(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:are(e.onPointerDownCapture,S.onPointerDownCapture)}))}));function Lre(){const e=new CustomEvent(kre);document.dispatchEvent(e)}function Ore(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?vre(o,i):o.dispatchEvent(i)}let Mre=0;function Tre(){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 Are="focusScope.autoFocusOnMount",Ire="focusScope.autoFocusOnUnmount",Rre={bubbles:!1,cancelable:!0},Nre=a.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=a.exports.useState(null),u=wre(o),d=wre(i),h=a.exports.useRef(null),f=ure(t,(e=>c(e))),p=a.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:jre(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||jre(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),a.exports.useEffect((()=>{if(l){Fre.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Are,Rre);l.addEventListener(Are,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jre(r,{select:t}),document.activeElement!==n)return}((e=Dre(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&jre(l))}return()=>{l.removeEventListener(Are,u),setTimeout((()=>{const e=new CustomEvent(Ire,Rre);l.addEventListener(Ire,d),l.dispatchEvent(e),e.defaultPrevented||jre(null!=t?t:document.body,{select:!0}),l.removeEventListener(Ire,d),Fre.remove(p)}),0)}}var e}),[l,u,d,p]);const g=a.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=Dre(e),n=zre(t,e),r=zre(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&jre(i,{select:!0})):(e.preventDefault(),n&&jre(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return a.exports.createElement(mre.div,vp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function Dre(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zre(e,t){for(const n of e)if(!Bre(n,{upTo:t}))return n}function Bre(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function jre(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Fre=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Hre(e,t),e.unshift(t)},remove(t){var n;e=Hre(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Hre(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Wre=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?a.exports.useLayoutEffect:()=>{},Vre=W["useId".toString()]||(()=>{});let $re=0;function Ure(e){return e.split("-")[0]}function Gre(e){return e.split("-")[1]}function qre(e){return["top","bottom"].includes(Ure(e))?"x":"y"}function Yre(e){return"y"===e?"height":"width"}function Zre(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,s=qre(t),l=Yre(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Ure(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Gre(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function Xre(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kre(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qre(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=Xre(f),g=s[h?"floating"===d?"reference":"floating":d],m=Kre(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=Kre(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const Jre=Math.min,eoe=Math.max;function toe(e,t,n){return eoe(e,Jre(t,n))}const noe=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=Xre(r),u={x:o,y:i},d=qre(a),h=Gre(a),f=Yre(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-y/2,k=c[g],S=x-p[f]-c[m],C=x/2-p[f]/2+w,_=toe(k,C,S),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?Croe[e]))}const ioe={start:"end",end:"start"};function aoe(e){return e.replace(/start|end/g,(e=>ioe[e]))}const soe=["top","right","bottom","left"];const loe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=Ure(r),m=d||(g===a||!f?[ooe(a)]:function(e){const t=ooe(e);return[aoe(e),t,aoe(t)]}(a)),v=[a,...m],y=await Qre(t,p),b=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Gre(e),o=qre(e),i=Yre(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ooe(a)),{main:a,cross:ooe(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,k;const e=(null!=(w=null==(k=o.flip)?void 0:k.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var S;const e=null==(S=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function coe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uoe(e){return soe.some((t=>e[t]>=0))}const doe=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=coe(await Qre(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:uoe(t)}}}case"escaped":{const t=coe(await Qre(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:uoe(t)}}}default:return{}}}}};const hoe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ure(n),s=Gre(n),l="x"===qre(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function foe(e){return"x"===e?"y":"x"}const poe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Qre(t,l),d=qre(Ure(o)),h=foe(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=toe(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=toe(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},goe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=qre(o),h=foe(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,y,b,x;const e="y"===d?"width":"height",t=["top","left"].includes(Ure(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(y=a.offset)?void 0:y[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(b=null==(x=a.offset)?void 0:x[h])?b:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function moe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function voe(e){if(null==e)return window;if(!moe(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function yoe(e){return voe(e).getComputedStyle(e)}function boe(e){return moe(e)?"":e?(e.nodeName||"").toLowerCase():""}function xoe(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function woe(e){return e instanceof voe(e).HTMLElement}function koe(e){return e instanceof voe(e).Element}function Soe(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof voe(e).ShadowRoot||e instanceof ShadowRoot}function Coe(e){const{overflow:t,overflowX:n,overflowY:r}=yoe(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function _oe(e){return["table","td","th"].includes(boe(e))}function Eoe(e){const t=/firefox/i.test(xoe()),n=yoe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function Poe(){return!/^((?!chrome|android).)*safari/i.test(xoe())}const Loe=Math.min,Ooe=Math.max,Moe=Math.round;function Toe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&woe(e)&&(l=e.offsetWidth>0&&Moe(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Moe(s.height)/e.offsetHeight||1);const u=koe(e)?voe(e):window,d=!Poe()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Aoe(e){return((function(e){return e instanceof voe(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ioe(e){return koe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Roe(e){return Toe(Aoe(e)).left+Ioe(e).scrollLeft}function Noe(e,t,n){const r=woe(t),o=Aoe(t),i=Toe(e,r&&function(e){const t=Toe(e);return Moe(t.width)!==e.offsetWidth||Moe(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==boe(t)||Coe(o))&&(a=Ioe(t)),woe(t)){const e=Toe(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Roe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Doe(e){return"html"===boe(e)?e:e.assignedSlot||e.parentNode||(Soe(e)?e.host:null)||Aoe(e)}function zoe(e){return woe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Boe(e){const t=voe(e);let n=zoe(e);for(;n&&_oe(n)&&"static"===getComputedStyle(n).position;)n=zoe(n);return n&&("html"===boe(n)||"body"===boe(n)&&"static"===getComputedStyle(n).position&&!Eoe(n))?t:n||function(e){let t=Doe(e);for(Soe(t)&&(t=t.host);woe(t)&&!["html","body"].includes(boe(t));){if(Eoe(t))return t;t=t.parentNode}return null}(e)||t}function joe(e){if(woe(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Toe(e);return{width:t.width,height:t.height}}function Foe(e){const t=Doe(e);return["html","body","#document"].includes(boe(t))?e.ownerDocument.body:woe(t)&&Coe(t)?t:Foe(t)}function Hoe(e,t){var n;void 0===t&&(t=[]);const r=Foe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=voe(r),a=o?[i].concat(i.visualViewport||[],Coe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Hoe(a))}function Woe(e,t,n){return"viewport"===t?Kre(function(e,t){const n=voe(e),r=Aoe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Poe();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):koe(t)?function(e,t){const n=Toe(e,!1,"fixed"===t),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}}(t,n):Kre(function(e){var t;const n=Aoe(e),r=Ioe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ooe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ooe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Roe(e);const l=-r.scrollTop;return"rtl"===yoe(o||n).direction&&(s+=Ooe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(Aoe(e)))}function Voe(e){const t=Hoe(e),n=["absolute","fixed"].includes(yoe(e).position)&&woe(e)?Boe(e):e;return koe(n)?t.filter((e=>koe(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Soe(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==boe(e))):[]}const $oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Voe(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Woe(t,n,o);return e.top=Ooe(r.top,e.top),e.right=Loe(r.right,e.right),e.bottom=Loe(r.bottom,e.bottom),e.left=Ooe(r.left,e.left),e}),Woe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=woe(n),i=Aoe(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==boe(n)||Coe(i))&&(a=Ioe(n)),woe(n))){const e=Toe(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:koe,getDimensions:joe,getOffsetParent:Boe,getDocumentElement:Aoe,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Noe(t,Boe(n),r),floating:{...joe(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===yoe(e).direction};function Uoe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...koe(e)?Hoe(e):[],...Hoe(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),koe(e)&&!s&&h.observe(e),h.observe(t)}let f=s?Toe(e):null;return s&&function t(){const r=Toe(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const Goe=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=Zre(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=a.exports.useRef(null),[u,d]=a.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=a.exports.useState(t);Yoe(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=a.exports.useCallback((()=>{i.current&&s.current&&Goe(i.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&$.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);qoe((()=>{g.current&&p()}),[p]);const g=a.exports.useRef(!1);qoe((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=a.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),i.current&&s.current)if(l.current){const e=l.current(i.current,s.current,p);c.current=e}else p()}),[p,l]),v=a.exports.useCallback((e=>{i.current=e,m()}),[m]),y=a.exports.useCallback((e=>{s.current=e,m()}),[m]),b=a.exports.useMemo((()=>({reference:i,floating:s})),[]);return a.exports.useMemo((()=>({...u,update:p,refs:b,reference:v,floating:y})),[u,p,b,v,y])}const Xoe=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?noe({element:t.current,padding:n}).fn(e):{}:t?noe({element:t,padding:n}).fn(e):{}}};const Koe="Popper",[Qoe,Joe]=sre(Koe),[eie,tie]=Qoe(Koe),nie=a.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=tie("PopperAnchor",n),s=a.exports.useRef(null),l=ure(t,s);return a.exports.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:a.exports.createElement(mre.div,vp({},o,{ref:l}))})),rie="PopperContent",[oie,iie]=Qoe(rie),[aie,sie]=Qoe(rie,{hasParent:!1,positionUpdateFns:new Set}),lie=a.exports.forwardRef(((e,t)=>{var n,r,o,i,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...k}=e,S=tie(rie,d),[C,_]=a.exports.useState(null),E=ure(t,(e=>_(e))),[P,L]=a.exports.useState(null),O=function(e){const[t,n]=a.exports.useState(void 0);return Wre((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(P),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A=h+("center"!==p?"-"+p:""),I="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(uie),altBoundary:N},{reference:z,floating:B,strategy:j,x:F,y:H,placement:W,middlewareData:V,update:$}=Zoe({strategy:"fixed",placement:A,whileElementsMounted:Uoe,middleware:[hoe({mainAxis:f+T,alignmentAxis:g}),w?poe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?goe():void 0,...D}):void 0,P?Xoe({element:P,padding:m}):void 0,w?loe({...D}):void 0,die({arrowWidth:M,arrowHeight:T}),x?doe({strategy:"referenceHidden"}):void 0].filter(cie)});Wre((()=>{z(S.anchor)}),[z,S.anchor]);const U=null!==F&&null!==H,[G,q]=hie(W),Y=null===(o=V.arrow)||void 0===o?void 0:o.x,Z=null===(i=V.arrow)||void 0===i?void 0:i.y,X=0!==(null===(s=V.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=a.exports.useState();Wre((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=sie(rie,d),te=!J;a.exports.useLayoutEffect((()=>{if(!te)return ee.add($),()=>{ee.delete($)}}),[te,ee,$]),a.exports.useLayoutEffect((()=>{te&&U&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,U,ee]);const ne={"data-side":G,"data-align":q,...k,ref:E,style:{...k.style,animation:U?void 0:"none",opacity:null!==(l=V.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return a.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:j,left:0,top:0,transform:U?`translate3d(${Math.round(F)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=V.transformOrigin)||void 0===c?void 0:c.x,null===(u=V.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},a.exports.createElement(oie,{scope:d,placedSide:G,onArrowChange:L,arrowX:Y,arrowY:Z,shouldHideArrow:X},te?a.exports.createElement(aie,{scope:d,hasParent:!0,positionUpdateFns:ee},a.exports.createElement(mre.div,ne)):a.exports.createElement(mre.div,ne)))}));function cie(e){return void 0!==e}function uie(e){return null!==e}const die=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=hie(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let y="",b="";return"bottom"===f?(y=u?g:`${m}px`,b=-h+"px"):"top"===f?(y=u?g:`${m}px`,b=`${l.floating.height+h}px`):"right"===f?(y=-h+"px",b=u?g:`${v}px`):"left"===f&&(y=`${l.floating.width+h}px`,b=u?g:`${v}px`),{data:{x:y,y:b}}}});function hie(e){const[t,n="center"]=e.split("-");return[t,n]}const fie=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.exports.useState(null);return a.exports.createElement(eie,{scope:t,anchor:r,onAnchorChange:o},n)},pie=nie,gie=lie;const mie=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.exports.useState(),r=a.exports.useRef({}),o=a.exports.useRef(e),i=a.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.exports.useEffect((()=>{const e=vie(r.current);i.current="mounted"===l?e:"none"}),[l]),Wre((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=vie(t);if(e)c("MOUNT");else if("none"===a||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Wre((()=>{if(t){const e=e=>{const n=vie(r.current).includes(e.animationName);e.target===t&&n&&$.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=vie(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):a.exports.Children.only(n),i=ure(r.ref,o.ref);return"function"==typeof n||r.isPresent?a.exports.cloneElement(o,{ref:i}):null};function vie(e){return(null==e?void 0:e.animationName)||"none"}function yie({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=a.exports.useState(e),[r]=n,o=a.exports.useRef(r),i=wre(t);return a.exports.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,l=wre(n),c=a.exports.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l]);return[s,c]}mie.displayName="Presence";const bie="rovingFocusGroup.onEntryFocus",xie={bubbles:!1,cancelable:!0},wie="RovingFocusGroup",[kie,Sie,Cie]=yre(wie),[_ie,Eie]=sre(wie,[Cie]),[Pie,Lie]=_ie(wie),Oie=a.exports.forwardRef(((e,t)=>a.exports.createElement(kie.Provider,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(kie.Slot,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(Mie,vp({},e,{ref:t})))))),Mie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=a.exports.useRef(null),f=ure(t,h),p=xre(i),[g=null,m]=yie({prop:s,defaultProp:l,onChange:c}),[v,y]=a.exports.useState(!1),b=wre(u),x=Sie(n),w=a.exports.useRef(!1),[k,S]=a.exports.useState(0);return a.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(bie,b),()=>e.removeEventListener(bie,b)}),[b]),a.exports.createElement(Pie,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:a.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:a.exports.useCallback((()=>y(!0)),[]),onFocusableItemAdd:a.exports.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:a.exports.useCallback((()=>S((e=>e-1))),[])},a.exports.createElement(mre.div,vp({tabIndex:v||0===k?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:are(e.onMouseDown,(()=>{w.current=!0})),onFocus:are(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(bie,xie);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));Iie([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:are(e.onBlur,(()=>y(!1)))})))})),Tie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=e,s=function(e){const[t,n]=a.exports.useState(Vre());return Wre((()=>{e||n((e=>null!=e?e:String($re++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=Lie("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=Sie(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return a.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),a.exports.createElement(kie.ItemSlot,{scope:n,id:s,focusable:r,active:o},a.exports.createElement(mre.span,vp({tabIndex:c?0:-1,"data-orientation":l.orientation},i,{ref:t,onMouseDown:are(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:are(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:are(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Aie[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Iie(o)))}var n,r}))})))})),Aie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Iie(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const Rie=Oie,Nie=Tie,Die=["Enter"," "],zie=["ArrowUp","PageDown","End"],Bie=["ArrowDown","PageUp","Home",...zie],jie="Menu",[Fie,Hie,Wie]=yre(jie),[Vie,$ie]=sre(jie,[Wie,Joe,Eie]),Uie=Joe(),Gie=Eie(),[qie,Yie]=Vie(jie),[Zie,Xie]=Vie(jie),Kie=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=Uie(n);return a.exports.createElement(pie,vp({},o,r,{ref:t}))})),[Qie,Jie]=Vie("MenuPortal",{forceMount:void 0}),eae="MenuContent",[tae,nae]=Vie(eae),rae=a.exports.forwardRef(((e,t)=>{const n=Jie(eae,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Yie(eae,e.__scopeMenu),s=Xie(eae,e.__scopeMenu);return a.exports.createElement(Fie.Provider,{scope:e.__scopeMenu},a.exports.createElement(mie,{present:r||i.open},a.exports.createElement(Fie.Slot,{scope:e.__scopeMenu},s.modal?a.exports.createElement(oae,vp({},o,{ref:t})):a.exports.createElement(iae,vp({},o,{ref:t})))))})),oae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu),r=a.exports.useRef(null),o=ure(t,r);return a.exports.useEffect((()=>{const e=r.current;if(e)return pD(e)}),[]),a.exports.createElement(aae,vp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:are(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),iae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu);return a.exports.createElement(aae,vp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),aae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=Yie(eae,n),v=Xie(eae,n),y=Uie(n),b=Gie(n),x=Hie(n),[w,k]=a.exports.useState(null),S=a.exports.useRef(null),C=ure(t,S,m.onContentChange),_=a.exports.useRef(0),E=a.exports.useRef(""),P=a.exports.useRef(0),L=a.exports.useRef(null),O=a.exports.useRef("right"),M=a.exports.useRef(0),T=p?_B:a.exports.Fragment,A=p?{as:dre,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};a.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),a.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Tre()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Tre()),Mre++,()=>{1===Mre&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mre--}}),[]);const R=a.exports.useCallback((e=>{var t,n;return O.current===(null===(t=L.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=L.current)||void 0===n?void 0:n.area)}),[]);return a.exports.createElement(tae,{scope:n,searchRef:E,onItemEnter:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:a.exports.useCallback((e=>{var t;R(e)||(null===(t=S.current)||void 0===t||t.focus(),k(null))}),[R]),onTriggerLeave:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:P,onPointerGraceIntentChange:a.exports.useCallback((e=>{L.current=e}),[])},a.exports.createElement(T,A,a.exports.createElement(Nre,{asChild:!0,trapped:o,onMountAutoFocus:are(i,(e=>{var t;e.preventDefault(),null===(t=S.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},a.exports.createElement(Pre,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},a.exports.createElement(Rie,vp({asChild:!0},b,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),a.exports.createElement(gie,vp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},y,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:are(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=S.current;if(e.target!==o)return;if(!Bie.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));zie.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:are(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:are(e.onPointerMove,dae((e=>{const t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>M.current?"right":"left";O.current=t,M.current=e.clientX}})))})))))));var N})),sae="MenuItem",lae="menu.itemSelect",cae=a.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.exports.useRef(null),s=Xie(sae,e.__scopeMenu),l=nae(sae,e.__scopeMenu),c=ure(t,i),u=a.exports.useRef(!1);return a.exports.createElement(uae,vp({},o,{ref:c,disabled:n,onClick:are(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(lae,{bubbles:!0,cancelable:!0});e.addEventListener(lae,(e=>null==r?void 0:r(e)),{once:!0}),vre(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:are(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:are(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||Die.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),uae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=nae(sae,n),l=Gie(n),c=a.exports.useRef(null),u=ure(t,c),[d,h]=a.exports.useState(!1),[f,p]=a.exports.useState("");return a.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[i.children]),a.exports.createElement(Fie.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},a.exports.createElement(Nie,vp({asChild:!0},l,{focusable:!r}),a.exports.createElement(mre.div,vp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:are(e.onPointerMove,dae((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:are(e.onPointerLeave,dae((e=>s.onItemLeave(e)))),onFocus:are(e.onFocus,(()=>h(!0))),onBlur:are(e.onBlur,(()=>h(!1)))}))))}));Vie("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});Vie("MenuItemIndicator",{checked:!1});function dae(e){return t=>"mouse"===t.pointerType?e(t):void 0}Vie("MenuSub");const hae=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=Uie(t),[c,u]=a.exports.useState(null),d=a.exports.useRef(!1),h=wre(i),f=xre(o);return a.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),a.exports.createElement(fie,l,a.exports.createElement(qie,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},a.exports.createElement(Zie,{scope:t,onClose:a.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},fae=Kie,pae=rae,gae=cae,mae="ContextMenu",[vae,yae]=sre(mae,[$ie]),bae=$ie(),[xae,wae]=vae(mae);function kae(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const Sae=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[s,l]=a.exports.useState(!1),c=bae(t),u=wre(r),d=a.exports.useCallback((e=>{l(e),u(e)}),[u]);return a.exports.createElement(xae,{scope:t,open:s,onOpenChange:d,modal:i},a.exports.createElement(hae,vp({},c,{dir:o,open:s,onOpenChange:d,modal:i}),n))},Cae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuTrigger",n),i=bae(n),s=a.exports.useRef({x:0,y:0}),l=a.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=a.exports.useRef(0),u=a.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return a.exports.useEffect((()=>u),[u]),a.exports.createElement(a.exports.Fragment,null,a.exports.createElement(fae,vp({},i,{virtualRef:l})),a.exports.createElement(mre.span,vp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:are(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:are(e.onPointerDown,kae((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:are(e.onPointerMove,kae(u)),onPointerCancel:are(e.onPointerCancel,kae(u)),onPointerUp:are(e.onPointerUp,kae(u))})))})),_ae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuContent",n),i=bae(n),s=a.exports.useRef(!1);return a.exports.createElement(pae,vp({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),Eae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=bae(n);return a.exports.createElement(gae,vp({},o,r,{ref:t}))})),Pae=uV([e=>e.gallery,e=>e.options,dne,T3],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Lae=uV([e=>e.options,e=>e.gallery,e=>e.system,T3],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Oae=a.exports.memo((e=>{const t=m5(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:i,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=v5(Lae),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=a.exports.useState(!1),v=zH(),{t:y}=FY();return cd(Sae,{onOpenChange:e=>{t(GU(e))},children:[ld(Cae,{children:cd(mI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[ld(ET,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),ld("div",{className:"hoverable-image-content",onClick:()=>t(DU(c)),children:u&&ld(kk,{width:"50%",height:"50%",as:z5,className:"hoverable-image-check"})}),g&&o>=64&&ld("div",{className:"hoverable-image-delete-button",children:ld(Gne,{image:c,children:ld(zT,{"aria-label":y("options:deleteImage"),icon:ld(g3,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!i})})})]},f)}),cd(_ae,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[ld(Eae,{onClickCapture:()=>{t(q$(!0)),t(DU(c))},children:y("options:openInViewer")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(J$(c.metadata.image.prompt)),v({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:y("options:usePrompt")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(aU(c.metadata.image.seed)),v({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:y("options:useSeed")}),ld(Eae,{onClickCapture:()=>{p&&t(D$(p)),v({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:y("options:useAll")}),ld(Eae,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(I$("img2img")),t(R$(p)),void v({title:y("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0})}v({title:y("toast:initialImageNotSet"),description:y("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:y("options:useInitImg")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(G$(c)),"img2img"!==n&&t(I$("img2img")),v({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToImg2Img")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(aX(c)),t(YZ()),"unifiedCanvas"!==n&&t(I$("unifiedCanvas")),v({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToUnifiedCanvas")}),ld(Eae,{"data-warning":!0,children:ld(Gne,{image:c,children:ld("p",{children:y("options:deleteImage")})})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),Mae=320,Tae={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Aae(){const e=m5(),{t:t}=FY(),{images:n,currentCategory:r,currentImageUuid:o,shouldPinGallery:i,shouldShowGallery:s,galleryScrollPosition:l,galleryImageMinimumWidth:c,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:p,areMoreImagesAvailable:g,galleryWidth:m,isLightBoxOpen:v,isStaging:y,shouldEnableResize:b,shouldUseSingleGalleryColumn:x}=v5(Pae),{galleryMinWidth:w,galleryMaxWidth:k}=v?{galleryMinWidth:400,galleryMaxWidth:400}:Tae[d],[S,C]=a.exports.useState(m>=Mae),[_,E]=a.exports.useState(!1),[P,L]=a.exports.useState(0),O=a.exports.useRef(null),M=a.exports.useRef(null),T=a.exports.useRef(null);a.exports.useEffect((()=>{m>=Mae&&C(!1)}),[m]);const A=()=>{e(HU(!i)),e(iX(!0))},I=()=>{e(WU(!0)),i&&e(iX(!0))},R=a.exports.useCallback((()=>{e(WU(!1)),e(GU(!1)),e(VU(M.current?M.current.scrollTop:0)),setTimeout((()=>i&&e(iX(!0))),400)}),[e,i]),N=()=>{T.current&&window.clearTimeout(T.current)};gte("g",(()=>{s?R():I()}),[s,i]),gte("left",(()=>{e(FU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("right",(()=>{e(jU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("shift+g",(()=>{A()}),[i]),gte("esc",(()=>{e(WU(!1))}),{enabled:()=>!i,preventDefault:!0},[i]);return gte("shift+up",(()=>{if(c<256){const t=TU.clamp(c+32,32,256);e($U(t))}}),[c]),gte("shift+down",(()=>{if(c>32){const t=TU.clamp(c-32,32,256);e($U(t))}}),[c]),a.exports.useEffect((()=>{M.current&&(M.current.scrollTop=l)}),[l,s]),a.exports.useEffect((()=>{function e(e){i||!O.current||O.current.contains(e.target)||R()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[R,i]),ld(jne,{nodeRef:O,in:s||f,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:cd("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:O,onMouseLeave:i?void 0:()=>{f||(T.current=window.setTimeout((()=>R()),500))},onMouseEnter:i?void 0:N,onMouseOver:i?void 0:N,children:[cd(m8,{minWidth:w,maxWidth:i?k:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:m,height:i?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,i&&(n.style.position="fixed",n.style.right="1rem",E(!0))},onResizeStop:(t,n,r,o)=>{const a=i?TU.clamp(Number(m)+o.width,w,Number(k)):Number(m)+o.width;e(ZU(a)),r.removeAttribute("data-resize-alert"),i&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",i?"100%":"100vh"),E(!1),e(iX(!0)))},onResize:(t,n,r,o)=>{const a=TU.clamp(Number(m)+o.width,w,Number(i?k:.95*window.innerWidth));a>=Mae&&!S?C(!0):aa-40&&e($U(a-40)),i&&(a>=k?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${P}px`},children:[cd("div",{className:"image-gallery-header",children:[ld(DT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:cd(sd,S?{children:[ld(B3,{size:"sm","data-selected":"result"===r,onClick:()=>e(YU("result")),children:t("gallery:generations")}),ld(B3,{size:"sm","data-selected":"user"===r,onClick:()=>e(YU("user")),children:t("gallery:uploads")})]}:{children:[ld(k3,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===r,icon:ld(K5,{}),onClick:()=>e(YU("result"))}),ld(k3,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===r,icon:ld(b3,{}),onClick:()=>e(YU("user"))})]})}),cd("div",{className:"image-gallery-header-right-icons",children:[ld(z3,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:ld(k3,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:ld(x3,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:cd("div",{className:"image-gallery-settings-popover",children:[cd("div",{children:[ld(Ite,{value:c,onChange:t=>{e($U(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),ld(k3,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e($U(64)),icon:ld(T9,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),ld("div",{children:ld(k9,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===h,onChange:()=>e(UU("contain"===h?"cover":"contain"))})}),ld("div",{children:ld(k9,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:t=>e(qU(t.target.checked))})}),ld("div",{children:ld(k9,{label:t("gallery:singleColumnLayout"),isChecked:x,onChange:t=>e(XU(t.target.checked))})})]})}),ld(k3,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:A,icon:ld(i?kne:Sne,{})})]})]}),ld("div",{className:"image-gallery-container",ref:M,children:n.length||g?cd(sd,{children:[ld("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map((e=>{const{uuid:t}=e;return ld(Oae,{image:e,isSelected:o===t},t)}))}),ld(RT,{onClick:()=>{e(CQ(r))},isDisabled:!g,className:"image-gallery-load-more-btn",children:t(g?"gallery:loadMore":"gallery:allImagesLoaded")})]}):cd("div",{className:"image-gallery-container-placeholder",children:[ld(P9,{}),ld("p",{children:t("gallery:noImagesInGallery")})]})})]}),_&&ld("div",{style:{width:m+"px",height:"100%"}})]})})}const Iae=uV((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),Rae=uV([e=>e.options,T3],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Nae=e=>{const t=m5(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=v5(Rae),c=(()=>{const{resultImages:e,userImages:t}=v5(Iae);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return ld("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:cd("div",{className:"workarea-main",children:[n,cd("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(G$(r)):"unifiedCanvas"===i&&t(aX(r)))},children:[r,l&&ld(YH,{label:"Toggle Split View",children:ld("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(bU(!a)),t(iX(!0))},children:ld(ire,{})})})]}),!s&&ld(Aae,{})]})})};function Dae(){return ld(Nae,{optionsPanel:ld(Wne,{}),children:ld(ore,{})})}const zae=()=>{const e=m5(),t=v5((e=>e.options.hiresFix)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:t=>e(V$(t.target.checked))})})},Bae=()=>cd(CI,{gap:2,direction:"column",children:[ld(Nte,{}),ld(zae,{})]});function jae(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Bae,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(cne,{accordionInfo:t})]})}const Fae=()=>ld("div",{className:"workarea-single-view",children:ld("div",{className:"text-to-image-area",children:ld(tre,{})})});function Hae(){return ld(Nae,{optionsPanel:ld(jae,{}),children:ld(Fae,{})})}var Wae=function(e,t){return Wae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Wae(e,t)};var Vae=function(){return Vae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Kae(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):Xae(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var Qae=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Jae=function(e,t){var n=Qae(e,t);return e.bounds=n,n};function ese(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:tse(e,s-d,c+d,r),y:tse(t,l-h,u+h,r)}}var tse=function(e,t,n,r){return Uae(r?en?n:e:e,2)};function nse(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):ese(l-t*u,c-n*u,o,i,0,0,null)}function rse(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var ose=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!Tse(i,n)},ise=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var ase=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function sse(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:tse(e,i,a,o)}function lse(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function cse(e,t){var n=e.transformState.scale;Zae(e),Jae(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function use(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=ase(e,i),d=ase(e,a);lse(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=ese(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function dse(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,y=m.lockAxisX,b=g.animationType,x=p.sizeX,w=p.sizeY,k=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,k),_=ase(e,x),E=ase(e,w),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=c+P,M=u-P,T=d+L,A=h-L,I=e.transformState,R=(new Date).getTime();Xae(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/k,g=1-(0,qae[p.animationType])(Math.min(1,l)),m=1-t,b=o+a*m,x=i+s*m,w=sse(b,I.positionX,o,y,f,u,c,M,O,g),S=sse(x,I.positionY,i,v,f,h,d,A,T,g);o===b&&i===x||e.setTransformState(r,w,S)}))}}(e):hse(e)}}function hse(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=v.x,b=v.y;return{scale:o,positionX:g?y:n,positionY:m?b:r}}}(e);u&&Kae(e,u,l,c)}}function fse(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&hse(e),!h&&o&&e.mounted){var f=pse(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&Kae(e,f,u,d)}}function pse(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=rse(Uae(t,2),i,a,0,!1),c=nse(e,n,r,l,Jae(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var gse={previousScale:1,scale:1,positionX:0,positionY:0},mse=Vae(Vae({},gse),{setComponents:function(){},contextInstance:null}),vse={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},yse=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:gse.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:gse.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:gse.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:gse.positionY}},bse=function(e){var t=Vae({},vse);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==vse[n]&&r){var o=Object.prototype.toString.call(vse[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Vae(Vae({},vse[n]),e[n]):a?$ae($ae([],vse[n]),e[n]):e[n]}})),t},xse=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return rse(Uae(c,3),s,a,l,!1)};function wse(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=pse(e,xse(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,r,o)}function kse(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=yse(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=Qae(e,a.scale),h=ese(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||Kae(e,f,t,n)}}var Sse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,1,t,n,r)}},Cse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,-1,t,n,r)}},_se=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};Kae(e,h,o,i)}}},Ese=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),kse(e,t,n)}},Pse=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=Rse(t||o.scale,i,a);Kae(e,s,n,r)}}},Lse=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Zae(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return gse;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=rse(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,y=(l.height-f*m)/2,b=ese((l.left-u)*m+v,(l.top-d)*m+y,Qae(e,m),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:m}}(e,a,n);Kae(e,s,r,o)}}},Ose=function(e){return{instance:e,state:e.transformState,zoomIn:Sse(e),zoomOut:Cse(e),setTransform:_se(e),resetTransform:Ese(e),centerView:Pse(e),zoomToElement:Lse(e)}};function Mse(){try{return{get passive(){return!0,!1}}}catch(Hhe){return!1}}var Tse=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Ase=function(e){e&&clearTimeout(e)},Ise=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},Rse=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Nse=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!Tse(c,a)))};function Dse(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var zse=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!Tse(a,o)},Bse=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},jse=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Fse=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Zae(e),Gae(Ose(e),t,r),Gae(Ose(e),t,o))},Hse=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return rse(Uae(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=Jae(e,m),y=Dse(t,i,s),b=l&&(f||0===h||c),x=nse(e,y.x,y.y,m,v,b),w=x.x,k=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,k),Gae(Ose(e),t,r),Gae(Ose(e),t,o)}},Wse=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Ase(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(fse(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Ase(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Gae(Ose(e),t,r),Gae(Ose(e),t,o))}),160))},Vse=function(e,t){var n=jse(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Zae(e)},$se=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Uae(o[0].clientX-r.left,5),a=Uae(o[0].clientY-r.top,5);return{x:(i+Uae(o[1].clientX-r.left,5))/2/t,y:(a+Uae(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=jse(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:rse(Uae(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=Jae(e,f),g=a&&(c||0===u||s),m=nse(e,d.x,d.y,f,p,g),v=m.x,y=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,y)}}}},Use=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,fse(e,null==t?void 0:t.x,null==t?void 0:t.y)};function Gse(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return kse(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=xse(e,"zoomOut"===o?-1:1,i),d=Dse(t,c,l),h=pse(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,a,s)}}var qse=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!Tse(l,s)&&!!u)},Yse=H.createContext(mse),Zse=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=yse(t.props),t.setup=bse(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=Mse();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Nse(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Fse(t,e),Hse(t,e),Wse(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||ose(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Zae(t),cse(t,e),Gae(Ose(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||ise(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),use(t,e.clientX,e.clientY),Gae(Ose(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(dse(t),Gae(Ose(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||zse(t,e)&&(Vse(t,e),Zae(t),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Bse(t)&&(e.preventDefault(),e.stopPropagation(),$se(t,e),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Use(t),Gae(Ose(t),e,r),Gae(Ose(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&ose(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Zae(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Zae(t),cse(t,e),Gae(Ose(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!ise(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];use(t,o.clientX,o.clientY),Gae(Ose(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||qse(t,e)&&Gse(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Jae(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,Gae(Ose(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Rse(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Ise(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(Ose(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=Mse();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=Mse();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Zae(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Jae(this,this.transformState.scale),this.setup=bse(this.props))},t.prototype.render=function(){var e=Ose(this),t=this.props.children,n="function"==typeof t?t(e):t;return ld(Yse.Provider,{value:Vae(Vae({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(a.exports.Component),Xse=H.forwardRef((function(e,t){var n=a.exports.useState(null),r=n[0],o=n[1];return a.exports.useImperativeHandle(t,(function(){return r}),[r]),ld(Zse,{...Vae({},e,{setRef:o})})}));var Kse="transform-component-module_wrapper__1_Fgj",Qse="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Jse=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=a.exports.useContext(Yse).setComponents,u=a.exports.useRef(null),d=a.exports.useRef(null);return a.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),ld("div",{ref:u,className:"react-transform-wrapper "+Kse+" "+r,style:s,children:ld("div",{ref:d,className:"react-transform-component "+Qse+" "+i,style:l,children:t})})};function ele({image:e,alt:t,ref:n,styleClass:r}){const[o,i]=a.exports.useState(0),[s,l]=a.exports.useState(!1),c=()=>{i(-3===o?0:o-1)},u=()=>{i(3===o?0:o+1)},d=()=>{l(!s)};return ld(Xse,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:a,zoomOut:h,resetTransform:f,centerView:p})=>cd(sd,{children:[cd("div",{className:"lightbox-image-options",children:[ld(k3,{icon:ld(R9,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>a(),fontSize:20}),ld(k3,{icon:ld(N9,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),ld(k3,{icon:ld(A9,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),ld(k3,{icon:ld(I9,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),ld(k3,{icon:ld(E9,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),ld(k3,{icon:ld(T9,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),i(0),l(!1)},fontSize:20})]}),ld(Jse,{wrapperStyle:{width:"100%",height:"100%"},children:ld("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function tle(){const e=m5(),t=v5((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return gte("Esc",(()=>{t&&e(q$(!1))}),[t]),cd("div",{className:"lightbox-container",children:[ld(k3,{icon:ld(M9,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(q$(!1))},fontSize:20}),cd("div",{className:"lightbox-display-container",children:[cd("div",{className:"lightbox-preview-wrapper",children:[ld(Yne,{}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!i&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),n&&cd(sd,{children:[ld(ele,{image:n.url,styleClass:"lightbox-image"}),r&&ld(Kne,{image:n})]})]}),ld(Aae,{})]})]})}const nle=uV([A3],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),rle=()=>{const e=m5(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=v5(nle),{t:i}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{sliderMarkRightOffset:-6,label:i("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(rU(t))},handleReset:()=>e(rU(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(tU(t))},handleReset:()=>{e(tU(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-7,label:i("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:t=>{e(iU(t))},handleReset:()=>{e(iU(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(oU(t))},handleReset:()=>{e(oU(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},ole=uV(une,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),ile=()=>{const e=m5(),{boundingBoxDimensions:t}=v5(ole),{t:n}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:n=>{e(KZ({...t,width:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:n=>{e(KZ({...t,height:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},ale=uV(une,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function sle(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=v5(ale),n=m5(),{t:r}=FY();return cd(CI,{alignItems:"center",columnGap:"1rem",children:[ld(Ite,{label:r("options:inpaintReplace"),value:e,onChange:e=>{n(sX(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(sX(1)),isResetDisabled:!t}),ld(_3,{isChecked:t,onChange:e=>n(RX(e.target.checked)),marginTop:"1.25rem"})]})}const lle=uV([A3,O3,une],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),cle=()=>{const e=m5(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=v5(lle),{t:s}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(E3,{label:s("options:scaleBeforeProcessing"),validValues:CZ,value:o,onChange:t=>{e(JZ(t.target.value))}}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:t=>{e(HX({...a,width:Math.floor(t)}))},handleReset:()=>{e(HX({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:t=>{e(HX({...a,height:Math.floor(t)}))},handleReset:()=>{e(HX({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(sle,{}),ld(E3,{label:s("options:infillMethod"),value:n,validValues:r,onChange:t=>e(U$(t.target.value))}),ld(Ite,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(kU(t))},handleReset:()=>{e(kU(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function ule(){const{t:e}=FY(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:Ete.BOUNDING_BOX,content:ld(ile,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:Ete.SEAM_CORRECTION,content:ld(rle,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:Ete.INFILL_AND_SCALING,content:ld(cle,{})},seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(cne,{accordionInfo:t})]})}const dle=uV(une,hne,T3,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),hle=()=>{const e=m5(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=v5(dle),i=a.exports.useRef(null);return a.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!i.current)return;const{clientWidth:t,clientHeight:n}=i.current;e(nX({width:t,height:n})),e(o?ZZ():YZ()),e(iX(!1))}),0)}),[e,r,t,n,o]),ld("div",{ref:i,className:"inpainting-canvas-area",children:ld(hT,{thickness:"2px",speed:"1s",size:"xl"})})};var fle={exports:{}},ple=function(e){var t={},n=a.exports,r=G.exports,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function yt(e,t,n){if(ht.current!==dt)throw Error(i(168));ut(ht,t),ut(ft,n)}function bt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,C(e)||"Unknown",a));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=bt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var kt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(St(e)/Ct|0)|0},St=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Pt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Pt(s):0!==(i&=a)&&(r=Pt(i))}else 0!==(a=n&~o)?r=Pt(a):0!==i&&(r=Pt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-kt(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<>=a,o-=a,cn=1<<32-kt(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var b=m(o,h,y.value,c);if(null===b){null===h&&(h=p);break}e&&h&&null===b.alternate&&t(o,h),s=a(b,s,f),null===d?u=b:d.sibling=b,d=b,h=p}if(y.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=g(o,y.value,c))&&(s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return vn&&dn(o,f),u}for(h=r(o,h);!y.done;f++,y=l.next())null!==(y=v(h,o,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===b&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case b:return e(r,i,(f=a._init)(a._payload),d)}if(A(a))return y(r,i,a,d);if(k(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),yr=lt(gr);function br(e){if(e===gr)throw Error(i(174));return e}function xr(e,t){ut(yr,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(yr)}function kr(e){var t=br(yr.current),n=br(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function Sr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Pr(){for(var e=0;en?n:4,e(!0);var r=Or.transition;Or.transition={};try{e(!1),t()}finally{Nt=n,Or.transition=r}}function vo(){return Vr().memoizedState}function yo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Un(e,t,n,r))){Na(n,e,r,Ia()),ko(n,t,r)}}function bo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Yt(s,a)){var l=t.interleaved;return null===l?(o.next=o,$n(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(V2){}null!==(n=Un(e,t,o,r))&&(Na(n,e,r,o=Ia()),ko(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var So={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?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=yo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===aa)throw Error(i(349));0!=(30&Mr)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,io(Kr.bind(null,r,a,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-kt(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Ur,useRef:no,useState:function(){return Ur($r)},useDebugValue:ho,useDeferredValue:function(e){return go(Vr(),Ar.memoizedState,e)},useTransition:function(){return[Ur($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr($r)},useDebugValue:ho,useDeferredValue:function(e){var t=Vr();return null===Ar?t.memoizedState=e:go(t,Ar.memoizedState,e)},useTransition:function(){return[Gr($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1};function Po(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(nue){o="\nError generating stack: "+nue.message+"\n"+nue.stack}return{value:e,source:t,stack:o,digest:null}}function Lo(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Oo(e,t){try{console.error(t.value)}catch(Jce){setTimeout((function(){throw Jce}))}}var Mo="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Sa||(Sa=!0,Ca=r),Oo(0,t)},n}function Ao(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Oo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Oo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Mo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=Fr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Fo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Mn)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Mn(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return $o(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=Fr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Uo(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:An(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?yt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yt(0,t.context,!1),xr(e,t.containerInfo)}function Yo(e,t,n,r,o){return Pn(),Ln(o),t.flags|=256,Bo(e,t,n,r),t.child}var Zo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,a=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),ut(Cr,1&a),null===e)return Sn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Lo(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,a);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=je(o).digest,a=Error(i(419)),r=Lo(a,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Gn(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Lo(Error(i(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),Fe(o,t),null):(e=a.treeContext,K&&(mn=$e(o),gn=t,vn=!0,bn=null,yn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Ln(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Fn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Z)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=br(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),Oe(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Oe(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Le(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Me(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=br(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Pe(i,c,n,a,r,t,e,s),F(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Zo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=br(yr.current),n=br(mr.current),t.stateNode=V(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Pr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==bn&&(ja(bn),bn=null))),Xo(e,t),fi(t),null;case 5:Sr(t),n=br(yr.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=br(mr.current),_n(t)){if(!K)throw Error(i(175));e=Ue(t.stateNode,t.type,t.memoizedProps,n,e,t,!yn),t.updateQueue=e,null!==e&&ci(t)}else{var a=B(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,F(a,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=br(yr.current),n=br(mr.current),_n(t)){if(!K)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ge(e,n,t,!yn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Pn(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!K)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));qe(o,t)}else Pn(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==bn&&(ja(bn),bn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return jn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ba&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ba&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Z&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Pr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Sr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));Pn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return jn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var mi=!1,vi=!1,yi="function"==typeof WeakSet?WeakSet:Set,bi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(oue){ns(e,t,oue)}else n.current=null}function wi(e,t,n){try{n()}catch(oue){ns(e,t,oue)}}var ki=!1;function Si(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),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 Pi(e){return 5===e.tag||3===e.tag||4===e.tag}function Li(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Pi(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ye(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}var Ti=null,Ai=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount(Gt,n)}catch(iue){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Z){var r=Ti,o=Ai;Ti=null,Ii(e,t,n),Ai=o,null!==(Ti=r)&&(Ai?xe(Ti,n.stateNode):be(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Z&&null!==Ti&&(Ai?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Z?(r=Ti,o=Ai,Ti=n.stateNode.containerInfo,Ai=!0,Ii(e,t,n),Ti=r,Ai=o):(X&&(r=n.stateNode.containerInfo,o=Le(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(iue){ns(n,t,iue)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new yi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Qi(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=$(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(i(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&($a(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=va,va=n,null!==t&&ja(t)),e}function ja(e){null===va?va=e:va.push.apply(va,e)}function Fa(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Pa)var r=!1;else{if(e=Pa,Pa=null,La=0,0!=(6&ia))throw Error(i(331));var o=ia;for(ia|=4,bi=e.current;null!==bi;){var a=bi,s=a.child;if(0!=(16&bi.flags)){var l=a.deletions;if(null!==l){for(var c=0;cHt()-ya?$a(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=Gn(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(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 cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=a,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=a,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=a,e;case x:return ps(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case y:s=14;break e;case b:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function ys(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yn(i),e}function bs(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(mt(n))return bt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=L(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&a>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>a&&(c.height+=h-a,c.y=a),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Ss,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Gt=t.inject(e),qt=t}catch(Jce){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(i(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=bs(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; + */!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",y="[object Array]",b="[object Boolean]",x="[object Date]",w="[object Error]",k="[object Function]",S="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",P="[object Promise]",L="[object RegExp]",O="[object Set]",M="[object String]",T="[object Symbol]",A="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",F="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,Z=RegExp(q.source),X=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Me="['’]",Te="["+Se+"]",Ae="["+Oe+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+Se+Oe+Re+_e+Ee+Pe+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+Se+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Pe+"]",Ve="\\u200d",$e="(?:"+De+"|"+ze+")",Ue="(?:"+We+"|"+ze+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ie+"|"+Be+")"+"?",Ze="["+Le+"]?",Xe=Ze+Ye+("(?:"+Ve+"(?:"+[je,Fe,He].join("|")+")"+Ze+Ye+")*"),Ke="(?:"+[Ne,Fe,He].join("|")+")"+Xe,Qe="(?:"+[je+Ie+"?",Ie,Fe,He,Te].join("|")+")",Je=RegExp(Me,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+Ge+"(?="+[Ae,We,"$"].join("|")+")",Ue+"+"+qe+"(?="+[Ae,We+$e,"$"].join("|")+")",We+"?"+$e+"+"+Ge,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ve+Se+Ce+Le+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[j]=st[F]=st[H]=st[W]=st[V]=!0,st[v]=st[y]=st[I]=st[b]=st[R]=st[x]=st[w]=st[k]=st[C]=st[_]=st[E]=st[L]=st[O]=st[M]=st[A]=!1;var lt={};lt[v]=lt[y]=lt[I]=lt[R]=lt[b]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[j]=lt[C]=lt[_]=lt[E]=lt[L]=lt[O]=lt[M]=lt[T]=lt[F]=lt[H]=lt[W]=lt[V]=!0,lt[w]=lt[k]=lt[A]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof o&&o&&o.Object===Object&&o,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,yt=vt&&ht.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(B2){}}(),xt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,kt=bt&&bt.isMap,St=bt&&bt.isRegExp,Ct=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var yn=function e(t){var o,ae=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,Se=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Pe=t.Object,Le=t.RegExp,Oe=t.String,Me=t.TypeError,Te=ae.prototype,Ae=_e.prototype,Ie=Pe.prototype,Re=t["__core-js_shared__"],Ne=Ae.toString,De=Ie.hasOwnProperty,ze=0,Be=(o=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",je=Ie.toString,Fe=Ne.call(Pe),He=pt._,We=Le("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=vt?t.Buffer:n,$e=t.Symbol,Ue=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:n,qe=un(Pe.getPrototypeOf,Pe),Ye=Pe.create,Ze=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=$e?$e.isConcatSpreadable:n,Qe=$e?$e.iterator:n,tt=$e?$e.toStringTag:n,rt=function(){try{var e=pi(Pe,"defineProperty");return e({},"",{}),e}catch(B2){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Se&&Se.now!==pt.Date.now&&Se.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,yt=Pe.getOwnPropertySymbols,bt=Ve?Ve.isBuffer:n,jt=t.isFinite,qt=Te.join,bn=un(Pe.keys,Pe),xn=Ee.max,wn=Ee.min,kn=Se.now,Sn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Pn=pi(t,"Map"),Ln=pi(t,"Promise"),On=pi(t,"Set"),Mn=pi(t,"WeakMap"),Tn=pi(Pe,"create"),An=Mn&&new Mn,In={},Rn=Hi(En),Nn=Hi(Pn),Dn=Hi(Ln),zn=Hi(On),Bn=Hi(Mn),jn=$e?$e.prototype:n,Fn=jn?jn.valueOf:n,Hn=jn?jn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Un(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ao(e,s)}else{var h=vi(e),f=h==k||h==S;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:bi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Po(e);case b:case x:return new r(+e);case R:return function(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case j:case F:case H:case W:case V:return Lo(e,n);case C:return new r;case _:case M:return new r(e);case L:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case T:return o=e,Fn?Pe(Fn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Lt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Pe(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,o){if("function"!=typeof e)throw new Me(r);return Ri((function(){e.apply(n,o)}),t)}function fr(e,t,n,r){var o=-1,i=At,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Pn||Yn),string:new qn}},Zn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return hi(this,e).get(e)},Zn.prototype.has=function(e){return hi(this,e).has(e)},Zn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(kr),gr=Do(Sr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?br(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,Rs)}function Sr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=ko(t,e)).length;null!=e&&rt}function Or(e,t){return null!=e&&De.call(e,t)}function Mr(e,t){return null!=e&&t in Pe(e)}function Tr(e,t,r){for(var o=r?It:At,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Oi(e,t,al),e+"")}function Jr(e){return Jn(Vs(e))}function eo(e,t){var n=Vs(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=ko(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Lo(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Oo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&ki(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Pe(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var o=t.length,i=o,a=Un.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Me(r);if(a&&!l&&"wrapper"==ci(s))var l=new Un([],!0)}for(i=l?i:o;++i1&&y.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Lt(m,(function(n){var r="_."+n[0];t&n[1]&&!At(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=kn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Gn&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Un(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ya=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ho(Gi),xa=Ho(qi);function wa(e,t){return(qa(e)?Lt:pr)(e,di(t,3))}function ka(e,t){return(qa(e)?Ot:gr)(e,di(t,3))}var Sa=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Za(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Ar(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var Pa=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var La=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,br(t,1),[])})),Oa=ht||function(){return pt.Date.now()};function Ma(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var o;if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Aa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Aa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,o){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Me(r);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(y,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function y(){var e=Oa();if(v(e))return b(e);c=Ri(y,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function b(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Oa(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(y,t),g(u)}return c===n&&(c=Ri(y,t)),l}return t=bs(t)||0,rs(o)&&(h=!!o.leading,s=(f="maxWait"in o)?xn(bs(o.maxWait)||0,t):s,p="trailing"in o?!!o.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:b(Oa())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,bs(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Zn),n}function Ba(e){if("function"!=typeof e)throw new Me(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Zn;var ja=So((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(br(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),Ga=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ze.call(e,"callee")},qa=ae.isArray,Ya=xt?Qt(xt):function(e){return os(e)&&Pr(e)==I};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Za(e)}var Ka=bt||bl,Qa=wt?Qt(wt):function(e){return os(e)&&Pr(e)==x};function Ja(e){if(!os(e))return!1;var t=Pr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Pr(e);return t==k||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=kt?Qt(kt):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Pr(e)==_}function ss(e){if(!os(e)||Pr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ls=St?Qt(St):function(e){return os(e)&&Pr(e)==L};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==O};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Pr(e)==M}function ds(e){return"symbol"==typeof e||os(e)&&Pr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Pr(e)]};var fs=Zo(Fr),ps=Zo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Za(e))return us(e)?gn(e):Ao(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==O?hn:Vs)(e)}function ms(e){return e?(e=bs(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?cr(vs(e),0,g):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||ye.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var ks=No((function(e,t){if(Ei(t)||Za(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),Ss=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ps=Qr((function(e,t){e=Pe(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&ki(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var js=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Vs(e){return null==e?[]:Jt(e,Rs(e))}var $s=jo((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=jo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=jo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Bo("toLowerCase");var Xs=jo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=jo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=jo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(B2){return Ja(B2)?B2:new Ce(B2)}})),nl=ii((function(e,t){return Lt(t,(function(t){t=Fi(t),sr(e,t,Aa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Ao(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=Go(Rt),fl=Go(Mt),pl=Go(Bt);function gl(e){return Si(e)?Gt(Fi(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Yo(),vl=Yo(!0);function yl(){return[]}function bl(){return!1}var xl=Uo((function(e,t){return e+t}),0),wl=Ko("ceil"),kl=Uo((function(e,t){return e/t}),1),Sl=Ko("floor");var Cl,_l=Uo((function(e,t){return e*t}),1),El=Ko("round"),Pl=Uo((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Ma,Wn.assign=ks,Wn.assignIn=Ss,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Aa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?ki(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:ys(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Me(r);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Me(r);return rs(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:o,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,Fi):ds(e)?[e]:Ao(ji(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Vn(qe(e)):{}}return(o?Lt:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Ma(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Vs,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return Fa(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return bo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return bo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=Ss,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=$s,Wn.capitalize=Us,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),cr(bs(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=Gs,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=kl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Va,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Y,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?Mt:mr;return r&&ki(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ba,Wn.findIndex=Gi,Wn.findKey=function(e,t){return Ft(e,di(t,3),kr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return Ft(e,di(t,3),Sr)},Wn.floor=Sl,Wn.forEach=wa,Wn.forEachRight=ka,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&kr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&Sr(e,di(t,3))},Wn.get=Os,Wn.gt=$a,Wn.gte=Ua,Wn.has=function(e,t){return null!=e&&yi(e,t,Or)},Wn.hasIn=Ms,Wn.head=Zi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Za(e)?e:Vs(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==A},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Pr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,$t,i,!0)},Wn.lowerCase=Ys,Wn.lowerFirst=Zs,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Lr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Lr):n},Wn.mean=function(e){return Ut(e,al)},Wn.meanBy=function(e,t){return Ut(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,Fr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Fr):n},Wn.stubArray=yl,Wn.stubFalse=bl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Ur(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Oa,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?ki(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Le(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Z.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=ka,Wn.first=Zi,ul(Wn,(Cl={},kr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Lt(["drop","take"],(function(e,t){Gn.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new Gn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(di(e)))},Gn.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},kr(Gn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Un(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Vo(n,2).name]=[{name:"wrapper",func:n}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Ao(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ao(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ao(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=yn)._=yn,gt._=yn):pt._=yn}).call(o)}(MU,MU.exports);const TU=MU.exports,AU=AV({name:"gallery",initialState:{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,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=MU.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].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},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:IU,clearIntermediateImage:RU,removeImage:NU,setCurrentImage:DU,addGalleryImages:zU,setIntermediateImage:BU,selectNextImage:jU,selectPrevImage:FU,setShouldPinGallery:HU,setShouldShowGallery:WU,setGalleryScrollPosition:VU,setGalleryImageMinimumWidth:$U,setGalleryImageObjectFit:UU,setShouldHoldGalleryOpen:GU,setShouldAutoSwitchToNewImages:qU,setCurrentCategory:YU,setGalleryWidth:ZU,setShouldUseSingleGalleryColumn:XU}=AU.actions,KU=AU.reducer;function QU(e){return QU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QU(e)}function JU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eG(e){var t=function(e,t){if("object"!==QU(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==QU(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===QU(t)?t:String(t)}function tG(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.init(t,n)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fG,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function wG(e,t,n){var r=xG(e,t,Object);r.obj[r.k]=n}function kG(e,t){var n=xG(e,t),r=n.obj,o=n.k;if(r)return r[o]}function SG(e,t,n){var r=kG(e,n);return void 0!==r?r:kG(t,n)}function CG(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):CG(e[r],t[r],n):e[r]=t[r]);return e}function _G(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var EG={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function PG(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return EG[e]})):e}var LG="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,OG=[" ",",","?","!",";"];function MG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TG(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?IG(l,c,n):void 0}o=o[r[i]]}return o}}var RG=function(e){iG(n,e);var t=AG(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return nG(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=kG(this.data,a);return s||!i||"string"!=typeof n?s:IG(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),wG(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=kG(this.data,a)||{};r?CG(s,n,o):s=TG(TG({},s),n),wG(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?TG(TG({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(mG),NG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function DG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zG(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),bG(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,rG(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gG.create("translator"),r}return nG(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=OG.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==QU(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),g=p&&p.res,m=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(g),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(w&&g&&k&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,g,zG(zG({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?v:m;for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,zG(zG({},t),{joinArrays:!1,ns:c})),_[P]===L&&(_[P]=g[P])}g=_}}else if(w&&"string"==typeof x&&"[object Array]"===y)(g=g.join(x))&&(g=this.extendTranslation(g,e,t,r));else{var O=!1,M=!1,T=void 0!==t.count&&"string"!=typeof t.count,A=n.hasDefaultValue(t),I=T?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(g)&&A&&(O=!0,g=R),this.isValidLookup(g)||(M=!0,g=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&M?void 0:g,z=A&&R!==g&&this.options.updateMissing;if(M||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,u,l,z?R:g),a){var B=this.resolve(l,zG(zG({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!jG["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(jG["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var g="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(g),d&&(l.push(g+u),h&&l.push(g+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(mG);function HG(e){return e.charAt(0).toUpperCase()+e.slice(1)}var WG=function(){function e(t){JU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gG.create("languageUtils")}return nG(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=HG(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),VG=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},UG=["v1","v2","v3"],GG={zero:0,one:1,two:2,few:3,many:4,other:5};function qG(){var e={};return VG.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:$G[t.fc]}}))})),e}var YG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.languageUtils=t,this.options=n,this.logger=gG.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=qG()}return nG(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return GG[e]-GG[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!UG.includes(this.options.compatibilityJSON)}}]),e}();function ZG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return nG(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:PG,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_G(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_G(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?_G(t.nestingPrefix):t.nestingPrefixEscaped||_G("$t("),this.nestingSuffix=t.nestingSuffix?_G(t.nestingSuffix):t.nestingSuffixEscaped||_G(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=SG(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,XG(XG(XG({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(SG(t,l,a),c,n,XG(XG(XG({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yG(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),h?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=XG(XG({},t),o))}catch(B2){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),B2),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=XG({},a)).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yG(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,XG(XG({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function QG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("formatter"),this.options=t,this.formats={number:eq((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:eq((function(e,t){var n=new Intl.NumberFormat(e,JG(JG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:eq((function(e,t){var n=new Intl.DateTimeFormat(e,JG({},t));return function(e){return n.format(e)}})),relativetime:eq((function(e,t){var n=new Intl.RelativeTimeFormat(e,JG({},t));return function(e){return n.format(e,t.range||"day")}})),list:eq((function(e,t){var n=new Intl.ListFormat(e,JG({},t));return function(e){return n.format(e)}}))},this.init(t)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=eq(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=uG(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,JG(JG(JG({},s),r),c))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function nq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rq(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return JU(this,n),i=t.call(this),LG&&mG.call(rG(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=gG.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return nG(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=xG(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=rq(rq({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var c;(c=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(Hhe){a(Hhe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(mG);function aq(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===QU(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===QU(e[2])||"object"===QU(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function sq(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(JU(this,n),e=t.call(this),LG&&mG.call(rG(e)),e.options=sq(r),e.services={},e.logger=gG,e.modules={external:[]},hq(rG(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),aG(e,rG(e));setTimeout((function(){e.init(r,o)}),0)}return e}return nG(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=aq();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=cq(cq(cq({},r),this.options),sq(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=cq(cq({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?gG.init(o(this.modules.logger),this.options):gG.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=tq);var a=new WG(this.options);this.store=new RG(this.options.resources,this.options);var s=this.services;s.logger=gG,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new YG(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new KG(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new iq(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=vG(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=vG();return e||(e=this.languages),t||(t=this.options.ns),n||(n=dq),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&NG.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=vG();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==QU(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=vG();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=vG();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new WG(aq());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,o=cq(cq(cq({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=cq({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new FG(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fq(e,t)}));var pq=fq.createInstance();function gq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mq(e){return mq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mq(e)}function vq(e){var t=function(e,t){if("object"!==mq(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==mq(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mq(t)?t:String(t)}function yq(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Sq.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Sq.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},_q=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=Cq(e,encodeURIComponent(t),o)},Eq=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},Oq=null,Mq=function(){if(null!==Oq)return Oq;try{Oq="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(B2){Oq=!1}return Oq},Tq={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Mq()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Mq()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Aq=null,Iq=function(){if(null!==Aq)return Aq;try{Aq="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(B2){Aq=!1}return Aq},Rq={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Iq()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Iq()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},Nq={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Dq={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},zq={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},Bq={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var jq=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};gq(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=kq(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Pq),this.addDetector(Lq),this.addDetector(Tq),this.addDetector(Rq),this.addDetector(Nq),this.addDetector(Dq),this.addDetector(zq),this.addDetector(Bq)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&yq(t.prototype,n),r&&yq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fq(e){return Fq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fq(e)}jq.type="languageDetector";var Hq=[],Wq=Hq.forEach,Vq=Hq.slice;function $q(e){return Wq.call(Vq.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function Uq(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Fq(XMLHttpRequest))}function Gq(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qq,Yq={exports:{}},Zq={exports:{}};function Xq(){return qq||(qq=1,function(e,t){var n="undefined"!=typeof self?self:o,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(B2){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];w.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(Hhe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Zq,Zq.exports)),Zq.exports}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==o&&o.fetch?o.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==Gq&&("undefined"==typeof window||void 0===window.document)){var r=n||Xq();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(Yq,Yq.exports);const Kq=Yq.exports,Qq=r({__proto__:null,default:Kq},[Yq.exports]);function Jq(e){return Jq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jq(e)}var eY,tY,nY;"function"==typeof fetch&&(eY="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),Uq()&&("undefined"!=typeof global&&global.XMLHttpRequest?tY=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(tY=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?nY=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(nY=window.ActiveXObject)),eY||!Qq||tY||nY||(eY=Kq||Qq),"function"!=typeof eY&&(eY=void 0);var rY=function(e,t){if(t&&"object"===Jq(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},oY=function(e,t,n){eY(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},iY=!1,aY=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},eY&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=rY(t,e.queryStringParams));var o=$q({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=$q({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},iY?{}:i);try{oY(t,a,r)}catch(B2){if(!i||0===Object.keys(i).length||!B2.message||B2.message.indexOf("not implemented")<0)return r(B2);try{Object.keys(i).forEach((function(e){delete a[e]})),oY(t,a,r),iY=!0}catch(Hhe){r(Hhe)}}}(e,t,n,r):Uq()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===Jq(n)&&(n=rY("",n).slice(1)),e.queryStringParams&&(t=rY(t,e.queryStringParams));try{var o;(o=tY?new tY:new nY("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(B2){console&&console.log(B2)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function sY(e){return sY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sY(e)}function lY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cY(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};lY(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=$q(n,this.options||{},dY()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(B2){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var u=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,u,a,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&cY(t.prototype,n),r&&cY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fY(e){return fY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fY(e)}function pY(e){var t=function(e,t){if("object"!==fY(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fY(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fY(t)?t:String(t)}function gY(e,t,n){return(t=pY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mY(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function wY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return yY("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):xY(e,t,n)}var kY=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SY={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},CY=function(e){return SY[e]};function _Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function EY(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};LY=EY(EY({},LY),e)}(e.options.react),function(e){PY=e}(e)}},IY=a.exports.createContext(),RY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&TY(t.prototype,n),r&&TY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function NY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=a.exports.useContext(IY)||{},o=r.i18n,i=r.defaultNS,s=n||o||MY();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new RY),!s){yY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&yY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BY(BY(BY({},OY()),s.options.react),t),d=u.useSuspense,h=u.keyPrefix,f=e||i||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var p=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return wY(e,s,u)}));function g(){return s.getFixedT(null,"fallback"===u.nsMode?f:f[0],h)}var m=a.exports.useState(g),v=DY(m,2),y=v[0],b=v[1],x=f.join(),w=jY(x),k=a.exports.useRef(!0);a.exports.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&b(g)}return k.current=!0,p||d||bY(s,f,(function(){k.current&&b(g)})),p&&w&&w!==x&&k.current&&b(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){k.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var S=a.exports.useRef(!0);a.exports.useEffect((function(){k.current&&!S.current&&b(g),S.current=!1}),[s,h]);var C=[y,s,p];if(C.t=y,C.i18n=s,C.ready=p,p)return C;if(!p&&!d)return C;throw new Promise((function(e){bY(s,f,(function(){e()}))}))}pq.use(hY).use(jq).use(AY).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","options","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const HY=AV({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:pq.isInitialized?pq.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=pq.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?pq.t("common:statusConnected"):pq.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},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=pq.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=pq.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=pq.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:WY,setIsProcessing:VY,addLogEntry:$Y,setShouldShowLogViewer:UY,setIsConnected:GY,setSocketId:qY,setShouldConfirmOnDelete:YY,setOpenAccordions:ZY,setSystemStatus:XY,setCurrentStatus:KY,setSystemConfig:QY,setShouldDisplayGuides:JY,processingCanceled:eZ,errorOccurred:tZ,errorSeen:nZ,setModelList:rZ,setIsCancelable:oZ,modelChangeRequested:iZ,setSaveIntermediatesInterval:aZ,setEnableImageDebugging:sZ,generationRequested:lZ,addToast:cZ,clearToastQueue:uZ,setProcessingIndeterminateTask:dZ,setSearchFolder:hZ,setFoundModels:fZ,setOpenModel:pZ}=HY.actions,gZ=HY.reducer,mZ=(e,t)=>Math.floor(e/t)*t,vZ=(e,t)=>Math.round(e/t)*t,yZ=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),bZ=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},xZ=.95,wZ=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),kZ=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=vZ(a/o,64)):o<1&&(r.height=a,r.width=vZ(a*o,64)),i=r.width*r.height}return r},SZ=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],CZ=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],_Z=e=>"line"===e.kind&&"mask"===e.layer,EZ=e=>"image"===e.kind&&"base"===e.layer,PZ=e=>"line"===e.kind,LZ={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},OZ=AV({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:LZ,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!_Z(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:mZ(TU.clamp(n.width,64,512),64),height:mZ(TU.clamp(n.height,64,512),64)},i={x:vZ(n.width/2-o.width/2,64),y:vZ(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState={...LZ,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=bZ(r.width,r.height,n.width,n.height,xZ),s=yZ(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:vZ(r.width,64),height:vZ(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=kZ(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=wZ(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(PZ);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(TU.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState=LZ,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(EZ),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=bZ(o.width,o.height,512,512,xZ),n=yZ(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=kZ(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=bZ(t,n,i,a,.95),l=yZ(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=wZ(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(EZ)){const t=bZ(r.width,r.height,512,512,xZ),n=yZ(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=bZ(r,o,s,l,xZ),n=yZ(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=bZ(r,o,512,512,xZ),n=yZ(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=kZ(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:mZ(TU.clamp(i,64,512),64),height:mZ(TU.clamp(a,64,512),64)},n={x:vZ(i/2-t.width/2,64),y:vZ(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=kZ(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=kZ(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:MZ,addFillRect:TZ,addImageToStagingArea:AZ,addLine:IZ,addPointToCurrentLine:RZ,clearCanvasHistory:NZ,clearMask:DZ,commitColorPickerColor:zZ,commitStagingAreaImage:BZ,discardStagedImages:jZ,fitBoundingBoxToStage:FZ,mouseLeftCanvas:HZ,nextStagingAreaImage:WZ,prevStagingAreaImage:VZ,redo:$Z,resetCanvas:UZ,resetCanvasInteractionState:GZ,resetCanvasView:qZ,resizeAndScaleCanvas:YZ,resizeCanvas:ZZ,setBoundingBoxCoordinates:XZ,setBoundingBoxDimensions:KZ,setBoundingBoxPreviewFill:QZ,setBoundingBoxScaleMethod:JZ,setBrushColor:eX,setBrushSize:tX,setCanvasContainerDimensions:nX,setColorPickerColor:rX,setCursorPosition:oX,setDoesCanvasNeedScaling:iX,setInitialCanvasImage:aX,setInpaintReplace:sX,setIsDrawing:lX,setIsMaskEnabled:cX,setIsMouseOverBoundingBox:uX,setIsMoveBoundingBoxKeyHeld:dX,setIsMoveStageKeyHeld:hX,setIsMovingBoundingBox:fX,setIsMovingStage:pX,setIsTransformingBoundingBox:gX,setLayer:mX,setMaskColor:vX,setMergedCanvas:yX,setShouldAutoSave:bX,setShouldCropToBoundingBoxOnSave:xX,setShouldDarkenOutsideBoundingBox:wX,setShouldLockBoundingBox:kX,setShouldPreserveMaskedArea:SX,setShouldShowBoundingBox:CX,setShouldShowBrush:_X,setShouldShowBrushPreview:EX,setShouldShowCanvasDebugInfo:PX,setShouldShowCheckboardTransparency:LX,setShouldShowGrid:OX,setShouldShowIntermediates:MX,setShouldShowStagingImage:TX,setShouldShowStagingOutline:AX,setShouldSnapToGrid:IX,setShouldUseInpaintReplace:RX,setStageCoordinates:NX,setStageScale:DX,setTool:zX,toggleShouldLockBoundingBox:BX,toggleTool:jX,undo:FX,setScaledBoundingBoxDimensions:HX,setShouldRestrictStrokesToBox:WX}=OZ.actions,VX=OZ.reducer,$X=Object.create(null);$X.open="0",$X.close="1",$X.ping="2",$X.pong="3",$X.message="4",$X.upgrade="5",$X.noop="6";const UX=Object.create(null);Object.keys($X).forEach((e=>{UX[$X[e]]=e}));const GX={type:"error",data:"parser error"},qX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YX="function"==typeof ArrayBuffer,ZX=({type:e,data:t},n,r)=>qX&&t instanceof Blob?n?r(t):XX(t,r):YX&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):XX(new Blob([t]),r):r($X[e]+(t||"")),XX=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},KX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QX="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:nK(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:tK(e.substring(1),t)};return UX[n]?e.length>1?{type:UX[n],data:e.substring(1)}:{type:UX[n]}:GX},tK=(e,t)=>{if(JX){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return nK(n,t)}return{base64:!0,data:e}},nK=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,rK=String.fromCharCode(30);function oK(e){if(e)return function(e){for(var t in oK.prototype)e[t]=oK.prototype[t];return e}(e)}oK.prototype.on=oK.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},oK.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},oK.prototype.off=oK.prototype.removeListener=oK.prototype.removeAllListeners=oK.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const sK=setTimeout,lK=clearTimeout;function cK(e,t){t.useNativeTimers?(e.setTimeoutFn=sK.bind(iK),e.clearTimeoutFn=lK.bind(iK)):(e.setTimeoutFn=setTimeout.bind(iK),e.clearTimeoutFn=clearTimeout.bind(iK))}function uK(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class dK extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class hK extends oK{constructor(e){super(),this.writable=!1,cK(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new dK(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=eK(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pK={};let gK,mK=0,vK=0;function yK(e){let t="";do{t=fK[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function bK(){const e=yK(+new Date);return e!==gK?(mK=0,gK=e):e+"."+yK(mK++)}for(;vK<64;vK++)pK[fK[vK]]=vK;function xK(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let wK=!1;try{wK="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Hhe){}const kK=wK;function SK(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||kK))return new XMLHttpRequest}catch(B2){}if(!t)try{return new(iK[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(B2){}}function CK(){}const _K=null!=new SK({xdomain:!1}).responseType;class EK extends oK{constructor(e,t){super(),cK(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=aK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new SK(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(B2){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(B2){}try{t.setRequestHeader("Accept","*/*")}catch(B2){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(B2){return void this.setTimeoutFn((()=>{this.onError(B2)}),0)}"undefined"!=typeof document&&(this.index=EK.requestsCount++,EK.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=CK,e)try{this.xhr.abort()}catch(B2){}"undefined"!=typeof document&&delete EK.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(EK.requestsCount=0,EK.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",PK);else if("function"==typeof addEventListener){addEventListener("onpagehide"in iK?"pagehide":"unload",PK,!1)}function PK(){for(let e in EK.requests)EK.requests.hasOwnProperty(e)&&EK.requests[e].abort()}const LK="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),OK=iK.WebSocket||iK.MozWebSocket,MK="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const TK={websocket:class extends hK{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=MK?{}:aK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=MK?new OK(e,t,n):t?new OK(e,t):new OK(e)}catch(Hhe){return this.emitReserved("error",Hhe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(B2){}r&&LK((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||(e.b64=1);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!OK}},polling:class extends hK{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=_K&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(rK),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZX(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(rK))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new EK(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},AK=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RK(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=AK.exec(e||""),i={},a=14;for(;a--;)i[IK[a]]=o[a]||"";return-1!=n&&-1!=r&&(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=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class NK extends oK{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=RK(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=RK(t.host).host),cK(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new TK[e](n)}open(){let e;if(this.opts.rememberUpgrade&&NK.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(B2){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;NK.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;NK.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",NK.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){NK.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||BK&&e instanceof Blob||jK&&e instanceof File}function HK(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case GK.ACK:case GK.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class YK{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=$K(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ZK=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return GK},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==GK.EVENT&&e.type!==GK.ACK||!HK(e)?[this.encodeAsString(e)]:(e.type=e.type===GK.EVENT?GK.BINARY_EVENT:GK.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==GK.BINARY_EVENT&&e.type!==GK.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=WK(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:qK},Symbol.toStringTag,{value:"Module"}));function XK(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const KK=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class QK extends oK{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[XK(e,"open",this.onopen.bind(this)),XK(e,"packet",this.onpacket.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(KK.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:GK.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:GK.CONNECT,data:e})})):this.packet({type:GK.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case GK.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}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 GK.EVENT:case GK.BINARY_EVENT:this.onevent(e);break;case GK.ACK:case GK.BINARY_ACK:this.onack(e);break;case GK.DISCONNECT:this.ondisconnect();break;case GK.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:GK.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:GK.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}JK.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=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},JK.prototype.reset=function(){this.attempts=0},JK.prototype.setMin=function(e){this.ms=e},JK.prototype.setMax=function(e){this.max=e},JK.prototype.setJitter=function(e){this.jitter=e};class eQ extends oK{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,cK(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new JK({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||ZK;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new NK(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=XK(t,"open",(function(){n.onopen(),e&&e()})),o=XK(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(XK(e,"ping",this.onping.bind(this)),XK(e,"data",this.ondata.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this)),XK(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(B2){this.onclose("parse error",B2)}}ondecoded(e){LK((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new QK(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const tQ={};function nQ(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=RK(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=tQ[o]&&i in tQ[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new eQ(r,t):(tQ[o]||(tQ[o]=new eQ(r,t)),s=tQ[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}let rQ;Object.assign(nQ,{Manager:eQ,Socket:QK,io:nQ,connect:nQ});const oQ=new Uint8Array(16);function iQ(){if(!rQ&&(rQ="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rQ))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rQ(oQ)}const aQ=[];for(let e=0;e<256;++e)aQ.push((e+256).toString(16).slice(1));const sQ={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lQ(e,t,n){if(sQ.randomUUID&&!t&&!e)return sQ.randomUUID();const r=(e=e||{}).random||(e.rng||iQ)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(aQ[e[t+0]]+aQ[e[t+1]]+aQ[e[t+2]]+aQ[e[t+3]]+"-"+aQ[e[t+4]]+aQ[e[t+5]]+"-"+aQ[e[t+6]]+aQ[e[t+7]]+"-"+aQ[e[t+8]]+aQ[e[t+9]]+"-"+aQ[e[t+10]]+aQ[e[t+11]]+aQ[e[t+12]]+aQ[e[t+13]]+aQ[e[t+14]]+aQ[e[t+15]]).toLowerCase()}(r)}var cQ=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,uQ=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,dQ=/[^-+\dA-Z]/g;function hQ(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(fQ[t]||t||fQ.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return vQ(e)},m=function(){return yQ(e)},v={d:function(){return a()},dd:function(){return gQ(a())},ddd:function(){return pQ.dayNames[s()]},DDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()],short:!0})},dddd:function(){return pQ.dayNames[s()+7]},DDDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return gQ(l()+1)},mmm:function(){return pQ.monthNames[l()]},mmmm:function(){return pQ.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return gQ(c(),4)},h:function(){return u()%12||12},hh:function(){return gQ(u()%12||12)},H:function(){return u()},HH:function(){return gQ(u())},M:function(){return d()},MM:function(){return gQ(d())},s:function(){return h()},ss:function(){return gQ(h())},l:function(){return gQ(f(),3)},L:function(){return gQ(Math.floor(f()/10))},t:function(){return u()<12?pQ.timeNames[0]:pQ.timeNames[1]},tt:function(){return u()<12?pQ.timeNames[2]:pQ.timeNames[3]},T:function(){return u()<12?pQ.timeNames[4]:pQ.timeNames[5]},TT:function(){return u()<12?pQ.timeNames[6]:pQ.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":bQ(e)},o:function(){return(p()>0?"-":"+")+gQ(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+gQ(Math.floor(Math.abs(p())/60),2)+":"+gQ(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return gQ(g())},N:function(){return m()}};return t.replace(cQ,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var fQ={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"},pQ={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"]},gQ=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},mQ=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},vQ=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},yQ=function(e){var t=e.getDay();return 0===t&&(t=7),t},bQ=function(e){return(String(e).match(uQ)||[""]).pop().replace(dQ,"").replace(/GMT\+0000/g,"UTC")};const xQ=MV("socketio/generateImage"),wQ=MV("socketio/runESRGAN"),kQ=MV("socketio/runFacetool"),SQ=MV("socketio/deleteImage"),CQ=MV("socketio/requestImages"),_Q=MV("socketio/requestNewImages"),EQ=MV("socketio/cancelProcessing"),PQ=MV("socketio/requestSystemConfig"),LQ=MV("socketio/searchForModels"),OQ=MV("socketio/addNewModel"),MQ=MV("socketio/deleteModel"),TQ=MV("socketio/requestModelChange"),AQ=MV("socketio/saveStagingAreaImageToGallery"),IQ=MV("socketio/requestEmptyTempFolder"),RQ=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],NQ=[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],DQ=[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],zQ=[{key:"2x",value:2},{key:"4x",value:4}],BQ=4294967295,jQ=["gfpgan","codeformer"],FQ=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],HQ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var WQ=Math.PI/180;const VQ="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},$Q={_global:VQ,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>$Q.angleDeg?e*WQ: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:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>$Q.DD.isDragging,isDragReady:()=>!!$Q.DD.node,releaseCanvasOnDestroy:!0,document:VQ.document,_injectGlobal(e){VQ.Konva=e}},UQ=e=>{$Q[e.prototype.getClassName()]=e};$Q._injectGlobal($Q);class GQ{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 GQ(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=eJ._getRotation(i.rotation),i}}var qQ=Math.PI/180,YQ=180/Math.PI,ZQ="Konva error: ",XQ={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]},KQ=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,QQ=[];const JQ="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},eJ={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){QQ.push(e),1===QQ.length&&JQ((function(){const e=QQ;QQ=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(B2){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=eJ.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in XQ?{r:(t=XQ[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=KQ.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=>(e=e||"black",eJ._namedColorToRBA(e)||eJ._hex3ColorToRGBA(e)||eJ._hex6ColorToRGBA(e)||eJ._rgbColorToRGBA(e)||eJ._rgbaColorToRGBA(e)||eJ._hslColorToRGBA(e)),_namedColorToRBA(e){var t=XQ[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)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]&&4===e.length)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,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*qQ,radToDeg:e=>e*YQ,_degToRad:e=>(eJ.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),eJ.degToRad(e)),_radToDeg:e=>(eJ.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),eJ.radToDeg(e)),_getRotation:e=>$Q.angleDeg?eJ.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(ZQ+e)},error(e){console.error(ZQ+e)},warn(e){$Q.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=eJ.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=eJ._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){$Q.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function tJ(e){return eJ._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||eJ._isBoolean(e)?e:Object.prototype.toString.call(e)}function nJ(e){return e>255?255:e<0?0:Math.round(e)}function rJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function oJ(e){if($Q.isUnminified)return function(t,n){let r=eJ._isNumber(t),o=eJ._isArray(t)&&t.length==e;return r||o||eJ.warn(tJ(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function iJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||"auto"===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function aJ(){if($Q.isUnminified)return function(e,t){return eJ._isString(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function sJ(){if($Q.isUnminified)return function(e,t){const n=eJ._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function lJ(){if($Q.isUnminified)return function(e,t){return!0===e||!1===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var cJ="get",uJ="set";const dJ={addGetterSetter(e,t,n,r,o){dJ.addGetter(e,t,n),dJ.addSetter(e,t,r,o),dJ.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cJ+eJ._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]||dJ.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=eJ._capitalize,c=cJ+l(t),u=uJ+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},dJ.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=eJ._capitalize(t),r=uJ+n,o=cJ+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){eJ.error("Adding deprecated "+t);var o=cJ+eJ._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){eJ.error(i);var e=this.attrs[t];return void 0===e?n:e},dJ.addSetter(e,t,r,(function(){eJ.error(i)})),dJ.addOverloadedGetterSetter(e,t)},backCompat(e,t){eJ.each(t,(function(t,n){var r=e.prototype[n],o=cJ+eJ._capitalize(t),i=uJ+eJ._capitalize(t);function a(){r.apply(this,arguments),eJ.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function hJ(e){var t,n,r=[],o=e.length,i=eJ;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=fJ.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=hJ(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return wJ._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];wJ._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=eJ._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];wJ._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(wJ.justDragged=!0,$Q._mouseListenClick=!1,$Q._touchListenClick=!1,$Q._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof $Q.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){wJ._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&wJ._dragElements.delete(n)}))}};$Q.isBrowser&&(window.addEventListener("mouseup",wJ._endDragBefore,!0),window.addEventListener("touchend",wJ._endDragBefore,!0),window.addEventListener("mousemove",wJ._drag),window.addEventListener("touchmove",wJ._drag),window.addEventListener("mouseup",wJ._endDragAfter,!1),window.addEventListener("touchend",wJ._endDragAfter,!1));var kJ="absoluteOpacity",SJ="allEventListeners",CJ="absoluteTransform",_J="absoluteScale",EJ="canvas",PJ="listening",LJ="mouseenter",OJ="mouseleave",MJ="Shape",TJ=" ",AJ="stage",IJ="transform",RJ="visible",NJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(TJ);let DJ=1;class zJ{constructor(e){this._id=DJ++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==IJ&&e!==CJ||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===IJ||e===CJ)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(TJ);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(EJ)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===CJ&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(EJ)){const{scene:e,filter:t,hit:n}=this._cache.get(EJ);eJ.releaseCanvas(e,t,n),this._cache.delete(EJ)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new bJ({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new bJ({pixelRatio:i,width:0,height:0}),f=new xJ({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(EJ),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(kJ),this._clearSelfAndDescendantCache(_J),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(EJ,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}eJ.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(EJ)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+eJ._capitalize(t),eJ._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(PJ,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(RJ,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;wJ._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!$Q.hitOnDragEnabled&&r;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 e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new GQ,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(IJ);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={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,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return eJ.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return eJ.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&eJ.warn("Unexpected value "+e+" 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 t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(kJ,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],eJ.isObject(t)&&!eJ._isPlainObject(t)&&!eJ._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),eJ._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,eJ._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():$Q.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;wJ._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=wJ._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&wJ._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return eJ.haveIntersection(n,this.getClientRect())}static create(e,t){return eJ._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=zJ.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),$Q[i]||(eJ.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,$Q[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=zJ.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=zJ.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",m0=e=>{const t=g0(e);return"pointer"===t?$Q.pointerEventsEnabled&&p0.pointer:"touch"===t?p0.touch:"mouse"===t?p0.mouse:void 0};function v0(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&eJ.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const y0=[];class b0 extends jJ{constructor(e){super(v0(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),y0.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{v0(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||eJ.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&y0.splice(t,1),eJ.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(eJ.warn("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);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new bJ({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&eJ.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),$Q.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}getLayers(){return this.children}_bindContentEvents(){$Q.isBrowser&&f0.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!wJ.isDragging||$Q.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);wJ.justDragged=!1,$Q["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;$Q.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=m0(e.type),n=g0(e.type);if(!t)return;if(wJ.isDragging&&wJ.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!wJ.isDragging||$Q.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=WJ(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=m0(e.type),n=g0(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=WJ(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;$Q["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):wJ.justDragged||($Q["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){$Q["_"+n+"InDblClickWindow"]=!1}),$Q.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),$Q["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,$Q["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),$Q["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(s0,{evt:e}):this._fire(s0,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(h0,{evt:e}):this._fire(h0,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=WJ(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(t0,VJ(e)),GJ(e.pointerId)}_lostpointercapture(e){GJ(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}])}_setPointerPosition(e){eJ.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new bJ({width:this.width(),height:this.height()}),this.bufferHitCanvas=new xJ({pixelRatio:1,width:this.width(),height:this.height()}),$Q.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return eJ.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(e){e.batchDraw()})),this}}b0.prototype.nodeType="Stage",UQ(b0),dJ.addGetterSetter(b0,"container");var x0="hasShadow",w0="shadowRGBA",k0="patternImage",S0="linearGradient",C0="radialGradient";let _0;function E0(){return _0||(_0=eJ.createCanvasElement().getContext("2d"),_0)}const P0={};class L0 extends zJ{constructor(e){let t;for(super(e);t=eJ.getRandomColor(),!t||t in P0;);this.colorKey=t,P0[t]=this}getContext(){return eJ.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return eJ.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(x0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(k0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=E0().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new GQ;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate($Q.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(S0,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=E0(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return zJ.prototype.destroy.call(this),delete P0[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){eJ.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||eJ.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()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=eJ._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(B2){eJ.error("Unable to draw hit graph from cached scene canvas. "+B2.message)}return this}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}}L0.prototype._fillFunc=function(e){e.fill()},L0.prototype._strokeFunc=function(e){e.stroke()},L0.prototype._fillFuncHit=function(e){e.fill()},L0.prototype._strokeFuncHit=function(e){e.stroke()},L0.prototype._centroid=!1,L0.prototype.nodeType="Shape",UQ(L0),L0.prototype.eventListeners={},L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(x0)})),L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(w0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(k0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(S0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(C0)})),dJ.addGetterSetter(L0,"stroke",void 0,sJ()),dJ.addGetterSetter(L0,"strokeWidth",2,rJ()),dJ.addGetterSetter(L0,"fillAfterStrokeEnabled",!1),dJ.addGetterSetter(L0,"hitStrokeWidth","auto",iJ()),dJ.addGetterSetter(L0,"strokeHitEnabled",!0,lJ()),dJ.addGetterSetter(L0,"perfectDrawEnabled",!0,lJ()),dJ.addGetterSetter(L0,"shadowForStrokeEnabled",!0,lJ()),dJ.addGetterSetter(L0,"lineJoin"),dJ.addGetterSetter(L0,"lineCap"),dJ.addGetterSetter(L0,"sceneFunc"),dJ.addGetterSetter(L0,"hitFunc"),dJ.addGetterSetter(L0,"dash"),dJ.addGetterSetter(L0,"dashOffset",0,rJ()),dJ.addGetterSetter(L0,"shadowColor",void 0,aJ()),dJ.addGetterSetter(L0,"shadowBlur",0,rJ()),dJ.addGetterSetter(L0,"shadowOpacity",1,rJ()),dJ.addComponentsGetterSetter(L0,"shadowOffset",["x","y"]),dJ.addGetterSetter(L0,"shadowOffsetX",0,rJ()),dJ.addGetterSetter(L0,"shadowOffsetY",0,rJ()),dJ.addGetterSetter(L0,"fillPatternImage"),dJ.addGetterSetter(L0,"fill",void 0,sJ()),dJ.addGetterSetter(L0,"fillPatternX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternY",0,rJ()),dJ.addGetterSetter(L0,"fillLinearGradientColorStops"),dJ.addGetterSetter(L0,"strokeLinearGradientColorStops"),dJ.addGetterSetter(L0,"fillRadialGradientStartRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientEndRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientColorStops"),dJ.addGetterSetter(L0,"fillPatternRepeat","repeat"),dJ.addGetterSetter(L0,"fillEnabled",!0),dJ.addGetterSetter(L0,"strokeEnabled",!0),dJ.addGetterSetter(L0,"shadowEnabled",!0),dJ.addGetterSetter(L0,"dashEnabled",!0),dJ.addGetterSetter(L0,"strokeScaleEnabled",!0),dJ.addGetterSetter(L0,"fillPriority","color"),dJ.addComponentsGetterSetter(L0,"fillPatternOffset",["x","y"]),dJ.addGetterSetter(L0,"fillPatternOffsetX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternOffsetY",0,rJ()),dJ.addComponentsGetterSetter(L0,"fillPatternScale",["x","y"]),dJ.addGetterSetter(L0,"fillPatternScaleX",1,rJ()),dJ.addGetterSetter(L0,"fillPatternScaleY",1,rJ()),dJ.addComponentsGetterSetter(L0,"fillLinearGradientStartPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientStartPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillLinearGradientEndPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientEndPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientStartPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientEndPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientEndPointY",0),dJ.addGetterSetter(L0,"fillPatternRotation",0),dJ.backCompat(L0,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var O0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],M0=O0.length;class T0 extends jJ{constructor(e){super(e),this.canvas=new bJ,this.hitCanvas=new xJ({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),jJ.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),jJ.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return eJ.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}T0.prototype.nodeType="Layer",UQ(T0),dJ.addGetterSetter(T0,"imageSmoothingEnabled",!0),dJ.addGetterSetter(T0,"clearBeforeDraw",!0),dJ.addGetterSetter(T0,"hitGraphEnabled",!0,lJ());class A0 extends T0{constructor(e){super(e),this.listening(!1),eJ.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}A0.prototype.nodeType="FastLayer",UQ(A0);class I0 extends jJ{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&eJ.throw("You may only add groups and shapes to groups.")}}I0.prototype.nodeType="Group",UQ(I0);var R0=VQ.performance&&VQ.performance.now?function(){return VQ.performance.now()}:function(){return(new Date).getTime()};class N0{constructor(e,t){this.id=N0.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:R0(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class F0{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||H0.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=z0++;var l=o.getLayer()||(o instanceof $Q.Stage?o.getLayers():null);for(n in l||eJ.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new N0((function(){r.tween.onEnterFrame()}),l),this.tween=new j0(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),F0.attrs[i]||(F0.attrs[i]={}),F0.attrs[i][this._id]||(F0.attrs[i][this._id]={}),F0.tweens[i]||(F0.tweens[i]={}),e)void 0===D0[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=F0.tweens[d][e])&&delete F0.attrs[d][o][e],n=u.getAttr(e),eJ._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=eJ._prepareArrayForTween(n,t,u.closed())):(s=t,t=eJ._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.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(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=F0.tweens[t];for(e in this.pause(),r)delete F0.tweens[t][e];delete F0.attrs[t][n]}}F0.attrs={},F0.tweens={},zJ.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new F0(e).play()};const H0={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-H0.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},W0=eJ._assign($Q,{Util:eJ,Transform:GQ,Node:zJ,Container:jJ,Stage:b0,stages:y0,Layer:T0,FastLayer:A0,Group:I0,DD:wJ,Shape:L0,shapes:P0,Animation:N0,Tween:F0,Easings:H0,Context:pJ,Canvas:yJ});class V0 extends L0{_sceneFunc(e){var t=$Q.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=$Q.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function $0(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function U0(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=q0.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return q0.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return q0.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return q0.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,q0.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,y,b,x,w,k,S,C,_,E,P=null,L=[],O=l,M=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),P="L",L.push(l,c);break;case"L":l=f.shift(),c=f.shift(),L.push(l,c);break;case"m":var T=f.shift(),A=f.shift();if(l+=T,c+=A,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+A;break}L.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),P="M",L.push(l,c),h="L";break;case"h":l+=f.shift(),P="L",L.push(l,c);break;case"H":l=f.shift(),P="L",L.push(l,c);break;case"v":c+=f.shift(),P="L",L.push(l,c);break;case"V":c=f.shift(),P="L",L.push(l,c);break;case"C":L.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"c":L.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"S":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,f.shift(),f.shift()),l=f.shift(),c=f.shift(),P="C",L.push(l,c);break;case"s":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"Q":L.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"q":L.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="Q",L.push(l,c);break;case"T":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l=f.shift(),c=f.shift(),P="Q",L.push(y,b,l,c);break;case"t":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),P="Q",L.push(y,b,l,c);break;case"A":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k);break;case"a":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k)}a.push({command:P||h,points:L,start:{x:O,y:M},pathLength:this.calcLength(O,M,P||h,L)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=q0;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}q0.prototype.className="Path",q0.prototype._attrsAffectingSize=["data"],UQ(q0),dJ.addGetterSetter(q0,"data");class Y0 extends G0{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=q0.calcLength(r[r.length-4],r[r.length-3],"C",e),o=q0.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}Y0.prototype.className="Arrow",UQ(Y0),dJ.addGetterSetter(Y0,"pointerLength",10,rJ()),dJ.addGetterSetter(Y0,"pointerWidth",10,rJ()),dJ.addGetterSetter(Y0,"pointerAtBeginning",!1),dJ.addGetterSetter(Y0,"pointerAtEnding",!0);class Z0 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Z0.prototype._centroid=!0,Z0.prototype.className="Circle",Z0.prototype._attrsAffectingSize=["radius"],UQ(Z0),dJ.addGetterSetter(Z0,"radius",0,rJ());class X0 extends L0{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}X0.prototype.className="Ellipse",X0.prototype._centroid=!0,X0.prototype._attrsAffectingSize=["radiusX","radiusY"],UQ(X0),dJ.addComponentsGetterSetter(X0,"radius",["x","y"]),dJ.addGetterSetter(X0,"radiusX",0,rJ()),dJ.addGetterSetter(X0,"radiusY",0,rJ());class K0 extends L0{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=eJ.createImageElement();r.onload=function(){var e=new K0({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}K0.prototype.className="Image",UQ(K0),dJ.addGetterSetter(K0,"image"),dJ.addComponentsGetterSetter(K0,"crop",["x","y","width","height"]),dJ.addGetterSetter(K0,"cropX",0,rJ()),dJ.addGetterSetter(K0,"cropY",0,rJ()),dJ.addGetterSetter(K0,"cropWidth",0,rJ()),dJ.addGetterSetter(K0,"cropHeight",0,rJ());var Q0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],J0="up",e1="right",t1="down",n1="left",r1=Q0.length;class o1 extends I0{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}s1.prototype.className="RegularPolygon",s1.prototype._centroid=!0,s1.prototype._attrsAffectingSize=["radius"],UQ(s1),dJ.addGetterSetter(s1,"radius",0,rJ()),dJ.addGetterSetter(s1,"sides",0,rJ());var l1=2*Math.PI;class c1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,l1,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),l1,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}c1.prototype.className="Ring",c1.prototype._centroid=!0,c1.prototype._attrsAffectingSize=["innerRadius","outerRadius"],UQ(c1),dJ.addGetterSetter(c1,"innerRadius",0,rJ()),dJ.addGetterSetter(c1,"outerRadius",0,rJ());class u1 extends L0{constructor(e){super(e),this._updated=!0,this.anim=new N0((()=>{var e=this._updated;return this._updated=!1,e})),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(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=eJ._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===p1||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===p1||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return eJ.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=S1(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+b1+this.fontVariant()+b1+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===g1&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return S1().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==p1&&void 0!==o,s=i!==p1&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==x1,p=this.ellipsis();this.textArr=[],S1().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;y.length>0;){for(var x=0,w=y.length,k="",S=0;x>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,k=_,S=E):w=C}if(!k)break;if(f){var P,L=y[k.length];(P=(L===b1||"-"===L)&&S<=c?k.length:Math.max(k.lastIndexOf(b1),k.lastIndexOf("-"))+1)>0&&(x=P,k=k.slice(0,x),S=this._getTextWidth(k))}if(k=k.trimRight(),this._addTextLine(k),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(x)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=c){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==p1&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==x1)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==p1&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=h1(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=q0.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],y=d.points[5],b=d.points[4]+y;0===g?g=v+1e-8:o>s?g+=Math.PI/180*y/Math.abs(y):g-=Math.PI/360*y/Math.abs(y),(y<0&&g=0&&g>b)&&(g=b,p=!0),u=q0.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=q0.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=q0.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=q0.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;be+`.${O1}`)).join(" "),T1="nodesRect",A1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],I1={"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 R1="ontouchstart"in $Q._global;var N1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function D1(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=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:o})}function z1(e,t){const n=function(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)}}(e);return D1(e,t,n)}class B1 extends I0{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(M1,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return eJ.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return O1+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(A1.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(T1),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(T1,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=($Q.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return D1({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-$Q.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new GQ;var n,r,o,i;t.rotate(-$Q.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:$Q.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(),N1.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new a1({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:R1?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=$Q.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=eJ.degToRad(I1[e]||0);var n=(eJ.radToDeg(t)%360+360)%360;return eJ._inRange(n,337.5,360)||eJ._inRange(n,0,22.5)?"ns-resize":eJ._inRange(n,22.5,67.5)?"nesw-resize":eJ._inRange(n,67.5,112.5)?"ew-resize":eJ._inRange(n,112.5,157.5)?"nwse-resize":eJ._inRange(n,157.5,202.5)?"ns-resize":eJ._inRange(n,202.5,247.5)?"nesw-resize":eJ._inRange(n,247.5,292.5)?"ew-resize":eJ._inRange(n,292.5,337.5)?"nwse-resize":(eJ.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new L0({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*eJ._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(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 i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(eJ._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(eJ._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new GQ;if(o.rotate($Q.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:eJ.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new GQ;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new GQ;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new GQ;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(eJ._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(eJ._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*eJ._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),I0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return zJ.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}B1.prototype.className="Transformer",UQ(B1),dJ.addGetterSetter(B1,"enabledAnchors",N1,(function(e){return e instanceof Array||eJ.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===N1.indexOf(e)&&eJ.warn("Unknown anchor name: "+e+". Available names are: "+N1.join(", "))})),e||[]})),dJ.addGetterSetter(B1,"flipEnabled",!0,lJ()),dJ.addGetterSetter(B1,"resizeEnabled",!0),dJ.addGetterSetter(B1,"anchorSize",10,rJ()),dJ.addGetterSetter(B1,"rotateEnabled",!0),dJ.addGetterSetter(B1,"rotationSnaps",[]),dJ.addGetterSetter(B1,"rotateAnchorOffset",50,rJ()),dJ.addGetterSetter(B1,"rotationSnapTolerance",5,rJ()),dJ.addGetterSetter(B1,"borderEnabled",!0),dJ.addGetterSetter(B1,"anchorStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"anchorStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"anchorFill","white"),dJ.addGetterSetter(B1,"anchorCornerRadius",0,rJ()),dJ.addGetterSetter(B1,"borderStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"borderStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"borderDash"),dJ.addGetterSetter(B1,"keepRatio",!0),dJ.addGetterSetter(B1,"centeredScaling",!1),dJ.addGetterSetter(B1,"ignoreStroke",!1),dJ.addGetterSetter(B1,"padding",0,rJ()),dJ.addGetterSetter(B1,"node"),dJ.addGetterSetter(B1,"nodes"),dJ.addGetterSetter(B1,"boundBoxFunc"),dJ.addGetterSetter(B1,"anchorDragBoundFunc"),dJ.addGetterSetter(B1,"shouldOverdrawWholeArea",!1),dJ.addGetterSetter(B1,"useSingleNodeRotation",!0),dJ.backCompat(B1,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class j1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,$Q.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function F1(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}j1.prototype.className="Wedge",j1.prototype._centroid=!0,j1.prototype._attrsAffectingSize=["radius"],UQ(j1),dJ.addGetterSetter(j1,"radius",0,rJ()),dJ.addGetterSetter(j1,"angle",0,rJ()),dJ.addGetterSetter(j1,"clockwise",!1),dJ.backCompat(j1,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var H1=[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],W1=[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];dJ.addGetterSetter(zJ,"blurRadius",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"brightness",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"contrast",0,rJ(),dJ.afterSetFilter);function V1(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}dJ.addGetterSetter(zJ,"embossStrength",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossWhiteLevel",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossDirection","top-left",null,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossBlend",!1,null,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"enhance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"luminance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"value",0,rJ(),dJ.afterSetFilter);function $1(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function U1(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}dJ.addGetterSetter(zJ,"kaleidoscopePower",2,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"kaleidoscopeAngle",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"threshold",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"noise",.2,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"pixelSize",8,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"levels",.5,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));dJ.addGetterSetter(zJ,"threshold",.5,rJ(),dJ.afterSetFilter);const G1=W0.Util._assign(W0,{Arc:V0,Arrow:Y0,Circle:Z0,Ellipse:X0,Image:K0,Label:o1,Tag:i1,Line:G0,Path:q0,Rect:a1,RegularPolygon:s1,Ring:c1,Sprite:u1,Star:d1,Text:C1,TextPath:L1,Transformer:B1,Wedge:j1,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,y,b,x,w,k,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,M=P-1,T=L-1,A=t+1,I=A*(A+1)/2,R=new F1,N=null,D=R,z=null,B=null,j=H1[t],F=W1[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(c*j>>F)*C,E[s+1]=(u*j>>F)*C,E[s+2]=(d*j>>F)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(c*j>>F)*C,E[i+1]=(u*j>>F)*C,E[i+2]=(d*j>>F)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+A)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:eJ.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var y=p+4*(g-1+v),b=s[m]-s[y],x=s[m+1]-s[y+1],w=s[m+2]-s[y+2],k=b,S=k>0?k:-k;if((x>0?x:-x)>S&&(k=x),(w>0?w:-w)>S&&(k=w),k*=t,o){var C=s[m]+k,_=s[m+1]+k,E=s[m+2]+k;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var P=n-k;P<0?P=0:P>255&&(P=255),s[m]=s[m+1]=s[m+2]=P}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,y,b,x,w,k;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),y=u+f*(255-u),b=c-f*(c-0),w=h+f*(255-h),k=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),y=u+f*(u-(v=.5*(u+c))),b=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),k=d+f*(d-x)),o=0;ov?a:v;var y,b,x,w,k=u,S=c,C=360/S*Math.PI/180;for(b=0;bu&&(b=y,x=0,w=-1),n=0;nb?l:b;var x,w,k,S=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;tq1,X1=()=>Y1,K1=e=>{const t=Z1(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:y,seamBlur:b,seamless:x,seamSize:w,seamSteps:k,seamStrength:S,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:P,shouldRandomizeSeed:L,shouldRunESRGAN:O,shouldRunFacetool:M,steps:T,threshold:A,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:j,enableImageDebugging:F}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:A,perlin:m,height:u,width:z,sampler_name:y,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:j,generation_mode:n,init_mask:""};let W=!1,V=!1;if(H.seed=L?HQ(0,BQ):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,O&&(W={level:R,strength:N}),M&&(V={type:c,strength:l},"codeformer"===c&&(V.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new G1.Stage({container:o,width:n,height:r}),a=new G1.Layer,s=new G1.Layer;a.add(new G1.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new G1.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(_Z):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),y=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});F&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:y,caption:"image sent as init_img"}]),t.scale(m),H.init_img=y,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=b,H.seam_strength=S,H.seam_steps=k,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return P?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,F&&(H.enable_image_debugging=F),{generationParameters:H,esrganParameters:W,facetoolParameters:V}},Q1=()=>{const{origin:e}=new URL(window.location.href),t=nQ(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onFoundModels:v,onNewModelAdded:y,onModelDeleted:b,onModelChangeFailed:x,onTempFolderEmptied:w}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(GY(!0)),t(KY(pq.t("common:statusConnected"))),t(PQ());const e=n().gallery;e.categories.result.latest_mtime?t(_Q("result")):t(CQ("result")),e.categories.user.latest_mtime?t(_Q("user")):t(CQ("user"))}catch(B2){console.error(B2)}},onDisconnect:()=>{try{t(GY(!1)),t(KY(pq.t("common:statusDisconnected"))),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(B2){console.error(B2)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:lQ(),...l};if(["txt2img","img2img"].includes(s)&&t(IU({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(AZ({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(IU({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===P$[i]&&t(G$(c)),t(RU()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onIntermediateResult:e=>{try{t(BU({uuid:lQ(),...e,category:"result"})),e.isBase64||t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onPostprocessingResult:e=>{try{t(IU({category:"result",image:{uuid:lQ(),...e,category:"result"}})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(B2){console.error(B2)}},onProgressUpdate:e=>{try{t(VY(!0)),t(XY(e))}catch(B2){console.error(B2)}},onError:e=>{const{message:n,additionalData:r}=e;try{t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(tZ()),t(RU())}catch(B2){console.error(B2)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:lQ(),...e})));t(zU({images:i,areMoreImagesAvailable:r,category:o})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(eZ());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(IU({category:"result",image:e})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(RU())),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(NU(e));const{initialImage:o,maskPath:i}=n().options;o!==r&&o?.url!==r||t(M$()),i===r&&t(Z$("")),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(QY(e)),e.infill_methods.includes("patchmatch")||t(U$(e.infill_methods[0]))},onFoundModels:e=>{const{search_folder:n,found_models:r}=e;t(hZ(n)),t(fZ(r))},onNewModelAdded:e=>{const{new_model_name:n,model_list:r,update:o}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model Added: ${n}`,level:"info"})),t(cZ({title:o?`${pq.t("modelmanager:modelUpdated")}: ${n}`:`${pq.t("modelmanager:modelAdded")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:e=>{const{deleted_model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`${pq.t("modelmanager:modelAdded")}: ${n}`,level:"info"})),t(cZ({title:`${pq.t("modelmanager:modelEntryDeleted")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(KY(pq.t("common:statusModelChanged"))),t(VY(!1)),t(oZ(!0)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t(oZ(!0)),t(tZ()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(cZ({title:pq.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:k,emitRunESRGAN:S,emitRunFacetool:C,emitDeleteImage:_,emitRequestImages:E,emitRequestNewImages:P,emitCancelProcessing:L,emitRequestSystemConfig:O,emitSearchForModels:M,emitAddNewModel:T,emitDeleteModel:A,emitRequestModelChange:I,emitSaveStagingAreaImageToGallery:R,emitRequestEmptyTempFolder:N}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n(VY(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(lZ());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=K1(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n(VY(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n(VY(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(NU(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:e=>{t.emit("searchForModels",e)},emitAddNewModel:e=>{t.emit("addNewModel",e)},emitDeleteModel:e=>{t.emit("deleteModel",e)},emitRequestModelChange:e=>{n(iZ()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("foundModels",(e=>{v(e)})),t.on("newModelAdded",(e=>{y(e)})),t.on("modelDeleted",(e=>{b(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{x(e)})),t.on("tempFolderEmptied",(()=>{w()})),n=!0),o.type){case"socketio/generateImage":k(o.payload);break;case"socketio/runESRGAN":S(o.payload);break;case"socketio/runFacetool":C(o.payload);break;case"socketio/deleteImage":_(o.payload);break;case"socketio/requestImages":E(o.payload);break;case"socketio/requestNewImages":P(o.payload);break;case"socketio/cancelProcessing":L();break;case"socketio/requestSystemConfig":O();break;case"socketio/searchForModels":M(o.payload);break;case"socketio/addNewModel":T(o.payload);break;case"socketio/deleteModel":A(o.payload);break;case"socketio/requestModelChange":I(o.payload);break;case"socketio/saveStagingAreaImageToGallery":R(o.payload);break;case"socketio/requestEmptyTempFolder":N()}r(o)}},J1=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),e2=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((e=>`system.${e}`)),t2=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),n2=nV({options:OU,gallery:KU,system:gZ,canvas:VX}),r2=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||QV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=o$(h,["_persist"]);if(d.type===VV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=XV(e)),f)return n$({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)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 d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),n$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===$V)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:jV).concat(e.key);return t.removeItem(n,e$)}(e)),n$({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),n$({},t(p,d),{_persist:f});if(d.type===WV)l=!0;else if(d.type===HV){if(s)return n$({},p,{_persist:n$({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),y=d.payload,b=n$({},!1!==r&&void 0!==y?r(y,u,v,e):v,{_persist:n$({},f,{rehydrated:!0})});return c(b)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(n$({},x,{_persist:f}))}}(x$.getPersistConfig({key:"root",storage:y$,rootReducer:n2,blacklist:[...J1,...e2,...t2],debounce:300}),n2),o2=function(e){var t,n=OV(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=nV(i)}var p=s;"function"==typeof p&&(p=p(n));var g=oV.apply(void 0,p),m=rV;c&&(m=EV(CV({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=mV([g],f):"function"==typeof f&&(v=f(v)),tV(t,d,m.apply(void 0,v))}({reducer:r2,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Q1()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var i2={exports:{}},a2={},s2=a.exports;var l2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c2=s2.useState,u2=s2.useEffect,d2=s2.useLayoutEffect,h2=s2.useDebugValue;function f2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!l2(e,n)}catch(nue){return!0}}var p2="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=c2({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return d2((function(){o.value=n,o.getSnapshot=t,f2(o)&&i({inst:o})}),[e,n,t]),u2((function(){return f2(o)&&i({inst:o}),e((function(){f2(o)&&i({inst:o})}))}),[e]),h2(n),n};a2.useSyncExternalStore=void 0!==s2.useSyncExternalStore?s2.useSyncExternalStore:p2,function(e){e.exports=a2}(i2);var g2={exports:{}},m2={},v2=a.exports,y2=i2.exports;var b2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},x2=y2.useSyncExternalStore,w2=v2.useRef,k2=v2.useEffect,S2=v2.useMemo,C2=v2.useDebugValue;m2.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=w2(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=S2((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,b2(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var s=x2(e,i[0],i[1]);return k2((function(){a.hasValue=!0,a.value=s}),[s]),C2(s),s},function(e){e.exports=m2}(g2);let _2=function(e){e()};const E2=()=>_2,P2=a.exports.createContext(null);function L2(){return a.exports.useContext(P2)}let O2=()=>{throw new Error("uSES not initialized!")};const M2=(e,t)=>e===t;function T2(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(e,n=M2){const{store:r,subscription:o,getServerState:i}=t(),s=O2(o.addNestedSub,r.getState,i||r.getState,e,n);return a.exports.useDebugValue(s),s}}const A2=T2();var I2,R2={},N2=Symbol.for("react.element"),D2=Symbol.for("react.portal"),z2=Symbol.for("react.fragment"),B2=Symbol.for("react.strict_mode"),j2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),H2=Symbol.for("react.context"),W2=Symbol.for("react.server_context"),V2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),G2=Symbol.for("react.memo"),q2=Symbol.for("react.lazy"),Y2=Symbol.for("react.offscreen");function Z2(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N2:switch(e=e.type){case z2:case j2:case B2:case $2:case U2:return e;default:switch(e=e&&e.$$typeof){case W2:case H2:case V2:case q2:case G2:case F2:return e;default:return t}}case D2:return t}}}I2=Symbol.for("react.module.reference"),R2.ContextConsumer=H2,R2.ContextProvider=F2,R2.Element=N2,R2.ForwardRef=V2,R2.Fragment=z2,R2.Lazy=q2,R2.Memo=G2,R2.Portal=D2,R2.Profiler=j2,R2.StrictMode=B2,R2.Suspense=$2,R2.SuspenseList=U2,R2.isAsyncMode=function(){return!1},R2.isConcurrentMode=function(){return!1},R2.isContextConsumer=function(e){return Z2(e)===H2},R2.isContextProvider=function(e){return Z2(e)===F2},R2.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N2},R2.isForwardRef=function(e){return Z2(e)===V2},R2.isFragment=function(e){return Z2(e)===z2},R2.isLazy=function(e){return Z2(e)===q2},R2.isMemo=function(e){return Z2(e)===G2},R2.isPortal=function(e){return Z2(e)===D2},R2.isProfiler=function(e){return Z2(e)===j2},R2.isStrictMode=function(e){return Z2(e)===B2},R2.isSuspense=function(e){return Z2(e)===$2},R2.isSuspenseList=function(e){return Z2(e)===U2},R2.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===z2||e===j2||e===B2||e===$2||e===U2||e===Y2||"object"==typeof e&&null!==e&&(e.$$typeof===q2||e.$$typeof===G2||e.$$typeof===F2||e.$$typeof===H2||e.$$typeof===V2||e.$$typeof===I2||void 0!==e.getModuleId)},R2.typeOf=Z2,function(e){e.exports=R2}({exports:{}});const X2={notify(){},get:()=>[]};function K2(e,t){let n,r=X2;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=E2();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=X2)},getListeners:()=>r};return a}const Q2=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?a.exports.useLayoutEffect:a.exports.useEffect;function J2({store:e,context:t,children:n,serverState:r}){const o=a.exports.useMemo((()=>{const t=K2(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=a.exports.useMemo((()=>e.getState()),[e]);Q2((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);return ld((t||P2).Provider,{value:o,children:n})}function e5(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(){const{store:e}=t();return e}}const t5=e5();function n5(e=P2){const t=e===P2?t5:e5(e);return function(){return t().dispatch}}const r5=n5();var o5;function i5(e){return i5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i5(e)}function a5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s5(e,t){for(var n=0;n{O2=e})(g2.exports.useSyncExternalStoreWithSelector),o5=$.exports.unstable_batchedUpdates,_2=o5;var f5=function(e){function t(){var e,n;a5(this,t);for(var r=arguments.length,o=new Array(r),i=0;ild(CI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:ld(hT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),m5=r5,v5=A2,y5=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),b5=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=v5(y5),o=t?Math.round(100*t/n):0;return ld(eF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};var x5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w5=H.createContext&&H.createContext(x5),k5=globalThis&&globalThis.__assign||function(){return k5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return ld(YH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:ld(zT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function S3(e){const{title:t,hotkey:n,description:r}=e;return cd("div",{className:"hotkey-modal-item",children:[cd("div",{className:"hotkey-info",children:[ld("p",{className:"hotkey-title",children:t}),r&&ld("p",{className:"hotkey-description",children:r})]}),ld("div",{className:"hotkey-key",children:n})]})}function C3({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY(),i=[{title:o("hotkeys:invoke.title"),desc:o("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys:cancel.title"),desc:o("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys:focusPrompt.title"),desc:o("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys:toggleOptions.title"),desc:o("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys:pinOptions.title"),desc:o("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys:toggleViewer.title"),desc:o("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys:toggleGallery.title"),desc:o("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys:maximizeWorkSpace.title"),desc:o("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys:changeTabs.title"),desc:o("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys:consoleToggle.title"),desc:o("hotkeys:consoleToggle.desc"),hotkey:"`"}],s=[{title:o("hotkeys:setPrompt.title"),desc:o("hotkeys:setPrompt.desc"),hotkey:"P"},{title:o("hotkeys:setSeed.title"),desc:o("hotkeys:setSeed.desc"),hotkey:"S"},{title:o("hotkeys:setParameters.title"),desc:o("hotkeys:setParameters.desc"),hotkey:"A"},{title:o("hotkeys:restoreFaces.title"),desc:o("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys:upscale.title"),desc:o("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys:showInfo.title"),desc:o("hotkeys:showInfo.desc"),hotkey:"I"},{title:o("hotkeys:sendToImageToImage.title"),desc:o("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys:deleteImage.title"),desc:o("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys:closePanels.title"),desc:o("hotkeys:closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys:previousImage.title"),desc:o("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextImage.title"),desc:o("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:toggleGalleryPin.title"),desc:o("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys:increaseGalleryThumbSize.title"),desc:o("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys:decreaseGalleryThumbSize.title"),desc:o("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],c=[{title:o("hotkeys:selectBrush.title"),desc:o("hotkeys:selectBrush.desc"),hotkey:"B"},{title:o("hotkeys:selectEraser.title"),desc:o("hotkeys:selectEraser.desc"),hotkey:"E"},{title:o("hotkeys:decreaseBrushSize.title"),desc:o("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys:increaseBrushSize.title"),desc:o("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys:decreaseBrushOpacity.title"),desc:o("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys:increaseBrushOpacity.title"),desc:o("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys:moveTool.title"),desc:o("hotkeys:moveTool.desc"),hotkey:"V"},{title:o("hotkeys:fillBoundingBox.title"),desc:o("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys:eraseBoundingBox.title"),desc:o("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys:colorPicker.title"),desc:o("hotkeys:colorPicker.desc"),hotkey:"C"},{title:o("hotkeys:toggleSnap.title"),desc:o("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys:quickToggleMove.title"),desc:o("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys:toggleLayer.title"),desc:o("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys:clearMask.title"),desc:o("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys:hideMask.title"),desc:o("hotkeys:hideMask.desc"),hotkey:"H"},{title:o("hotkeys:showHideBoundingBox.title"),desc:o("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys:mergeVisible.title"),desc:o("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys:saveToGallery.title"),desc:o("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys:copyToClipboard.title"),desc:o("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys:downloadImage.title"),desc:o("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys:undoStroke.title"),desc:o("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys:redoStroke.title"),desc:o("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys:resetView.title"),desc:o("hotkeys:resetView.desc"),hotkey:"R"},{title:o("hotkeys:previousStagingImage.title"),desc:o("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextStagingImage.title"),desc:o("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:acceptStagingImage.title"),desc:o("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=e=>{const t=[];return e.forEach(((e,n)=>{t.push(ld(S3,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),ld("div",{className:"hotkey-modal-category",children:t})};return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,children:[ld(GB,{}),cd(WB,{className:" modal hotkeys-modal",children:[ld(DB,{className:"modal-close-btn"}),ld("h1",{children:"Keyboard Shorcuts"}),ld("div",{className:"hotkeys-modal-items",children:cd(uT,{allowMultiple:!0,children:[cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:appHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(i)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:generalHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(s)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:galleryHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(l)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:unifiedCanvasHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(c)})]})]})})]})]})]})}const _3=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return cd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...o,children:[ld(eA,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...i,children:t}),ld(nH,{className:"invokeai__switch-root",...s})]})},E3=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="sm",styleClass:l,...c}=e;return cd(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&ld(eA,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),ld(YH,{label:o,...i,children:ld(rF,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?ld("option",{value:e,className:"invokeai__select-option",children:e},e):ld("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},P3=/^-?(0\.)?\.?$/,L3=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:o=!1,showStepper:i=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:b,...x}=e,[w,k]=a.exports.useState(String(u));a.exports.useEffect((()=>{w.match(P3)||u===Number(w)||k(String(u))}),[u,w]);return ld(YH,{...b,children:cd(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&ld(eA,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...m,children:t}),cd(fj,{className:"invokeai__number-input-root",value:w,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{k(e),e.match(P3)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=TU.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);k(String(t)),d(t)},width:s,...x,children:[ld(gj,{className:"invokeai__number-input-field",textAlign:l,...v}),i&&cd("div",{className:"invokeai__number-input-stepper",children:[ld(yj,{...y,className:"invokeai__number-input-stepper-button"}),ld(vj,{...y,className:"invokeai__number-input-stepper-button"})]})]})]})})},O3=e=>e.system,M3=e=>e.system.toastQueue,T3=uV((e=>e.options),(e=>P$[e.activeTab]),{memoizeOptions:{equalityCheck:TU.isEqual}});uV((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});const A3=e=>e.options,I3=uV([O3,A3],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:TU.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),R3=({children:e})=>{const t=m5(),{t:n}=FY(),r=v5((e=>e.options.steps)),{isOpen:o,onOpen:i,onClose:s}=QA(),{isOpen:l,onOpen:c,onClose:u}=QA(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:f,saveIntermediatesInterval:p,enableImageDebugging:g,shouldUseCanvasBetaLayout:m}=v5(I3);return cd(sd,{children:[a.exports.cloneElement(e,{onClick:i}),cd(RB,{isOpen:o,onClose:s,size:"lg",children:[ld(GB,{}),cd(WB,{className:"modal settings-modal",children:[ld($B,{className:"settings-modal-header",children:n("common:settingsLabel")}),ld(DB,{className:"modal-close-btn"}),cd(NB,{className:"settings-modal-content",children:[cd("div",{className:"settings-modal-items",children:[cd("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[ld(E3,{label:n("settings:displayInProgress"),validValues:FQ,value:d,onChange:e=>t(WY(e.target.value))}),"full-res"===d&&ld(L3,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:e=>{e>r&&(e=r),e<1&&(e=1),t(aZ(e))},value:p,width:"auto",textAlign:"center"})]}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:e=>t(YY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:f,onChange:e=>t(JY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:m,onChange:e=>t(PU(e.target.checked))})]}),cd("div",{className:"settings-modal-items",children:[ld("h2",{style:{fontWeight:"bold"},children:"Developer"}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:g,onChange:e=>t(sZ(e.target.checked))})]}),cd("div",{className:"settings-modal-reset",children:[ld(LI,{size:"md",children:n("settings:resetWebUI")}),ld(RT,{colorScheme:"red",onClick:()=>{p5.purge().then((()=>{s(),c()}))},children:n("settings:resetWebUI")}),ld(VI,{children:n("settings:resetWebUIDesc1")}),ld(VI,{children:n("settings:resetWebUIDesc2")})]})]}),ld(VB,{children:ld(RT,{onClick:s,className:"modal-close-btn",children:n("common:close")})})]})]}),cd(RB,{closeOnOverlayClick:!1,isOpen:l,onClose:u,isCentered:!0,children:[ld(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),ld(WB,{children:ld(NB,{pb:6,pt:6,children:ld(CI,{justifyContent:"center",children:ld(VI,{fontSize:"lg",children:ld(VI,{children:n("settings:resetComplete")})})})})})]})]})},N3=uV((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:MU.exports.isEqual}}),D3=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=v5(N3),s=m5(),{t:l}=FY();let c;c=e&&!i?"status-good":"status-bad";let u=o;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(u)&&(c="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`);return ld(YH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:ld(VI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(nZ())},className:`status ${c}`,children:l(u)})})},z3=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return cd(Aj,{...i,children:[ld(Wj,{children:t}),cd(Fj,{className:`invokeai__popover-content ${r}`,children:[o&&ld(Ij,{className:"invokeai__popover-arrow"}),n]})]})},B3=ok(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return ld(YH,{label:r,...o,children:ld(RT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function j3(){const{t:e}=FY(),{setColorMode:t,colorMode:n}=dd(),r=m5(),o=v5((e=>e.options.currentTheme)),i={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};a.exports.useEffect((()=>{n!==o&&t(o)}),[t,n,o]);return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(o3,{})}),children:ld(WI,{align:"stretch",children:(()=>{const e=[];return Object.keys(i).forEach((t=>{e.push(ld(B3,{style:{width:"6rem"},leftIcon:o===t?ld(z5,{}):void 0,size:"sm",onClick:()=>(e=>{r(j$(e))})(t),children:i[t]},t))})),e})()})})}const F3=uV([O3],(e=>{const{isProcessing:t,model_list:n}=e,r=TU.map(n,((e,t)=>t)),o=TU.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),H3=()=>{const e=m5(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=v5(F3);return ld(CI,{style:{paddingLeft:"0.3rem"},children:ld(E3,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(TQ(t.target.value))}})})};function W3(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:o="sm",width:i,size:a="sm",isInvalid:s,...l}=e;return cd(GT,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[""!==t&&ld(eA,{fontSize:o,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),ld(eI,{...l,className:"input-entry",size:a,width:i})]})}var V3=Array.isArray,$3=Object.keys,U3=Object.prototype.hasOwnProperty,G3="undefined"!=typeof Element;function q3(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,o,i=V3(e),a=V3(t);if(i&&a){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!q3(e[n],t[n]))return!1;return!0}if(i!=a)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!=u)return!1;if(c&&u)return e.toString()==t.toString();var d=$3(e);if((r=d.length)!==$3(t).length)return!1;for(n=r;0!=n--;)if(!U3.call(t,d[n]))return!1;if(G3&&e instanceof Element&&t instanceof Element)return e===t;for(n=r;0!=n--;)if(!("_owner"===(o=d[n])&&e.$$typeof||q3(e[o],t[o])))return!1;return!0}return e!=e&&t!=t}var Y3=function(e,t){try{return q3(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}},Z3=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===X3}(e)}(e)};var X3="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K3(e,t){return!1!==t.clone&&t.isMergeableObject(e)?J3((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Q3(e,t,n){return e.concat(t).map((function(e){return K3(e,n)}))}function J3(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Q3,n.isMergeableObject=n.isMergeableObject||Z3;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=K3(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=J3(e[o],t[o],n):r[o]=K3(t[o],n)})),r}(e,t,n):K3(t,n)}J3.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return J3(e,n,t)}),{})};var e4=J3;const t4="object"==typeof global&&global&&global.Object===Object&&global;var n4="object"==typeof self&&self&&self.Object===Object&&self;const r4=t4||n4||Function("return this")();const o4=r4.Symbol;var i4=Object.prototype,a4=i4.hasOwnProperty,s4=i4.toString,l4=o4?o4.toStringTag:void 0;var c4=Object.prototype.toString;var u4=o4?o4.toStringTag:void 0;function d4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u4&&u4 in Object(e)?function(e){var t=a4.call(e,l4),n=e[l4];try{e[l4]=void 0;var r=!0}catch(B2){}var o=s4.call(e);return r&&(t?e[l4]=n:delete e[l4]),o}(e):function(e){return c4.call(e)}(e)}function h4(e,t){return function(n){return e(t(n))}}const f4=h4(Object.getPrototypeOf,Object);function p4(e){return null!=e&&"object"==typeof e}var g4=Function.prototype,m4=Object.prototype,v4=g4.toString,y4=m4.hasOwnProperty,b4=v4.call(Object);function x4(e){if(!p4(e)||"[object Object]"!=d4(e))return!1;var t=f4(e);if(null===t)return!0;var n=y4.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&v4.call(n)==b4}function w4(e,t){return e===t||e!=e&&t!=t}function k4(e,t){for(var n=e.length;n--;)if(w4(e[n][0],t))return n;return-1}var S4=Array.prototype.splice;function C4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},C4.prototype.set=function(e,t){var n=this.__data__,r=k4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function E4(e){if(!_4(e))return!1;var t=d4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}const P4=r4["__core-js_shared__"];var L4,O4=(L4=/[^.]+$/.exec(P4&&P4.keys&&P4.keys.IE_PROTO||""))?"Symbol(src)_1."+L4:"";var M4=Function.prototype.toString;function T4(e){if(null!=e){try{return M4.call(e)}catch(B2){}try{return e+""}catch(B2){}}return""}var A4=/^\[object .+?Constructor\]$/,I4=Function.prototype,R4=Object.prototype,N4=I4.toString,D4=R4.hasOwnProperty,z4=RegExp("^"+N4.call(D4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B4(e){return!(!_4(e)||(t=e,O4&&O4 in t))&&(E4(e)?z4:A4).test(T4(e));var t}function j4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B4(n)?n:void 0}const F4=j4(r4,"Map");const H4=j4(Object,"create");var W4=Object.prototype.hasOwnProperty;var V4=Object.prototype.hasOwnProperty;function $4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var f6={};function p6(e){return function(t){return e(t)}}f6["[object Float32Array]"]=f6["[object Float64Array]"]=f6["[object Int8Array]"]=f6["[object Int16Array]"]=f6["[object Int32Array]"]=f6["[object Uint8Array]"]=f6["[object Uint8ClampedArray]"]=f6["[object Uint16Array]"]=f6["[object Uint32Array]"]=!0,f6["[object Arguments]"]=f6["[object Array]"]=f6["[object ArrayBuffer]"]=f6["[object Boolean]"]=f6["[object DataView]"]=f6["[object Date]"]=f6["[object Error]"]=f6["[object Function]"]=f6["[object Map]"]=f6["[object Number]"]=f6["[object Object]"]=f6["[object RegExp]"]=f6["[object Set]"]=f6["[object String]"]=f6["[object WeakMap]"]=!1;var g6="object"==typeof t&&t&&!t.nodeType&&t,m6=g6&&"object"==typeof n&&n&&!n.nodeType&&n,v6=m6&&m6.exports===g6&&t4.process,y6=function(){try{var e=m6&&m6.require&&m6.require("util").types;return e||v6&&v6.binding&&v6.binding("util")}catch(B2){}}();const b6=y6;var x6=b6&&b6.isTypedArray,w6=x6?p6(x6):function(e){return p4(e)&&h6(e.length)&&!!f6[d4(e)]};const k6=w6;var S6=Object.prototype.hasOwnProperty;function C6(e,t){var n=i6(e),r=!n&&o6(e),o=!n&&!r&&c6(e),i=!n&&!r&&!o&&k6(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function q7(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Y7=function(e){return Array.isArray(e)&&0===e.length},Z7=function(e){return"function"==typeof e},X7=function(e){return null!==e&&"object"==typeof e},K7=function(e){return String(Math.floor(Number(e)))===e},Q7=function(e){return"[object String]"===Object.prototype.toString.call(e)},J7=function(e){return 0===a.exports.Children.count(e)},e9=function(e){return X7(e)&&Z7(e.then)};function t9(e,t,n,r){void 0===r&&(r=0);for(var o=V7(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function r9(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;t9(t,a.path)||(t=n9(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),_=a.exports.useCallback((function(e,t){return new Promise((function(n){return n(b.current[e].validate(t))}))}),[]),E=a.exports.useCallback((function(e){var t=Object.keys(b.current).filter((function(e){return Z7(b.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,t9(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=n9(e,t[r],n)),e}),{})}))}),[_]),P=a.exports.useCallback((function(e){return Promise.all([E(e),f.validationSchema?C(e):{},f.validate?S(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return e4.all([t,n,r],{arrayMerge:f9})}))}),[f.validate,f.validationSchema,E,S,C]),L=g9((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return y.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));a.exports.useEffect((function(){s&&!0===y.current&&Y3(p.current,f.initialValues)&&L(p.current)}),[s,L]);var O=a.exports.useCallback((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:g.current?g.current:f.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:f.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:f.initialStatus;p.current=t,g.current=n,m.current=r,v.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);e9(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);a.exports.useEffect((function(){!0!==y.current||Y3(p.current,f.initialValues)||(u&&(p.current=f.initialValues,O()),s&&L(p.current))}),[u,f.initialValues,O,s,L]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(g.current,f.initialErrors)&&(g.current=f.initialErrors||l9,k({type:"SET_ERRORS",payload:f.initialErrors||l9}))}),[u,f.initialErrors]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(m.current,f.initialTouched)&&(m.current=f.initialTouched||c9,k({type:"SET_TOUCHED",payload:f.initialTouched||c9}))}),[u,f.initialTouched]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(v.current,f.initialStatus)&&(v.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var M=g9((function(e){if(b.current[e]&&Z7(b.current[e].validate)){var t=t9(w.values,e),n=b.current[e].validate(t);return e9(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),C(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),T=a.exports.useCallback((function(e,t){var n=t.validate;b.current[e]={validate:n}}),[]),A=a.exports.useCallback((function(e){delete b.current[e]}),[]),I=g9((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?L(w.values):Promise.resolve()})),R=a.exports.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),N=g9((function(e,t){var r=Z7(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?L(r):Promise.resolve()})),D=a.exports.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),z=g9((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?L(n9(w.values,e,t)):Promise.resolve()})),B=a.exports.useCallback((function(e,t){var n,r=t,o=e;if(!Q7(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,c=i.value,u=i.checked,d=(i.outerHTML,i.options),h=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(t9(w.values,r),u,c):d&&h?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):c}r&&z(r,o)}),[z,w.values]),j=g9((function(e){if(Q7(e))return function(t){return B(t,e)};B(e)})),F=g9((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?L(w.values):Promise.resolve()})),H=a.exports.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));F(i,!0)}),[F]),W=g9((function(e){if(Q7(e))return function(t){return H(t,e)};H(e)})),V=a.exports.useCallback((function(e){Z7(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),$=a.exports.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=a.exports.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=g9((function(){return k({type:"SUBMIT_ATTEMPT"}),L().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return y.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(y.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(y.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:O,validateForm:L,validateField:M,setErrors:R,setFieldError:D,setFieldTouched:F,setFieldValue:z,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,setFormikState:V,submitForm:G},Z=g9((function(){return d(w.values,Y)})),X=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),O()})),K=a.exports.useCallback((function(e){return{value:t9(w.values,e),error:t9(w.errors,e),touched:!!t9(w.touched,e),initialValue:t9(p.current,e),initialTouched:!!t9(m.current,e),initialError:t9(g.current,e)}}),[w.errors,w.touched,w.values]),Q=a.exports.useCallback((function(e){return{setValue:function(t,n){return z(e,t,n)},setTouched:function(t,n){return F(e,t,n)},setError:function(t){return D(e,t)}}}),[z,F,D]),J=a.exports.useCallback((function(e){var t=X7(e),n=t?e.name:e,r=t9(w.values,n),o={name:n,value:r,onChange:j,onBlur:W};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[W,j,w.values]),ee=a.exports.useMemo((function(){return!Y3(p.current,w.values)}),[p.current,w.values]),te=a.exports.useMemo((function(){return void 0!==l?ee?w.errors&&0===Object.keys(w.errors).length:!1!==l&&Z7(l)?l(f):l:w.errors&&0===Object.keys(w.errors).length}),[l,ee,w.errors,f]);return U7({},w,{initialValues:p.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:W,handleChange:j,handleReset:X,handleSubmit:q,resetForm:O,setErrors:R,setFormikState:V,setFieldTouched:F,setFieldValue:z,setFieldError:D,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,submitForm:G,validateForm:L,validateField:M,isValid:te,dirty:ee,unregisterField:A,registerField:T,getFieldProps:J,getFieldMeta:K,getFieldHelpers:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:s})}function d9(e){var t=u9(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return a.exports.useImperativeHandle(i,(function(){return t})),a.exports.createElement(i9,{value:t},n?a.exports.createElement(n,t):o?o(t):r?Z7(r)?r(t):J7(r)?null:a.exports.Children.only(r):null)}function h9(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||x4(e)?h9(e):""!==e?e:void 0})):x4(e[r])?t[r]=h9(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function f9(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?e4(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=e4(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var p9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.exports.useLayoutEffect:a.exports.useEffect;function g9(e){var t=a.exports.useRef(e);return p9((function(){t.current=e})),a.exports.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(U7({},e,{length:t+1}))}return[]},b9=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=n9(n.values,i,e(t9(n.values,i))),l=r?o(t9(n.errors,i)):void 0,c=t?a(t9(n.touched,i)):void 0;return Y7(l)&&(l=void 0),Y7(c)&&(c=void 0),U7({},n,{values:s,errors:r?n9(n.errors,i,l):n.errors,touched:t?n9(n.touched,i,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(y9(t),[$7(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return v9(n,e,t)}),(function(t){return v9(t,e,null)}),(function(t){return v9(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(q7(n)),n.pop=n.pop.bind(q7(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Y3(t9(e.formik.values,e.name),t9(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?y9(n):[];return t||(t=r[e]),Z7(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,s=U7({},e,{form:G7(t.formik,["validate","validationSchema"]),name:i});return n?a.exports.createElement(n,s):r?r(s):o?"function"==typeof o?o(s):J7(o)?null:a.exports.Children.only(o):null},r}(a.exports.Component);b9.defaultProps={validateOnChange:!0};const x9=uV([O3],(e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function w9(){const{openModel:e,model_list:t}=v5(x9),n=v5((e=>e.system.isProcessing)),r=m5(),{t:o}=FY(),[i,s]=a.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});a.exports.useEffect((()=>{if(e){const n=TU.pickBy(t,((t,n)=>TU.isEqual(n,e)));s({name:e,description:n[e]?.description,config:n[e]?.config,weights:n[e]?.weights,vae:n[e]?.vae,width:n[e]?.width,height:n[e]?.height,default:n[e]?.default})}}),[t,e]);return e?cd(CI,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[ld(CI,{alignItems:"center",children:ld(VI,{fontSize:"lg",fontWeight:"bold",children:e})}),ld(CI,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:ld(d9,{enableReinitialize:!0,initialValues:i,onSubmit:e=>{r(OQ(e))},children:({handleSubmit:e,errors:t,touched:r})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",alignItems:"start",children:[cd(GT,{isInvalid:!!t.description&&r.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"lg"}),t.description&&r.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&r.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"lg"}),t.config&&r.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&r.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"lg"}),t.weights&&r.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&r.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"lg"}),t.vae&&r.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&r.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&r.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&r.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&r.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelmanager:updateModel")})]})})})})]}):ld(CI,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:ld(VI,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const k9=e=>{const{label:t,styleClass:n,...r}=e;return ld(TA,{className:`invokeai__checkbox ${n}`,...r,children:t})};function S9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function C9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function _9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function E9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function P9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function L9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function O9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function M9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function T9(e){return _5({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 A9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function I9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function R9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function N9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const D9=uV([O3],(e=>{const{model_list:t}=e,n=[];return TU.forEach(t,(e=>{n.push(e.weights)})),n}));function z9(){const{t:e}=FY();return ld(mI,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function B9({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=v5(D9);return cd(mI,{position:"relative",children:[r.includes(e.location)?ld(z9,{}):null,ld(k9,{value:e.name,label:ld(sd,{children:cd(WI,{alignItems:"start",children:[ld("p",{style:{fontWeight:"bold"},children:e.name}),ld("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:e=>{t.includes(e.target.value)?n(TU.remove(t,(t=>t!==e.target.value))):n([...t,e.target.value])},padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function j9(){const e=m5(),{t:t}=FY(),n=v5((e=>e.system.searchFolder)),r=v5((e=>e.system.foundModels)),o=v5(D9),i=v5((e=>e.options.shouldShowExistingModelsInSearch)),a=v5((e=>e.system.isProcessing)),[s,l]=H.useState([]);return cd(sd,{children:[n?cd(CI,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),ld(k3,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:ld(T9,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(LQ(n))}),ld(k3,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:ld(a3,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:()=>{e(hZ(null)),e(fZ(null)),l([])}})]}):ld(d9,{initialValues:{checkpointFolder:""},onSubmit:t=>{(t=>{e(LQ(t.checkpointFolder))})(t)},children:({handleSubmit:e})=>ld("form",{onSubmit:e,children:cd(HI,{columnGap:"0.5rem",children:[ld(GT,{isRequired:!0,width:"max-content",children:ld(m9,{as:W3,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),ld(k3,{icon:ld(S9,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&cd(CI,{flexDirection:"column",rowGap:"1rem",children:[cd(CI,{justifyContent:"space-between",alignItems:"center",children:[cd("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),cd("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),cd(CI,{columnGap:"0.5rem",justifyContent:"space-between",children:[cd(CI,{columnGap:"0.5rem",children:[ld(B3,{isDisabled:s.length===r.length,onClick:()=>{l([]),r&&r.forEach((e=>{o.includes(e.location)||l((t=>[...t,e.name]))}))},children:t("modelmanager:selectAll")}),ld(B3,{isDisabled:0===s.length,onClick:()=>{l([])},children:t("modelmanager:deselectAll")}),ld(k9,{label:t("modelmanager:showExisting"),isChecked:i,onChange:()=>e(LU(!i))})]}),ld(B3,{isDisabled:0===s.length,onClick:()=>{const t=r?.filter((e=>s.includes(e.name)));t?.forEach((t=>{const n={name:t.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:t.location,vae:"",width:512,height:512,default:!1};e(OQ(n))})),l([])},backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),cd(CI,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?0===s.length&&ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),(()=>{const e=[],t=[];return r&&r.forEach(((n,r)=>{o.includes(n.location)?t.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r)):e.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r))})),cd(sd,{children:[e,i&&t]})})()]})]})]})}function F9(){const{isOpen:e,onOpen:t,onClose:n}=QA(),r=m5(),{t:o}=FY(),i=v5((e=>e.system.isProcessing));function a(e){let t;return function(e){return/\\s/g.test(e)}(e)&&(t=o("modelmanager:cannotUseSpaces")),t}const[s,l]=H.useState(!1);return cd(sd,{children:[ld(B3,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:cd(CI,{columnGap:"0.5rem",alignItems:"center",children:[ld(a3,{}),o("modelmanager:addNew")]})}),cd(RB,{isOpen:e,onClose:()=>{n()},size:"3xl",closeOnOverlayClick:!1,children:[ld(GB,{}),cd(WB,{className:"modal add-model-modal",children:[ld($B,{children:o("modelmanager:addNewModel")}),ld(DB,{}),cd(NB,{className:"add-model-modal-body",children:[ld(j9,{}),ld(k9,{label:o("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&ld(d9,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},onSubmit:e=>{r(OQ(e)),n()},children:({handleSubmit:e,errors:t,touched:n})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",children:[ld(VI,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:o("modelmanager:manual")}),cd(GT,{isInvalid:!!t.name&&n.name,isRequired:!0,children:[ld(eA,{htmlFor:"name",fontSize:"sm",children:o("modelmanager:name")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"name",name:"name",type:"text",validate:a,width:"2xl"}),t.name&&n.name?ld(QT,{children:t.name}):ld(qT,{margin:0,children:o("modelmanager:nameValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.description&&n.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"2xl"}),t.description&&n.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&n.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"2xl"}),t.config&&n.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&n.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"2xl"}),t.weights&&n.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&n.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"2xl"}),t.vae&&n.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&n.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&n.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&n.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&n.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:i,children:o("modelmanager:addModel")})]})})})]})]})]})]})}Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"SunIcon",path:cd("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[ld("circle",{cx:"12",cy:"12",r:"5"}),ld("path",{d:"M12 1v2"}),ld("path",{d:"M12 21v2"}),ld("path",{d:"M4.22 4.22l1.42 1.42"}),ld("path",{d:"M18.36 18.36l1.42 1.42"}),ld("path",{d:"M1 12h2"}),ld("path",{d:"M21 12h2"}),ld("path",{d:"M4.22 19.78l1.42-1.42"}),ld("path",{d:"M18.36 5.64l1.42-1.42"})]})}),Sk({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"}),Sk({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"ViewIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("circle",{cx:"12",cy:"12",r:"2"})]})}),Sk({displayName:"ViewOffIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"});var H9=Sk({displayName:"DeleteIcon",path:ld("g",{fill:"currentColor",children:ld("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"})})});Sk({displayName:"RepeatIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"RepeatClockIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})});var W9=Sk({displayName:"EditIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ld("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});Sk({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),Sk({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),Sk({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),Sk({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Sk({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),Sk({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),Sk({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),Sk({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"}),Sk({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var V9=Sk({displayName:"ExternalLinkIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ld("path",{d:"M15 3h6v6"}),ld("path",{d:"M10 14L21 3"})]})});Sk({displayName:"LinkIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"PlusSquareIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),ld("path",{d:"M12 8v8"}),ld("path",{d:"M8 12h8"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"TimeIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowRightIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowLeftIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"EmailIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"SpinnerIcon",path:cd(sd,{children:[ld("defs",{children:cd("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[ld("stop",{stopColor:"currentColor",offset:"0%"}),ld("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),cd("g",{transform:"translate(2)",fill:"none",children:[ld("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),ld("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),ld("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),Sk({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"}),Sk({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"InfoOutlineIcon",path:cd("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[ld("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),ld("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),ld("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"QuestionOutlineIcon",path:cd("g",{stroke:"currentColor",strokeWidth:"1.5",children:[ld("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"}),ld("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),ld("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),Sk({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"}),Sk({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"}),Sk({viewBox:"0 0 14 14",path:ld("g",{fill:"currentColor",children:ld("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Sk({displayName:"MinusIcon",path:ld("g",{fill:"currentColor",children:ld("rect",{height:"4",width:"20",x:"2",y:"10"})})}),Sk({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"});const $9=ok(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:i,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=QA(),f=a.exports.useRef(null);return cd(sd,{children:[a.exports.cloneElement(c,{onClick:d,ref:t}),ld(qB,{isOpen:u,leastDestructiveRef:f,onClose:h,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:l}),ld(NB,{children:s}),cd(VB,{children:[ld(RT,{ref:f,onClick:()=>{i&&i(),h()},className:"modal-close-btn",children:o}),ld(RT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})}));function U9(e){const{isProcessing:t,isConnected:n}=v5((e=>e.system)),r=v5((e=>e.system.openModel)),{t:o}=FY(),i=m5(),{name:a,status:s,description:l}=e,c=()=>{i(pZ(a))};return cd(CI,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[ld(mI,{onClick:c,cursor:"pointer",children:ld(YH,{label:l,hasArrow:!0,placement:"bottom",children:ld(VI,{fontWeight:"bold",children:a})})}),ld(zI,{onClick:c,cursor:"pointer"}),cd(CI,{gap:2,alignItems:"center",children:[ld(VI,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),ld(RT,{size:"sm",onClick:()=>{i(TQ(a))},isDisabled:"active"===s||t||!n,className:"modal-close-btn",children:o("modelmanager:load")}),ld(k3,{icon:ld(W9,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===s||t||!n,className:" modal-close-btn"}),ld($9,{title:o("modelmanager:deleteModel"),acceptCallback:()=>{i(MQ(a)),i(pZ(null))},acceptButtonText:o("modelmanager:delete"),triggerComponent:ld(k3,{icon:ld(H9,{}),size:"sm","aria-label":o("modelmanager:deleteConfig"),isDisabled:"active"===s||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:cd(CI,{rowGap:"1rem",flexDirection:"column",children:[ld("p",{style:{fontWeight:"bold"},children:o("modelmanager:deleteMsg1")}),ld("p",{style:{color:"var(--text-color-secondary"},children:o("modelmanager:deleteMsg2")})]})})]})]})}const G9=uV((e=>e.system),(e=>{const t=TU.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),q9=()=>{const{models:e}=v5(G9),[t,n]=a.exports.useState(""),{t:r}=FY(),o=TU.debounce((e=>{n(e.target.value)}),400);return cd(CI,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[cd(CI,{justifyContent:"space-between",children:[ld(VI,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),ld(F9,{})]}),ld(W3,{onChange:o,label:r("modelmanager:search")}),ld(CI,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:(()=>{const n=[],r=[];return e.forEach(((e,o)=>{e.name.startsWith(t)&&r.push(ld(U9,{name:e.name,status:e.status,description:e.description},o)),n.push(ld(U9,{name:e.name,status:e.status,description:e.description},o))})),""!==t?r:n})()})]})};function Y9({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY();return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,size:"6xl",children:[ld(GB,{}),cd(WB,{className:" modal",children:[ld(DB,{className:"modal-close-btn"}),ld($B,{children:o("modelmanager:modelManager")}),cd(CI,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[ld(q9,{}),ld(w9,{})]})]})]})]})}function Z9(){const{t:e,i18n:t}=FY(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")};return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:ld(J5,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:ld(WI,{children:(()=>{const e=[];return Object.keys(n).forEach((r=>{e.push(ld(B3,{"data-selected":localStorage.getItem("i18nextLng")===r,onClick:()=>t.changeLanguage(r),className:"modal-close-btn lang-select-btn","aria-label":n[r],tooltip:n[r],size:"sm",minWidth:"200px",children:n[r]},r))})),e})()})})}const X9=()=>{const{t:e}=FY();return cd("div",{className:"site-header",children:[cd("div",{className:"site-header-left-side",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),cd("div",{className:"site-header-right-side",children:[ld(D3,{}),ld(H3,{}),ld(Y9,{children:ld(k3,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(H5,{})})}),ld(C3,{children:ld(k3,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(Q5,{})})}),ld(j3,{}),ld(Z9,{}),ld(k3,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:ld(D5,{})})}),ld(k3,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:ld(L5,{})})}),ld(k3,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:ld(P5,{})})}),ld(R3,{children:ld(k3,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:ld(_9,{})})})]})]})};var K9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q9=globalThis&&globalThis.__assign||function(){return Q9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n()=>(t||e((t={exports:{}}).exports,t),t.exports),C8=(e,t,n)=>(n=null!=e?v8(w8(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of x8(t))!k8.call(e,o)&&o!==n&&y8(e,o,{get:()=>t[o],enumerable:!(r=b8(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:y8(n,"default",{value:e,enumerable:!0}),e)),_8=S8(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),E8=S8(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),P8=S8(((e,t)=>{var n=E8();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),L8=S8(((e,t)=>{var n=P8(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),O8=S8(((e,t)=>{var n=P8();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),M8=S8(((e,t)=>{var n=P8();t.exports=function(e){return n(this.__data__,e)>-1}})),T8=S8(((e,t)=>{var n=P8();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),A8=S8(((e,t)=>{var n=_8(),r=L8(),o=O8(),i=M8(),a=T8();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8();t.exports=function(){this.__data__=new n,this.size=0}})),R8=S8(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),N8=S8(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),D8=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),z8=S8(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),B8=S8(((e,t)=>{var n=z8(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),j8=S8(((e,t)=>{var n=B8().Symbol;t.exports=n})),F8=S8(((e,t)=>{var n=j8(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),H8=S8(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),W8=S8(((e,t)=>{var n=j8(),r=F8(),o=H8(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),V8=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),$8=S8(((e,t)=>{var n=W8(),r=V8();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),U8=S8(((e,t)=>{var n=B8()["__core-js_shared__"];t.exports=n})),G8=S8(((e,t)=>{var n=U8(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),q8=S8(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),Y8=S8(((e,t)=>{var n=$8(),r=G8(),o=V8(),i=q8(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),Z8=S8(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),X8=S8(((e,t)=>{var n=Y8(),r=Z8();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),K8=S8(((e,t)=>{var n=X8()(B8(),"Map");t.exports=n})),Q8=S8(((e,t)=>{var n=X8()(Object,"create");t.exports=n})),J8=S8(((e,t)=>{var n=Q8();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),eee=S8(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),tee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),nee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),ree=S8(((e,t)=>{var n=Q8();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),oee=S8(((e,t)=>{var n=J8(),r=eee(),o=tee(),i=nee(),a=ree();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=oee(),r=A8(),o=K8();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),aee=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),see=S8(((e,t)=>{var n=aee();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),lee=S8(((e,t)=>{var n=see();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),cee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).get(e)}})),uee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).has(e)}})),dee=S8(((e,t)=>{var n=see();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),hee=S8(((e,t)=>{var n=iee(),r=lee(),o=cee(),i=uee(),a=dee();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8(),r=K8(),o=hee();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),pee=S8(((e,t)=>{var n=A8(),r=I8(),o=R8(),i=N8(),a=D8(),s=fee();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),gee=S8(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),mee=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),vee=S8(((e,t)=>{var n=hee(),r=gee(),o=mee();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),xee=S8(((e,t)=>{var n=vee(),r=yee(),o=bee();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=B8().Uint8Array;t.exports=n})),kee=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),See=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),Cee=S8(((e,t)=>{var n=j8(),r=wee(),o=E8(),i=xee(),a=kee(),s=See(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),_ee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),Pee=S8(((e,t)=>{var n=_ee(),r=Eee();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),Lee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),Mee=S8(((e,t)=>{var n=Lee(),r=Oee(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),Tee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),Iee=S8(((e,t)=>{var n=W8(),r=Aee();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),Ree=S8(((e,t)=>{var n=Iee(),r=Aee(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),Nee=S8(((e,t)=>{t.exports=function(){return!1}})),Dee=S8(((e,t)=>{var n=B8(),r=Nee(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),zee=S8(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),jee=S8(((e,t)=>{var n=W8(),r=Bee(),o=Aee(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),Fee=S8(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Hee=S8(((e,t)=>{var n=z8(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),Wee=S8(((e,t)=>{var n=jee(),r=Fee(),o=Hee(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Vee=S8(((e,t)=>{var n=Tee(),r=Ree(),o=Eee(),i=Dee(),a=zee(),s=Wee(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),$ee=S8(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),Uee=S8(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),Gee=S8(((e,t)=>{var n=Uee()(Object.keys,Object);t.exports=n})),qee=S8(((e,t)=>{var n=$ee(),r=Gee(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),Yee=S8(((e,t)=>{var n=$8(),r=Bee();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),Zee=S8(((e,t)=>{var n=Vee(),r=qee(),o=Yee();t.exports=function(e){return o(e)?n(e):r(e)}})),Xee=S8(((e,t)=>{var n=Pee(),r=Mee(),o=Zee();t.exports=function(e){return n(e,o,r)}})),Kee=S8(((e,t)=>{var n=Xee(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=X8()(B8(),"DataView");t.exports=n})),Jee=S8(((e,t)=>{var n=X8()(B8(),"Promise");t.exports=n})),ete=S8(((e,t)=>{var n=X8()(B8(),"Set");t.exports=n})),tte=S8(((e,t)=>{var n=X8()(B8(),"WeakMap");t.exports=n})),nte=S8(((e,t)=>{var n=Qee(),r=K8(),o=Jee(),i=ete(),a=tte(),s=W8(),l=q8(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),y=l(a),b=s;(n&&b(new n(new ArrayBuffer(1)))!=f||r&&b(new r)!=c||o&&b(o.resolve())!=u||i&&b(new i)!=d||a&&b(new a)!=h)&&(b=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case y:return h}return t}),t.exports=b})),rte=S8(((e,t)=>{var n=pee(),r=xee(),o=Cee(),i=Kee(),a=nte(),s=Eee(),l=Dee(),c=Wee(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var y=s(e),b=s(t),x=y?d:a(e),w=b?d:a(t),k=(x=x==u?h:x)==h,S=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;y=!0,k=!1}if(C&&!k)return v||(v=new n),y||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=k&&f.call(e,"__wrapped__"),E=S&&f.call(t,"__wrapped__");if(_||E){var P=_?e.value():e,L=E?t.value():t;return v||(v=new n),m(P,L,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),ote=S8(((e,t)=>{var n=rte(),r=Aee();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),ite=S8(((e,t)=>{var n=ote();t.exports=function(e,t){return n(e,t)}})),ate=["ctrl","shift","alt","meta","mod"],ste={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function lte(e,t=","){return"string"==typeof e?e.split(t):e}function cte(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>ste[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!ate.includes(e)));return{...r,keys:o}}function ute({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var dte=a.exports.createContext(void 0),hte=a.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),fte=C8(ite());var pte=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function gte(e,t,n,r){let o=a.exports.useRef(null),{current:i}=a.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=a.exports.useCallback(t,[...l]),u=function(e){let t=a.exports.useRef(void 0);return(0,fte.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=a.exports.useContext(hte),h=a.exports.useContext(dte);return a.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return ute(e,["input","textarea","select"])}(t)||ute(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void pte(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||lte(e,u?.splitKey).forEach((e=>{let n=cte(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,i)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void pte(t);c(t,n)}}))}},n=e=>{i.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.addHotkey(cte(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.removeHotkey(cte(e,u?.combinationKey))))}}),[e,c,u,d]),o}C8(ite());var mte=new Set;window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>mte.add(cte(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=cte(e);for(let n of mte)n.keys?.every((e=>t.keys?.includes(e)))&&mte.delete(n)}))}(e.key)}))}));const vte=uV((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),yte=uV((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),bte=()=>{const e=m5(),t=v5(vte),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=v5(yte),[i,s]=a.exports.useState(!0),l=a.exports.useRef(null);a.exports.useLayoutEffect((()=>{null!==l.current&&i&&(l.current.scrollTop=l.current.scrollHeight)}),[i,t,n]);gte("`",(()=>{e(UY(!n))}),[n]),gte("esc",(()=>{e(UY(!1))}));return cd(sd,{children:[n&&ld(m8,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:ld("div",{className:"console",ref:l,onScroll:()=>{l.current&&i&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return cd("div",{className:`console-entry console-${o}-color`,children:[cd("p",{className:"console-timestamp",children:[n,":"]}),ld("p",{className:"console-message",children:r})]},t)}))})}),n&&ld(YH,{hasArrow:!0,label:i?"Autoscroll On":"Autoscroll Off",children:ld(zT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":i,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:ld(O5,{}),onClick:()=>s(!i)})}),ld(YH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:ld(zT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:ld(n?n3:B5,{}),onClick:()=>{e(nZ()),e(UY(!n))}})})]})};function xte(){const{t:e}=FY();return cd("div",{className:"work-in-progress nodes-work-in-progress",children:[ld("h1",{children:e("common:nodes")}),ld("p",{children:e("common:nodesDesc")})]})}const wte=()=>{const{t:e}=FY();return cd("div",{className:"work-in-progress post-processing-work-in-progress",children:[ld("h1",{children:e("common:postProcessing")}),ld("p",{children:e("common:postProcessDesc1")}),ld("p",{children:e("common:postProcessDesc2")}),ld("p",{children:e("common:postProcessDesc3")})]})},kte=Sk({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:ld("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"})})}),Ste=Sk({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),Cte=Sk({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),_te=Sk({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:ld("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 Ete=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Ete||{});const Pte=e=>{const t=(()=>{const{t:e}=FY();return a.exports.useMemo((()=>({0:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},1:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},2:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},3:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},4:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},5:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},6:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},7:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},8:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}})),[e])})();return t[e]},Lte=uV((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ote=uV((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Mte=()=>{const e=m5(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=v5(Lte),{isGFPGANAvailable:o}=v5(Ote),{t:i}=FY();return cd(CI,{direction:"column",gap:2,children:[ld(E3,{label:i("options:type"),validValues:jQ.concat(),value:n,onChange:t=>e(H$(t.target.value))}),ld(L3,{isDisabled:!o,label:i("options:strength"),step:.05,min:0,max:1,onChange:t=>e(F$(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&ld(L3,{isDisabled:!o,label:i("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:t=>e(B$(t)),value:r,width:"90px",isInteger:!1})]})};function Tte(){const e=v5((e=>e.system.isGFPGANAvailable)),t=v5((e=>e.options.shouldRunFacetool)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(gU(e.target.checked))})}function Ate(){const e=m5(),t=v5((e=>e.options.shouldFitToWidthHeight)),{t:n}=FY();return ld(_3,{label:n("options:imageFit"),isChecked:t,onChange:t=>e(lU(t.target.checked))})}function Ite(e){const[t,n]=a.exports.useState(!1),{label:r,value:o,min:i=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5rem",inputReadOnly:y=!0,withReset:b=!1,hideTooltip:x=!1,isCompact:w=!1,handleReset:k,isResetDisabled:S,isSliderDisabled:C,isInputDisabled:_,styleClass:E,sliderFormControlProps:P,sliderFormLabelProps:L,sliderMarkProps:O,sliderTrackProps:M,sliderThumbProps:T,sliderNumberInputProps:A,sliderNumberInputFieldProps:I,sliderNumberInputStepperProps:R,sliderTooltipProps:N,sliderIAIIconButtonProps:D,...z}=e,[B,j]=a.exports.useState(String(o)),F=a.exports.useMemo((()=>A?.max?A.max:s),[s,A?.max]);a.exports.useEffect((()=>{String(o)!==B&&""!==B&&j(String(o))}),[o,B,j]);const H=e=>{j(String(e)),c(Number(e))};return cd(GT,{className:E?`invokeai__slider-component ${E}`:"invokeai__slider-component","data-markers":h,style:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...P,children:[ld(eA,{className:"invokeai__slider-component-label",...L,children:r}),cd(HI,{w:"100%",gap:2,alignItems:"center",children:[cd(ZF,{"aria-label":r,value:o,min:i,max:s,step:l,onChange:H,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:C,width:u,...z,children:[h&&cd(sd,{children:[ld(JF,{value:i,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...O,children:i}),ld(JF,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...O,children:s})]}),ld(KF,{className:"invokeai__slider_track",...M,children:ld(QF,{className:"invokeai__slider_track-filled"})}),ld(YH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...N,children:ld(XF,{className:"invokeai__slider-thumb",...T})})]}),g&&cd(fj,{min:i,max:F,step:l,value:B,onChange:H,onBlur:e=>{const t=TU.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),i,F);j(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:_,...A,children:[ld(gj,{className:"invokeai__slider-number-input",width:v,readOnly:y,...I}),cd(pj,{...R,children:[ld(yj,{className:"invokeai__slider-number-stepper"}),ld(vj,{className:"invokeai__slider-number-stepper"})]})]}),b&&ld(k3,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:ld(T9,{}),onClick:()=>{k&&k()},isDisabled:S,...D})]})]})}function Rte(e){const{t:t}=FY(),{label:n=`${t("options:strength")}`,styleClass:r}=e,o=v5((e=>e.options.img2imgStrength)),i=m5();return ld(Ite,{label:n,step:.01,min:.01,max:.99,onChange:e=>i($$(e)),value:o,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i($$(.75))}})}const Nte=()=>{const e=m5(),t=v5((e=>e.options.seamless)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:t=>e(nU(t.target.checked))})})},Dte=()=>ld(CI,{gap:2,direction:"column",children:ld(Nte,{})});function zte(){const e=m5(),{t:t}=FY(),n=v5((e=>e.options.shouldRandomizeSeed));return ld(_3,{label:t("options:randomizeSeed"),isChecked:n,onChange:t=>e(fU(t.target.checked))})}function Bte(){const e=v5((e=>e.options.seed)),t=v5((e=>e.options.shouldRandomizeSeed)),n=v5((e=>e.options.shouldGenerateVariations)),{t:r}=FY(),o=m5();return ld(L3,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:0,max:BQ,isDisabled:t,isInvalid:e<0&&n,onChange:e=>o(aU(e)),value:e,width:"auto"})}function jte(){const e=m5(),t=v5((e=>e.options.shouldRandomizeSeed)),{t:n}=FY();return ld(RT,{size:"sm",isDisabled:t,onClick:()=>e(aU(HQ(0,BQ))),padding:"0 1.5rem",children:ld("p",{children:n("options:shuffle")})})}function Fte(){const e=m5(),t=v5((e=>e.options.threshold)),{t:n}=FY();return ld(L3,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:t=>e(wU(t)),value:t,isInteger:!1})}function Hte(){const e=m5(),t=v5((e=>e.options.perlin)),{t:n}=FY();return ld(L3,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:t=>e(Q$(t)),value:t,isInteger:!1})}const Wte=()=>cd(CI,{gap:2,direction:"column",children:[ld(zte,{}),cd(CI,{gap:2,children:[ld(Bte,{}),ld(jte,{})]}),ld(CI,{gap:2,children:ld(Fte,{})}),ld(CI,{gap:2,children:ld(Hte,{})})]}),Vte=uV((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),$te=uV((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ute=()=>{const e=m5(),{upscalingLevel:t,upscalingStrength:n}=v5(Vte),{isESRGANAvailable:r}=v5($te),{t:o}=FY();return cd("div",{className:"upscale-options",children:[ld(E3,{isDisabled:!r,label:o("options:scale"),value:t,onChange:t=>e(SU(Number(t.target.value))),validValues:zQ}),ld(L3,{isDisabled:!r,label:o("options:strength"),step:.05,min:0,max:1,onChange:t=>e(CU(t)),value:n,isInteger:!1})]})};function Gte(){const e=v5((e=>e.system.isESRGANAvailable)),t=v5((e=>e.options.shouldRunESRGAN)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(pU(e.target.checked))})}function qte(){const e=v5((e=>e.options.shouldGenerateVariations)),t=m5();return ld(_3,{isChecked:e,width:"auto",onChange:e=>t(cU(e.target.checked))})}function Yte(){const e=v5((e=>e.options.seedWeights)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(W3,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(_$(e)||""===e),isDisabled:!t,onChange:e=>r(sU(e.target.value))})}function Zte(){const e=v5((e=>e.options.variationAmount)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(L3,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>r(_U(e)),isInteger:!1})}const Xte=()=>cd(CI,{gap:2,direction:"column",children:[ld(Zte,{}),ld(Yte,{})]});function Kte(){const e=m5(),t=v5((e=>e.options.cfgScale)),{t:n}=FY();return ld(L3,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:t=>e(z$(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function Qte(){const e=v5((e=>e.options.height)),t=v5(T3),n=m5(),{t:r}=FY();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:r("options:height"),value:e,flexGrow:1,onChange:e=>n(W$(Number(e.target.value))),validValues:DQ,styleClass:"main-option-block"})}const Jte=uV([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function ene(){const e=m5(),{iterations:t}=v5(Jte),{t:n}=FY();return ld(L3,{label:n("options:images"),step:1,min:1,max:9999,onChange:t=>e(Y$(t)),value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function tne(){const e=v5((e=>e.options.sampler)),t=m5(),{t:n}=FY();return ld(E3,{label:n("options:sampler"),value:e,onChange:e=>t(eU(e.target.value)),validValues:RQ,styleClass:"main-option-block"})}function nne(){const e=m5(),t=v5((e=>e.options.steps)),{t:n}=FY();return ld(L3,{label:n("options:steps"),min:1,max:9999,step:1,onChange:t=>e(xU(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function rne(){const e=v5((e=>e.options.width)),t=v5(T3),{t:n}=FY(),r=m5();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:n("options:width"),value:e,flexGrow:1,onChange:e=>r(EU(Number(e.target.value))),validValues:NQ,styleClass:"main-option-block"})}function one(){return ld("div",{className:"main-options",children:cd("div",{className:"main-options-list",children:[cd("div",{className:"main-options-row",children:[ld(ene,{}),ld(nne,{}),ld(Kte,{})]}),cd("div",{className:"main-options-row",children:[ld(rne,{}),ld(Qte,{}),ld(tne,{})]})]})})}const ine=uV((e=>e.system),(e=>e.shouldDisplayGuides)),ane=({children:e,feature:t})=>{const n=v5(ine),{text:r}=Pte(t);return n?cd(Aj,{trigger:"hover",children:[ld(Wj,{children:ld(mI,{children:e})}),cd(Fj,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[ld(Ij,{className:"guide-popover-arrow"}),ld("div",{className:"guide-popover-guide-content",children:r})]})]}):null},sne=ok((({feature:e,icon:t=C9},n)=>ld(ane,{feature:e,children:ld(mI,{ref:n,children:ld(kk,{marginBottom:"-.15rem",as:t})})})));function lne(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return cd(lT,{className:"advanced-settings-item",children:[ld(nT,{className:"advanced-settings-header",children:cd(CI,{width:"100%",gap:"0.5rem",align:"center",children:[ld(mI,{flexGrow:1,textAlign:"left",children:t}),o,n&&ld(sne,{feature:n}),ld(sT,{})]})}),ld(cT,{className:"advanced-settings-panel",children:r})]})}const cne=e=>{const{accordionInfo:t}=e,n=v5((e=>e.system.openAccordions)),r=m5();return ld(uT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(ZY(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(ld(lne,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})},une=e=>e.canvas,dne=uV([une,T3,O3],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),hne=e=>e.canvas.layerState.objects.find(EZ),fne=uV([e=>e.options,e=>e.system,hne,T3],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!_$(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:TU.isEqual,resultEqualityCheck:TU.isEqual}});function pne(e){const{iconButton:t=!1,...n}=e,r=m5(),{isReady:o}=v5(fne),i=v5(T3),a=()=>{r(xQ(i))},{t:s}=FY();return gte(["ctrl+enter","meta+enter"],(()=>{r(xQ(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),ld("div",{style:{flexGrow:4},children:t?ld(k3,{"aria-label":s("options:invoke"),type:"submit",icon:ld(i3,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):ld(B3,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const gne=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function mne(e){const{...t}=e,n=m5(),{isProcessing:r,isConnected:o,isCancelable:i}=v5(gne),a=()=>n(EQ()),{t:s}=FY();return gte("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),ld(k3,{icon:ld(O9,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const vne=uV((e=>e.options),(e=>e.shouldLoopback)),yne=()=>{const e=m5(),t=v5(vne),{t:n}=FY();return ld(k3,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:ld(l3,{}),onClick:()=>{e(dU(!t))}})},bne=()=>{const e=v5(T3);return cd("div",{className:"process-buttons",children:[ld(pne,{}),"img2img"===e&&ld(yne,{}),ld(mne,{})]})},xne=uV([e=>e.options,T3],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),wne=()=>{const e=m5(),{prompt:t,activeTabName:n}=v5(xne),{isReady:r}=v5(fne),o=a.exports.useRef(null),{t:i}=FY();gte("alt+a",(()=>{o.current?.focus()}),[]);return ld("div",{className:"prompt-bar",children:ld(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:ld(_H,{id:"prompt",name:"prompt",placeholder:i("options:promptPlaceholder"),size:"lg",value:t,onChange:t=>{e(J$(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(xQ(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function kne(e){return _5({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 Sne(e){return _5({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function Cne(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const _ne=!1,Ene=H.createContext(null);var Pne=function(e){return e.scrollTop},Lne="unmounted",One="exited",Mne="entering",Tne="entered",Ane="exiting",Ine=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=One,r.appearStatus=Mne):o=Tne:o=t.unmountOnExit||t.mountOnEnter?Lne:One,r.state={status:o},r.nextCallback=null,r}DD(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Lne?{status:One}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Mne&&n!==Tne&&(t=Mne):n!==Mne&&n!==Tne||(t=Ane)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Mne){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&Pne(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===One&&this.setState({status:Lne})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||_ne?this.safeSetState({status:Tne},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Mne},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:Tne},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!_ne?(this.props.onExit(r),this.safeSetState({status:Ane},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:One},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:One},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Lne)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=gD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ld(Ene.Provider,{value:null,children:"function"==typeof n?n(e,r):H.cloneElement(H.Children.only(n),r)})},t}(H.Component);function Rne(){}Ine.contextType=Ene,Ine.propTypes={},Ine.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rne,onEntering:Rne,onEntered:Rne,onExit:Rne,onExiting:Rne,onExited:Rne},Ine.UNMOUNTED=Lne,Ine.EXITED=One,Ine.ENTERING=Mne,Ine.ENTERED=Tne,Ine.EXITING=Ane;const Nne=Ine;var Dne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},zne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Cne(n.className,r):n.setAttribute("class",Cne(n.className&&n.className.baseVal||"",r)));var n,r}))},Bne=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Hne=e=>{const t=m5(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=v5(Fne),i=a.exports.useRef(null),s=a.exports.useRef(null),l=a.exports.useRef(null),{children:c}=e;gte("o",(()=>{t(vU(!n)),o&&setTimeout((()=>t(iX(!0))),400)}),[n,o]),gte("esc",(()=>{t(vU(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),gte("shift+o",(()=>{h(),t(iX(!0))}),[o]);const u=a.exports.useCallback((()=>{o||(t(X$(s.current?s.current.scrollTop:0)),t(vU(!1)),t(uU(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(hU(!o)),t(iX(!0))};return a.exports.useEffect((()=>{function e(e){i.current&&!i.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),ld(jne,{nodeRef:i,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:ld("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:i,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:ld("div",{className:"options-panel-margin",children:cd("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[ld(YH,{label:"Pin Options Panel",children:ld("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:ld(o?kne:Sne,{})})}),!o&&cd("div",{className:"invoke-ai-logo-wrapper",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),c]})})})})};function Wne(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Dte,{})}},n=m5(),r=v5(T3);return a.exports.useEffect((()=>{if("img2img"===r){(()=>n(V$(!1)))()}}),[r,n]),cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(Ate,{}),ld(cne,{accordionInfo:t})]})}const Vne=a.exports.createContext(null),$ne=e=>{const{styleClass:t}=e,n=a.exports.useContext(Vne);return ld("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:cd("div",{className:"image-upload-button",children:[ld(y3,{}),ld(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},Une=uV((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Gne=a.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:i}=QA(),s=m5(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=v5(Une),d=a.exports.useRef(null),h=()=>{c&&!u&&e&&s(SQ(e)),i()};gte("delete",(()=>{l?o():h()}),[e,l]);return cd(sd,{children:[a.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),ld(qB,{isOpen:r,leastDestructiveRef:d,onClose:i,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),ld(NB,{children:cd(CI,{direction:"column",gap:5,children:[ld(VI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),ld(GT,{children:cd(CI,{alignItems:"center",children:[ld(eA,{mb:0,children:"Don't ask me again"}),ld(nH,{checked:!l,onChange:e=>s(YY(!e.target.checked))})]})})]})}),cd(VB,{children:[ld(RT,{ref:d,onClick:i,className:"modal-close-btn",children:"Cancel"}),ld(RT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),qne=uV([e=>e.system,e=>e.options,e=>e.gallery,T3],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Yne=()=>{const e=m5(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=v5(qne),h=zH(),{t:f}=FY(),p=()=>{c&&(u&&e(q$(!1)),e(G$(c)),e(I$("img2img")))};gte("shift+i",(()=>{c?(p(),h({title:f("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:imageNotLoaded"),description:f("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c&&(c.metadata&&e(N$(c.metadata)),"img2img"===c.metadata?.image.type?e(I$("img2img")):"txt2img"===c.metadata?.image.type&&e(I$("txt2img")))};gte("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(g(),h({title:f("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:parametersNotSet"),description:f("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>{c?.metadata&&e(aU(c.metadata.image.seed))};gte("s",(()=>{c?.metadata?.image?.seed?(m(),h({title:f("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:seedNotSet"),description:f("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>c?.metadata?.image?.prompt&&e(J$(c.metadata.image.prompt));gte("p",(()=>{c?.metadata?.image?.prompt?(v(),h({title:f("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:promptNotSet"),description:f("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const y=()=>{c&&e(wQ(c))};gte("Shift+U",(()=>{o&&!s&&n&&!t&&i?y():h({title:f("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(kQ(c))};gte("Shift+R",(()=>{r&&!s&&n&&!t&&a?b():h({title:f("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const x=()=>e(mU(!l));gte("i",(()=>{c?x():h({title:f("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[c,l]);return cd("div",{className:"current-image-options",children:[cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":`${f("options:sendTo")}...`,icon:ld(h3,{})}),children:cd("div",{className:"current-image-send-to-popover",children:[ld(B3,{size:"sm",onClick:p,leftIcon:ld(f3,{}),children:f("options:sendToImg2Img")}),ld(B3,{size:"sm",onClick:()=>{c&&(u&&e(q$(!1)),e(aX(c)),e(iX(!0)),"unifiedCanvas"!==d&&e(I$("unifiedCanvas")),h({title:f("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:ld(f3,{}),children:f("options:sendToUnifiedCanvas")}),ld(B3,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:f("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:ld(j5,{}),children:f("options:copyImageToLink")}),ld(B3,{leftIcon:ld(W5,{}),size:"sm",children:ld(MI,{download:!0,href:c?.url,children:f("options:downloadImage")})})]})}),ld(k3,{icon:ld(U5,{}),tooltip:u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"aria-label":u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"data-selected":u,onClick:()=>{e(q$(!u))}})]}),cd(DT,{isAttached:!0,children:[ld(k3,{icon:ld(s3,{}),tooltip:`${f("options:usePrompt")} (P)`,"aria-label":`${f("options:usePrompt")} (P)`,isDisabled:!c?.metadata?.image?.prompt,onClick:v}),ld(k3,{icon:ld(d3,{}),tooltip:`${f("options:useSeed")} (S)`,"aria-label":`${f("options:useSeed")} (S)`,isDisabled:!c?.metadata?.image?.seed,onClick:m}),ld(k3,{icon:ld(N5,{}),tooltip:`${f("options:useAll")} (A)`,"aria-label":`${f("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:g})]}),cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld(X5,{}),"aria-label":f("options:restoreFaces")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Mte,{}),ld(B3,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:f("options:restoreFaces")})]})}),ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld($5,{}),"aria-label":f("options:upscale")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Ute,{}),ld(B3,{isDisabled:!(o&&c&&n&&!t&&i),onClick:y,children:f("options:upscaleImage")})]})})]}),ld(DT,{isAttached:!0,children:ld(k3,{icon:ld(B5,{}),tooltip:`${f("options:info")} (I)`,"aria-label":`${f("options:info")} (I)`,"data-selected":l,onClick:x})}),ld(Gne,{image:c,children:ld(k3,{icon:ld(m3,{}),tooltip:`${f("options:deleteImage")} (Del)`,"aria-label":`${f("options:deleteImage")} (Del)`,isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function Zne(e){return _5({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 Xne=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>cd(CI,{gap:2,children:[n&&ld(YH,{label:`Recall ${e}`,children:ld(zT,{"aria-label":"Use this parameter",icon:ld(Zne,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&ld(YH,{label:`Copy ${e}`,children:ld(zT,{"aria-label":`Copy ${e}`,icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),cd(CI,{direction:o?"column":"row",children:[cd(VI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?cd(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",ld(V9,{mx:"2px"})]}):ld(VI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Kne=a.exports.memo((({image:e,styleClass:t})=>{const n=m5();gte("esc",(()=>{n(mU(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:y,steps:b,strength:x,threshold:w,type:k,variations:S,width:C}=r,_=JSON.stringify(e.metadata,null,2);return ld("div",{className:`image-metadata-viewer ${t}`,children:cd(CI,{gap:1,direction:"column",width:"100%",children:[cd(CI,{gap:2,children:[ld(VI,{fontWeight:"semibold",children:"File:"}),cd(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,ld(V9,{mx:"2px"})]})]}),Object.keys(r).length>0?cd(sd,{children:[k&&ld(Xne,{label:"Generation type",value:k}),e.metadata?.model_weights&&ld(Xne,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(k)&&ld(Xne,{label:"Original image",value:d}),"gfpgan"===k&&void 0!==x&&ld(Xne,{label:"Fix faces strength",value:x,onClick:()=>n(F$(x))}),"esrgan"===k&&void 0!==m&&ld(Xne,{label:"Upscaling scale",value:m,onClick:()=>n(SU(m))}),"esrgan"===k&&void 0!==x&&ld(Xne,{label:"Upscaling strength",value:x,onClick:()=>n(CU(x))}),p&&ld(Xne,{label:"Prompt",labelPosition:"top",value:C$(p),onClick:()=>n(J$(p))}),void 0!==y&&ld(Xne,{label:"Seed",value:y,onClick:()=>n(aU(y))}),void 0!==w&&ld(Xne,{label:"Noise Threshold",value:w,onClick:()=>n(wU(w))}),void 0!==h&&ld(Xne,{label:"Perlin Noise",value:h,onClick:()=>n(Q$(h))}),g&&ld(Xne,{label:"Sampler",value:g,onClick:()=>n(eU(g))}),b&&ld(Xne,{label:"Steps",value:b,onClick:()=>n(xU(b))}),void 0!==i&&ld(Xne,{label:"CFG scale",value:i,onClick:()=>n(z$(i))}),S&&S.length>0&&ld(Xne,{label:"Seed-weight pairs",value:E$(S),onClick:()=>n(sU(E$(S)))}),v&&ld(Xne,{label:"Seamless",value:v,onClick:()=>n(nU(v))}),l&&ld(Xne,{label:"High Resolution Optimization",value:l,onClick:()=>n(V$(l))}),C&&ld(Xne,{label:"Width",value:C,onClick:()=>n(EU(C))}),s&&ld(Xne,{label:"Height",value:s,onClick:()=>n(W$(s))}),c&&ld(Xne,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(G$(c))}),u&&ld(Xne,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Z$(u))}),"img2img"===k&&x&&ld(Xne,{label:"Image to image strength",value:x,onClick:()=>n($$(x))}),a&&ld(Xne,{label:"Image to image fit",value:a,onClick:()=>n(lU(a))}),f&&f.length>0&&cd(sd,{children:[ld(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),ld(Xne,{label:"Scale",value:r,onClick:()=>n(SU(r))}),ld(Xne,{label:"Strength",value:o,onClick:()=>n(CU(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("codeformer"))}}),o&&ld(Xne,{label:"Fidelity",value:o,onClick:()=>{n(B$(o)),n(H$("codeformer"))}})]},t)}}))]}),o&&ld(Xne,{withCopy:!0,label:"Dream Prompt",value:o}),cd(CI,{gap:2,direction:"column",children:[cd(CI,{gap:2,children:[ld(YH,{label:"Copy metadata JSON",children:ld(zT,{"aria-label":"Copy metadata JSON",icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),ld(VI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),ld("div",{className:"image-json-viewer",children:ld("pre",{children:_})})]})]}):ld(bI,{width:"100%",pt:10,children:ld(VI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),Qne=uV([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function Jne(){const e=m5(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return cd("div",{className:"current-image-preview",children:[o&&ld(ET,{src:o.url,width:o.width,height:o.height,style:{imageRendering:i?"pixelated":"initial"}}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),r&&o&&ld(Kne,{image:o,styleClass:"current-image-metadata"})]})}const ere=uV([e=>e.gallery,e=>e.options,T3],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),tre=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=v5(ere);return ld("div",{className:"current-image-area","data-tab-name":t,children:e?cd(sd,{children:[ld(Yne,{}),ld(Jne,{})]}):ld("div",{className:"current-image-display-placeholder",children:ld(L9,{})})})},nre=()=>{const e=a.exports.useContext(Vne);return ld(k3,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:ld(y3,{}),onClick:e||void 0})};function rre(){const e=v5((e=>e.options.initialImage)),{t:t}=FY(),n=m5(),r=zH();return cd(sd,{children:[cd("div",{className:"init-image-preview-header",children:[ld("h2",{children:t("options:initialImage")}),ld(nre,{})]}),e&&ld("div",{className:"init-image-preview",children:ld(ET,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(M$())}})})]})}const ore=()=>{const e=v5((e=>e.options.initialImage)),{currentImage:t}=v5((e=>e.gallery));return cd("div",{className:"workarea-split-view",children:[ld("div",{className:"workarea-split-view-left",children:e?ld("div",{className:"image-to-image-area",children:ld(rre,{})}):ld($ne,{})}),t&&ld("div",{className:"workarea-split-view-right",children:ld(tre,{})})]})};function ire(e){return _5({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 are(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function sre(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>a.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return a.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=a.exports.createContext(r),i=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][i])||o,c=a.exports.useMemo((()=>s),Object.values(s));return a.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||o,c=a.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},lre(r,...t)]}function lre(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return a.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function cre(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function ure(...e){return a.exports.useCallback(cre(...e),e)}const dre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=a.exports.Children.toArray(n),i=o.find(pre);if(i){const e=i.props.children,n=o.map((t=>t===i?a.exports.Children.count(e)>1?a.exports.Children.only(null):a.exports.isValidElement(e)?e.props.children:null:t));return a.exports.createElement(hre,vp({},r,{ref:t}),a.exports.isValidElement(e)?a.exports.cloneElement(e,void 0,n):null)}return a.exports.createElement(hre,vp({},r,{ref:t}),n)}));dre.displayName="Slot";const hre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return a.exports.isValidElement(n)?a.exports.cloneElement(n,{...gre(r,n.props),ref:cre(t,n.ref)}):a.exports.Children.count(n)>1?a.exports.Children.only(null):null}));hre.displayName="SlotClone";const fre=({children:e})=>a.exports.createElement(a.exports.Fragment,null,e);function pre(e){return a.exports.isValidElement(e)&&e.type===fre}function gre(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]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const mre=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=a.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?dre:t;return a.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),a.exports.createElement(i,vp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function vre(e,t){e&&$.exports.flushSync((()=>e.dispatchEvent(t)))}function yre(e){const t=e+"CollectionProvider",[n,r]=sre(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=H.useRef(null),i=H.useRef(new Map).current;return H.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:H.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=ure(t,i(a,n).collectionRef);return H.createElement(dre,{ref:o},r)})),ItemSlot:H.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=H.useRef(null),c=ure(t,a),u=i(s,n);return H.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),H.createElement(dre,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=H.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const bre=a.exports.createContext(void 0);function xre(e){const t=a.exports.useContext(bre);return e||t||"ltr"}function wre(e){const t=a.exports.useRef(e);return a.exports.useEffect((()=>{t.current=e})),a.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const kre="dismissableLayer.update",Sre="dismissableLayer.pointerDownOutside",Cre="dismissableLayer.focusOutside";let _re;const Ere=a.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pre=a.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=a.exports.useContext(Ere),[h,f]=a.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=a.exports.useState({}),m=ure(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,S=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1),o=a.exports.useRef((()=>{}));return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){Ore(Sre,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1);return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Ore(Cre,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e);a.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),a.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_re=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Lre(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_re)}}),[h,p,r,d]),a.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Lre())}),[h,d]),a.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(kre,e),()=>document.removeEventListener(kre,e)}),[]),a.exports.createElement(mre.div,vp({},u,{ref:m,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:are(e.onFocusCapture,C.onFocusCapture),onBlurCapture:are(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:are(e.onPointerDownCapture,S.onPointerDownCapture)}))}));function Lre(){const e=new CustomEvent(kre);document.dispatchEvent(e)}function Ore(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?vre(o,i):o.dispatchEvent(i)}let Mre=0;function Tre(){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 Are="focusScope.autoFocusOnMount",Ire="focusScope.autoFocusOnUnmount",Rre={bubbles:!1,cancelable:!0},Nre=a.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=a.exports.useState(null),u=wre(o),d=wre(i),h=a.exports.useRef(null),f=ure(t,(e=>c(e))),p=a.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:jre(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||jre(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),a.exports.useEffect((()=>{if(l){Fre.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Are,Rre);l.addEventListener(Are,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jre(r,{select:t}),document.activeElement!==n)return}((e=Dre(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&jre(l))}return()=>{l.removeEventListener(Are,u),setTimeout((()=>{const e=new CustomEvent(Ire,Rre);l.addEventListener(Ire,d),l.dispatchEvent(e),e.defaultPrevented||jre(null!=t?t:document.body,{select:!0}),l.removeEventListener(Ire,d),Fre.remove(p)}),0)}}var e}),[l,u,d,p]);const g=a.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=Dre(e),n=zre(t,e),r=zre(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&jre(i,{select:!0})):(e.preventDefault(),n&&jre(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return a.exports.createElement(mre.div,vp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function Dre(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zre(e,t){for(const n of e)if(!Bre(n,{upTo:t}))return n}function Bre(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function jre(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Fre=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Hre(e,t),e.unshift(t)},remove(t){var n;e=Hre(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Hre(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Wre=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?a.exports.useLayoutEffect:()=>{},Vre=W["useId".toString()]||(()=>{});let $re=0;function Ure(e){return e.split("-")[0]}function Gre(e){return e.split("-")[1]}function qre(e){return["top","bottom"].includes(Ure(e))?"x":"y"}function Yre(e){return"y"===e?"height":"width"}function Zre(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,s=qre(t),l=Yre(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Ure(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Gre(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function Xre(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kre(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qre(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=Xre(f),g=s[h?"floating"===d?"reference":"floating":d],m=Kre(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=Kre(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const Jre=Math.min,eoe=Math.max;function toe(e,t,n){return eoe(e,Jre(t,n))}const noe=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=Xre(r),u={x:o,y:i},d=qre(a),h=Gre(a),f=Yre(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-y/2,k=c[g],S=x-p[f]-c[m],C=x/2-p[f]/2+w,_=toe(k,C,S),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?Croe[e]))}const ioe={start:"end",end:"start"};function aoe(e){return e.replace(/start|end/g,(e=>ioe[e]))}const soe=["top","right","bottom","left"];const loe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=Ure(r),m=d||(g===a||!f?[ooe(a)]:function(e){const t=ooe(e);return[aoe(e),t,aoe(t)]}(a)),v=[a,...m],y=await Qre(t,p),b=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Gre(e),o=qre(e),i=Yre(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ooe(a)),{main:a,cross:ooe(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,k;const e=(null!=(w=null==(k=o.flip)?void 0:k.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var S;const e=null==(S=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function coe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uoe(e){return soe.some((t=>e[t]>=0))}const doe=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=coe(await Qre(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:uoe(t)}}}case"escaped":{const t=coe(await Qre(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:uoe(t)}}}default:return{}}}}};const hoe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ure(n),s=Gre(n),l="x"===qre(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function foe(e){return"x"===e?"y":"x"}const poe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Qre(t,l),d=qre(Ure(o)),h=foe(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=toe(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=toe(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},goe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=qre(o),h=foe(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,y,b,x;const e="y"===d?"width":"height",t=["top","left"].includes(Ure(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(y=a.offset)?void 0:y[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(b=null==(x=a.offset)?void 0:x[h])?b:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function moe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function voe(e){if(null==e)return window;if(!moe(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function yoe(e){return voe(e).getComputedStyle(e)}function boe(e){return moe(e)?"":e?(e.nodeName||"").toLowerCase():""}function xoe(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function woe(e){return e instanceof voe(e).HTMLElement}function koe(e){return e instanceof voe(e).Element}function Soe(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof voe(e).ShadowRoot||e instanceof ShadowRoot}function Coe(e){const{overflow:t,overflowX:n,overflowY:r}=yoe(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function _oe(e){return["table","td","th"].includes(boe(e))}function Eoe(e){const t=/firefox/i.test(xoe()),n=yoe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function Poe(){return!/^((?!chrome|android).)*safari/i.test(xoe())}const Loe=Math.min,Ooe=Math.max,Moe=Math.round;function Toe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&woe(e)&&(l=e.offsetWidth>0&&Moe(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Moe(s.height)/e.offsetHeight||1);const u=koe(e)?voe(e):window,d=!Poe()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Aoe(e){return((function(e){return e instanceof voe(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ioe(e){return koe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Roe(e){return Toe(Aoe(e)).left+Ioe(e).scrollLeft}function Noe(e,t,n){const r=woe(t),o=Aoe(t),i=Toe(e,r&&function(e){const t=Toe(e);return Moe(t.width)!==e.offsetWidth||Moe(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==boe(t)||Coe(o))&&(a=Ioe(t)),woe(t)){const e=Toe(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Roe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Doe(e){return"html"===boe(e)?e:e.assignedSlot||e.parentNode||(Soe(e)?e.host:null)||Aoe(e)}function zoe(e){return woe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Boe(e){const t=voe(e);let n=zoe(e);for(;n&&_oe(n)&&"static"===getComputedStyle(n).position;)n=zoe(n);return n&&("html"===boe(n)||"body"===boe(n)&&"static"===getComputedStyle(n).position&&!Eoe(n))?t:n||function(e){let t=Doe(e);for(Soe(t)&&(t=t.host);woe(t)&&!["html","body"].includes(boe(t));){if(Eoe(t))return t;t=t.parentNode}return null}(e)||t}function joe(e){if(woe(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Toe(e);return{width:t.width,height:t.height}}function Foe(e){const t=Doe(e);return["html","body","#document"].includes(boe(t))?e.ownerDocument.body:woe(t)&&Coe(t)?t:Foe(t)}function Hoe(e,t){var n;void 0===t&&(t=[]);const r=Foe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=voe(r),a=o?[i].concat(i.visualViewport||[],Coe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Hoe(a))}function Woe(e,t,n){return"viewport"===t?Kre(function(e,t){const n=voe(e),r=Aoe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Poe();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):koe(t)?function(e,t){const n=Toe(e,!1,"fixed"===t),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}}(t,n):Kre(function(e){var t;const n=Aoe(e),r=Ioe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ooe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ooe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Roe(e);const l=-r.scrollTop;return"rtl"===yoe(o||n).direction&&(s+=Ooe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(Aoe(e)))}function Voe(e){const t=Hoe(e),n=["absolute","fixed"].includes(yoe(e).position)&&woe(e)?Boe(e):e;return koe(n)?t.filter((e=>koe(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Soe(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==boe(e))):[]}const $oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Voe(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Woe(t,n,o);return e.top=Ooe(r.top,e.top),e.right=Loe(r.right,e.right),e.bottom=Loe(r.bottom,e.bottom),e.left=Ooe(r.left,e.left),e}),Woe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=woe(n),i=Aoe(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==boe(n)||Coe(i))&&(a=Ioe(n)),woe(n))){const e=Toe(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:koe,getDimensions:joe,getOffsetParent:Boe,getDocumentElement:Aoe,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Noe(t,Boe(n),r),floating:{...joe(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===yoe(e).direction};function Uoe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...koe(e)?Hoe(e):[],...Hoe(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),koe(e)&&!s&&h.observe(e),h.observe(t)}let f=s?Toe(e):null;return s&&function t(){const r=Toe(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const Goe=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=Zre(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=a.exports.useRef(null),[u,d]=a.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=a.exports.useState(t);Yoe(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=a.exports.useCallback((()=>{i.current&&s.current&&Goe(i.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&$.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);qoe((()=>{g.current&&p()}),[p]);const g=a.exports.useRef(!1);qoe((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=a.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),i.current&&s.current)if(l.current){const e=l.current(i.current,s.current,p);c.current=e}else p()}),[p,l]),v=a.exports.useCallback((e=>{i.current=e,m()}),[m]),y=a.exports.useCallback((e=>{s.current=e,m()}),[m]),b=a.exports.useMemo((()=>({reference:i,floating:s})),[]);return a.exports.useMemo((()=>({...u,update:p,refs:b,reference:v,floating:y})),[u,p,b,v,y])}const Xoe=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?noe({element:t.current,padding:n}).fn(e):{}:t?noe({element:t,padding:n}).fn(e):{}}};const Koe="Popper",[Qoe,Joe]=sre(Koe),[eie,tie]=Qoe(Koe),nie=a.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=tie("PopperAnchor",n),s=a.exports.useRef(null),l=ure(t,s);return a.exports.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:a.exports.createElement(mre.div,vp({},o,{ref:l}))})),rie="PopperContent",[oie,iie]=Qoe(rie),[aie,sie]=Qoe(rie,{hasParent:!1,positionUpdateFns:new Set}),lie=a.exports.forwardRef(((e,t)=>{var n,r,o,i,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...k}=e,S=tie(rie,d),[C,_]=a.exports.useState(null),E=ure(t,(e=>_(e))),[P,L]=a.exports.useState(null),O=function(e){const[t,n]=a.exports.useState(void 0);return Wre((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(P),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A=h+("center"!==p?"-"+p:""),I="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(uie),altBoundary:N},{reference:z,floating:B,strategy:j,x:F,y:H,placement:W,middlewareData:V,update:$}=Zoe({strategy:"fixed",placement:A,whileElementsMounted:Uoe,middleware:[hoe({mainAxis:f+T,alignmentAxis:g}),w?poe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?goe():void 0,...D}):void 0,P?Xoe({element:P,padding:m}):void 0,w?loe({...D}):void 0,die({arrowWidth:M,arrowHeight:T}),x?doe({strategy:"referenceHidden"}):void 0].filter(cie)});Wre((()=>{z(S.anchor)}),[z,S.anchor]);const U=null!==F&&null!==H,[G,q]=hie(W),Y=null===(o=V.arrow)||void 0===o?void 0:o.x,Z=null===(i=V.arrow)||void 0===i?void 0:i.y,X=0!==(null===(s=V.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=a.exports.useState();Wre((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=sie(rie,d),te=!J;a.exports.useLayoutEffect((()=>{if(!te)return ee.add($),()=>{ee.delete($)}}),[te,ee,$]),a.exports.useLayoutEffect((()=>{te&&U&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,U,ee]);const ne={"data-side":G,"data-align":q,...k,ref:E,style:{...k.style,animation:U?void 0:"none",opacity:null!==(l=V.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return a.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:j,left:0,top:0,transform:U?`translate3d(${Math.round(F)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=V.transformOrigin)||void 0===c?void 0:c.x,null===(u=V.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},a.exports.createElement(oie,{scope:d,placedSide:G,onArrowChange:L,arrowX:Y,arrowY:Z,shouldHideArrow:X},te?a.exports.createElement(aie,{scope:d,hasParent:!0,positionUpdateFns:ee},a.exports.createElement(mre.div,ne)):a.exports.createElement(mre.div,ne)))}));function cie(e){return void 0!==e}function uie(e){return null!==e}const die=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=hie(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let y="",b="";return"bottom"===f?(y=u?g:`${m}px`,b=-h+"px"):"top"===f?(y=u?g:`${m}px`,b=`${l.floating.height+h}px`):"right"===f?(y=-h+"px",b=u?g:`${v}px`):"left"===f&&(y=`${l.floating.width+h}px`,b=u?g:`${v}px`),{data:{x:y,y:b}}}});function hie(e){const[t,n="center"]=e.split("-");return[t,n]}const fie=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.exports.useState(null);return a.exports.createElement(eie,{scope:t,anchor:r,onAnchorChange:o},n)},pie=nie,gie=lie;const mie=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.exports.useState(),r=a.exports.useRef({}),o=a.exports.useRef(e),i=a.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.exports.useEffect((()=>{const e=vie(r.current);i.current="mounted"===l?e:"none"}),[l]),Wre((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=vie(t);if(e)c("MOUNT");else if("none"===a||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Wre((()=>{if(t){const e=e=>{const n=vie(r.current).includes(e.animationName);e.target===t&&n&&$.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=vie(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):a.exports.Children.only(n),i=ure(r.ref,o.ref);return"function"==typeof n||r.isPresent?a.exports.cloneElement(o,{ref:i}):null};function vie(e){return(null==e?void 0:e.animationName)||"none"}function yie({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=a.exports.useState(e),[r]=n,o=a.exports.useRef(r),i=wre(t);return a.exports.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,l=wre(n),c=a.exports.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l]);return[s,c]}mie.displayName="Presence";const bie="rovingFocusGroup.onEntryFocus",xie={bubbles:!1,cancelable:!0},wie="RovingFocusGroup",[kie,Sie,Cie]=yre(wie),[_ie,Eie]=sre(wie,[Cie]),[Pie,Lie]=_ie(wie),Oie=a.exports.forwardRef(((e,t)=>a.exports.createElement(kie.Provider,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(kie.Slot,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(Mie,vp({},e,{ref:t})))))),Mie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=a.exports.useRef(null),f=ure(t,h),p=xre(i),[g=null,m]=yie({prop:s,defaultProp:l,onChange:c}),[v,y]=a.exports.useState(!1),b=wre(u),x=Sie(n),w=a.exports.useRef(!1),[k,S]=a.exports.useState(0);return a.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(bie,b),()=>e.removeEventListener(bie,b)}),[b]),a.exports.createElement(Pie,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:a.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:a.exports.useCallback((()=>y(!0)),[]),onFocusableItemAdd:a.exports.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:a.exports.useCallback((()=>S((e=>e-1))),[])},a.exports.createElement(mre.div,vp({tabIndex:v||0===k?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:are(e.onMouseDown,(()=>{w.current=!0})),onFocus:are(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(bie,xie);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));Iie([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:are(e.onBlur,(()=>y(!1)))})))})),Tie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=e,s=function(e){const[t,n]=a.exports.useState(Vre());return Wre((()=>{e||n((e=>null!=e?e:String($re++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=Lie("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=Sie(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return a.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),a.exports.createElement(kie.ItemSlot,{scope:n,id:s,focusable:r,active:o},a.exports.createElement(mre.span,vp({tabIndex:c?0:-1,"data-orientation":l.orientation},i,{ref:t,onMouseDown:are(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:are(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:are(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Aie[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Iie(o)))}var n,r}))})))})),Aie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Iie(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const Rie=Oie,Nie=Tie,Die=["Enter"," "],zie=["ArrowUp","PageDown","End"],Bie=["ArrowDown","PageUp","Home",...zie],jie="Menu",[Fie,Hie,Wie]=yre(jie),[Vie,$ie]=sre(jie,[Wie,Joe,Eie]),Uie=Joe(),Gie=Eie(),[qie,Yie]=Vie(jie),[Zie,Xie]=Vie(jie),Kie=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=Uie(n);return a.exports.createElement(pie,vp({},o,r,{ref:t}))})),[Qie,Jie]=Vie("MenuPortal",{forceMount:void 0}),eae="MenuContent",[tae,nae]=Vie(eae),rae=a.exports.forwardRef(((e,t)=>{const n=Jie(eae,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Yie(eae,e.__scopeMenu),s=Xie(eae,e.__scopeMenu);return a.exports.createElement(Fie.Provider,{scope:e.__scopeMenu},a.exports.createElement(mie,{present:r||i.open},a.exports.createElement(Fie.Slot,{scope:e.__scopeMenu},s.modal?a.exports.createElement(oae,vp({},o,{ref:t})):a.exports.createElement(iae,vp({},o,{ref:t})))))})),oae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu),r=a.exports.useRef(null),o=ure(t,r);return a.exports.useEffect((()=>{const e=r.current;if(e)return pD(e)}),[]),a.exports.createElement(aae,vp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:are(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),iae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu);return a.exports.createElement(aae,vp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),aae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=Yie(eae,n),v=Xie(eae,n),y=Uie(n),b=Gie(n),x=Hie(n),[w,k]=a.exports.useState(null),S=a.exports.useRef(null),C=ure(t,S,m.onContentChange),_=a.exports.useRef(0),E=a.exports.useRef(""),P=a.exports.useRef(0),L=a.exports.useRef(null),O=a.exports.useRef("right"),M=a.exports.useRef(0),T=p?_B:a.exports.Fragment,A=p?{as:dre,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};a.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),a.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Tre()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Tre()),Mre++,()=>{1===Mre&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mre--}}),[]);const R=a.exports.useCallback((e=>{var t,n;return O.current===(null===(t=L.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=L.current)||void 0===n?void 0:n.area)}),[]);return a.exports.createElement(tae,{scope:n,searchRef:E,onItemEnter:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:a.exports.useCallback((e=>{var t;R(e)||(null===(t=S.current)||void 0===t||t.focus(),k(null))}),[R]),onTriggerLeave:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:P,onPointerGraceIntentChange:a.exports.useCallback((e=>{L.current=e}),[])},a.exports.createElement(T,A,a.exports.createElement(Nre,{asChild:!0,trapped:o,onMountAutoFocus:are(i,(e=>{var t;e.preventDefault(),null===(t=S.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},a.exports.createElement(Pre,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},a.exports.createElement(Rie,vp({asChild:!0},b,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),a.exports.createElement(gie,vp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},y,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:are(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=S.current;if(e.target!==o)return;if(!Bie.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));zie.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:are(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:are(e.onPointerMove,dae((e=>{const t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>M.current?"right":"left";O.current=t,M.current=e.clientX}})))})))))));var N})),sae="MenuItem",lae="menu.itemSelect",cae=a.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.exports.useRef(null),s=Xie(sae,e.__scopeMenu),l=nae(sae,e.__scopeMenu),c=ure(t,i),u=a.exports.useRef(!1);return a.exports.createElement(uae,vp({},o,{ref:c,disabled:n,onClick:are(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(lae,{bubbles:!0,cancelable:!0});e.addEventListener(lae,(e=>null==r?void 0:r(e)),{once:!0}),vre(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:are(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:are(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||Die.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),uae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=nae(sae,n),l=Gie(n),c=a.exports.useRef(null),u=ure(t,c),[d,h]=a.exports.useState(!1),[f,p]=a.exports.useState("");return a.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[i.children]),a.exports.createElement(Fie.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},a.exports.createElement(Nie,vp({asChild:!0},l,{focusable:!r}),a.exports.createElement(mre.div,vp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:are(e.onPointerMove,dae((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:are(e.onPointerLeave,dae((e=>s.onItemLeave(e)))),onFocus:are(e.onFocus,(()=>h(!0))),onBlur:are(e.onBlur,(()=>h(!1)))}))))}));Vie("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});Vie("MenuItemIndicator",{checked:!1});function dae(e){return t=>"mouse"===t.pointerType?e(t):void 0}Vie("MenuSub");const hae=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=Uie(t),[c,u]=a.exports.useState(null),d=a.exports.useRef(!1),h=wre(i),f=xre(o);return a.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),a.exports.createElement(fie,l,a.exports.createElement(qie,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},a.exports.createElement(Zie,{scope:t,onClose:a.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},fae=Kie,pae=rae,gae=cae,mae="ContextMenu",[vae,yae]=sre(mae,[$ie]),bae=$ie(),[xae,wae]=vae(mae);function kae(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const Sae=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[s,l]=a.exports.useState(!1),c=bae(t),u=wre(r),d=a.exports.useCallback((e=>{l(e),u(e)}),[u]);return a.exports.createElement(xae,{scope:t,open:s,onOpenChange:d,modal:i},a.exports.createElement(hae,vp({},c,{dir:o,open:s,onOpenChange:d,modal:i}),n))},Cae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuTrigger",n),i=bae(n),s=a.exports.useRef({x:0,y:0}),l=a.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=a.exports.useRef(0),u=a.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return a.exports.useEffect((()=>u),[u]),a.exports.createElement(a.exports.Fragment,null,a.exports.createElement(fae,vp({},i,{virtualRef:l})),a.exports.createElement(mre.span,vp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:are(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:are(e.onPointerDown,kae((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:are(e.onPointerMove,kae(u)),onPointerCancel:are(e.onPointerCancel,kae(u)),onPointerUp:are(e.onPointerUp,kae(u))})))})),_ae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuContent",n),i=bae(n),s=a.exports.useRef(!1);return a.exports.createElement(pae,vp({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),Eae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=bae(n);return a.exports.createElement(gae,vp({},o,r,{ref:t}))})),Pae=uV([e=>e.gallery,e=>e.options,dne,T3],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Lae=uV([e=>e.options,e=>e.gallery,e=>e.system,T3],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Oae=a.exports.memo((e=>{const t=m5(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:i,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=v5(Lae),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=a.exports.useState(!1),v=zH(),{t:y}=FY();return cd(Sae,{onOpenChange:e=>{t(GU(e))},children:[ld(Cae,{children:cd(mI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[ld(ET,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),ld("div",{className:"hoverable-image-content",onClick:()=>t(DU(c)),children:u&&ld(kk,{width:"50%",height:"50%",as:z5,className:"hoverable-image-check"})}),g&&o>=64&&ld("div",{className:"hoverable-image-delete-button",children:ld(Gne,{image:c,children:ld(zT,{"aria-label":y("options:deleteImage"),icon:ld(g3,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!i})})})]},f)}),cd(_ae,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[ld(Eae,{onClickCapture:()=>{t(q$(!0)),t(DU(c))},children:y("options:openInViewer")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(J$(c.metadata.image.prompt)),v({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:y("options:usePrompt")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(aU(c.metadata.image.seed)),v({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:y("options:useSeed")}),ld(Eae,{onClickCapture:()=>{p&&t(D$(p)),v({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:y("options:useAll")}),ld(Eae,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(I$("img2img")),t(R$(p)),void v({title:y("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0})}v({title:y("toast:initialImageNotSet"),description:y("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:y("options:useInitImg")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(G$(c)),"img2img"!==n&&t(I$("img2img")),v({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToImg2Img")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(aX(c)),t(YZ()),"unifiedCanvas"!==n&&t(I$("unifiedCanvas")),v({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToUnifiedCanvas")}),ld(Eae,{"data-warning":!0,children:ld(Gne,{image:c,children:ld("p",{children:y("options:deleteImage")})})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),Mae=320,Tae={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Aae(){const e=m5(),{t:t}=FY(),{images:n,currentCategory:r,currentImageUuid:o,shouldPinGallery:i,shouldShowGallery:s,galleryScrollPosition:l,galleryImageMinimumWidth:c,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:p,areMoreImagesAvailable:g,galleryWidth:m,isLightBoxOpen:v,isStaging:y,shouldEnableResize:b,shouldUseSingleGalleryColumn:x}=v5(Pae),{galleryMinWidth:w,galleryMaxWidth:k}=v?{galleryMinWidth:400,galleryMaxWidth:400}:Tae[d],[S,C]=a.exports.useState(m>=Mae),[_,E]=a.exports.useState(!1),[P,L]=a.exports.useState(0),O=a.exports.useRef(null),M=a.exports.useRef(null),T=a.exports.useRef(null);a.exports.useEffect((()=>{m>=Mae&&C(!1)}),[m]);const A=()=>{e(HU(!i)),e(iX(!0))},I=()=>{e(WU(!0)),i&&e(iX(!0))},R=a.exports.useCallback((()=>{e(WU(!1)),e(GU(!1)),e(VU(M.current?M.current.scrollTop:0)),setTimeout((()=>i&&e(iX(!0))),400)}),[e,i]),N=()=>{T.current&&window.clearTimeout(T.current)};gte("g",(()=>{s?R():I()}),[s,i]),gte("left",(()=>{e(FU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("right",(()=>{e(jU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("shift+g",(()=>{A()}),[i]),gte("esc",(()=>{e(WU(!1))}),{enabled:()=>!i,preventDefault:!0},[i]);return gte("shift+up",(()=>{if(c<256){const t=TU.clamp(c+32,32,256);e($U(t))}}),[c]),gte("shift+down",(()=>{if(c>32){const t=TU.clamp(c-32,32,256);e($U(t))}}),[c]),a.exports.useEffect((()=>{M.current&&(M.current.scrollTop=l)}),[l,s]),a.exports.useEffect((()=>{function e(e){i||!O.current||O.current.contains(e.target)||R()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[R,i]),ld(jne,{nodeRef:O,in:s||f,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:cd("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:O,onMouseLeave:i?void 0:()=>{f||(T.current=window.setTimeout((()=>R()),500))},onMouseEnter:i?void 0:N,onMouseOver:i?void 0:N,children:[cd(m8,{minWidth:w,maxWidth:i?k:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:m,height:i?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,i&&(n.style.position="fixed",n.style.right="1rem",E(!0))},onResizeStop:(t,n,r,o)=>{const a=i?TU.clamp(Number(m)+o.width,w,Number(k)):Number(m)+o.width;e(ZU(a)),r.removeAttribute("data-resize-alert"),i&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",i?"100%":"100vh"),E(!1),e(iX(!0)))},onResize:(t,n,r,o)=>{const a=TU.clamp(Number(m)+o.width,w,Number(i?k:.95*window.innerWidth));a>=Mae&&!S?C(!0):aa-40&&e($U(a-40)),i&&(a>=k?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${P}px`},children:[cd("div",{className:"image-gallery-header",children:[ld(DT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:cd(sd,S?{children:[ld(B3,{size:"sm","data-selected":"result"===r,onClick:()=>e(YU("result")),children:t("gallery:generations")}),ld(B3,{size:"sm","data-selected":"user"===r,onClick:()=>e(YU("user")),children:t("gallery:uploads")})]}:{children:[ld(k3,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===r,icon:ld(K5,{}),onClick:()=>e(YU("result"))}),ld(k3,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===r,icon:ld(b3,{}),onClick:()=>e(YU("user"))})]})}),cd("div",{className:"image-gallery-header-right-icons",children:[ld(z3,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:ld(k3,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:ld(x3,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:cd("div",{className:"image-gallery-settings-popover",children:[cd("div",{children:[ld(Ite,{value:c,onChange:t=>{e($U(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),ld(k3,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e($U(64)),icon:ld(T9,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),ld("div",{children:ld(k9,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===h,onChange:()=>e(UU("contain"===h?"cover":"contain"))})}),ld("div",{children:ld(k9,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:t=>e(qU(t.target.checked))})}),ld("div",{children:ld(k9,{label:t("gallery:singleColumnLayout"),isChecked:x,onChange:t=>e(XU(t.target.checked))})})]})}),ld(k3,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:A,icon:ld(i?kne:Sne,{})})]})]}),ld("div",{className:"image-gallery-container",ref:M,children:n.length||g?cd(sd,{children:[ld("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map((e=>{const{uuid:t}=e;return ld(Oae,{image:e,isSelected:o===t},t)}))}),ld(RT,{onClick:()=>{e(CQ(r))},isDisabled:!g,className:"image-gallery-load-more-btn",children:t(g?"gallery:loadMore":"gallery:allImagesLoaded")})]}):cd("div",{className:"image-gallery-container-placeholder",children:[ld(P9,{}),ld("p",{children:t("gallery:noImagesInGallery")})]})})]}),_&&ld("div",{style:{width:m+"px",height:"100%"}})]})})}const Iae=uV((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),Rae=uV([e=>e.options,T3],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Nae=e=>{const t=m5(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=v5(Rae),c=(()=>{const{resultImages:e,userImages:t}=v5(Iae);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return ld("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:cd("div",{className:"workarea-main",children:[n,cd("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(G$(r)):"unifiedCanvas"===i&&t(aX(r)))},children:[r,l&&ld(YH,{label:"Toggle Split View",children:ld("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(bU(!a)),t(iX(!0))},children:ld(ire,{})})})]}),!s&&ld(Aae,{})]})})};function Dae(){return ld(Nae,{optionsPanel:ld(Wne,{}),children:ld(ore,{})})}const zae=()=>{const e=m5(),t=v5((e=>e.options.hiresFix)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:t=>e(V$(t.target.checked))})})},Bae=()=>cd(CI,{gap:2,direction:"column",children:[ld(Nte,{}),ld(zae,{})]});function jae(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Bae,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(cne,{accordionInfo:t})]})}const Fae=()=>ld("div",{className:"workarea-single-view",children:ld("div",{className:"text-to-image-area",children:ld(tre,{})})});function Hae(){return ld(Nae,{optionsPanel:ld(jae,{}),children:ld(Fae,{})})}var Wae=function(e,t){return Wae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Wae(e,t)};var Vae=function(){return Vae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Kae(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):Xae(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var Qae=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Jae=function(e,t){var n=Qae(e,t);return e.bounds=n,n};function ese(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:tse(e,s-d,c+d,r),y:tse(t,l-h,u+h,r)}}var tse=function(e,t,n,r){return Uae(r?en?n:e:e,2)};function nse(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):ese(l-t*u,c-n*u,o,i,0,0,null)}function rse(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var ose=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!Tse(i,n)},ise=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var ase=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function sse(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:tse(e,i,a,o)}function lse(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function cse(e,t){var n=e.transformState.scale;Zae(e),Jae(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function use(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=ase(e,i),d=ase(e,a);lse(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=ese(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function dse(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,y=m.lockAxisX,b=g.animationType,x=p.sizeX,w=p.sizeY,k=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,k),_=ase(e,x),E=ase(e,w),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=c+P,M=u-P,T=d+L,A=h-L,I=e.transformState,R=(new Date).getTime();Xae(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/k,g=1-(0,qae[p.animationType])(Math.min(1,l)),m=1-t,b=o+a*m,x=i+s*m,w=sse(b,I.positionX,o,y,f,u,c,M,O,g),S=sse(x,I.positionY,i,v,f,h,d,A,T,g);o===b&&i===x||e.setTransformState(r,w,S)}))}}(e):hse(e)}}function hse(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=v.x,b=v.y;return{scale:o,positionX:g?y:n,positionY:m?b:r}}}(e);u&&Kae(e,u,l,c)}}function fse(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&hse(e),!h&&o&&e.mounted){var f=pse(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&Kae(e,f,u,d)}}function pse(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=rse(Uae(t,2),i,a,0,!1),c=nse(e,n,r,l,Jae(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var gse={previousScale:1,scale:1,positionX:0,positionY:0},mse=Vae(Vae({},gse),{setComponents:function(){},contextInstance:null}),vse={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},yse=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:gse.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:gse.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:gse.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:gse.positionY}},bse=function(e){var t=Vae({},vse);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==vse[n]&&r){var o=Object.prototype.toString.call(vse[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Vae(Vae({},vse[n]),e[n]):a?$ae($ae([],vse[n]),e[n]):e[n]}})),t},xse=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return rse(Uae(c,3),s,a,l,!1)};function wse(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=pse(e,xse(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,r,o)}function kse(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=yse(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=Qae(e,a.scale),h=ese(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||Kae(e,f,t,n)}}var Sse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,1,t,n,r)}},Cse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,-1,t,n,r)}},_se=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};Kae(e,h,o,i)}}},Ese=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),kse(e,t,n)}},Pse=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=Rse(t||o.scale,i,a);Kae(e,s,n,r)}}},Lse=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Zae(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return gse;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=rse(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,y=(l.height-f*m)/2,b=ese((l.left-u)*m+v,(l.top-d)*m+y,Qae(e,m),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:m}}(e,a,n);Kae(e,s,r,o)}}},Ose=function(e){return{instance:e,state:e.transformState,zoomIn:Sse(e),zoomOut:Cse(e),setTransform:_se(e),resetTransform:Ese(e),centerView:Pse(e),zoomToElement:Lse(e)}};function Mse(){try{return{get passive(){return!0,!1}}}catch(Hhe){return!1}}var Tse=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Ase=function(e){e&&clearTimeout(e)},Ise=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},Rse=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Nse=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!Tse(c,a)))};function Dse(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var zse=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!Tse(a,o)},Bse=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},jse=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Fse=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Zae(e),Gae(Ose(e),t,r),Gae(Ose(e),t,o))},Hse=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return rse(Uae(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=Jae(e,m),y=Dse(t,i,s),b=l&&(f||0===h||c),x=nse(e,y.x,y.y,m,v,b),w=x.x,k=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,k),Gae(Ose(e),t,r),Gae(Ose(e),t,o)}},Wse=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Ase(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(fse(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Ase(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Gae(Ose(e),t,r),Gae(Ose(e),t,o))}),160))},Vse=function(e,t){var n=jse(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Zae(e)},$se=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Uae(o[0].clientX-r.left,5),a=Uae(o[0].clientY-r.top,5);return{x:(i+Uae(o[1].clientX-r.left,5))/2/t,y:(a+Uae(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=jse(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:rse(Uae(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=Jae(e,f),g=a&&(c||0===u||s),m=nse(e,d.x,d.y,f,p,g),v=m.x,y=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,y)}}}},Use=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,fse(e,null==t?void 0:t.x,null==t?void 0:t.y)};function Gse(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return kse(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=xse(e,"zoomOut"===o?-1:1,i),d=Dse(t,c,l),h=pse(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,a,s)}}var qse=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!Tse(l,s)&&!!u)},Yse=H.createContext(mse),Zse=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=yse(t.props),t.setup=bse(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=Mse();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Nse(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Fse(t,e),Hse(t,e),Wse(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||ose(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Zae(t),cse(t,e),Gae(Ose(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||ise(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),use(t,e.clientX,e.clientY),Gae(Ose(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(dse(t),Gae(Ose(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||zse(t,e)&&(Vse(t,e),Zae(t),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Bse(t)&&(e.preventDefault(),e.stopPropagation(),$se(t,e),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Use(t),Gae(Ose(t),e,r),Gae(Ose(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&ose(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Zae(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Zae(t),cse(t,e),Gae(Ose(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!ise(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];use(t,o.clientX,o.clientY),Gae(Ose(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||qse(t,e)&&Gse(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Jae(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,Gae(Ose(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Rse(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Ise(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(Ose(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=Mse();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=Mse();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Zae(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Jae(this,this.transformState.scale),this.setup=bse(this.props))},t.prototype.render=function(){var e=Ose(this),t=this.props.children,n="function"==typeof t?t(e):t;return ld(Yse.Provider,{value:Vae(Vae({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(a.exports.Component),Xse=H.forwardRef((function(e,t){var n=a.exports.useState(null),r=n[0],o=n[1];return a.exports.useImperativeHandle(t,(function(){return r}),[r]),ld(Zse,{...Vae({},e,{setRef:o})})}));var Kse="transform-component-module_wrapper__1_Fgj",Qse="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Jse=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=a.exports.useContext(Yse).setComponents,u=a.exports.useRef(null),d=a.exports.useRef(null);return a.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),ld("div",{ref:u,className:"react-transform-wrapper "+Kse+" "+r,style:s,children:ld("div",{ref:d,className:"react-transform-component "+Qse+" "+i,style:l,children:t})})};function ele({image:e,alt:t,ref:n,styleClass:r}){const[o,i]=a.exports.useState(0),[s,l]=a.exports.useState(!1),c=()=>{i(-3===o?0:o-1)},u=()=>{i(3===o?0:o+1)},d=()=>{l(!s)};return ld(Xse,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:a,zoomOut:h,resetTransform:f,centerView:p})=>cd(sd,{children:[cd("div",{className:"lightbox-image-options",children:[ld(k3,{icon:ld(R9,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>a(),fontSize:20}),ld(k3,{icon:ld(N9,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),ld(k3,{icon:ld(A9,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),ld(k3,{icon:ld(I9,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),ld(k3,{icon:ld(E9,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),ld(k3,{icon:ld(T9,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),i(0),l(!1)},fontSize:20})]}),ld(Jse,{wrapperStyle:{width:"100%",height:"100%"},children:ld("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function tle(){const e=m5(),t=v5((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return gte("Esc",(()=>{t&&e(q$(!1))}),[t]),cd("div",{className:"lightbox-container",children:[ld(k3,{icon:ld(M9,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(q$(!1))},fontSize:20}),cd("div",{className:"lightbox-display-container",children:[cd("div",{className:"lightbox-preview-wrapper",children:[ld(Yne,{}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!i&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),n&&cd(sd,{children:[ld(ele,{image:n.url,styleClass:"lightbox-image"}),r&&ld(Kne,{image:n})]})]}),ld(Aae,{})]})]})}const nle=uV([A3],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),rle=()=>{const e=m5(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=v5(nle),{t:i}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{sliderMarkRightOffset:-6,label:i("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(rU(t))},handleReset:()=>e(rU(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(tU(t))},handleReset:()=>{e(tU(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-7,label:i("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:t=>{e(iU(t))},handleReset:()=>{e(iU(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(oU(t))},handleReset:()=>{e(oU(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},ole=uV(une,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),ile=()=>{const e=m5(),{boundingBoxDimensions:t}=v5(ole),{t:n}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:n=>{e(KZ({...t,width:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:n=>{e(KZ({...t,height:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},ale=uV(une,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function sle(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=v5(ale),n=m5(),{t:r}=FY();return cd(CI,{alignItems:"center",columnGap:"1rem",children:[ld(Ite,{label:r("options:inpaintReplace"),value:e,onChange:e=>{n(sX(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(sX(1)),isResetDisabled:!t}),ld(_3,{isChecked:t,onChange:e=>n(RX(e.target.checked)),marginTop:"1.25rem"})]})}const lle=uV([A3,O3,une],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),cle=()=>{const e=m5(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=v5(lle),{t:s}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(E3,{label:s("options:scaleBeforeProcessing"),validValues:CZ,value:o,onChange:t=>{e(JZ(t.target.value))}}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:t=>{e(HX({...a,width:Math.floor(t)}))},handleReset:()=>{e(HX({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:t=>{e(HX({...a,height:Math.floor(t)}))},handleReset:()=>{e(HX({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(sle,{}),ld(E3,{label:s("options:infillMethod"),value:n,validValues:r,onChange:t=>e(U$(t.target.value))}),ld(Ite,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(kU(t))},handleReset:()=>{e(kU(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function ule(){const{t:e}=FY(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:Ete.BOUNDING_BOX,content:ld(ile,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:Ete.SEAM_CORRECTION,content:ld(rle,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:Ete.INFILL_AND_SCALING,content:ld(cle,{})},seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(cne,{accordionInfo:t})]})}const dle=uV(une,hne,T3,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),hle=()=>{const e=m5(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=v5(dle),i=a.exports.useRef(null);return a.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!i.current)return;const{clientWidth:t,clientHeight:n}=i.current;e(nX({width:t,height:n})),e(o?ZZ():YZ()),e(iX(!1))}),0)}),[e,r,t,n,o]),ld("div",{ref:i,className:"inpainting-canvas-area",children:ld(hT,{thickness:"2px",speed:"1s",size:"xl"})})};var fle={exports:{}},ple=function(e){var t={},n=a.exports,r=G.exports,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function yt(e,t,n){if(ht.current!==dt)throw Error(i(168));ut(ht,t),ut(ft,n)}function bt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,C(e)||"Unknown",a));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=bt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var kt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(St(e)/Ct|0)|0},St=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Pt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Pt(s):0!==(i&=a)&&(r=Pt(i))}else 0!==(a=n&~o)?r=Pt(a):0!==i&&(r=Pt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-kt(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<>=a,o-=a,cn=1<<32-kt(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var b=m(o,h,y.value,c);if(null===b){null===h&&(h=p);break}e&&h&&null===b.alternate&&t(o,h),s=a(b,s,f),null===d?u=b:d.sibling=b,d=b,h=p}if(y.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=g(o,y.value,c))&&(s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return vn&&dn(o,f),u}for(h=r(o,h);!y.done;f++,y=l.next())null!==(y=v(h,o,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===b&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case b:return e(r,i,(f=a._init)(a._payload),d)}if(A(a))return y(r,i,a,d);if(k(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),yr=lt(gr);function br(e){if(e===gr)throw Error(i(174));return e}function xr(e,t){ut(yr,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(yr)}function kr(e){var t=br(yr.current),n=br(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function Sr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Pr(){for(var e=0;en?n:4,e(!0);var r=Or.transition;Or.transition={};try{e(!1),t()}finally{Nt=n,Or.transition=r}}function vo(){return Vr().memoizedState}function yo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Un(e,t,n,r))){Na(n,e,r,Ia()),ko(n,t,r)}}function bo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Yt(s,a)){var l=t.interleaved;return null===l?(o.next=o,$n(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(V2){}null!==(n=Un(e,t,o,r))&&(Na(n,e,r,o=Ia()),ko(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var So={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?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=yo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===aa)throw Error(i(349));0!=(30&Mr)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,io(Kr.bind(null,r,a,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-kt(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Ur,useRef:no,useState:function(){return Ur($r)},useDebugValue:ho,useDeferredValue:function(e){return go(Vr(),Ar.memoizedState,e)},useTransition:function(){return[Ur($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr($r)},useDebugValue:ho,useDeferredValue:function(e){var t=Vr();return null===Ar?t.memoizedState=e:go(t,Ar.memoizedState,e)},useTransition:function(){return[Gr($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1};function Po(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(nue){o="\nError generating stack: "+nue.message+"\n"+nue.stack}return{value:e,source:t,stack:o,digest:null}}function Lo(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Oo(e,t){try{console.error(t.value)}catch(Jce){setTimeout((function(){throw Jce}))}}var Mo="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Sa||(Sa=!0,Ca=r),Oo(0,t)},n}function Ao(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Oo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Oo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Mo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=Fr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Fo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Mn)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Mn(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return $o(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=Fr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Uo(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:An(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?yt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yt(0,t.context,!1),xr(e,t.containerInfo)}function Yo(e,t,n,r,o){return Pn(),Ln(o),t.flags|=256,Bo(e,t,n,r),t.child}var Zo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,a=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),ut(Cr,1&a),null===e)return Sn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Lo(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,a);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=je(o).digest,a=Error(i(419)),r=Lo(a,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Gn(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Lo(Error(i(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),Fe(o,t),null):(e=a.treeContext,K&&(mn=$e(o),gn=t,vn=!0,bn=null,yn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Ln(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Fn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Z)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=br(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),Oe(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Oe(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Le(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Me(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=br(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Pe(i,c,n,a,r,t,e,s),F(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Zo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=br(yr.current),n=br(mr.current),t.stateNode=V(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Pr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==bn&&(ja(bn),bn=null))),Xo(e,t),fi(t),null;case 5:Sr(t),n=br(yr.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=br(mr.current),_n(t)){if(!K)throw Error(i(175));e=Ue(t.stateNode,t.type,t.memoizedProps,n,e,t,!yn),t.updateQueue=e,null!==e&&ci(t)}else{var a=B(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,F(a,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=br(yr.current),n=br(mr.current),_n(t)){if(!K)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ge(e,n,t,!yn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Pn(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!K)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));qe(o,t)}else Pn(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==bn&&(ja(bn),bn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return jn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ba&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ba&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Z&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Pr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Sr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));Pn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return jn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var mi=!1,vi=!1,yi="function"==typeof WeakSet?WeakSet:Set,bi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(oue){ns(e,t,oue)}else n.current=null}function wi(e,t,n){try{n()}catch(oue){ns(e,t,oue)}}var ki=!1;function Si(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),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 Pi(e){return 5===e.tag||3===e.tag||4===e.tag}function Li(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Pi(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ye(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}var Ti=null,Ai=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount(Gt,n)}catch(iue){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Z){var r=Ti,o=Ai;Ti=null,Ii(e,t,n),Ai=o,null!==(Ti=r)&&(Ai?xe(Ti,n.stateNode):be(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Z&&null!==Ti&&(Ai?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Z?(r=Ti,o=Ai,Ti=n.stateNode.containerInfo,Ai=!0,Ii(e,t,n),Ti=r,Ai=o):(X&&(r=n.stateNode.containerInfo,o=Le(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(iue){ns(n,t,iue)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new yi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Qi(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=$(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(i(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&($a(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=va,va=n,null!==t&&ja(t)),e}function ja(e){null===va?va=e:va.push.apply(va,e)}function Fa(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Pa)var r=!1;else{if(e=Pa,Pa=null,La=0,0!=(6&ia))throw Error(i(331));var o=ia;for(ia|=4,bi=e.current;null!==bi;){var a=bi,s=a.child;if(0!=(16&bi.flags)){var l=a.deletions;if(null!==l){for(var c=0;cHt()-ya?$a(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=Gn(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(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 cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=a,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=a,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=a,e;case x:return ps(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case y:s=14;break e;case b:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function ys(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yn(i),e}function bs(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(mt(n))return bt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=L(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&a>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>a&&(c.height+=h-a,c.y=a),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Ss,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Gt=t.inject(e),qt=t}catch(Jce){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(i(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=bs(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; /** * @license React * react-reconciler.production.min.js diff --git a/frontend/dist/assets/index.21ff81eb.js b/frontend/dist/assets/index.dca51560.js similarity index 76% rename from frontend/dist/assets/index.21ff81eb.js rename to frontend/dist/assets/index.dca51560.js index ae1e4c9c2f..ede6f94277 100644 --- a/frontend/dist/assets/index.21ff81eb.js +++ b/frontend/dist/assets/index.dca51560.js @@ -1,4 +1,4 @@ -var YJ=Object.defineProperty;var KJ=(e,t,n)=>t in e?YJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(KJ(e,typeof t!="symbol"?t+"":t,n),n);function xze(){import("data:text/javascript,")}function qN(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 xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},nn={};/** +var YJ=Object.defineProperty;var KJ=(e,t,n)=>t in e?YJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(KJ(e,typeof t!="symbol"?t+"":t,n),n);function wze(){import("data:text/javascript,")}function qN(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 xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},nn={};/** * @license React * react.production.min.js * @@ -66,8 +66,8 @@ Error generating stack: `+o.message+` top: ${s}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(u)}},[t]),y(Tge,{isPresent:t,childRef:r,sizeRef:i,children:C.exports.cloneElement(e,{ref:r})})}const B6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=GS(Age),l=C.exports.useId(),u=C.exports.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:f=>{s.set(f,!0);for(const p of s.values())if(!p)return;r&&r()},register:f=>(s.set(f,!1),()=>s.delete(f))}),o?void 0:[n]);return C.exports.useMemo(()=>{s.forEach((f,p)=>s.set(p,!1))},[n]),C.exports.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=y(Lge,{isPresent:n,children:e})),y(p1.Provider,{value:u,children:e})};function Age(){return new Map}const $0=e=>e.key||"";function Oge(e,t){e.forEach(n=>{const r=$0(n);t.set(r,n)})}function Mge(e){const t=[];return C.exports.Children.forEach(e,n=>{C.exports.isValidElement(n)&&t.push(n)}),t}const cf=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",tj(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=Pge();const l=C.exports.useContext(uk).forceRender;l&&(s=l);const u=Lj(),f=Mge(e);let p=f;const m=new Set,v=C.exports.useRef(p),b=C.exports.useRef(new Map).current,x=C.exports.useRef(!0);if(d5(()=>{x.current=!1,Oge(f,b),v.current=p}),yk(()=>{x.current=!0,b.clear(),m.clear()}),x.current)return y(fn,{children:p.map(T=>y(B6,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a,children:T},$0(T)))});p=[...p];const E=v.current.map($0),k=f.map($0),_=E.length;for(let T=0;T<_;T++){const A=E[T];k.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(p=[]),m.forEach(T=>{if(k.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const R=E.indexOf(T),I=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(B=>B.key===T);if(v.current.splice(D,1),!m.size){if(v.current=f,u.current===!1)return;s(),r&&r()}};p.splice(R,0,y(B6,{isPresent:!1,onExitComplete:I,custom:t,presenceAffectsLayout:o,mode:a,children:A},$0(A)))}),p=p.map(T=>{const A=T.key;return m.has(A)?T:y(B6,{isPresent:!0,presenceAffectsLayout:o,mode:a,children:T},$0(T))}),ej!=="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.`),y(fn,{children:m.size?p:p.map(T=>C.exports.cloneElement(T))})};var Ul=function(){return Ul=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[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 b9(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function Rge(){return!1}var Ige=e=>{const{condition:t,message:n}=e;t&&Rge()&&console.warn(n)},Mh={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Zm={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 S9(e){var n;switch((n=e==null?void 0:e.direction)!=null?n:"right"){case"right":return Zm.slideRight;case"left":return Zm.slideLeft;case"bottom":return Zm.slideDown;case"top":return Zm.slideUp;default:return Zm.slideRight}}var zh={enter:{duration:.2,ease:Mh.easeOut},exit:{duration:.1,ease:Mh.easeIn}},Zs={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Dge=e=>e!=null&&parseInt(e.toString(),10)>0,dM={exit:{height:{duration:.2,ease:Mh.ease},opacity:{duration:.3,ease:Mh.ease}},enter:{height:{duration:.3,ease:Mh.ease},opacity:{duration:.4,ease:Mh.ease}}},Nge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:Dge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(dM.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:Zs.enter(dM.enter,i)}}},Oj=C.exports.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:f,...p}=e,[m,v]=C.exports.useState(!1);C.exports.useEffect(()=>{const _=setTimeout(()=>{v(!0)});return()=>clearTimeout(_)},[]),Ige({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,x={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:f==null?void 0:f.enter,exit:r?f==null?void 0:f.exit:{...f==null?void 0:f.exit,display:b?"block":"none"}}},E=r?n:!0,k=n||r?"enter":"exit";return y(cf,{initial:!1,custom:x,children:E&&oe.createElement(gu.div,{ref:t,...p,className:vy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:x,variants:Nge,initial:r?"exit":!1,animate:k,exit:"exit"})})});Oj.displayName="Collapse";var Bge={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Zs.exit(zh.exit,n),transitionEnd:t==null?void 0:t.exit}}},Mj={initial:"exit",animate:"enter",exit:"exit",variants:Bge},$ge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,f=i||r?"enter":"exit",p=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return y(cf,{custom:m,children:p&&oe.createElement(gu.div,{ref:n,className:vy("chakra-fade",o),custom:m,...Mj,animate:f,...u})})});$ge.displayName="Fade";var Fge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(zh.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:e==null?void 0:e.enter}}},Rj={initial:"exit",animate:"enter",exit:"exit",variants:Fge},zge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:f,...p}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:f};return y(cf,{custom:b,children:m&&oe.createElement(gu.div,{ref:n,className:vy("chakra-offset-slide",s),...Rj,animate:v,custom:b,...p})})});zge.displayName="ScaleFade";var fM={exit:{duration:.15,ease:Mh.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},jge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:i}=S9({direction:e});return{...i,transition:(o=t==null?void 0:t.exit)!=null?o:Zs.exit(fM.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:i}=S9({direction:e});return{...i,transition:(o=n==null?void 0:n.enter)!=null?o:Zs.enter(fM.enter,r),transitionEnd:t==null?void 0:t.enter}}},Ij=C.exports.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:f,motionProps:p,...m}=t,v=S9({direction:r}),b=Object.assign({position:"fixed"},v.position,i),x=o?a&&o:!0,E=a||o?"enter":"exit",k={transitionEnd:u,transition:l,direction:r,delay:f};return y(cf,{custom:k,children:x&&oe.createElement(gu.div,{...m,ref:n,initial:"exit",className:vy("chakra-slide",s),animate:E,exit:"exit",custom:k,variants:jge,style:b,...p})})});Ij.displayName="Slide";var Hge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(zh.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:Zs.exit(zh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},x9={initial:"initial",animate:"enter",exit:"exit",variants:Hge},Vge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:f,delay:p,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",x={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:f,delay:p};return y(cf,{custom:x,children:v&&oe.createElement(gu.div,{ref:n,className:vy("chakra-offset-slide",a),custom:x,...x9,animate:b,...m})})});Vge.displayName="SlideFade";var yy=(...e)=>e.filter(Boolean).join(" ");function Uge(){return!1}var JS=e=>{const{condition:t,message:n}=e;t&&Uge()&&console.warn(n)};function $6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Wge,ex]=An({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Gge,Ik]=An({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[qge,Cze,Yge,Kge]=nz(),tg=Oe(function(t,n){const{getButtonProps:r}=Ik(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ex().button};return oe.createElement(_e.button,{...i,className:yy("chakra-accordion__button",t.className),__css:a})});tg.displayName="AccordionButton";function Xge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Jge(e),e1e(e);const s=Yge(),[l,u]=C.exports.useState(-1);C.exports.useEffect(()=>()=>{u(-1)},[]);const[f,p]=HS({value:r,defaultValue(){return i?n!=null?n:[]:n!=null?n:-1},onChange:t});return{index:f,setIndex:p,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(f)?f.includes(v):f===v),{isOpen:b,onChange:E=>{if(v!==null)if(i&&Array.isArray(f)){const k=E?f.concat(v):f.filter(_=>_!==v);p(k)}else E?p(v):o&&p(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Zge,Dk]=An({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Qge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=Dk(),s=C.exports.useRef(null),l=C.exports.useId(),u=r!=null?r:l,f=`accordion-button-${u}`,p=`accordion-panel-${u}`;t1e(e);const{register:m,index:v,descendants:b}=Kge({disabled:t&&!n}),{isOpen:x,onChange:E}=o(v===-1?null:v);n1e({isOpen:x,isDisabled:t});const k=()=>{E==null||E(!0)},_=()=>{E==null||E(!1)},T=C.exports.useCallback(()=>{E==null||E(!x),a(v)},[v,a,x,E]),A=C.exports.useCallback(B=>{const j={ArrowDown:()=>{const Y=b.nextEnabled(v);Y==null||Y.node.focus()},ArrowUp:()=>{const Y=b.prevEnabled(v);Y==null||Y.node.focus()},Home:()=>{const Y=b.firstEnabled();Y==null||Y.node.focus()},End:()=>{const Y=b.lastEnabled();Y==null||Y.node.focus()}}[B.key];j&&(B.preventDefault(),j(B))},[b,v]),R=C.exports.useCallback(()=>{a(v)},[a,v]),I=C.exports.useCallback(function(z={},j=null){return{...z,type:"button",ref:Gn(m,s,j),id:f,disabled:!!t,"aria-expanded":!!x,"aria-controls":p,onClick:$6(z.onClick,T),onFocus:$6(z.onFocus,R),onKeyDown:$6(z.onKeyDown,A)}},[f,t,x,T,R,A,p,m]),D=C.exports.useCallback(function(z={},j=null){return{...z,ref:j,role:"region",id:p,"aria-labelledby":f,hidden:!x}},[f,x,p]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:I,getPanelProps:D,htmlProps:i}}function Jge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;JS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function e1e(e){JS({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 t1e(e){JS({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 n1e(e){JS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function ng(e){const{isOpen:t,isDisabled:n}=Ik(),{reduceMotion:r}=Dk(),i=yy("chakra-accordion__icon",e.className),o=ex(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return y($a,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:y("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}ng.displayName="AccordionIcon";var rg=Oe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Qge(t),l={...ex().container,overflowAnchor:"none"},u=C.exports.useMemo(()=>a,[a]);return oe.createElement(Gge,{value:u},oe.createElement(_e.div,{ref:n,...o,className:yy("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});rg.displayName="AccordionItem";var ig=Oe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=Dk(),{getPanelProps:s,isOpen:l}=Ik(),u=s(o,n),f=yy("chakra-accordion__panel",r),p=ex();a||delete u.hidden;const m=oe.createElement(_e.div,{...u,__css:p.panel,className:f});return a?m:y(Oj,{in:l,...i,children:m})});ig.displayName="AccordionPanel";var Nk=Oe(function({children:t,reduceMotion:n,...r},i){const o=qi("Accordion",r),a=_n(r),{htmlProps:s,descendants:l,...u}=Xge(a),f=C.exports.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return oe.createElement(qge,{value:l},oe.createElement(Zge,{value:f},oe.createElement(Wge,{value:o},oe.createElement(_e.div,{ref:i,...s,className:yy("chakra-accordion",r.className),__css:o.root},t))))});Nk.displayName="Accordion";var r1e=(...e)=>e.filter(Boolean).join(" "),i1e=uf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),by=Oe((e,t)=>{const n=Lo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=_n(e),u=r1e("chakra-spinner",s),f={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${i1e} ${o} linear infinite`,...n};return oe.createElement(_e.div,{ref:t,__css:f,className:u,...l},r&&oe.createElement(_e.span,{srOnly:!0},r))});by.displayName="Spinner";var tx=(...e)=>e.filter(Boolean).join(" ");function o1e(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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 a1e(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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 hM(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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[s1e,l1e]=An({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[u1e,Bk]=An({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Dj={info:{icon:a1e,colorScheme:"blue"},warning:{icon:hM,colorScheme:"orange"},success:{icon:o1e,colorScheme:"green"},error:{icon:hM,colorScheme:"red"},loading:{icon:by,colorScheme:"blue"}};function c1e(e){return Dj[e].colorScheme}function d1e(e){return Dj[e].icon}var Nj=Oe(function(t,n){var u;const{status:r="info",addRole:i=!0,...o}=_n(t),a=(u=t.colorScheme)!=null?u:c1e(r),s=qi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return oe.createElement(s1e,{value:{status:r}},oe.createElement(u1e,{value:s},oe.createElement(_e.div,{role:i?"alert":void 0,ref:n,...o,className:tx("chakra-alert",t.className),__css:l})))});Nj.displayName="Alert";var Bj=Oe(function(t,n){const i={display:"inline",...Bk().description};return oe.createElement(_e.div,{ref:n,...t,className:tx("chakra-alert__desc",t.className),__css:i})});Bj.displayName="AlertDescription";function $j(e){const{status:t}=l1e(),n=d1e(t),r=Bk(),i=t==="loading"?r.spinner:r.icon;return oe.createElement(_e.span,{display:"inherit",...e,className:tx("chakra-alert__icon",e.className),__css:i},e.children||y(n,{h:"100%",w:"100%"}))}$j.displayName="AlertIcon";var Fj=Oe(function(t,n){const r=Bk();return oe.createElement(_e.div,{ref:n,...t,className:tx("chakra-alert__title",t.className),__css:r.title})});Fj.displayName="AlertTitle";function f1e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function h1e(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,f]=C.exports.useState("pending");C.exports.useEffect(()=>{f(n?"loading":"pending")},[n]);const p=C.exports.useRef(),m=C.exports.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=x=>{v(),f("loaded"),i==null||i(x)},b.onerror=x=>{v(),f("failed"),o==null||o(x)},p.current=b},[n,a,r,s,i,o,t]),v=()=>{p.current&&(p.current.onload=null,p.current.onerror=null,p.current=null)};return Ys(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var p1e=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",C5=Oe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return y("img",{width:r,height:i,ref:n,alt:o,...a})});C5.displayName="NativeImage";var nx=Oe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:f,crossOrigin:p,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,x=r!==void 0||i!==void 0,E=u!=null||f||!x,k=h1e({...t,ignoreFallback:E}),_=p1e(k,m),T={ref:n,objectFit:l,objectPosition:s,...E?b:f1e(b,["onError","onLoad"])};return _?i||oe.createElement(_e.img,{as:C5,className:"chakra-image__placeholder",src:r,...T}):oe.createElement(_e.img,{as:C5,src:o,srcSet:a,crossOrigin:p,loading:u,referrerPolicy:v,className:"chakra-image",...T})});nx.displayName="Image";Oe((e,t)=>oe.createElement(_e.img,{ref:t,as:C5,className:"chakra-image",...e}));function rx(e){return C.exports.Children.toArray(e).filter(t=>C.exports.isValidElement(t))}var ix=(...e)=>e.filter(Boolean).join(" "),pM=e=>e?"":void 0,[g1e,m1e]=An({strict:!1,name:"ButtonGroupContext"});function w9(e){const{children:t,className:n,...r}=e,i=C.exports.isValidElement(t)?C.exports.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=ix("chakra-button__icon",n);return oe.createElement(_e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}w9.displayName="ButtonIcon";function C9(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=y(by,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=ix("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",f=C.exports.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return oe.createElement(_e.div,{className:l,...s,__css:f},i)}C9.displayName="ButtonSpinner";function v1e(e){const[t,n]=C.exports.useState(!e);return{ref:C.exports.useCallback(o=>{!o||n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ds=Oe((e,t)=>{const n=m1e(),r=Lo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:f,iconSpacing:p="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:x,as:E,...k}=_n(e),_=C.exports.useMemo(()=>{const I={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:I}}},[r,n]),{ref:T,type:A}=v1e(E),R={rightIcon:u,leftIcon:l,iconSpacing:p,children:s};return oe.createElement(_e.button,{disabled:i||o,ref:Fde(t,T),as:E,type:m!=null?m:A,"data-active":pM(a),"data-loading":pM(o),__css:_,className:ix("chakra-button",x),...k},o&&b==="start"&&y(C9,{className:"chakra-button__spinner--start",label:f,placement:"start",spacing:p,children:v}),o?f||oe.createElement(_e.span,{opacity:0},y(gM,{...R})):y(gM,{...R}),o&&b==="end"&&y(C9,{className:"chakra-button__spinner--end",label:f,placement:"end",spacing:p,children:v}))});ds.displayName="Button";function gM(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return K(fn,{children:[t&&y(w9,{marginEnd:i,children:t}),r,n&&y(w9,{marginStart:i,children:n})]})}var io=Oe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...f}=t,p=ix("chakra-button__group",a),m=C.exports.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *: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}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},oe.createElement(g1e,{value:m},oe.createElement(_e.div,{ref:n,role:"group",__css:v,className:p,"data-attached":l?"":void 0,...f}))});io.displayName="ButtonGroup";var fs=Oe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=C.exports.isValidElement(s)?C.exports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return y(ds,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});fs.displayName="IconButton";var y1=(...e)=>e.filter(Boolean).join(" "),lb=e=>e?"":void 0,F6=e=>e?!0:void 0;function mM(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[y1e,zj]=An({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[b1e,b1]=An({strict:!1,name:"FormControlContext"});function S1e(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=C.exports.useId(),l=t||`field-${s}`,u=`${l}-label`,f=`${l}-feedback`,p=`${l}-helptext`,[m,v]=C.exports.useState(!1),[b,x]=C.exports.useState(!1),[E,k]=C.exports.useState(!1),_=C.exports.useCallback((D={},B=null)=>({id:p,...D,ref:Gn(B,z=>{!z||x(!0)})}),[p]),T=C.exports.useCallback((D={},B=null)=>{var z,j;return{...D,ref:B,"data-focus":lb(E),"data-disabled":lb(i),"data-invalid":lb(r),"data-readonly":lb(o),id:(z=D.id)!=null?z:u,htmlFor:(j=D.htmlFor)!=null?j:l}},[l,i,E,r,o,u]),A=C.exports.useCallback((D={},B=null)=>({id:f,...D,ref:Gn(B,z=>{!z||v(!0)}),"aria-live":"polite"}),[f]),R=C.exports.useCallback((D={},B=null)=>({...D,...a,ref:B,role:"group"}),[a]),I=C.exports.useCallback((D={},B=null)=>({...D,ref:B,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:x,id:l,labelId:u,feedbackId:f,helpTextId:p,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:R,getLabelProps:T,getRequiredIndicatorProps:I}}var Ir=Oe(function(t,n){const r=qi("Form",t),i=_n(t),{getRootProps:o,htmlProps:a,...s}=S1e(i),l=y1("chakra-form-control",t.className);return oe.createElement(b1e,{value:s},oe.createElement(y1e,{value:r},oe.createElement(_e.div,{...o({},n),className:l,__css:r.container})))});Ir.displayName="FormControl";var Uo=Oe(function(t,n){const r=b1(),i=zj(),o=y1("chakra-form__helper-text",t.className);return oe.createElement(_e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});Uo.displayName="FormHelperText";function $k(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=Fk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":F6(n),"aria-required":F6(i),"aria-readonly":F6(r)}}function Fk(e){var b,x,E;const t=b1(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:f,onBlur:p,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return(t==null?void 0:t.hasFeedbackText)&&(t==null?void 0:t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n!=null?n:t==null?void 0:t.id,isDisabled:(b=r!=null?r:u)!=null?b:t==null?void 0:t.isDisabled,isReadOnly:(x=i!=null?i:l)!=null?x:t==null?void 0:t.isReadOnly,isRequired:(E=o!=null?o:a)!=null?E:t==null?void 0:t.isRequired,isInvalid:s!=null?s:t==null?void 0:t.isInvalid,onFocus:mM(t==null?void 0:t.onFocus,f),onBlur:mM(t==null?void 0:t.onBlur,p)}}var[x1e,w1e]=An({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Wo=Oe((e,t)=>{const n=qi("FormError",e),r=_n(e),i=b1();return i!=null&&i.isInvalid?oe.createElement(x1e,{value:n},oe.createElement(_e.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:y1("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});Wo.displayName="FormErrorMessage";var C1e=Oe((e,t)=>{const n=w1e(),r=b1();if(!(r!=null&&r.isInvalid))return null;const i=y1("chakra-form__error-icon",e.className);return y($a,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:y("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"})})});C1e.displayName="FormErrorIcon";var ti=Oe(function(t,n){var m;const r=Lo("FormLabel",t),i=_n(t),{className:o,children:a,requiredIndicator:s=y(jj,{}),optionalIndicator:l=null,...u}=i,f=b1(),p=(m=f==null?void 0:f.getLabelProps(u,n))!=null?m:{ref:n,...u};return oe.createElement(_e.label,{...p,className:y1("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,f!=null&&f.isRequired?s:l)});ti.displayName="FormLabel";var jj=Oe(function(t,n){const r=b1(),i=zj();if(!(r!=null&&r.isRequired))return null;const o=y1("chakra-form__required-indicator",t.className);return oe.createElement(_e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});jj.displayName="RequiredIndicator";function Kd(e,t){const n=C.exports.useRef(!1),r=C.exports.useRef(!1);C.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),C.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var zk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_1e=_e("span",{baseStyle:zk});_1e.displayName="VisuallyHidden";var k1e=_e("input",{baseStyle:zk});k1e.displayName="VisuallyHiddenInput";var vM=!1,ox=null,Xg=!1,_9=new Set,E1e=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function P1e(e){return!(e.metaKey||!E1e&&e.altKey||e.ctrlKey)}function jk(e,t){_9.forEach(n=>n(e,t))}function yM(e){Xg=!0,P1e(e)&&(ox="keyboard",jk("keyboard",e))}function C0(e){ox="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Xg=!0,jk("pointer",e))}function T1e(e){e.target===window||e.target===document||(Xg||(ox="keyboard",jk("keyboard",e)),Xg=!1)}function L1e(){Xg=!1}function bM(){return ox!=="pointer"}function A1e(){if(typeof window>"u"||vM)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Xg=!0,e.apply(this,n)},document.addEventListener("keydown",yM,!0),document.addEventListener("keyup",yM,!0),window.addEventListener("focus",T1e,!0),window.addEventListener("blur",L1e,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",C0,!0),document.addEventListener("pointermove",C0,!0),document.addEventListener("pointerup",C0,!0)):(document.addEventListener("mousedown",C0,!0),document.addEventListener("mousemove",C0,!0),document.addEventListener("mouseup",C0,!0)),vM=!0}function O1e(e){A1e(),e(bM());const t=()=>e(bM());return _9.add(t),()=>{_9.delete(t)}}var[_ze,M1e]=An({name:"CheckboxGroupContext",strict:!1}),R1e=(...e)=>e.filter(Boolean).join(" "),vo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function I1e(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function D1e(e){return oe.createElement(_e.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},y("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function N1e(e){return oe.createElement(_e.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},y("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function B1e(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?N1e:D1e;return n||t?oe.createElement(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},y(i,{...r})):null}function $1e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hj(e={}){const t=Fk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:f,isChecked:p,isFocusable:m,onChange:v,isIndeterminate:b,name:x,value:E,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":T,"aria-invalid":A,...R}=e,I=$1e(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=br(v),B=br(s),z=br(l),[j,Y]=C.exports.useState(!1),[te,G]=C.exports.useState(!1),[$,V]=C.exports.useState(!1),[J,Z]=C.exports.useState(!1);C.exports.useEffect(()=>O1e(Y),[]);const U=C.exports.useRef(null),[X,le]=C.exports.useState(!0),[fe,Se]=C.exports.useState(!!f),Ae=p!==void 0,be=Ae?p:fe,ke=C.exports.useCallback(Le=>{if(r||n){Le.preventDefault();return}Ae||Se(be?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,be,Ae,b,D]);Ys(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Kd(()=>{n&&G(!1)},[n,G]),Ys(()=>{const Le=U.current;!(Le!=null&&Le.form)||(Le.form.onreset=()=>{Se(!!f)})},[]);const De=n&&!m,Je=C.exports.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),Ye=C.exports.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Ys(()=>{if(!U.current)return;U.current.checked!==be&&Se(U.current.checked)},[U.current]);const mt=C.exports.useCallback((Le={},ut=null)=>{const Rt=ot=>{te&&ot.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":vo(J),"data-hover":vo($),"data-checked":vo(be),"data-focus":vo(te),"data-focus-visible":vo(te&&j),"data-indeterminate":vo(b),"data-disabled":vo(n),"data-invalid":vo(o),"data-readonly":vo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Rt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>V(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>V(!1))}},[J,be,n,te,j,$,b,o,r]),_t=C.exports.useCallback((Le={},ut=null)=>({...I,...Le,ref:Gn(ut,Rt=>{!Rt||le(Rt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Rt;X||((Rt=U.current)==null||Rt.click(),requestAnimationFrame(()=>{var ot;(ot=U.current)==null||ot.focus()}))}),"data-disabled":vo(n),"data-checked":vo(be),"data-invalid":vo(o)}),[I,n,be,o,X]),dt=C.exports.useCallback((Le={},ut=null)=>({...Le,ref:Gn(U,ut),type:"checkbox",name:x,value:E,id:a,tabIndex:k,onChange:Ka(Le.onChange,ke),onBlur:Ka(Le.onBlur,B,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,Je),onKeyUp:Ka(Le.onKeyUp,Ye),required:i,checked:be,disabled:De,readOnly:r,"aria-label":_,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:zk}),[x,E,a,ke,B,z,Je,Ye,i,be,De,r,_,T,A,o,u,n,k]),vt=C.exports.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,SM),onTouchStart:Ka(Le.onTouchStart,SM),"data-disabled":vo(n),"data-checked":vo(be),"data-invalid":vo(o)}),[be,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:be,isActive:J,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:_t,getCheckboxProps:mt,getInputProps:dt,getLabelProps:vt,htmlProps:I}}function SM(e){e.preventDefault(),e.stopPropagation()}var F1e={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},z1e={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},j1e=uf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),H1e=uf({from:{opacity:0},to:{opacity:1}}),V1e=uf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Vj=Oe(function(t,n){const r=M1e(),i={...r,...t},o=qi("Checkbox",i),a=_n(t),{spacing:s="0.5rem",className:l,children:u,iconColor:f,iconSize:p,icon:m=y(B1e,{}),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:x,inputProps:E,...k}=a;let _=v;(r==null?void 0:r.value)&&a.value&&(_=r.value.includes(a.value));let T=x;(r==null?void 0:r.onChange)&&a.value&&(T=I1e(r.onChange,x));const{state:A,getInputProps:R,getCheckboxProps:I,getLabelProps:D,getRootProps:B}=Hj({...k,isDisabled:b,isChecked:_,onChange:T}),z=C.exports.useMemo(()=>({animation:A.isIndeterminate?`${H1e} 20ms linear, ${V1e} 200ms linear`:`${j1e} 200ms linear`,fontSize:p,color:f,...o.icon}),[f,p,,A.isIndeterminate,o.icon]),j=C.exports.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return oe.createElement(_e.label,{__css:{...z1e,...o.container},className:R1e("chakra-checkbox",l),...B()},y("input",{className:"chakra-checkbox__input",...R(E,n)}),oe.createElement(_e.span,{__css:{...F1e,...o.control},className:"chakra-checkbox__control",...I()},j),u&&oe.createElement(_e.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});Vj.displayName="Checkbox";function U1e(e){return y($a,{focusable:"false","aria-hidden":!0,...e,children:y("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 ax=Oe(function(t,n){const r=Lo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=_n(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return oe.createElement(_e.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||y(U1e,{width:"1em",height:"1em"}))});ax.displayName="CloseButton";function W1e(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function Hk(e,t){let n=W1e(e);const r=10**(t!=null?t:10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function k9(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 _5(e,t,n){return(e-t)*100/(n-t)}function Uj(e,t,n){return(n-t)*e+t}function E9(e,t,n){const r=Math.round((e-t)/n)*n+t,i=k9(n);return Hk(r,i)}function Lg(e,t,n){return e==null?e:(n{var j;return r==null?"":(j=z6(r,o,n))!=null?j:""}),m=typeof i<"u",v=m?i:f,b=Wj(gd(v),o),x=n!=null?n:b,E=C.exports.useCallback(j=>{j!==v&&(m||p(j.toString()),u==null||u(j.toString(),gd(j)))},[u,m,v]),k=C.exports.useCallback(j=>{let Y=j;return l&&(Y=Lg(Y,a,s)),Hk(Y,x)},[x,l,s,a]),_=C.exports.useCallback((j=o)=>{let Y;v===""?Y=gd(j):Y=gd(v)+j,Y=k(Y),E(Y)},[k,o,E,v]),T=C.exports.useCallback((j=o)=>{let Y;v===""?Y=gd(-j):Y=gd(v)-j,Y=k(Y),E(Y)},[k,o,E,v]),A=C.exports.useCallback(()=>{var Y;let j;r==null?j="":j=(Y=z6(r,o,n))!=null?Y:a,E(j)},[r,n,o,E,a]),R=C.exports.useCallback(j=>{var te;const Y=(te=z6(j,o,x))!=null?te:a;E(Y)},[x,o,E,a]),I=gd(v);return{isOutOfRange:I>s||I{document.head.removeChild(u)}},[t]),y(Tge,{isPresent:t,childRef:r,sizeRef:i,children:C.exports.cloneElement(e,{ref:r})})}const B6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=GS(Age),l=C.exports.useId(),u=C.exports.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:f=>{s.set(f,!0);for(const p of s.values())if(!p)return;r&&r()},register:f=>(s.set(f,!1),()=>s.delete(f))}),o?void 0:[n]);return C.exports.useMemo(()=>{s.forEach((f,p)=>s.set(p,!1))},[n]),C.exports.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=y(Lge,{isPresent:n,children:e})),y(p1.Provider,{value:u,children:e})};function Age(){return new Map}const $0=e=>e.key||"";function Oge(e,t){e.forEach(n=>{const r=$0(n);t.set(r,n)})}function Mge(e){const t=[];return C.exports.Children.forEach(e,n=>{C.exports.isValidElement(n)&&t.push(n)}),t}const cf=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",tj(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=Pge();const l=C.exports.useContext(uk).forceRender;l&&(s=l);const u=Lj(),f=Mge(e);let p=f;const m=new Set,v=C.exports.useRef(p),b=C.exports.useRef(new Map).current,x=C.exports.useRef(!0);if(d5(()=>{x.current=!1,Oge(f,b),v.current=p}),yk(()=>{x.current=!0,b.clear(),m.clear()}),x.current)return y(fn,{children:p.map(T=>y(B6,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a,children:T},$0(T)))});p=[...p];const E=v.current.map($0),k=f.map($0),_=E.length;for(let T=0;T<_;T++){const A=E[T];k.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(p=[]),m.forEach(T=>{if(k.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const R=E.indexOf(T),I=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(B=>B.key===T);if(v.current.splice(D,1),!m.size){if(v.current=f,u.current===!1)return;s(),r&&r()}};p.splice(R,0,y(B6,{isPresent:!1,onExitComplete:I,custom:t,presenceAffectsLayout:o,mode:a,children:A},$0(A)))}),p=p.map(T=>{const A=T.key;return m.has(A)?T:y(B6,{isPresent:!0,presenceAffectsLayout:o,mode:a,children:T},$0(T))}),ej!=="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.`),y(fn,{children:m.size?p:p.map(T=>C.exports.cloneElement(T))})};var Ul=function(){return Ul=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[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 b9(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function Rge(){return!1}var Ige=e=>{const{condition:t,message:n}=e;t&&Rge()&&console.warn(n)},Mh={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Zm={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 S9(e){var n;switch((n=e==null?void 0:e.direction)!=null?n:"right"){case"right":return Zm.slideRight;case"left":return Zm.slideLeft;case"bottom":return Zm.slideDown;case"top":return Zm.slideUp;default:return Zm.slideRight}}var zh={enter:{duration:.2,ease:Mh.easeOut},exit:{duration:.1,ease:Mh.easeIn}},Zs={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Dge=e=>e!=null&&parseInt(e.toString(),10)>0,dM={exit:{height:{duration:.2,ease:Mh.ease},opacity:{duration:.3,ease:Mh.ease}},enter:{height:{duration:.3,ease:Mh.ease},opacity:{duration:.4,ease:Mh.ease}}},Nge={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:Dge(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(dM.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:Zs.enter(dM.enter,i)}}},Oj=C.exports.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:f,...p}=e,[m,v]=C.exports.useState(!1);C.exports.useEffect(()=>{const _=setTimeout(()=>{v(!0)});return()=>clearTimeout(_)},[]),Ige({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,x={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:f==null?void 0:f.enter,exit:r?f==null?void 0:f.exit:{...f==null?void 0:f.exit,display:b?"block":"none"}}},E=r?n:!0,k=n||r?"enter":"exit";return y(cf,{initial:!1,custom:x,children:E&&oe.createElement(gu.div,{ref:t,...p,className:vy("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:x,variants:Nge,initial:r?"exit":!1,animate:k,exit:"exit"})})});Oj.displayName="Collapse";var Bge={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Zs.exit(zh.exit,n),transitionEnd:t==null?void 0:t.exit}}},Mj={initial:"exit",animate:"enter",exit:"exit",variants:Bge},$ge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,f=i||r?"enter":"exit",p=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return y(cf,{custom:m,children:p&&oe.createElement(gu.div,{ref:n,className:vy("chakra-fade",o),custom:m,...Mj,animate:f,...u})})});$ge.displayName="Fade";var Fge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(zh.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:e==null?void 0:e.enter}}},Rj={initial:"exit",animate:"enter",exit:"exit",variants:Fge},zge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:f,...p}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:f};return y(cf,{custom:b,children:m&&oe.createElement(gu.div,{ref:n,className:vy("chakra-offset-slide",s),...Rj,animate:v,custom:b,...p})})});zge.displayName="ScaleFade";var fM={exit:{duration:.15,ease:Mh.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},jge={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:i}=S9({direction:e});return{...i,transition:(o=t==null?void 0:t.exit)!=null?o:Zs.exit(fM.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:i}=S9({direction:e});return{...i,transition:(o=n==null?void 0:n.enter)!=null?o:Zs.enter(fM.enter,r),transitionEnd:t==null?void 0:t.enter}}},Ij=C.exports.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:f,motionProps:p,...m}=t,v=S9({direction:r}),b=Object.assign({position:"fixed"},v.position,i),x=o?a&&o:!0,E=a||o?"enter":"exit",k={transitionEnd:u,transition:l,direction:r,delay:f};return y(cf,{custom:k,children:x&&oe.createElement(gu.div,{...m,ref:n,initial:"exit",className:vy("chakra-slide",s),animate:E,exit:"exit",custom:k,variants:jge,style:b,...p})})});Ij.displayName="Slide";var Hge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:Zs.exit(zh.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Zs.enter(zh.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:Zs.exit(zh.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},x9={initial:"initial",animate:"enter",exit:"exit",variants:Hge},Vge=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:f,delay:p,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",x={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:f,delay:p};return y(cf,{custom:x,children:v&&oe.createElement(gu.div,{ref:n,className:vy("chakra-offset-slide",a),custom:x,...x9,animate:b,...m})})});Vge.displayName="SlideFade";var yy=(...e)=>e.filter(Boolean).join(" ");function Uge(){return!1}var JS=e=>{const{condition:t,message:n}=e;t&&Uge()&&console.warn(n)};function $6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Wge,ex]=An({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Gge,Ik]=An({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[qge,_ze,Yge,Kge]=nz(),tg=Oe(function(t,n){const{getButtonProps:r}=Ik(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ex().button};return oe.createElement(_e.button,{...i,className:yy("chakra-accordion__button",t.className),__css:a})});tg.displayName="AccordionButton";function Xge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Jge(e),e1e(e);const s=Yge(),[l,u]=C.exports.useState(-1);C.exports.useEffect(()=>()=>{u(-1)},[]);const[f,p]=HS({value:r,defaultValue(){return i?n!=null?n:[]:n!=null?n:-1},onChange:t});return{index:f,setIndex:p,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(f)?f.includes(v):f===v),{isOpen:b,onChange:E=>{if(v!==null)if(i&&Array.isArray(f)){const k=E?f.concat(v):f.filter(_=>_!==v);p(k)}else E?p(v):o&&p(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Zge,Dk]=An({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Qge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=Dk(),s=C.exports.useRef(null),l=C.exports.useId(),u=r!=null?r:l,f=`accordion-button-${u}`,p=`accordion-panel-${u}`;t1e(e);const{register:m,index:v,descendants:b}=Kge({disabled:t&&!n}),{isOpen:x,onChange:E}=o(v===-1?null:v);n1e({isOpen:x,isDisabled:t});const k=()=>{E==null||E(!0)},_=()=>{E==null||E(!1)},T=C.exports.useCallback(()=>{E==null||E(!x),a(v)},[v,a,x,E]),A=C.exports.useCallback(B=>{const j={ArrowDown:()=>{const Y=b.nextEnabled(v);Y==null||Y.node.focus()},ArrowUp:()=>{const Y=b.prevEnabled(v);Y==null||Y.node.focus()},Home:()=>{const Y=b.firstEnabled();Y==null||Y.node.focus()},End:()=>{const Y=b.lastEnabled();Y==null||Y.node.focus()}}[B.key];j&&(B.preventDefault(),j(B))},[b,v]),R=C.exports.useCallback(()=>{a(v)},[a,v]),I=C.exports.useCallback(function(z={},j=null){return{...z,type:"button",ref:Gn(m,s,j),id:f,disabled:!!t,"aria-expanded":!!x,"aria-controls":p,onClick:$6(z.onClick,T),onFocus:$6(z.onFocus,R),onKeyDown:$6(z.onKeyDown,A)}},[f,t,x,T,R,A,p,m]),D=C.exports.useCallback(function(z={},j=null){return{...z,ref:j,role:"region",id:p,"aria-labelledby":f,hidden:!x}},[f,x,p]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:I,getPanelProps:D,htmlProps:i}}function Jge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;JS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function e1e(e){JS({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 t1e(e){JS({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 n1e(e){JS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function ng(e){const{isOpen:t,isDisabled:n}=Ik(),{reduceMotion:r}=Dk(),i=yy("chakra-accordion__icon",e.className),o=ex(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return y($a,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:y("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}ng.displayName="AccordionIcon";var rg=Oe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Qge(t),l={...ex().container,overflowAnchor:"none"},u=C.exports.useMemo(()=>a,[a]);return oe.createElement(Gge,{value:u},oe.createElement(_e.div,{ref:n,...o,className:yy("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});rg.displayName="AccordionItem";var ig=Oe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=Dk(),{getPanelProps:s,isOpen:l}=Ik(),u=s(o,n),f=yy("chakra-accordion__panel",r),p=ex();a||delete u.hidden;const m=oe.createElement(_e.div,{...u,__css:p.panel,className:f});return a?m:y(Oj,{in:l,...i,children:m})});ig.displayName="AccordionPanel";var Nk=Oe(function({children:t,reduceMotion:n,...r},i){const o=qi("Accordion",r),a=_n(r),{htmlProps:s,descendants:l,...u}=Xge(a),f=C.exports.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return oe.createElement(qge,{value:l},oe.createElement(Zge,{value:f},oe.createElement(Wge,{value:o},oe.createElement(_e.div,{ref:i,...s,className:yy("chakra-accordion",r.className),__css:o.root},t))))});Nk.displayName="Accordion";var r1e=(...e)=>e.filter(Boolean).join(" "),i1e=uf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),by=Oe((e,t)=>{const n=Lo("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=_n(e),u=r1e("chakra-spinner",s),f={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${i1e} ${o} linear infinite`,...n};return oe.createElement(_e.div,{ref:t,__css:f,className:u,...l},r&&oe.createElement(_e.span,{srOnly:!0},r))});by.displayName="Spinner";var tx=(...e)=>e.filter(Boolean).join(" ");function o1e(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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 a1e(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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 hM(e){return y($a,{viewBox:"0 0 24 24",...e,children:y("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[s1e,l1e]=An({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[u1e,Bk]=An({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Dj={info:{icon:a1e,colorScheme:"blue"},warning:{icon:hM,colorScheme:"orange"},success:{icon:o1e,colorScheme:"green"},error:{icon:hM,colorScheme:"red"},loading:{icon:by,colorScheme:"blue"}};function c1e(e){return Dj[e].colorScheme}function d1e(e){return Dj[e].icon}var Nj=Oe(function(t,n){var u;const{status:r="info",addRole:i=!0,...o}=_n(t),a=(u=t.colorScheme)!=null?u:c1e(r),s=qi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return oe.createElement(s1e,{value:{status:r}},oe.createElement(u1e,{value:s},oe.createElement(_e.div,{role:i?"alert":void 0,ref:n,...o,className:tx("chakra-alert",t.className),__css:l})))});Nj.displayName="Alert";var Bj=Oe(function(t,n){const i={display:"inline",...Bk().description};return oe.createElement(_e.div,{ref:n,...t,className:tx("chakra-alert__desc",t.className),__css:i})});Bj.displayName="AlertDescription";function $j(e){const{status:t}=l1e(),n=d1e(t),r=Bk(),i=t==="loading"?r.spinner:r.icon;return oe.createElement(_e.span,{display:"inherit",...e,className:tx("chakra-alert__icon",e.className),__css:i},e.children||y(n,{h:"100%",w:"100%"}))}$j.displayName="AlertIcon";var Fj=Oe(function(t,n){const r=Bk();return oe.createElement(_e.div,{ref:n,...t,className:tx("chakra-alert__title",t.className),__css:r.title})});Fj.displayName="AlertTitle";function f1e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function h1e(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,f]=C.exports.useState("pending");C.exports.useEffect(()=>{f(n?"loading":"pending")},[n]);const p=C.exports.useRef(),m=C.exports.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=x=>{v(),f("loaded"),i==null||i(x)},b.onerror=x=>{v(),f("failed"),o==null||o(x)},p.current=b},[n,a,r,s,i,o,t]),v=()=>{p.current&&(p.current.onload=null,p.current.onerror=null,p.current=null)};return Ys(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var p1e=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",C5=Oe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return y("img",{width:r,height:i,ref:n,alt:o,...a})});C5.displayName="NativeImage";var nx=Oe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:f,crossOrigin:p,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,x=r!==void 0||i!==void 0,E=u!=null||f||!x,k=h1e({...t,ignoreFallback:E}),_=p1e(k,m),T={ref:n,objectFit:l,objectPosition:s,...E?b:f1e(b,["onError","onLoad"])};return _?i||oe.createElement(_e.img,{as:C5,className:"chakra-image__placeholder",src:r,...T}):oe.createElement(_e.img,{as:C5,src:o,srcSet:a,crossOrigin:p,loading:u,referrerPolicy:v,className:"chakra-image",...T})});nx.displayName="Image";Oe((e,t)=>oe.createElement(_e.img,{ref:t,as:C5,className:"chakra-image",...e}));function rx(e){return C.exports.Children.toArray(e).filter(t=>C.exports.isValidElement(t))}var ix=(...e)=>e.filter(Boolean).join(" "),pM=e=>e?"":void 0,[g1e,m1e]=An({strict:!1,name:"ButtonGroupContext"});function w9(e){const{children:t,className:n,...r}=e,i=C.exports.isValidElement(t)?C.exports.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=ix("chakra-button__icon",n);return oe.createElement(_e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}w9.displayName="ButtonIcon";function C9(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=y(by,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=ix("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",f=C.exports.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return oe.createElement(_e.div,{className:l,...s,__css:f},i)}C9.displayName="ButtonSpinner";function v1e(e){const[t,n]=C.exports.useState(!e);return{ref:C.exports.useCallback(o=>{!o||n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ds=Oe((e,t)=>{const n=m1e(),r=Lo("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:f,iconSpacing:p="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:x,as:E,...k}=_n(e),_=C.exports.useMemo(()=>{const I={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:I}}},[r,n]),{ref:T,type:A}=v1e(E),R={rightIcon:u,leftIcon:l,iconSpacing:p,children:s};return oe.createElement(_e.button,{disabled:i||o,ref:Fde(t,T),as:E,type:m!=null?m:A,"data-active":pM(a),"data-loading":pM(o),__css:_,className:ix("chakra-button",x),...k},o&&b==="start"&&y(C9,{className:"chakra-button__spinner--start",label:f,placement:"start",spacing:p,children:v}),o?f||oe.createElement(_e.span,{opacity:0},y(gM,{...R})):y(gM,{...R}),o&&b==="end"&&y(C9,{className:"chakra-button__spinner--end",label:f,placement:"end",spacing:p,children:v}))});ds.displayName="Button";function gM(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return K(fn,{children:[t&&y(w9,{marginEnd:i,children:t}),r,n&&y(w9,{marginStart:i,children:n})]})}var io=Oe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...f}=t,p=ix("chakra-button__group",a),m=C.exports.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *: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}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},oe.createElement(g1e,{value:m},oe.createElement(_e.div,{ref:n,role:"group",__css:v,className:p,"data-attached":l?"":void 0,...f}))});io.displayName="ButtonGroup";var fs=Oe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=C.exports.isValidElement(s)?C.exports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return y(ds,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});fs.displayName="IconButton";var y1=(...e)=>e.filter(Boolean).join(" "),lb=e=>e?"":void 0,F6=e=>e?!0:void 0;function mM(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[y1e,zj]=An({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[b1e,b1]=An({strict:!1,name:"FormControlContext"});function S1e(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=C.exports.useId(),l=t||`field-${s}`,u=`${l}-label`,f=`${l}-feedback`,p=`${l}-helptext`,[m,v]=C.exports.useState(!1),[b,x]=C.exports.useState(!1),[E,k]=C.exports.useState(!1),_=C.exports.useCallback((D={},B=null)=>({id:p,...D,ref:Gn(B,z=>{!z||x(!0)})}),[p]),T=C.exports.useCallback((D={},B=null)=>{var z,j;return{...D,ref:B,"data-focus":lb(E),"data-disabled":lb(i),"data-invalid":lb(r),"data-readonly":lb(o),id:(z=D.id)!=null?z:u,htmlFor:(j=D.htmlFor)!=null?j:l}},[l,i,E,r,o,u]),A=C.exports.useCallback((D={},B=null)=>({id:f,...D,ref:Gn(B,z=>{!z||v(!0)}),"aria-live":"polite"}),[f]),R=C.exports.useCallback((D={},B=null)=>({...D,...a,ref:B,role:"group"}),[a]),I=C.exports.useCallback((D={},B=null)=>({...D,ref:B,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:x,id:l,labelId:u,feedbackId:f,helpTextId:p,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:R,getLabelProps:T,getRequiredIndicatorProps:I}}var Ir=Oe(function(t,n){const r=qi("Form",t),i=_n(t),{getRootProps:o,htmlProps:a,...s}=S1e(i),l=y1("chakra-form-control",t.className);return oe.createElement(b1e,{value:s},oe.createElement(y1e,{value:r},oe.createElement(_e.div,{...o({},n),className:l,__css:r.container})))});Ir.displayName="FormControl";var Uo=Oe(function(t,n){const r=b1(),i=zj(),o=y1("chakra-form__helper-text",t.className);return oe.createElement(_e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});Uo.displayName="FormHelperText";function $k(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=Fk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":F6(n),"aria-required":F6(i),"aria-readonly":F6(r)}}function Fk(e){var b,x,E;const t=b1(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:f,onBlur:p,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return(t==null?void 0:t.hasFeedbackText)&&(t==null?void 0:t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n!=null?n:t==null?void 0:t.id,isDisabled:(b=r!=null?r:u)!=null?b:t==null?void 0:t.isDisabled,isReadOnly:(x=i!=null?i:l)!=null?x:t==null?void 0:t.isReadOnly,isRequired:(E=o!=null?o:a)!=null?E:t==null?void 0:t.isRequired,isInvalid:s!=null?s:t==null?void 0:t.isInvalid,onFocus:mM(t==null?void 0:t.onFocus,f),onBlur:mM(t==null?void 0:t.onBlur,p)}}var[x1e,w1e]=An({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Wo=Oe((e,t)=>{const n=qi("FormError",e),r=_n(e),i=b1();return i!=null&&i.isInvalid?oe.createElement(x1e,{value:n},oe.createElement(_e.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:y1("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});Wo.displayName="FormErrorMessage";var C1e=Oe((e,t)=>{const n=w1e(),r=b1();if(!(r!=null&&r.isInvalid))return null;const i=y1("chakra-form__error-icon",e.className);return y($a,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:y("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"})})});C1e.displayName="FormErrorIcon";var ti=Oe(function(t,n){var m;const r=Lo("FormLabel",t),i=_n(t),{className:o,children:a,requiredIndicator:s=y(jj,{}),optionalIndicator:l=null,...u}=i,f=b1(),p=(m=f==null?void 0:f.getLabelProps(u,n))!=null?m:{ref:n,...u};return oe.createElement(_e.label,{...p,className:y1("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,f!=null&&f.isRequired?s:l)});ti.displayName="FormLabel";var jj=Oe(function(t,n){const r=b1(),i=zj();if(!(r!=null&&r.isRequired))return null;const o=y1("chakra-form__required-indicator",t.className);return oe.createElement(_e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});jj.displayName="RequiredIndicator";function Kd(e,t){const n=C.exports.useRef(!1),r=C.exports.useRef(!1);C.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),C.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var zk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},_1e=_e("span",{baseStyle:zk});_1e.displayName="VisuallyHidden";var k1e=_e("input",{baseStyle:zk});k1e.displayName="VisuallyHiddenInput";var vM=!1,ox=null,Xg=!1,_9=new Set,E1e=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function P1e(e){return!(e.metaKey||!E1e&&e.altKey||e.ctrlKey)}function jk(e,t){_9.forEach(n=>n(e,t))}function yM(e){Xg=!0,P1e(e)&&(ox="keyboard",jk("keyboard",e))}function C0(e){ox="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Xg=!0,jk("pointer",e))}function T1e(e){e.target===window||e.target===document||(Xg||(ox="keyboard",jk("keyboard",e)),Xg=!1)}function L1e(){Xg=!1}function bM(){return ox!=="pointer"}function A1e(){if(typeof window>"u"||vM)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Xg=!0,e.apply(this,n)},document.addEventListener("keydown",yM,!0),document.addEventListener("keyup",yM,!0),window.addEventListener("focus",T1e,!0),window.addEventListener("blur",L1e,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",C0,!0),document.addEventListener("pointermove",C0,!0),document.addEventListener("pointerup",C0,!0)):(document.addEventListener("mousedown",C0,!0),document.addEventListener("mousemove",C0,!0),document.addEventListener("mouseup",C0,!0)),vM=!0}function O1e(e){A1e(),e(bM());const t=()=>e(bM());return _9.add(t),()=>{_9.delete(t)}}var[kze,M1e]=An({name:"CheckboxGroupContext",strict:!1}),R1e=(...e)=>e.filter(Boolean).join(" "),vo=e=>e?"":void 0;function Ka(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function I1e(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function D1e(e){return oe.createElement(_e.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},y("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function N1e(e){return oe.createElement(_e.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},y("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function B1e(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?N1e:D1e;return n||t?oe.createElement(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},y(i,{...r})):null}function $1e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Hj(e={}){const t=Fk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:f,isChecked:p,isFocusable:m,onChange:v,isIndeterminate:b,name:x,value:E,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":T,"aria-invalid":A,...R}=e,I=$1e(R,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=br(v),B=br(s),z=br(l),[j,Y]=C.exports.useState(!1),[te,G]=C.exports.useState(!1),[$,V]=C.exports.useState(!1),[J,Z]=C.exports.useState(!1);C.exports.useEffect(()=>O1e(Y),[]);const U=C.exports.useRef(null),[X,le]=C.exports.useState(!0),[fe,Se]=C.exports.useState(!!f),Ae=p!==void 0,be=Ae?p:fe,ke=C.exports.useCallback(Le=>{if(r||n){Le.preventDefault();return}Ae||Se(be?Le.target.checked:b?!0:Le.target.checked),D==null||D(Le)},[r,n,be,Ae,b,D]);Ys(()=>{U.current&&(U.current.indeterminate=Boolean(b))},[b]),Kd(()=>{n&&G(!1)},[n,G]),Ys(()=>{const Le=U.current;!(Le!=null&&Le.form)||(Le.form.onreset=()=>{Se(!!f)})},[]);const De=n&&!m,Je=C.exports.useCallback(Le=>{Le.key===" "&&Z(!0)},[Z]),Ye=C.exports.useCallback(Le=>{Le.key===" "&&Z(!1)},[Z]);Ys(()=>{if(!U.current)return;U.current.checked!==be&&Se(U.current.checked)},[U.current]);const mt=C.exports.useCallback((Le={},ut=null)=>{const Rt=ot=>{te&&ot.preventDefault(),Z(!0)};return{...Le,ref:ut,"data-active":vo(J),"data-hover":vo($),"data-checked":vo(be),"data-focus":vo(te),"data-focus-visible":vo(te&&j),"data-indeterminate":vo(b),"data-disabled":vo(n),"data-invalid":vo(o),"data-readonly":vo(r),"aria-hidden":!0,onMouseDown:Ka(Le.onMouseDown,Rt),onMouseUp:Ka(Le.onMouseUp,()=>Z(!1)),onMouseEnter:Ka(Le.onMouseEnter,()=>V(!0)),onMouseLeave:Ka(Le.onMouseLeave,()=>V(!1))}},[J,be,n,te,j,$,b,o,r]),_t=C.exports.useCallback((Le={},ut=null)=>({...I,...Le,ref:Gn(ut,Rt=>{!Rt||le(Rt.tagName==="LABEL")}),onClick:Ka(Le.onClick,()=>{var Rt;X||((Rt=U.current)==null||Rt.click(),requestAnimationFrame(()=>{var ot;(ot=U.current)==null||ot.focus()}))}),"data-disabled":vo(n),"data-checked":vo(be),"data-invalid":vo(o)}),[I,n,be,o,X]),dt=C.exports.useCallback((Le={},ut=null)=>({...Le,ref:Gn(U,ut),type:"checkbox",name:x,value:E,id:a,tabIndex:k,onChange:Ka(Le.onChange,ke),onBlur:Ka(Le.onBlur,B,()=>G(!1)),onFocus:Ka(Le.onFocus,z,()=>G(!0)),onKeyDown:Ka(Le.onKeyDown,Je),onKeyUp:Ka(Le.onKeyUp,Ye),required:i,checked:be,disabled:De,readOnly:r,"aria-label":_,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:zk}),[x,E,a,ke,B,z,Je,Ye,i,be,De,r,_,T,A,o,u,n,k]),vt=C.exports.useCallback((Le={},ut=null)=>({...Le,ref:ut,onMouseDown:Ka(Le.onMouseDown,SM),onTouchStart:Ka(Le.onTouchStart,SM),"data-disabled":vo(n),"data-checked":vo(be),"data-invalid":vo(o)}),[be,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:be,isActive:J,isHovered:$,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:_t,getCheckboxProps:mt,getInputProps:dt,getLabelProps:vt,htmlProps:I}}function SM(e){e.preventDefault(),e.stopPropagation()}var F1e={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},z1e={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},j1e=uf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),H1e=uf({from:{opacity:0},to:{opacity:1}}),V1e=uf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Vj=Oe(function(t,n){const r=M1e(),i={...r,...t},o=qi("Checkbox",i),a=_n(t),{spacing:s="0.5rem",className:l,children:u,iconColor:f,iconSize:p,icon:m=y(B1e,{}),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:x,inputProps:E,...k}=a;let _=v;(r==null?void 0:r.value)&&a.value&&(_=r.value.includes(a.value));let T=x;(r==null?void 0:r.onChange)&&a.value&&(T=I1e(r.onChange,x));const{state:A,getInputProps:R,getCheckboxProps:I,getLabelProps:D,getRootProps:B}=Hj({...k,isDisabled:b,isChecked:_,onChange:T}),z=C.exports.useMemo(()=>({animation:A.isIndeterminate?`${H1e} 20ms linear, ${V1e} 200ms linear`:`${j1e} 200ms linear`,fontSize:p,color:f,...o.icon}),[f,p,,A.isIndeterminate,o.icon]),j=C.exports.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return oe.createElement(_e.label,{__css:{...z1e,...o.container},className:R1e("chakra-checkbox",l),...B()},y("input",{className:"chakra-checkbox__input",...R(E,n)}),oe.createElement(_e.span,{__css:{...F1e,...o.control},className:"chakra-checkbox__control",...I()},j),u&&oe.createElement(_e.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});Vj.displayName="Checkbox";function U1e(e){return y($a,{focusable:"false","aria-hidden":!0,...e,children:y("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 ax=Oe(function(t,n){const r=Lo("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=_n(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return oe.createElement(_e.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||y(U1e,{width:"1em",height:"1em"}))});ax.displayName="CloseButton";function W1e(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function Hk(e,t){let n=W1e(e);const r=10**(t!=null?t:10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function k9(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 _5(e,t,n){return(e-t)*100/(n-t)}function Uj(e,t,n){return(n-t)*e+t}function E9(e,t,n){const r=Math.round((e-t)/n)*n+t,i=k9(n);return Hk(r,i)}function Lg(e,t,n){return e==null?e:(n{var j;return r==null?"":(j=z6(r,o,n))!=null?j:""}),m=typeof i<"u",v=m?i:f,b=Wj(gd(v),o),x=n!=null?n:b,E=C.exports.useCallback(j=>{j!==v&&(m||p(j.toString()),u==null||u(j.toString(),gd(j)))},[u,m,v]),k=C.exports.useCallback(j=>{let Y=j;return l&&(Y=Lg(Y,a,s)),Hk(Y,x)},[x,l,s,a]),_=C.exports.useCallback((j=o)=>{let Y;v===""?Y=gd(j):Y=gd(v)+j,Y=k(Y),E(Y)},[k,o,E,v]),T=C.exports.useCallback((j=o)=>{let Y;v===""?Y=gd(-j):Y=gd(v)-j,Y=k(Y),E(Y)},[k,o,E,v]),A=C.exports.useCallback(()=>{var Y;let j;r==null?j="":j=(Y=z6(r,o,n))!=null?Y:a,E(j)},[r,n,o,E,a]),R=C.exports.useCallback(j=>{var te;const Y=(te=z6(j,o,x))!=null?te:a;E(Y)},[x,o,E,a]),I=gd(v);return{isOutOfRange:I>s||Ia)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Qye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gV=function(e,t){return e==="v"?Xye(t):Zye(t)},mV=function(e,t){return e==="v"?Qye(t):Jye(t)},e3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},t3e=function(e,t,n,r,i){var o=e3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,f=a>0,p=0,m=0;do{var v=mV(e,s),b=v[0],x=v[1],E=v[2],k=x-E-o*b;(b||k)&&gV(e,s)&&(p+=k,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&(i&&p===0||!i&&a>p)||!f&&(i&&m===0||!i&&-a>m))&&(u=!0),u},hb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HM=function(e){return[e.deltaX,e.deltaY]},VM=function(e){return e&&"current"in e?e.current:e},n3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},r3e=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},i3e=0,T0=[];function o3e(e){var t=C.exports.useRef([]),n=C.exports.useRef([0,0]),r=C.exports.useRef(),i=C.exports.useState(i3e++)[0],o=C.exports.useState(function(){return hV()})[0],a=C.exports.useRef(e);C.exports.useEffect(function(){a.current=e},[e]),C.exports.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=b9([e.lockRef.current],(e.shards||[]).map(VM),!0).filter(Boolean);return x.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=C.exports.useCallback(function(x,E){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var k=hb(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-k[0],A="deltaY"in x?x.deltaY:_[1]-k[1],R,I=x.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in x&&D==="h"&&I.type==="range")return!1;var B=jM(D,I);if(!B)return!0;if(B?R=D:(R=D==="v"?"h":"v",B=jM(D,I)),!B)return!1;if(!r.current&&"changedTouches"in x&&(T||A)&&(r.current=R),!R)return!0;var z=r.current||R;return t3e(z,E,x,z==="h"?T:A,!0)},[]),l=C.exports.useCallback(function(x){var E=x;if(!(!T0.length||T0[T0.length-1]!==o)){var k="deltaY"in E?HM(E):hb(E),_=t.current.filter(function(R){return R.name===E.type&&R.target===E.target&&n3e(R.delta,k)})[0];if(_&&_.should){E.cancelable&&E.preventDefault();return}if(!_){var T=(a.current.shards||[]).map(VM).filter(Boolean).filter(function(R){return R.contains(E.target)}),A=T.length>0?s(E,T[0]):!a.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),u=C.exports.useCallback(function(x,E,k,_){var T={name:x,delta:E,target:k,should:_};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),f=C.exports.useCallback(function(x){n.current=hb(x),r.current=void 0},[]),p=C.exports.useCallback(function(x){u(x.type,HM(x),x.target,s(x,e.lockRef.current))},[]),m=C.exports.useCallback(function(x){u(x.type,hb(x),x.target,s(x,e.lockRef.current))},[]);C.exports.useEffect(function(){return T0.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,P0),document.addEventListener("touchmove",l,P0),document.addEventListener("touchstart",f,P0),function(){T0=T0.filter(function(x){return x!==o}),document.removeEventListener("wheel",l,P0),document.removeEventListener("touchmove",l,P0),document.removeEventListener("touchstart",f,P0)}},[]);var v=e.removeScrollBar,b=e.inert;return K(fn,{children:[b?y(o,{styles:r3e(i)}):null,v?y(Yye,{gapMode:"margin"}):null]})}const a3e=F2e(fV,o3e);var vV=C.exports.forwardRef(function(e,t){return y(ux,{...Ul({},e,{ref:t,sideCar:a3e})})});vV.classNames=ux.classNames;const yV=vV;var cp=(...e)=>e.filter(Boolean).join(" ");function Sv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var s3e=class{constructor(){sn(this,"modals");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}},N9=new s3e;function l3e(e,t){C.exports.useEffect(()=>(t&&N9.add(e),()=>{N9.remove(e)}),[t,e])}function u3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=C.exports.useRef(null),f=C.exports.useRef(null),[p,m,v]=d3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");c3e(u,t&&a),l3e(u,t);const b=C.exports.useRef(null),x=C.exports.useCallback(B=>{b.current=B.target},[]),E=C.exports.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[k,_]=C.exports.useState(!1),[T,A]=C.exports.useState(!1),R=C.exports.useCallback((B={},z=null)=>({role:"dialog",...B,ref:Gn(z,u),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?m:void 0,"aria-describedby":T?v:void 0,onClick:Sv(B.onClick,j=>j.stopPropagation())}),[v,T,p,m,k]),I=C.exports.useCallback(B=>{B.stopPropagation(),b.current===B.target&&(!N9.isTopModal(u)||(i&&(n==null||n()),s==null||s()))},[n,i,s]),D=C.exports.useCallback((B={},z=null)=>({...B,ref:Gn(z,f),onClick:Sv(B.onClick,I),onKeyDown:Sv(B.onKeyDown,E),onMouseDown:Sv(B.onMouseDown,x)}),[E,x,I]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:f,getDialogProps:R,getDialogContainerProps:D}}function c3e(e,t){const n=e.current;C.exports.useEffect(()=>{if(!(!e.current||!t))return MH(e.current)},[t,e,n])}function d3e(e,...t){const n=C.exports.useId(),r=e||n;return C.exports.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[f3e,dp]=An({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[h3e,Zd]=An({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Qd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=qi("Modal",e),E={...u3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m};return y(h3e,{value:E,children:y(f3e,{value:b,children:y(cf,{onExitComplete:v,children:E.isOpen&&y(up,{...t,children:n})})})})};Qd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Qd.displayName="Modal";var t1=Oe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Zd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__body",n),s=dp();return oe.createElement(_e.div,{ref:t,className:a,id:i,...r,__css:s.body})});t1.displayName="ModalBody";var Cy=Oe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Zd(),a=cp("chakra-modal__close-btn",r),s=dp();return y(ax,{ref:t,__css:s.closeButton,className:a,onClick:Sv(n,l=>{l.stopPropagation(),o()}),...i})});Cy.displayName="ModalCloseButton";function bV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:f}=Zd(),[p,m]=Ek();return C.exports.useEffect(()=>{!p&&m&&setTimeout(m)},[p,m]),y(dV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:f,children:y(yV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0,children:e.children})})}var p3e={slideInBottom:{...x9,custom:{offsetY:16,reverse:!0}},slideInRight:{...x9,custom:{offsetX:16,reverse:!0}},scale:{...Rj,custom:{initialScale:.95,reverse:!0}},none:{}},g3e=_e(gu.section),m3e=e=>p3e[e||"none"],SV=C.exports.forwardRef((e,t)=>{const{preset:n,motionProps:r=m3e(n),...i}=e;return y(g3e,{ref:t,...r,...i})});SV.displayName="ModalTransition";var ep=Oe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Zd(),u=s(a,t),f=l(i),p=cp("chakra-modal__content",n),m=dp(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:x}=Zd();return oe.createElement(bV,null,oe.createElement(_e.div,{...f,className:"chakra-modal__content-container",tabIndex:-1,__css:b},y(SV,{preset:x,motionProps:o,className:p,...u,__css:v,children:r})))});ep.displayName="ModalContent";var cx=Oe((e,t)=>{const{className:n,...r}=e,i=cp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...dp().footer};return oe.createElement(_e.footer,{ref:t,...r,__css:a,className:i})});cx.displayName="ModalFooter";var S1=Oe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Zd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__header",n),l={flex:0,...dp().header};return oe.createElement(_e.header,{ref:t,className:a,id:i,...r,__css:l})});S1.displayName="ModalHeader";var v3e=_e(gu.div),Jd=Oe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=cp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...dp().overlay},{motionPreset:u}=Zd();return y(v3e,{...i||(u==="none"?{}:Mj),__css:l,ref:t,className:a,...o})});Jd.displayName="ModalOverlay";function xV(e){const{leastDestructiveRef:t,...n}=e;return y(Qd,{...n,initialFocusRef:t})}var wV=Oe((e,t)=>y(ep,{ref:t,role:"alertdialog",...e})),[kze,y3e]=An(),b3e=_e(Ij),S3e=Oe((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Zd(),f=s(a,t),p=l(o),m=cp("chakra-modal__content",n),v=dp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:E}=y3e();return oe.createElement(bV,null,oe.createElement(_e.div,{...p,className:"chakra-modal__content-container",__css:x},y(b3e,{motionProps:i,direction:E,in:u,className:m,...f,__css:b,children:r})))});S3e.displayName="DrawerContent";function x3e(e,t){const n=br(e);C.exports.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var CV=(...e)=>e.filter(Boolean).join(" "),K6=e=>e?!0:void 0;function Rl(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var w3e=e=>y($a,{viewBox:"0 0 24 24",...e,children:y("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"})}),C3e=e=>y($a,{viewBox:"0 0 24 24",...e,children:y("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 UM(e,t,n,r){C.exports.useEffect(()=>{var s;if(!e.current||!r)return;const i=(s=e.current.ownerDocument.defaultView)!=null?s:window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&o.includes(u.attributeName)&&n(u)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var _3e=50,WM=300;function k3e(e,t){const[n,r]=C.exports.useState(!1),[i,o]=C.exports.useState(null),[a,s]=C.exports.useState(!0),l=C.exports.useRef(null),u=()=>clearTimeout(l.current);x3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?_3e:null);const f=C.exports.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},WM)},[e,a]),p=C.exports.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},WM)},[t,a]),m=C.exports.useCallback(()=>{s(!0),r(!1),u()},[]);return C.exports.useEffect(()=>()=>u(),[]),{up:f,down:p,stop:m,isSpinning:n}}var E3e=/^[Ee0-9+\-.]$/;function P3e(e){return E3e.test(e)}function T3e(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 L3e(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:u,isInvalid:f,pattern:p="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:x,precision:E,name:k,"aria-describedby":_,"aria-label":T,"aria-labelledby":A,onFocus:R,onBlur:I,onInvalid:D,getAriaValueText:B,isValidCharacter:z,format:j,parse:Y,...te}=e,G=br(R),$=br(I),V=br(D),J=br(z!=null?z:P3e),Z=br(B),U=G1e(e),{update:X,increment:le,decrement:fe}=U,[Se,Ae]=C.exports.useState(!1),be=!(s||l),ke=C.exports.useRef(null),De=C.exports.useRef(null),Je=C.exports.useRef(null),Ye=C.exports.useRef(null),mt=C.exports.useCallback(Te=>Te.split("").filter(J).join(""),[J]),_t=C.exports.useCallback(Te=>{var Et;return(Et=Y==null?void 0:Y(Te))!=null?Et:Te},[Y]),dt=C.exports.useCallback(Te=>{var Et;return((Et=j==null?void 0:j(Te))!=null?Et:Te).toString()},[j]);Kd(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!ke.current)return;if(ke.current.value!=U.value){const Et=_t(ke.current.value);U.setValue(mt(Et))}},[_t,mt]);const vt=C.exports.useCallback((Te=a)=>{be&&le(Te)},[le,be,a]),xt=C.exports.useCallback((Te=a)=>{be&&fe(Te)},[fe,be,a]),Le=k3e(vt,xt);UM(Je,"disabled",Le.stop,Le.isSpinning),UM(Ye,"disabled",Le.stop,Le.isSpinning);const ut=C.exports.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const Ut=_t(Te.currentTarget.value);X(mt(Ut)),De.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[X,mt,_t]),Rt=C.exports.useCallback(Te=>{var Ut,Ve;var Et;G==null||G(Te),De.current&&(Te.target.selectionStart=(Ut=De.current.start)!=null?Ut:(Et=Te.currentTarget.value)==null?void 0:Et.length,Te.currentTarget.selectionEnd=(Ve=De.current.end)!=null?Ve:Te.currentTarget.selectionStart)},[G]),ot=C.exports.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;T3e(Te,J)||Te.preventDefault();const Et=Ct(Te)*a,Ut=Te.key,ft={ArrowUp:()=>vt(Et),ArrowDown:()=>xt(Et),Home:()=>X(i),End:()=>X(o)}[Ut];ft&&(Te.preventDefault(),ft(Te))},[J,a,vt,xt,X,i,o]),Ct=Te=>{let Et=1;return(Te.metaKey||Te.ctrlKey)&&(Et=.1),Te.shiftKey&&(Et=10),Et},ln=C.exports.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const Et=U.value.toString();return Et||void 0},[U.value,Z]),ue=C.exports.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),Ie=C.exports.useCallback(()=>{Ae(!1),n&&ue()},[n,Ae,ue]),We=C.exports.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=ke.current)==null||Te.focus()})},[t]),Xe=C.exports.useCallback(Te=>{Te.preventDefault(),Le.up(),We()},[We,Le]),Ce=C.exports.useCallback(Te=>{Te.preventDefault(),Le.down(),We()},[We,Le]);jh(()=>ke.current,"wheel",Te=>{var ze;var Et;const Ve=((ze=(Et=ke.current)==null?void 0:Et.ownerDocument)!=null?ze:document).activeElement===ke.current;if(!v||!Ve)return;Te.preventDefault();const ft=Ct(Te)*a,un=Math.sign(Te.deltaY);un===-1?vt(ft):un===1&&xt(ft)},{passive:!1});const Ne=C.exports.useCallback((Te={},Et=null)=>{const Ut=l||r&&U.isAtMax;return{...Te,ref:Gn(Et,Je),role:"button",tabIndex:-1,onPointerDown:Rl(Te.onPointerDown,Ve=>{Ve.button!==0||Ut||Xe(Ve)}),onPointerLeave:Rl(Te.onPointerLeave,Le.stop),onPointerUp:Rl(Te.onPointerUp,Le.stop),disabled:Ut,"aria-disabled":K6(Ut)}},[U.isAtMax,r,Xe,Le.stop,l]),kt=C.exports.useCallback((Te={},Et=null)=>{const Ut=l||r&&U.isAtMin;return{...Te,ref:Gn(Et,Ye),role:"button",tabIndex:-1,onPointerDown:Rl(Te.onPointerDown,Ve=>{Ve.button!==0||Ut||Ce(Ve)}),onPointerLeave:Rl(Te.onPointerLeave,Le.stop),onPointerUp:Rl(Te.onPointerUp,Le.stop),disabled:Ut,"aria-disabled":K6(Ut)}},[U.isAtMin,r,Ce,Le.stop,l]),Nt=C.exports.useCallback((Te={},Et=null)=>{var Ut,Ve,ft,un;return{name:k,inputMode:m,type:"text",pattern:p,"aria-labelledby":A,"aria-label":T,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:(Ut=Te.readOnly)!=null?Ut:s,"aria-readonly":(Ve=Te.readOnly)!=null?Ve:s,"aria-required":(ft=Te.required)!=null?ft:u,required:(un=Te.required)!=null?un:u,ref:Gn(ke,Et),value:dt(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":K6(f!=null?f:U.isOutOfRange),"aria-valuetext":ln,autoComplete:"off",autoCorrect:"off",onChange:Rl(Te.onChange,ut),onKeyDown:Rl(Te.onKeyDown,ot),onFocus:Rl(Te.onFocus,Rt,()=>Ae(!0)),onBlur:Rl(Te.onBlur,$,Ie)}},[k,m,p,A,T,dt,_,b,l,u,s,f,U.value,U.valueAsNumber,U.isOutOfRange,i,o,ln,ut,ot,Rt,$,Ie]);return{value:dt(U.value),valueAsNumber:U.valueAsNumber,isFocused:Se,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:kt,getInputProps:Nt,htmlProps:te}}var[A3e,dx]=An({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[O3e,pE]=An({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),gE=Oe(function(t,n){const r=qi("NumberInput",t),i=_n(t),o=Fk(i),{htmlProps:a,...s}=L3e(o),l=C.exports.useMemo(()=>s,[s]);return oe.createElement(O3e,{value:l},oe.createElement(A3e,{value:r},oe.createElement(_e.div,{...a,ref:n,className:CV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});gE.displayName="NumberInput";var _V=Oe(function(t,n){const r=dx();return oe.createElement(_e.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}})});_V.displayName="NumberInputStepper";var mE=Oe(function(t,n){const{getInputProps:r}=pE(),i=r(t,n),o=dx();return oe.createElement(_e.input,{...i,className:CV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});mE.displayName="NumberInputField";var kV=_e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),vE=Oe(function(t,n){var a;const r=dx(),{getDecrementButtonProps:i}=pE(),o=i(t,n);return y(kV,{...o,__css:r.stepper,children:(a=t.children)!=null?a:y(w3e,{})})});vE.displayName="NumberDecrementStepper";var yE=Oe(function(t,n){var a;const{getIncrementButtonProps:r}=pE(),i=r(t,n),o=dx();return y(kV,{...i,__css:o.stepper,children:(a=t.children)!=null?a:y(C3e,{})})});yE.displayName="NumberIncrementStepper";var _y=(...e)=>e.filter(Boolean).join(" ");function M3e(e,...t){return R3e(e)?e(...t):e}var R3e=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function I3e(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[D3e,fp]=An({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[N3e,ky]=An({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),L0={click:"click",hover:"hover"};function B3e(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=L0.click,openDelay:f=200,closeDelay:p=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...x}=e,{isOpen:E,onClose:k,onOpen:_,onToggle:T}=PH(e),A=C.exports.useRef(null),R=C.exports.useRef(null),I=C.exports.useRef(null),D=C.exports.useRef(!1),B=C.exports.useRef(!1);E&&(B.current=!0);const[z,j]=C.exports.useState(!1),[Y,te]=C.exports.useState(!1),G=C.exports.useId(),$=i!=null?i:G,[V,J,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${$}`),{referenceRef:X,getArrowProps:le,getPopperProps:fe,getArrowInnerProps:Se,forceUpdate:Ae}=EH({...x,enabled:E||!!b}),be=b2e({isOpen:E,ref:I});tme({enabled:E,ref:R}),Kme(I,{focusRef:R,visible:E,shouldFocus:o&&u===L0.click}),Zme(I,{focusRef:r,visible:E,shouldFocus:a&&u===L0.click});const ke=TH({wasSelected:B.current,enabled:m,mode:v,isSelected:be.present}),De=C.exports.useCallback((ut={},Rt=null)=>{const ot={...ut,style:{...ut.style,transformOrigin:ri.transformOrigin.varRef,[ri.arrowSize.var]:s?`${s}px`:void 0,[ri.arrowShadowColor.var]:l},ref:Gn(I,Rt),children:ke?ut.children:null,id:J,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,Ct=>{n&&Ct.key==="Escape"&&k()}),onBlur:Il(ut.onBlur,Ct=>{const ln=GM(Ct),ue=X6(I.current,ln),Ie=X6(R.current,ln);E&&t&&(!ue&&!Ie)&&k()}),"aria-labelledby":z?Z:void 0,"aria-describedby":Y?U:void 0};return u===L0.hover&&(ot.role="tooltip",ot.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ot.onMouseLeave=Il(ut.onMouseLeave,Ct=>{Ct.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>k(),p))})),ot},[ke,J,z,Z,Y,U,u,n,k,E,t,p,l,s]),Je=C.exports.useCallback((ut={},Rt=null)=>fe({...ut,style:{visibility:E?"visible":"hidden",...ut.style}},Rt),[E,fe]),Ye=C.exports.useCallback((ut,Rt=null)=>({...ut,ref:Gn(Rt,A,X)}),[A,X]),mt=C.exports.useRef(),_t=C.exports.useRef(),dt=C.exports.useCallback(ut=>{A.current==null&&X(ut)},[X]),vt=C.exports.useCallback((ut={},Rt=null)=>{const ot={...ut,ref:Gn(R,Rt,dt),id:V,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":J};return u===L0.click&&(ot.onClick=Il(ut.onClick,T)),u===L0.hover&&(ot.onFocus=Il(ut.onFocus,()=>{mt.current===void 0&&_()}),ot.onBlur=Il(ut.onBlur,Ct=>{const ln=GM(Ct),ue=!X6(I.current,ln);E&&t&&ue&&k()}),ot.onKeyDown=Il(ut.onKeyDown,Ct=>{Ct.key==="Escape"&&k()}),ot.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,mt.current=window.setTimeout(()=>_(),f)}),ot.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,mt.current&&(clearTimeout(mt.current),mt.current=void 0),_t.current=window.setTimeout(()=>{D.current===!1&&k()},p)})),ot},[V,E,J,u,dt,T,_,t,k,f,p]);C.exports.useEffect(()=>()=>{mt.current&&clearTimeout(mt.current),_t.current&&clearTimeout(_t.current)},[]);const xt=C.exports.useCallback((ut={},Rt=null)=>({...ut,id:Z,ref:Gn(Rt,ot=>{j(!!ot)})}),[Z]),Le=C.exports.useCallback((ut={},Rt=null)=>({...ut,id:U,ref:Gn(Rt,ot=>{te(!!ot)})}),[U]);return{forceUpdate:Ae,isOpen:E,onAnimationComplete:be.onComplete,onClose:k,getAnchorProps:Ye,getArrowProps:le,getArrowInnerProps:Se,getPopoverPositionerProps:Je,getPopoverProps:De,getTriggerProps:vt,getHeaderProps:xt,getBodyProps:Le}}function X6(e,t){return e===t||(e==null?void 0:e.contains(t))}function GM(e){var n;const t=e.currentTarget.ownerDocument.activeElement;return(n=e.relatedTarget)!=null?n:t}function bE(e){const t=qi("Popover",e),{children:n,...r}=_n(e),i=h1(),o=B3e({...r,direction:i.direction});return y(D3e,{value:o,children:y(N3e,{value:t,children:M3e(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}bE.displayName="Popover";function SE(e){var l;const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=fp(),a=ky(),s=(l=t!=null?t:n)!=null?l:r;return oe.createElement(_e.div,{...i(),className:"chakra-popover__arrow-positioner"},oe.createElement(_e.div,{className:_y("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}SE.displayName="PopoverArrow";var $3e=Oe(function(t,n){const{getBodyProps:r}=fp(),i=ky();return oe.createElement(_e.div,{...r(t,n),className:_y("chakra-popover__body",t.className),__css:i.body})});$3e.displayName="PopoverBody";var F3e=Oe(function(t,n){const{onClose:r}=fp(),i=ky();return y(ax,{size:"sm",onClick:r,className:_y("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});F3e.displayName="PopoverCloseButton";function z3e(e){if(!!e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var j3e={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]}}},H3e=_e(gu.section),EV=Oe(function(t,n){const{variants:r=j3e,...i}=t,{isOpen:o}=fp();return oe.createElement(H3e,{ref:n,variants:z3e(r),initial:!1,animate:o?"enter":"exit",...i})});EV.displayName="PopoverTransition";var xE=Oe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=fp(),u=ky(),f={position:"relative",display:"flex",flexDirection:"column",...u.content};return oe.createElement(_e.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},y(EV,{...i,...a(o,n),onAnimationComplete:I3e(l,o.onAnimationComplete),className:_y("chakra-popover__content",t.className),__css:f}))});xE.displayName="PopoverContent";var V3e=Oe(function(t,n){const{getHeaderProps:r}=fp(),i=ky();return oe.createElement(_e.header,{...r(t,n),className:_y("chakra-popover__header",t.className),__css:i.header})});V3e.displayName="PopoverHeader";function wE(e){const t=C.exports.Children.only(e.children),{getTriggerProps:n}=fp();return C.exports.cloneElement(t,n(t.props,t.ref))}wE.displayName="PopoverTrigger";function U3e(e,t,n){return(e-t)*100/(n-t)}var W3e=uf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),G3e=uf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),q3e=uf({"0%":{left:"-40%"},"100%":{left:"100%"}}),Y3e=uf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function PV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=U3e(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,l):i})(),role:s},percent:l,value:t}}var TV=e=>{const{size:t,isIndeterminate:n,...r}=e;return oe.createElement(_e.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${G3e} 2s linear infinite`:void 0},...r})};TV.displayName="Shape";var B9=e=>oe.createElement(_e.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});B9.displayName="Circle";var K3e=Oe((e,t)=>{var A;const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:f="10px",color:p="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,x=PV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),E=v?void 0:((A=x.percent)!=null?A:0)*2.64,k=E==null?void 0:`${E} ${264-E}`,_=v?{css:{animation:`${W3e} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:k,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return oe.createElement(_e.div,{ref:t,className:"chakra-progress",...x.bind,...b,__css:T},K(TV,{size:n,isIndeterminate:v,children:[y(B9,{stroke:m,strokeWidth:f,className:"chakra-progress__track"}),y(B9,{stroke:p,strokeWidth:f,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:x.value===0&&!v?0:void 0,..._})]}),u)});K3e.displayName="CircularProgress";var[X3e,Z3e]=An({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Q3e=Oe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=PV({value:i,min:n,max:r,isIndeterminate:o,role:a}),f={height:"100%",...Z3e().filledTrack};return oe.createElement(_e.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:f})}),LV=Oe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:f,"aria-label":p,"aria-labelledby":m,title:v,role:b,...x}=_n(e),E=qi("Progress",e),k=u!=null?u:(n=E.track)==null?void 0:n.borderRadius,_={animation:`${Y3e} 1s linear infinite`},R={...!f&&a&&s&&_,...f&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${q3e} 1s ease infinite normal none running`}},I={overflow:"hidden",position:"relative",...E.track};return oe.createElement(_e.div,{ref:t,borderRadius:k,__css:I,...x},K(X3e,{value:E,children:[y(Q3e,{"aria-label":p,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:f,css:R,borderRadius:k,title:v,role:b}),l]}))});LV.displayName="Progress";var J3e=_e("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});J3e.displayName="CircularProgressLabel";var ebe=(...e)=>e.filter(Boolean).join(" "),tbe=e=>e?"":void 0;function nbe(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 AV=Oe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return oe.createElement(_e.select,{...a,ref:n,className:ebe("chakra-select",o)},i&&y("option",{value:"",children:i}),r)});AV.displayName="SelectField";var OV=Oe((e,t)=>{var n;const r=qi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:f,minHeight:p,iconColor:m,iconSize:v,...b}=_n(e),[x,E]=nbe(b,kre),k=$k(E),_={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 oe.createElement(_e.div,{className:"chakra-select__wrapper",__css:_,...x,...i},y(AV,{ref:t,height:u!=null?u:l,minH:f!=null?f:p,placeholder:o,...k,__css:T,children:e.children}),y(MV,{"data-disabled":tbe(k.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v},children:a}))});OV.displayName="Select";var rbe=e=>y("svg",{viewBox:"0 0 24 24",...e,children:y("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),ibe=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),MV=e=>{const{children:t=y(rbe,{}),...n}=e,r=C.exports.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return y(ibe,{...n,className:"chakra-select__icon-wrapper",children:C.exports.isValidElement(t)?r:null})};MV.displayName="SelectIcon";function obe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function abe(e){const t=lbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function RV(e){return!!e.touches}function sbe(e){return RV(e)&&e.touches.length>1}function lbe(e){var t;return(t=e.view)!=null?t:window}function ube(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function cbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function IV(e,t="page"){return RV(e)?ube(e,t):cbe(e,t)}function dbe(e){return t=>{const n=abe(t);(!n||n&&t.button===0)&&e(t)}}function fbe(e,t=!1){function n(i){e(i,{point:IV(i)})}return t?dbe(n):n}function v4(e,t,n,r){return obe(e,t,fbe(n,t==="pointerdown"),r)}function DV(e){const t=C.exports.useRef(null);return t.current=e,t}var hbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=Z6(this.lastEventInfo,this.history),t=this.startEvent!==null,n=vbe(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=CA();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,Bie.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=Z6(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});var a;if(this.win=(a=e.view)!=null?a:window,sbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:IV(e)},{timestamp:i}=CA();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,Z6(r,this.history)),this.removeListeners=mbe(v4(this.win,"pointermove",this.onPointerMove),v4(this.win,"pointerup",this.onPointerUp),v4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),$ie.update(this.updatePoint)}};function qM(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Z6(e,t){return{point:e.point,delta:qM(e.point,t[t.length-1]),offset:qM(e.point,t[0]),velocity:gbe(t,.1)}}var pbe=e=>e*1e3;function gbe(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>pbe(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 mbe(...e){return t=>e.reduce((n,r)=>r(n),t)}function Q6(e,t){return Math.abs(e-t)}function YM(e){return"x"in e&&"y"in e}function vbe(e,t){if(typeof e=="number"&&typeof t=="number")return Q6(e,t);if(YM(e)&&YM(t)){const n=Q6(e.x,t.x),r=Q6(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function NV(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=C.exports.useRef(null),f=DV({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(p,m){u.current=null,i==null||i(p,m)}});C.exports.useEffect(()=>{var p;(p=u.current)==null||p.updateHandlers(f.current)}),C.exports.useEffect(()=>{const p=e.current;if(!p||!l)return;function m(v){u.current=new hbe(v,f.current,s)}return v4(p,"pointerdown",m)},[e,l,f,s]),C.exports.useEffect(()=>()=>{var p;(p=u.current)==null||p.end(),u.current=null},[])}function ybe(e,t){var i;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=(i=e.ownerDocument.defaultView)!=null?i:window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,l=f.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var bbe=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:C.exports.useEffect;function Sbe(e,t){var o;var n;if(!e||!e.parentElement)return;const r=(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function BV({getNodes:e,observeMutation:t=!0}){const[n,r]=C.exports.useState([]),[i,o]=C.exports.useState(0);return bbe(()=>{const a=e(),s=a.map((l,u)=>ybe(l,f=>{r(p=>[...p.slice(0,u),f,...p.slice(u+1)])}));if(t){const l=a[0];s.push(Sbe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function xbe(e){return typeof e=="object"&&e!==null&&"current"in e}function wbe(e){const[t]=BV({observeMutation:!1,getNodes(){return[xbe(e)?e.current:e]}});return t}var Cbe=Object.getOwnPropertyNames,_be=(e,t)=>function(){return e&&(t=(0,e[Cbe(e)[0]])(e=0)),t},ff=_be({"../../../react-shim.js"(){}});ff();ff();ff();var es=e=>e?"":void 0,Mg=e=>e?!0:void 0,hf=(...e)=>e.filter(Boolean).join(" ");ff();function Rg(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}ff();ff();function kbe(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 xv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var y4={width:0,height:0},pb=e=>e||y4;function $V(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=x=>{var k;const E=(k=r[x])!=null?k:y4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...xv({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${E.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${E.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,E)=>pb(x).height>pb(E).height?x:E,y4):r.reduce((x,E)=>pb(x).width>pb(E).width?x:E,y4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...xv({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",...xv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,f=[0,i?100-n[0]:n[0]],p=u?f:n;let m=p[0];!u&&i&&(m=100-m);const v=Math.abs(p[p.length-1]-p[0]),b={...l,...xv({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function FV(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Ebe(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:f,isReadOnly:p,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:x,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:R=0,...I}=e,D=br(m),B=br(v),z=br(x),j=FV({isReversed:a,direction:s,orientation:l}),[Y,te]=HS({value:i,defaultValue:o!=null?o:[25,75],onChange:r});if(!Array.isArray(Y))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof Y}\``);const[G,$]=C.exports.useState(!1),[V,J]=C.exports.useState(!1),[Z,U]=C.exports.useState(-1),X=!(f||p),le=C.exports.useRef(Y),fe=Y.map(ze=>Lg(ze,t,n)),Se=R*b,Ae=Pbe(fe,t,n,Se),be=C.exports.useRef({eventSource:null,value:[],valueBounds:[]});be.current.value=fe,be.current.valueBounds=Ae;const ke=fe.map(ze=>n-ze+t),Je=(j?ke:fe).map(ze=>_5(ze,t,n)),Ye=l==="vertical",mt=C.exports.useRef(null),_t=C.exports.useRef(null),dt=BV({getNodes(){const ze=_t.current,St=ze==null?void 0:ze.querySelectorAll("[role=slider]");return St?Array.from(St):[]}}),vt=C.exports.useId(),xt=u!=null?u:vt,Le=kbe(xt),ut=C.exports.useCallback(ze=>{var ia;var St;if(!mt.current)return;be.current.eventSource="pointer";const ct=mt.current.getBoundingClientRect(),{clientX:Vt,clientY:hn}=(ia=(St=ze.touches)==null?void 0:St[0])!=null?ia:ze,Er=Ye?ct.bottom-hn:Vt-ct.left,dr=Ye?ct.height:ct.width;let Kr=Er/dr;return j&&(Kr=1-Kr),Uj(Kr,t,n)},[Ye,j,n,t]),Rt=(n-t)/10,ot=b||(n-t)/100,Ct=C.exports.useMemo(()=>({setValueAtIndex(ze,St){if(!X)return;const ct=be.current.valueBounds[ze];St=parseFloat(E9(St,ct.min,ot)),St=Lg(St,ct.min,ct.max);const Vt=[...be.current.value];Vt[ze]=St,te(Vt)},setActiveIndex:U,stepUp(ze,St=ot){const ct=be.current.value[ze],Vt=j?ct-St:ct+St;Ct.setValueAtIndex(ze,Vt)},stepDown(ze,St=ot){const ct=be.current.value[ze],Vt=j?ct+St:ct-St;Ct.setValueAtIndex(ze,Vt)},reset(){te(le.current)}}),[ot,j,te,X]),ln=C.exports.useCallback(ze=>{const St=ze.key,Vt={ArrowRight:()=>Ct.stepUp(Z),ArrowUp:()=>Ct.stepUp(Z),ArrowLeft:()=>Ct.stepDown(Z),ArrowDown:()=>Ct.stepDown(Z),PageUp:()=>Ct.stepUp(Z,Rt),PageDown:()=>Ct.stepDown(Z,Rt),Home:()=>{const{min:hn}=Ae[Z];Ct.setValueAtIndex(Z,hn)},End:()=>{const{max:hn}=Ae[Z];Ct.setValueAtIndex(Z,hn)}}[St];Vt&&(ze.preventDefault(),ze.stopPropagation(),Vt(ze),be.current.eventSource="keyboard")},[Ct,Z,Rt,Ae]),{getThumbStyle:ue,rootStyle:Ie,trackStyle:We,innerTrackStyle:Xe}=C.exports.useMemo(()=>$V({isReversed:j,orientation:l,thumbRects:dt,thumbPercents:Je}),[j,l,Je,dt]),Ce=C.exports.useCallback(ze=>{var St;const ct=ze!=null?ze:Z;if(ct!==-1&&A){const Vt=Le.getThumb(ct),hn=(St=_t.current)==null?void 0:St.ownerDocument.getElementById(Vt);hn&&setTimeout(()=>hn.focus())}},[A,Z,Le]);Kd(()=>{be.current.eventSource==="keyboard"&&(B==null||B(be.current.value))},[fe,B]);const Ne=ze=>{const St=ut(ze)||0,ct=be.current.value.map(Kr=>Math.abs(Kr-St)),Vt=Math.min(...ct);let hn=ct.indexOf(Vt);const Er=ct.filter(Kr=>Kr===Vt);Er.length>1&&St>be.current.value[hn]&&(hn=hn+Er.length-1),U(hn),Ct.setValueAtIndex(hn,St),Ce(hn)},kt=ze=>{if(Z==-1)return;const St=ut(ze)||0;U(Z),Ct.setValueAtIndex(Z,St),Ce(Z)};NV(_t,{onPanSessionStart(ze){!X||($(!0),Ne(ze),D==null||D(be.current.value))},onPanSessionEnd(){!X||($(!1),B==null||B(be.current.value))},onPan(ze){!X||kt(ze)}});const Nt=C.exports.useCallback((ze={},St=null)=>({...ze,...I,id:Le.root,ref:Gn(St,_t),tabIndex:-1,"aria-disabled":Mg(f),"data-focused":es(V),style:{...ze.style,...Ie}}),[I,f,V,Ie,Le]),Te=C.exports.useCallback((ze={},St=null)=>({...ze,ref:Gn(St,mt),id:Le.track,"data-disabled":es(f),style:{...ze.style,...We}}),[f,We,Le]),Et=C.exports.useCallback((ze={},St=null)=>({...ze,ref:St,id:Le.innerTrack,style:{...ze.style,...Xe}}),[Xe,Le]),Ut=C.exports.useCallback((ze,St=null)=>{var dr;const{index:ct,...Vt}=ze,hn=fe[ct];if(hn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ct}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const Er=Ae[ct];return{...Vt,ref:St,role:"slider",tabIndex:X?0:void 0,id:Le.getThumb(ct),"data-active":es(G&&Z===ct),"aria-valuetext":(dr=z==null?void 0:z(hn))!=null?dr:E==null?void 0:E[ct],"aria-valuemin":Er.min,"aria-valuemax":Er.max,"aria-valuenow":hn,"aria-orientation":l,"aria-disabled":Mg(f),"aria-readonly":Mg(p),"aria-label":k==null?void 0:k[ct],"aria-labelledby":k!=null&&k[ct]||_==null?void 0:_[ct],style:{...ze.style,...ue(ct)},onKeyDown:Rg(ze.onKeyDown,ln),onFocus:Rg(ze.onFocus,()=>{J(!0),U(ct)}),onBlur:Rg(ze.onBlur,()=>{J(!1),U(-1)})}},[Le,fe,Ae,X,G,Z,z,E,l,f,p,k,_,ue,ln,J]),Ve=C.exports.useCallback((ze={},St=null)=>({...ze,ref:St,id:Le.output,htmlFor:fe.map((ct,Vt)=>Le.getThumb(Vt)).join(" "),"aria-live":"off"}),[Le,fe]),ft=C.exports.useCallback((ze,St=null)=>{const{value:ct,...Vt}=ze,hn=!(ctn),Er=ct>=fe[0]&&ct<=fe[fe.length-1];let dr=_5(ct,t,n);dr=j?100-dr:dr;const Kr={position:"absolute",pointerEvents:"none",...xv({orientation:l,vertical:{bottom:`${dr}%`},horizontal:{left:`${dr}%`}})};return{...Vt,ref:St,id:Le.getMarker(ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(f),"data-invalid":es(!hn),"data-highlighted":es(Er),style:{...ze.style,...Kr}}},[f,j,n,t,l,fe,Le]),un=C.exports.useCallback((ze,St=null)=>{const{index:ct,...Vt}=ze;return{...Vt,ref:St,id:Le.getInput(ct),type:"hidden",value:fe[ct],name:Array.isArray(T)?T[ct]:`${T}-${ct}`}},[T,fe,Le]);return{state:{value:fe,isFocused:V,isDragging:G,getThumbPercent:ze=>Je[ze],getThumbMinValue:ze=>Ae[ze].min,getThumbMaxValue:ze=>Ae[ze].max},actions:Ct,getRootProps:Nt,getTrackProps:Te,getInnerTrackProps:Et,getThumbProps:Ut,getMarkerProps:ft,getInputProps:un,getOutputProps:Ve}}function Pbe(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[Tbe,fx]=An({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[Lbe,CE]=An({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),zV=Oe(function(t,n){const r=qi("Slider",t),i=_n(t),{direction:o}=h1();i.direction=o;const{getRootProps:a,...s}=Ebe(i),l=C.exports.useMemo(()=>({...s,name:t.name}),[s,t.name]);return oe.createElement(Tbe,{value:l},oe.createElement(Lbe,{value:r},oe.createElement(_e.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});zV.defaultProps={orientation:"horizontal"};zV.displayName="RangeSlider";var Abe=Oe(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=fx(),a=CE(),s=r(t,n);return oe.createElement(_e.div,{...s,className:hf("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&y("input",{...i({index:t.index})}))});Abe.displayName="RangeSliderThumb";var Obe=Oe(function(t,n){const{getTrackProps:r}=fx(),i=CE(),o=r(t,n);return oe.createElement(_e.div,{...o,className:hf("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});Obe.displayName="RangeSliderTrack";var Mbe=Oe(function(t,n){const{getInnerTrackProps:r}=fx(),i=CE(),o=r(t,n);return oe.createElement(_e.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});Mbe.displayName="RangeSliderFilledTrack";var Rbe=Oe(function(t,n){const{getMarkerProps:r}=fx(),i=r(t,n);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__marker",t.className)})});Rbe.displayName="RangeSliderMark";ff();ff();function Ibe(e){var Ut;const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:f,isReadOnly:p,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:x,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,...R}=e,I=br(m),D=br(v),B=br(x),z=FV({isReversed:a,direction:s,orientation:l}),[j,Y]=HS({value:i,defaultValue:o!=null?o:Nbe(t,n),onChange:r}),[te,G]=C.exports.useState(!1),[$,V]=C.exports.useState(!1),J=!(f||p),Z=(n-t)/10,U=b||(n-t)/100,X=Lg(j,t,n),le=n-X+t,Se=_5(z?le:X,t,n),Ae=l==="vertical",be=DV({min:t,max:n,step:b,isDisabled:f,value:X,isInteractive:J,isReversed:z,isVertical:Ae,eventSource:null,focusThumbOnChange:A,orientation:l}),ke=C.exports.useRef(null),De=C.exports.useRef(null),Je=C.exports.useRef(null),Ye=C.exports.useId(),mt=u!=null?u:Ye,[_t,dt]=[`slider-thumb-${mt}`,`slider-track-${mt}`],vt=C.exports.useCallback(Ve=>{var Kr;var ft;if(!ke.current)return;const un=be.current;un.eventSource="pointer";const ze=ke.current.getBoundingClientRect(),{clientX:St,clientY:ct}=(Kr=(ft=Ve.touches)==null?void 0:ft[0])!=null?Kr:Ve,Vt=Ae?ze.bottom-ct:St-ze.left,hn=Ae?ze.height:ze.width;let Er=Vt/hn;z&&(Er=1-Er);let dr=Uj(Er,un.min,un.max);return un.step&&(dr=parseFloat(E9(dr,un.min,un.step))),dr=Lg(dr,un.min,un.max),dr},[Ae,z,be]),xt=C.exports.useCallback(Ve=>{const ft=be.current;!ft.isInteractive||(Ve=parseFloat(E9(Ve,ft.min,U)),Ve=Lg(Ve,ft.min,ft.max),Y(Ve))},[U,Y,be]),Le=C.exports.useMemo(()=>({stepUp(Ve=U){const ft=z?X-Ve:X+Ve;xt(ft)},stepDown(Ve=U){const ft=z?X+Ve:X-Ve;xt(ft)},reset(){xt(o||0)},stepTo(Ve){xt(Ve)}}),[xt,z,X,U,o]),ut=C.exports.useCallback(Ve=>{const ft=be.current,ze={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>xt(ft.min),End:()=>xt(ft.max)}[Ve.key];ze&&(Ve.preventDefault(),Ve.stopPropagation(),ze(Ve),ft.eventSource="keyboard")},[Le,xt,Z,be]),Rt=(Ut=B==null?void 0:B(X))!=null?Ut:E,ot=wbe(De),{getThumbStyle:Ct,rootStyle:ln,trackStyle:ue,innerTrackStyle:Ie}=C.exports.useMemo(()=>{const Ve=be.current,ft=ot!=null?ot:{width:0,height:0};return $V({isReversed:z,orientation:Ve.orientation,thumbRects:[ft],thumbPercents:[Se]})},[z,ot,Se,be]),We=C.exports.useCallback(()=>{be.current.focusThumbOnChange&&setTimeout(()=>{var ft;return(ft=De.current)==null?void 0:ft.focus()})},[be]);Kd(()=>{const Ve=be.current;We(),Ve.eventSource==="keyboard"&&(D==null||D(Ve.value))},[X,D]);function Xe(Ve){const ft=vt(Ve);ft!=null&&ft!==be.current.value&&Y(ft)}NV(Je,{onPanSessionStart(Ve){const ft=be.current;!ft.isInteractive||(G(!0),We(),Xe(Ve),I==null||I(ft.value))},onPanSessionEnd(){const Ve=be.current;!Ve.isInteractive||(G(!1),D==null||D(Ve.value))},onPan(Ve){!be.current.isInteractive||Xe(Ve)}});const Ce=C.exports.useCallback((Ve={},ft=null)=>({...Ve,...R,ref:Gn(ft,Je),tabIndex:-1,"aria-disabled":Mg(f),"data-focused":es($),style:{...Ve.style,...ln}}),[R,f,$,ln]),Ne=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:Gn(ft,ke),id:dt,"data-disabled":es(f),style:{...Ve.style,...ue}}),[f,dt,ue]),kt=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:ft,style:{...Ve.style,...Ie}}),[Ie]),Nt=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:Gn(ft,De),role:"slider",tabIndex:J?0:void 0,id:_t,"data-active":es(te),"aria-valuetext":Rt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":X,"aria-orientation":l,"aria-disabled":Mg(f),"aria-readonly":Mg(p),"aria-label":k,"aria-labelledby":k?void 0:_,style:{...Ve.style,...Ct(0)},onKeyDown:Rg(Ve.onKeyDown,ut),onFocus:Rg(Ve.onFocus,()=>V(!0)),onBlur:Rg(Ve.onBlur,()=>V(!1))}),[J,_t,te,Rt,t,n,X,l,f,p,k,_,Ct,ut]),Te=C.exports.useCallback((Ve,ft=null)=>{const un=!(Ve.valuen),ze=X>=Ve.value,St=_5(Ve.value,t,n),ct={position:"absolute",pointerEvents:"none",...Dbe({orientation:l,vertical:{bottom:z?`${100-St}%`:`${St}%`},horizontal:{left:z?`${100-St}%`:`${St}%`}})};return{...Ve,ref:ft,role:"presentation","aria-hidden":!0,"data-disabled":es(f),"data-invalid":es(!un),"data-highlighted":es(ze),style:{...Ve.style,...ct}}},[f,z,n,t,l,X]),Et=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:ft,type:"hidden",value:X,name:T}),[T,X]);return{state:{value:X,isFocused:$,isDragging:te},actions:Le,getRootProps:Ce,getTrackProps:Ne,getInnerTrackProps:kt,getThumbProps:Nt,getMarkerProps:Te,getInputProps:Et}}function Dbe(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function Nbe(e,t){return t"}),[$be,px]=An({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),_E=Oe((e,t)=>{const n=qi("Slider",e),r=_n(e),{direction:i}=h1();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=Ibe(r),l=a(),u=o({},t);return oe.createElement(Bbe,{value:s},oe.createElement($be,{value:n},oe.createElement(_e.div,{...l,className:hf("chakra-slider",e.className),__css:n.container},e.children,y("input",{...u}))))});_E.defaultProps={orientation:"horizontal"};_E.displayName="Slider";var jV=Oe((e,t)=>{const{getThumbProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__thumb",e.className),__css:r.thumb})});jV.displayName="SliderThumb";var HV=Oe((e,t)=>{const{getTrackProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__track",e.className),__css:r.track})});HV.displayName="SliderTrack";var VV=Oe((e,t)=>{const{getInnerTrackProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__filled-track",e.className),__css:r.filledTrack})});VV.displayName="SliderFilledTrack";var $9=Oe((e,t)=>{const{getMarkerProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__marker",e.className),__css:r.mark})});$9.displayName="SliderMark";var Fbe=(...e)=>e.filter(Boolean).join(" "),KM=e=>e?"":void 0,kE=Oe(function(t,n){const r=qi("Switch",t),{spacing:i="0.5rem",children:o,...a}=_n(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:f,getLabelProps:p}=Hj(a),m=C.exports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=C.exports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=C.exports.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return oe.createElement(_e.label,{...f(),className:Fbe("chakra-switch",t.className),__css:m},y("input",{className:"chakra-switch__input",...l({},n)}),oe.createElement(_e.span,{...u(),className:"chakra-switch__track",__css:v},oe.createElement(_e.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":KM(s.isChecked),"data-hover":KM(s.isHovered)})),o&&oe.createElement(_e.span,{className:"chakra-switch__label",...p(),__css:b},o))});kE.displayName="Switch";var x1=(...e)=>e.filter(Boolean).join(" ");function F9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[zbe,UV,jbe,Hbe]=nz();function Vbe(e){var _;const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[f,p]=C.exports.useState(t!=null?t:0),[m,v]=HS({defaultValue:t!=null?t:0,value:r,onChange:n});C.exports.useEffect(()=>{r!=null&&p(r)},[r]);const b=jbe(),x=C.exports.useId();return{id:`tabs-${(_=e.id)!=null?_:x}`,selectedIndex:m,focusedIndex:f,setSelectedIndex:v,setFocusedIndex:p,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[Ube,Ey]=An({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function Wbe(e){const{focusedIndex:t,orientation:n,direction:r}=Ey(),i=UV(),o=C.exports.useCallback(a=>{const s=()=>{var _;const T=i.nextEnabled(t);T&&((_=T.node)==null||_.focus())},l=()=>{var _;const T=i.prevEnabled(t);T&&((_=T.node)==null||_.focus())},u=()=>{var _;const T=i.firstEnabled();T&&((_=T.node)==null||_.focus())},f=()=>{var _;const T=i.lastEnabled();T&&((_=T.node)==null||_.focus())},p=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",k={[b]:()=>p&&l(),[x]:()=>p&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:f}[v];k&&(a.preventDefault(),k(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:F9(e.onKeyDown,o)}}function Gbe(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ey(),{index:u,register:f}=Hbe({disabled:t&&!n}),p=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=$me({...r,ref:Gn(f,e.ref),isDisabled:t,isFocusable:n,onClick:F9(e.onClick,m)}),x="button";return{...b,id:WV(a,u),role:"tab",tabIndex:p?0:-1,type:x,"aria-selected":p,"aria-controls":GV(a,u),onFocus:t?void 0:F9(e.onFocus,v)}}var[qbe,Ybe]=An({});function Kbe(e){const t=Ey(),{id:n,selectedIndex:r}=t,o=rx(e.children).map((a,s)=>C.exports.createElement(qbe,{key:s,value:{isSelected:s===r,id:GV(n,s),tabId:WV(n,s),selectedIndex:r}},a));return{...e,children:o}}function Xbe(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ey(),{isSelected:o,id:a,tabId:s}=Ybe(),l=C.exports.useRef(!1);o&&(l.current=!0);const u=TH({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function Zbe(){const e=Ey(),t=UV(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=C.exports.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=C.exports.useState(!1);return Ys(()=>{if(n==null)return;const f=t.item(n);if(f==null)return;i&&s({left:f.node.offsetLeft,width:f.node.offsetWidth}),o&&s({top:f.node.offsetTop,height:f.node.offsetHeight});const p=requestAnimationFrame(()=>{u(!0)});return()=>{p&&cancelAnimationFrame(p)}},[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 WV(e,t){return`${e}--tab-${t}`}function GV(e,t){return`${e}--tabpanel-${t}`}var[Qbe,Py]=An({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),qV=Oe(function(t,n){const r=qi("Tabs",t),{children:i,className:o,...a}=_n(t),{htmlProps:s,descendants:l,...u}=Vbe(a),f=C.exports.useMemo(()=>u,[u]),{isFitted:p,...m}=s;return oe.createElement(zbe,{value:l},oe.createElement(Ube,{value:f},oe.createElement(Qbe,{value:r},oe.createElement(_e.div,{className:x1("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});qV.displayName="Tabs";var Jbe=Oe(function(t,n){const r=Zbe(),i={...t.style,...r},o=Py();return oe.createElement(_e.div,{ref:n,...t,className:x1("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});Jbe.displayName="TabIndicator";var e4e=Oe(function(t,n){const r=Wbe({...t,ref:n}),o={display:"flex",...Py().tablist};return oe.createElement(_e.div,{...r,className:x1("chakra-tabs__tablist",t.className),__css:o})});e4e.displayName="TabList";var YV=Oe(function(t,n){const r=Xbe({...t,ref:n}),i=Py();return oe.createElement(_e.div,{outline:"0",...r,className:x1("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});YV.displayName="TabPanel";var KV=Oe(function(t,n){const r=Kbe(t),i=Py();return oe.createElement(_e.div,{...r,width:"100%",ref:n,className:x1("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});KV.displayName="TabPanels";var XV=Oe(function(t,n){const r=Py(),i=Gbe({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return oe.createElement(_e.button,{...i,className:x1("chakra-tabs__tab",t.className),__css:o})});XV.displayName="Tab";var t4e=(...e)=>e.filter(Boolean).join(" ");function n4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var r4e=["h","minH","height","minHeight"],ZV=Oe((e,t)=>{const n=Lo("Textarea",e),{className:r,rows:i,...o}=_n(e),a=$k(o),s=i?n4e(n,r4e):n;return oe.createElement(_e.textarea,{ref:t,rows:i,...a,className:t4e("chakra-textarea",r),__css:s})});ZV.displayName="Textarea";function i4e(e,t){const n=br(e);C.exports.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function z9(e,...t){return o4e(e)?e(...t):e}var o4e=e=>typeof e=="function";function a4e(e,t){var o;const n=e!=null?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(o=i==null?void 0:i[t])!=null?o:n}var s4e=(e,t)=>e.find(n=>n.id===t);function XM(e,t){const n=QV(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function QV(e,t){for(const[n,r]of Object.entries(e))if(s4e(r,t))return n}function l4e(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 u4e(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 c4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=d4e(c4e);function d4e(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=f4e(i,o),{position:s,id:l}=a;return r(u=>{var m,v;const p=s.includes("top")?[a,...(m=u[s])!=null?m:[]]:[...(v=u[s])!=null?v:[],a];return{...u,[s]:p}}),l},update:(i,o)=>{!i||r(a=>{const s={...a},{position:l,index:u}=XM(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:JV(o)}),s})},closeAll:({positions:i}={})=>{r(o=>{const a=["bottom","bottom-right","bottom-left","top","top-left","top-right"];return(i!=null?i:a).reduce((l,u)=>(l[u]=o[u].map(f=>({...f,requestClose:!0})),l),{...o})})},close:i=>{r(o=>{const a=QV(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(XM(Wl.getState(),i).position)}}var ZM=0;function f4e(e,t={}){var i,o;ZM+=1;const n=(i=t.id)!=null?i:ZM,r=(o=t.position)!=null?o:"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 h4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return oe.createElement(Nj,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},y($j,{children:l}),oe.createElement(_e.div,{flex:"1",maxWidth:"100%"},i&&y(Fj,{id:u==null?void 0:u.title,children:i}),s&&y(Bj,{id:u==null?void 0:u.description,display:"block",children:s})),o&&y(ax,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function JV(e={}){const{render:t,toastComponent:n=h4e}=e;return i=>typeof t=="function"?t({...i,...e}):y(n,{...i,...e})}function p4e(e,t){const n=i=>{var o;return{...t,...i,position:a4e((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=JV(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,...z9(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...z9(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function Ty(e){const{theme:t}=JF();return C.exports.useMemo(()=>p4e(t.direction,e),[e,t.direction])}var g4e={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]}}},eU=C.exports.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=g4e,toastSpacing:f="0.5rem"}=e,[p,m]=C.exports.useState(s),v=mpe();Kd(()=>{v||r==null||r()},[v]),Kd(()=>{m(s)},[s]);const b=()=>m(null),x=()=>m(s),E=()=>{v&&i()};C.exports.useEffect(()=>{v&&o&&i()},[v,o,i]),i4e(E,p);const k=C.exports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:f,...l}),[l,f]),_=C.exports.useMemo(()=>l4e(a),[a]);return oe.createElement(gu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:x,custom:{position:a},style:_},oe.createElement(_e.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:k},z9(n,{id:t,onClose:E})))});eU.displayName="ToastComponent";var m4e=e=>{const t=C.exports.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=eU,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return y("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${l}`,style:u4e(l),children:y(cf,{initial:!1,children:u.map(f=>y(i,{motionVariants:r,...f},f.id))})},l)});return K(fn,{children:[n,y(up,{...o,children:s})]})};function v4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function y4e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var b4e={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 Jm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var T5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},j9=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function S4e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:f,id:p,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:x,arrowPadding:E,modifiers:k,isDisabled:_,gutter:T,offset:A,direction:R,...I}=e,{isOpen:D,onOpen:B,onClose:z}=PH({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:j,getPopperProps:Y,getArrowInnerProps:te,getArrowProps:G}=EH({enabled:D,placement:f,arrowPadding:E,modifiers:k,gutter:T,offset:A,direction:R}),$=C.exports.useId(),J=`tooltip-${p!=null?p:$}`,Z=C.exports.useRef(null),U=C.exports.useRef(),X=C.exports.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),le=C.exports.useRef(),fe=C.exports.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=void 0)},[]),Se=C.exports.useCallback(()=>{fe(),z()},[z,fe]),Ae=x4e(Z,Se),be=C.exports.useCallback(()=>{if(!_&&!U.current){Ae();const vt=j9(Z);U.current=vt.setTimeout(B,t)}},[Ae,_,B,t]),ke=C.exports.useCallback(()=>{X();const vt=j9(Z);le.current=vt.setTimeout(Se,n)},[n,Se,X]),De=C.exports.useCallback(()=>{D&&r&&ke()},[r,ke,D]),Je=C.exports.useCallback(()=>{D&&a&&ke()},[a,ke,D]),Ye=C.exports.useCallback(vt=>{D&&vt.key==="Escape"&&ke()},[D,ke]);jh(()=>T5(Z),"keydown",s?Ye:void 0),jh(()=>T5(Z),"scroll",()=>{D&&o&&Se()}),C.exports.useEffect(()=>{!_||(X(),D&&z())},[_,D,z,X]),C.exports.useEffect(()=>()=>{X(),fe()},[X,fe]),jh(()=>Z.current,"pointerleave",ke);const mt=C.exports.useCallback((vt={},xt=null)=>({...vt,ref:Gn(Z,xt,j),onPointerEnter:Jm(vt.onPointerEnter,ut=>{ut.pointerType!=="touch"&&be()}),onClick:Jm(vt.onClick,De),onPointerDown:Jm(vt.onPointerDown,Je),onFocus:Jm(vt.onFocus,be),onBlur:Jm(vt.onBlur,ke),"aria-describedby":D?J:void 0}),[be,ke,Je,D,J,De,j]),_t=C.exports.useCallback((vt={},xt=null)=>Y({...vt,style:{...vt.style,[ri.arrowSize.var]:b?`${b}px`:void 0,[ri.arrowShadowColor.var]:x}},xt),[Y,b,x]),dt=C.exports.useCallback((vt={},xt=null)=>{const Le={...vt.style,position:"relative",transformOrigin:ri.transformOrigin.varRef};return{ref:xt,...I,...vt,id:J,role:"tooltip",style:Le}},[I,J]);return{isOpen:D,show:be,hide:ke,getTriggerProps:mt,getTooltipProps:dt,getTooltipPositionerProps:_t,getArrowProps:G,getArrowInnerProps:te}}var J6="chakra-ui:close-tooltip";function x4e(e,t){return C.exports.useEffect(()=>{const n=T5(e);return n.addEventListener(J6,t),()=>n.removeEventListener(J6,t)},[t,e]),()=>{const n=T5(e),r=j9(e);n.dispatchEvent(new r.CustomEvent(J6))}}var w4e=_e(gu.div),so=Oe((e,t)=>{var z,j;const n=Lo("Tooltip",e),r=_n(e),i=h1(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:f,portalProps:p,background:m,backgroundColor:v,bgColor:b,motionProps:x,...E}=r,k=(j=(z=m!=null?m:v)!=null?z:f)!=null?j:b;if(k){n.bg=k;const Y=Fre(i,"colors",k);n[ri.arrowBg.var]=Y}const _=S4e({...E,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=oe.createElement(_e.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const Y=C.exports.Children.only(o);A=C.exports.cloneElement(Y,_.getTriggerProps(Y.props,Y.ref))}const R=!!l,I=_.getTooltipProps({},t),D=R?v4e(I,["role","id"]):I,B=y4e(I,["role","id"]);return a?K(fn,{children:[A,y(cf,{children:_.isOpen&&oe.createElement(up,{...p},oe.createElement(_e.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},K(w4e,{variants:b4e,initial:"exit",animate:"enter",exit:"exit",...x,...D,__css:n,children:[a,R&&oe.createElement(_e.span,{srOnly:!0,...B},l),u&&oe.createElement(_e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},oe.createElement(_e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))]})))})]}):y(fn,{children:o})});so.displayName="Tooltip";var C4e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=y(uH,{environment:a,children:t});return y(Lde,{theme:o,cssVarsRoot:s,children:K(nF,{colorModeManager:n,options:o.config,children:[i?y(Y1e,{}):y(q1e,{}),y(Ode,{}),r?y(LH,{zIndex:r,children:l}):l]})})};function _4e({children:e,theme:t=Sde,toastOptions:n,...r}){return K(C4e,{theme:t,...r,children:[e,y(m4e,{...n})]})}function Us(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:EE(e)?2:PE(e)?3:0}function Ig(e,t){return w1(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k4e(e,t){return w1(e)===2?e.get(t):e[t]}function tU(e,t,n){var r=w1(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function nU(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function EE(e){return O4e&&e instanceof Map}function PE(e){return M4e&&e instanceof Set}function yh(e){return e.o||e.t}function TE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=iU(e);delete t[ur];for(var n=Dg(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=E4e),Object.freeze(e),t&&tp(e,function(n,r){return LE(r,!0)},!0)),e}function E4e(){Us(2)}function AE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ru(e){var t=W9[e];return t||Us(18,e),t}function P4e(e,t){W9[e]||(W9[e]=t)}function H9(){return G2}function eC(e,t){t&&(ru("Patches"),e.u=[],e.s=[],e.v=t)}function L5(e){V9(e),e.p.forEach(T4e),e.p=null}function V9(e){e===G2&&(G2=e.l)}function QM(e){return G2={p:[],l:G2,h:e,m:!0,_:0}}function T4e(e){var t=e[ur];t.i===0||t.i===1?t.j():t.O=!0}function tC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||ru("ES5").S(t,e,r),r?(n[ur].P&&(L5(t),Us(4)),lc(e)&&(e=A5(t,e),t.l||O5(t,e)),t.u&&ru("Patches").M(n[ur].t,e,t.u,t.s)):e=A5(t,n,[]),L5(t),t.u&&t.v(t.u,t.s),e!==rU?e:void 0}function A5(e,t,n){if(AE(t))return t;var r=t[ur];if(!r)return tp(t,function(o,a){return JM(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return O5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=TE(r.k):r.o;tp(r.i===3?new Set(i):i,function(o,a){return JM(e,r,i,o,a,n)}),O5(e,i,!1),n&&e.u&&ru("Patches").R(r,n,e.u,e.s)}return r.o}function JM(e,t,n,r,i,o){if(ef(i)){var a=A5(e,i,o&&t&&t.i!==3&&!Ig(t.D,r)?o.concat(r):void 0);if(tU(n,r,a),!ef(a))return;e.m=!1}if(lc(i)&&!AE(i)){if(!e.h.F&&e._<1)return;A5(e,i),t&&t.A.l||O5(e,i)}}function O5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&LE(t,n)}function nC(e,t){var n=e[ur];return(n?yh(n):e)[t]}function eR(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 _d(e){e.P||(e.P=!0,e.l&&_d(e.l))}function rC(e){e.o||(e.o=TE(e.t))}function U9(e,t,n){var r=EE(t)?ru("MapSet").N(t,n):PE(t)?ru("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:H9(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=q2;a&&(l=[s],u=wv);var f=Proxy.revocable(l,u),p=f.revoke,m=f.proxy;return s.k=m,s.j=p,m}(t,n):ru("ES5").J(t,n);return(n?n.A:H9()).p.push(r),r}function L4e(e){return ef(e)||Us(22,e),function t(n){if(!lc(n))return n;var r,i=n[ur],o=w1(n);if(i){if(!i.P&&(i.i<4||!ru("ES5").K(i)))return i.t;i.I=!0,r=tR(n,o),i.I=!1}else r=tR(n,o);return tp(r,function(a,s){i&&k4e(i.t,a)===s||tU(r,a,t(s))}),o===3?new Set(r):r}(e)}function tR(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return TE(e)}function A4e(){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[ur];return q2.get(l,o)},set:function(l){var u=this[ur];q2.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][ur];if(!s.P)switch(s.i){case 5:r(s)&&_d(s);break;case 4:n(s)&&_d(s)}}}function n(o){for(var a=o.t,s=o.k,l=Dg(s),u=l.length-1;u>=0;u--){var f=l[u];if(f!==ur){var p=a[f];if(p===void 0&&!Ig(a,f))return!0;var m=s[f],v=m&&m[ur];if(v?v.t!==p:!nU(m,p))return!0}}var b=!!a[ur];return l.length!==Dg(a).length+(b?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?k-1:0),T=1;T1?f-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=ru("Patches").$;return ef(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ia=new I4e,oU=Ia.produce;Ia.produceWithPatches.bind(Ia);Ia.setAutoFreeze.bind(Ia);Ia.setUseProxies.bind(Ia);Ia.applyPatches.bind(Ia);Ia.createDraft.bind(Ia);Ia.finishDraft.bind(Ia);function oR(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 aR(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(no(1));return n(ME)(e,t)}if(typeof e!="function")throw new Error(no(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function f(){if(l)throw new Error(no(3));return o}function p(x){if(typeof x!="function")throw new Error(no(4));if(l)throw new Error(no(5));var E=!0;return u(),s.push(x),function(){if(!!E){if(l)throw new Error(no(6));E=!1,u();var _=s.indexOf(x);s.splice(_,1),a=null}}}function m(x){if(!D4e(x))throw new Error(no(7));if(typeof x.type>"u")throw new Error(no(8));if(l)throw new Error(no(9));try{l=!0,o=i(o,x)}finally{l=!1}for(var E=a=s,k=0;k"u")throw new Error(no(12));if(typeof n(void 0,{type:M5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(no(13))})}function aU(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(no(14));p[v]=E,f=f||E!==x}return f=f||o.length!==Object.keys(l).length,f?p:l}}function R5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return I5}function i(s,l){r(s)===I5&&(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 z4e=function(t,n){return t===n};function j4e(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;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(I).forEach(function(D){!T(D)||f[D]!==I[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(f).forEach(function(D){I[D]===void 0&&T(D)&&m.indexOf(D)===-1&&f[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(k,i)),f=I},o)}function k(){if(m.length===0){v&&clearInterval(v),v=null;return}var I=m.shift(),D=r.reduce(function(B,z){return z.in(B,I,f)},f[I]);if(D!==void 0)try{p[I]=l(D)}catch(B){console.error("redux-persist/createPersistoid: error serializing state",B)}else delete p[I];m.length===0&&_()}function _(){Object.keys(p).forEach(function(I){f[I]===void 0&&delete p[I]}),b=s.setItem(a,l(p)).catch(A)}function T(I){return!(n&&n.indexOf(I)===-1&&I!=="_persist"||t&&t.indexOf(I)!==-1)}function A(I){u&&u(I)}var R=function(){for(;m.length!==0;)k();return b||Promise.resolve()};return{update:E,flush:R}}function x5e(e){return JSON.stringify(e)}function w5e(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:IE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=C5e,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,f){return f.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function C5e(e){return JSON.parse(e)}function _5e(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:IE).concat(e.key);return t.removeItem(n,k5e)}function k5e(e){}function pR(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 Vu(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function T5e(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 L5e=5e3;function A5e(e,t){var n=e.version!==void 0?e.version:m5e;e.debug;var r=e.stateReconciler===void 0?b5e:e.stateReconciler,i=e.getStoredState||w5e,o=e.timeout!==void 0?e.timeout:L5e,a=null,s=!1,l=!0,u=function(p){return p._persist.rehydrated&&a&&!l&&a.update(p),p};return function(f,p){var m=f||{},v=m._persist,b=P5e(m,["_persist"]),x=b;if(p.type===fU){var E=!1,k=function(B,z){E||(p.rehydrate(e.key,B,z),E=!0)};if(o&&setTimeout(function(){!E&&k(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=S5e(e)),v)return Vu({},t(x,p),{_persist:v});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),i(e).then(function(D){var B=e.migrate||function(z,j){return Promise.resolve(z)};B(D,n).then(function(z){k(z)},function(z){k(void 0,z)})},function(D){k(void 0,D)}),Vu({},t(x,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===hU)return s=!0,p.result(_5e(e)),Vu({},t(x,p),{_persist:v});if(p.type===cU)return p.result(a&&a.flush()),Vu({},t(x,p),{_persist:v});if(p.type===dU)l=!0;else if(p.type===DE){if(s)return Vu({},x,{_persist:Vu({},v,{rehydrated:!0})});if(p.key===e.key){var _=t(x,p),T=p.payload,A=r!==!1&&T!==void 0?r(T,f,_,e):_,R=Vu({},A,{_persist:Vu({},v,{rehydrated:!0})});return u(R)}}}if(!v)return t(f,p);var I=t(x,p);return I===x?f:u(Vu({},I,{_persist:v}))}}function gR(e){return R5e(e)||M5e(e)||O5e()}function O5e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function M5e(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function R5e(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:gU,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case pU:return q9({},t,{registry:[].concat(gR(t.registry),[n.key])});case DE:var r=t.registry.indexOf(n.key),i=gR(t.registry);return i.splice(r,1),q9({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function N5e(e,t,n){var r=n||!1,i=ME(D5e,gU,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:pU,key:u})},a=function(u,f,p){var m={type:DE,payload:f,err:p,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=q9({},i,{purge:function(){var u=[];return e.dispatch({type:hU,result:function(p){u.push(p)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:cU,result:function(p){u.push(p)}}),Promise.all(u)},pause:function(){e.dispatch({type:dU})},persist:function(){e.dispatch({type:fU,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var NE={},BE={};BE.__esModule=!0;BE.default=F5e;function S4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S4=function(n){return typeof n}:S4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},S4(e)}function sC(){}var B5e={getItem:sC,setItem:sC,removeItem:sC};function $5e(e){if((typeof self>"u"?"undefined":S4(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(r){return!1}return!0}function F5e(e){var t="".concat(e,"Storage");return $5e(t)?self[t]:B5e}NE.__esModule=!0;NE.default=H5e;var z5e=j5e(BE);function j5e(e){return e&&e.__esModule?e:{default:e}}function H5e(e){var t=(0,z5e.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 mU=void 0,V5e=U5e(NE);function U5e(e){return e&&e.__esModule?e:{default:e}}var W5e=(0,V5e.default)("local");mU=W5e;var vU={},yU={},np={};Object.defineProperty(np,"__esModule",{value:!0});np.PLACEHOLDER_UNDEFINED=np.PACKAGE_NAME=void 0;np.PACKAGE_NAME="redux-deep-persist";np.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var $E={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})($E);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=np,n=$E,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const f=Object.prototype.hasOwnProperty,p=function(G,$,V){V||(V=new Set([G])),$||($="");for(const J in G){const Z=$?`${$}.${J}`:J,U=G[J];if((0,e.isObjectLike)(U))return V.has(U)?`${$}.${J}:`:(V.add(U),(0,e.getCircularPath)(U,Z,V))}return null};e.getCircularPath=p;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const $=(0,e.isArray)(G)?[]:{};for(const V in G){const J=G[V];$[V]=(0,e._cloneDeep)(J)}return $};e._cloneDeep=m;const v=function(G){const $=(0,e.getCircularPath)(G);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=v;const b=function(G,$){if(G===$)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)($))return $;const V=(0,e.cloneDeep)(G),J=(0,e.cloneDeep)($),Z=Object.keys(V).reduce((X,le)=>(f.call(J,le)||(X[le]=void 0),X),{});if((0,e.isDate)(V)||(0,e.isDate)(J))return V.valueOf()===J.valueOf()?{}:J;const U=Object.keys(J).reduce((X,le)=>{if(!f.call(V,le))return X[le]=J[le],X;const fe=(0,e.difference)(V[le],J[le]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(V)&&!(0,e.isArray)(J)||!(0,e.isArray)(V)&&(0,e.isArray)(J)?J:X:(X[le]=fe,X)},Z);return delete U._persist,U};e.difference=b;const x=function(G,$){return $.reduce((V,J)=>{if(V){const Z=parseInt(J,10),U=(0,e.isIntegerString)(J)&&Z<0?V.length+Z:J;return(0,e.isString)(V)?V.charAt(U):V[U]}},G)};e.path=x;const E=function(G,$){return[...G].reverse().reduce((Z,U,X)=>{const le=(0,e.isIntegerString)(U)?[]:{};return le[U]=X===0?$:Z,le},{})};e.assocPath=E;const k=function(G,$){const V=(0,e.cloneDeep)(G);return $.reduce((J,Z,U)=>(U===$.length-1&&J&&(0,e.isObjectLike)(J)&&delete J[Z],J&&J[Z]),V),V};e.dissocPath=k;const _=function(G,$,...V){if(!V||!V.length)return $;const J=V.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(J))for(const X in J)if((0,e.isObjectLike)(J[X])&&(0,e.isObjectLike)($[X]))$[X]||($[X]={}),_(G,$[X],J[X]);else if((0,e.isArray)($)){let le=J[X];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(le=typeof le<"u"?le:$[parseInt(X,10)]),le=le!==t.PLACEHOLDER_UNDEFINED?le:fe,$[parseInt(X,10)]=le}else{const le=J[X]!==t.PLACEHOLDER_UNDEFINED?J[X]:void 0;$[X]=le}return _(G,$,...V)},T=function(G,$,V){return _({preservePlaceholder:V==null?void 0:V.preservePlaceholder,preserveUndefined:V==null?void 0:V.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)($))};e.mergeDeep=T;const A=function(G,$=[],V,J,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const X=G[U],le=(0,e.isArray)(G),fe=J?J+"."+U:U;X===null&&(V===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||V===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&le&&(G[parseInt(U,10)]=void 0),X===void 0&&Z&&V===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&le&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(X,$,V,fe,Z)}},R=function(G,$,V,J){const Z=(0,e.cloneDeep)(G);return A(Z,$,V,"",J),Z};e.preserveUndefined=R;const I=function(G,$,V){return V.indexOf(G)===$};e.unique=I;const D=function(G){return G.reduce(($,V)=>{const J=G.filter(Se=>Se===V),Z=G.filter(Se=>(V+".").indexOf(Se+".")===0),{duplicates:U,subsets:X}=$,le=J.length>1&&U.indexOf(V)===-1,fe=Z.length>1;return{duplicates:[...U,...le?J:[]],subsets:[...X,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const B=function(G,$,V){const J=V===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${J} configuration.`,U=`Check your create${V===n.ConfigType.WHITELIST?"White":"Black"}list arguments. +`)},i3e=0,T0=[];function o3e(e){var t=C.exports.useRef([]),n=C.exports.useRef([0,0]),r=C.exports.useRef(),i=C.exports.useState(i3e++)[0],o=C.exports.useState(function(){return hV()})[0],a=C.exports.useRef(e);C.exports.useEffect(function(){a.current=e},[e]),C.exports.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=b9([e.lockRef.current],(e.shards||[]).map(VM),!0).filter(Boolean);return x.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=C.exports.useCallback(function(x,E){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var k=hb(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-k[0],A="deltaY"in x?x.deltaY:_[1]-k[1],R,I=x.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in x&&D==="h"&&I.type==="range")return!1;var B=jM(D,I);if(!B)return!0;if(B?R=D:(R=D==="v"?"h":"v",B=jM(D,I)),!B)return!1;if(!r.current&&"changedTouches"in x&&(T||A)&&(r.current=R),!R)return!0;var z=r.current||R;return t3e(z,E,x,z==="h"?T:A,!0)},[]),l=C.exports.useCallback(function(x){var E=x;if(!(!T0.length||T0[T0.length-1]!==o)){var k="deltaY"in E?HM(E):hb(E),_=t.current.filter(function(R){return R.name===E.type&&R.target===E.target&&n3e(R.delta,k)})[0];if(_&&_.should){E.cancelable&&E.preventDefault();return}if(!_){var T=(a.current.shards||[]).map(VM).filter(Boolean).filter(function(R){return R.contains(E.target)}),A=T.length>0?s(E,T[0]):!a.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),u=C.exports.useCallback(function(x,E,k,_){var T={name:x,delta:E,target:k,should:_};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),f=C.exports.useCallback(function(x){n.current=hb(x),r.current=void 0},[]),p=C.exports.useCallback(function(x){u(x.type,HM(x),x.target,s(x,e.lockRef.current))},[]),m=C.exports.useCallback(function(x){u(x.type,hb(x),x.target,s(x,e.lockRef.current))},[]);C.exports.useEffect(function(){return T0.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,P0),document.addEventListener("touchmove",l,P0),document.addEventListener("touchstart",f,P0),function(){T0=T0.filter(function(x){return x!==o}),document.removeEventListener("wheel",l,P0),document.removeEventListener("touchmove",l,P0),document.removeEventListener("touchstart",f,P0)}},[]);var v=e.removeScrollBar,b=e.inert;return K(fn,{children:[b?y(o,{styles:r3e(i)}):null,v?y(Yye,{gapMode:"margin"}):null]})}const a3e=F2e(fV,o3e);var vV=C.exports.forwardRef(function(e,t){return y(ux,{...Ul({},e,{ref:t,sideCar:a3e})})});vV.classNames=ux.classNames;const yV=vV;var cp=(...e)=>e.filter(Boolean).join(" ");function Sv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var s3e=class{constructor(){sn(this,"modals");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}},N9=new s3e;function l3e(e,t){C.exports.useEffect(()=>(t&&N9.add(e),()=>{N9.remove(e)}),[t,e])}function u3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=C.exports.useRef(null),f=C.exports.useRef(null),[p,m,v]=d3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");c3e(u,t&&a),l3e(u,t);const b=C.exports.useRef(null),x=C.exports.useCallback(B=>{b.current=B.target},[]),E=C.exports.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[k,_]=C.exports.useState(!1),[T,A]=C.exports.useState(!1),R=C.exports.useCallback((B={},z=null)=>({role:"dialog",...B,ref:Gn(z,u),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?m:void 0,"aria-describedby":T?v:void 0,onClick:Sv(B.onClick,j=>j.stopPropagation())}),[v,T,p,m,k]),I=C.exports.useCallback(B=>{B.stopPropagation(),b.current===B.target&&(!N9.isTopModal(u)||(i&&(n==null||n()),s==null||s()))},[n,i,s]),D=C.exports.useCallback((B={},z=null)=>({...B,ref:Gn(z,f),onClick:Sv(B.onClick,I),onKeyDown:Sv(B.onKeyDown,E),onMouseDown:Sv(B.onMouseDown,x)}),[E,x,I]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:f,getDialogProps:R,getDialogContainerProps:D}}function c3e(e,t){const n=e.current;C.exports.useEffect(()=>{if(!(!e.current||!t))return MH(e.current)},[t,e,n])}function d3e(e,...t){const n=C.exports.useId(),r=e||n;return C.exports.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[f3e,dp]=An({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[h3e,Zd]=An({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Qd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=qi("Modal",e),E={...u3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:f,motionPreset:p,lockFocusAcrossFrames:m};return y(h3e,{value:E,children:y(f3e,{value:b,children:y(cf,{onExitComplete:v,children:E.isOpen&&y(up,{...t,children:n})})})})};Qd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Qd.displayName="Modal";var t1=Oe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Zd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__body",n),s=dp();return oe.createElement(_e.div,{ref:t,className:a,id:i,...r,__css:s.body})});t1.displayName="ModalBody";var Cy=Oe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Zd(),a=cp("chakra-modal__close-btn",r),s=dp();return y(ax,{ref:t,__css:s.closeButton,className:a,onClick:Sv(n,l=>{l.stopPropagation(),o()}),...i})});Cy.displayName="ModalCloseButton";function bV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:f}=Zd(),[p,m]=Ek();return C.exports.useEffect(()=>{!p&&m&&setTimeout(m)},[p,m]),y(dV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:f,children:y(yV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0,children:e.children})})}var p3e={slideInBottom:{...x9,custom:{offsetY:16,reverse:!0}},slideInRight:{...x9,custom:{offsetX:16,reverse:!0}},scale:{...Rj,custom:{initialScale:.95,reverse:!0}},none:{}},g3e=_e(gu.section),m3e=e=>p3e[e||"none"],SV=C.exports.forwardRef((e,t)=>{const{preset:n,motionProps:r=m3e(n),...i}=e;return y(g3e,{ref:t,...r,...i})});SV.displayName="ModalTransition";var ep=Oe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Zd(),u=s(a,t),f=l(i),p=cp("chakra-modal__content",n),m=dp(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:x}=Zd();return oe.createElement(bV,null,oe.createElement(_e.div,{...f,className:"chakra-modal__content-container",tabIndex:-1,__css:b},y(SV,{preset:x,motionProps:o,className:p,...u,__css:v,children:r})))});ep.displayName="ModalContent";var cx=Oe((e,t)=>{const{className:n,...r}=e,i=cp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...dp().footer};return oe.createElement(_e.footer,{ref:t,...r,__css:a,className:i})});cx.displayName="ModalFooter";var S1=Oe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Zd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=cp("chakra-modal__header",n),l={flex:0,...dp().header};return oe.createElement(_e.header,{ref:t,className:a,id:i,...r,__css:l})});S1.displayName="ModalHeader";var v3e=_e(gu.div),Jd=Oe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=cp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...dp().overlay},{motionPreset:u}=Zd();return y(v3e,{...i||(u==="none"?{}:Mj),__css:l,ref:t,className:a,...o})});Jd.displayName="ModalOverlay";function xV(e){const{leastDestructiveRef:t,...n}=e;return y(Qd,{...n,initialFocusRef:t})}var wV=Oe((e,t)=>y(ep,{ref:t,role:"alertdialog",...e})),[Eze,y3e]=An(),b3e=_e(Ij),S3e=Oe((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Zd(),f=s(a,t),p=l(o),m=cp("chakra-modal__content",n),v=dp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},x={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:E}=y3e();return oe.createElement(bV,null,oe.createElement(_e.div,{...p,className:"chakra-modal__content-container",__css:x},y(b3e,{motionProps:i,direction:E,in:u,className:m,...f,__css:b,children:r})))});S3e.displayName="DrawerContent";function x3e(e,t){const n=br(e);C.exports.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var CV=(...e)=>e.filter(Boolean).join(" "),K6=e=>e?!0:void 0;function Rl(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var w3e=e=>y($a,{viewBox:"0 0 24 24",...e,children:y("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"})}),C3e=e=>y($a,{viewBox:"0 0 24 24",...e,children:y("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 UM(e,t,n,r){C.exports.useEffect(()=>{var s;if(!e.current||!r)return;const i=(s=e.current.ownerDocument.defaultView)!=null?s:window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&o.includes(u.attributeName)&&n(u)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var _3e=50,WM=300;function k3e(e,t){const[n,r]=C.exports.useState(!1),[i,o]=C.exports.useState(null),[a,s]=C.exports.useState(!0),l=C.exports.useRef(null),u=()=>clearTimeout(l.current);x3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?_3e:null);const f=C.exports.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},WM)},[e,a]),p=C.exports.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},WM)},[t,a]),m=C.exports.useCallback(()=>{s(!0),r(!1),u()},[]);return C.exports.useEffect(()=>()=>u(),[]),{up:f,down:p,stop:m,isSpinning:n}}var E3e=/^[Ee0-9+\-.]$/;function P3e(e){return E3e.test(e)}function T3e(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 L3e(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:u,isInvalid:f,pattern:p="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:x,precision:E,name:k,"aria-describedby":_,"aria-label":T,"aria-labelledby":A,onFocus:R,onBlur:I,onInvalid:D,getAriaValueText:B,isValidCharacter:z,format:j,parse:Y,...te}=e,G=br(R),$=br(I),V=br(D),J=br(z!=null?z:P3e),Z=br(B),U=G1e(e),{update:X,increment:le,decrement:fe}=U,[Se,Ae]=C.exports.useState(!1),be=!(s||l),ke=C.exports.useRef(null),De=C.exports.useRef(null),Je=C.exports.useRef(null),Ye=C.exports.useRef(null),mt=C.exports.useCallback(Te=>Te.split("").filter(J).join(""),[J]),_t=C.exports.useCallback(Te=>{var Et;return(Et=Y==null?void 0:Y(Te))!=null?Et:Te},[Y]),dt=C.exports.useCallback(Te=>{var Et;return((Et=j==null?void 0:j(Te))!=null?Et:Te).toString()},[j]);Kd(()=>{(U.valueAsNumber>o||U.valueAsNumber{if(!ke.current)return;if(ke.current.value!=U.value){const Et=_t(ke.current.value);U.setValue(mt(Et))}},[_t,mt]);const vt=C.exports.useCallback((Te=a)=>{be&&le(Te)},[le,be,a]),xt=C.exports.useCallback((Te=a)=>{be&&fe(Te)},[fe,be,a]),Le=k3e(vt,xt);UM(Je,"disabled",Le.stop,Le.isSpinning),UM(Ye,"disabled",Le.stop,Le.isSpinning);const ut=C.exports.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;const Ut=_t(Te.currentTarget.value);X(mt(Ut)),De.current={start:Te.currentTarget.selectionStart,end:Te.currentTarget.selectionEnd}},[X,mt,_t]),Rt=C.exports.useCallback(Te=>{var Ut,Ve;var Et;G==null||G(Te),De.current&&(Te.target.selectionStart=(Ut=De.current.start)!=null?Ut:(Et=Te.currentTarget.value)==null?void 0:Et.length,Te.currentTarget.selectionEnd=(Ve=De.current.end)!=null?Ve:Te.currentTarget.selectionStart)},[G]),ot=C.exports.useCallback(Te=>{if(Te.nativeEvent.isComposing)return;T3e(Te,J)||Te.preventDefault();const Et=Ct(Te)*a,Ut=Te.key,ft={ArrowUp:()=>vt(Et),ArrowDown:()=>xt(Et),Home:()=>X(i),End:()=>X(o)}[Ut];ft&&(Te.preventDefault(),ft(Te))},[J,a,vt,xt,X,i,o]),Ct=Te=>{let Et=1;return(Te.metaKey||Te.ctrlKey)&&(Et=.1),Te.shiftKey&&(Et=10),Et},ln=C.exports.useMemo(()=>{const Te=Z==null?void 0:Z(U.value);if(Te!=null)return Te;const Et=U.value.toString();return Et||void 0},[U.value,Z]),ue=C.exports.useCallback(()=>{let Te=U.value;if(U.value==="")return;/^[eE]/.test(U.value.toString())?U.setValue(""):(U.valueAsNumbero&&(Te=o),U.cast(Te))},[U,o,i]),Ie=C.exports.useCallback(()=>{Ae(!1),n&&ue()},[n,Ae,ue]),We=C.exports.useCallback(()=>{t&&requestAnimationFrame(()=>{var Te;(Te=ke.current)==null||Te.focus()})},[t]),Xe=C.exports.useCallback(Te=>{Te.preventDefault(),Le.up(),We()},[We,Le]),Ce=C.exports.useCallback(Te=>{Te.preventDefault(),Le.down(),We()},[We,Le]);jh(()=>ke.current,"wheel",Te=>{var ze;var Et;const Ve=((ze=(Et=ke.current)==null?void 0:Et.ownerDocument)!=null?ze:document).activeElement===ke.current;if(!v||!Ve)return;Te.preventDefault();const ft=Ct(Te)*a,un=Math.sign(Te.deltaY);un===-1?vt(ft):un===1&&xt(ft)},{passive:!1});const Ne=C.exports.useCallback((Te={},Et=null)=>{const Ut=l||r&&U.isAtMax;return{...Te,ref:Gn(Et,Je),role:"button",tabIndex:-1,onPointerDown:Rl(Te.onPointerDown,Ve=>{Ve.button!==0||Ut||Xe(Ve)}),onPointerLeave:Rl(Te.onPointerLeave,Le.stop),onPointerUp:Rl(Te.onPointerUp,Le.stop),disabled:Ut,"aria-disabled":K6(Ut)}},[U.isAtMax,r,Xe,Le.stop,l]),kt=C.exports.useCallback((Te={},Et=null)=>{const Ut=l||r&&U.isAtMin;return{...Te,ref:Gn(Et,Ye),role:"button",tabIndex:-1,onPointerDown:Rl(Te.onPointerDown,Ve=>{Ve.button!==0||Ut||Ce(Ve)}),onPointerLeave:Rl(Te.onPointerLeave,Le.stop),onPointerUp:Rl(Te.onPointerUp,Le.stop),disabled:Ut,"aria-disabled":K6(Ut)}},[U.isAtMin,r,Ce,Le.stop,l]),Nt=C.exports.useCallback((Te={},Et=null)=>{var Ut,Ve,ft,un;return{name:k,inputMode:m,type:"text",pattern:p,"aria-labelledby":A,"aria-label":T,"aria-describedby":_,id:b,disabled:l,...Te,readOnly:(Ut=Te.readOnly)!=null?Ut:s,"aria-readonly":(Ve=Te.readOnly)!=null?Ve:s,"aria-required":(ft=Te.required)!=null?ft:u,required:(un=Te.required)!=null?un:u,ref:Gn(ke,Et),value:dt(U.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(U.valueAsNumber)?void 0:U.valueAsNumber,"aria-invalid":K6(f!=null?f:U.isOutOfRange),"aria-valuetext":ln,autoComplete:"off",autoCorrect:"off",onChange:Rl(Te.onChange,ut),onKeyDown:Rl(Te.onKeyDown,ot),onFocus:Rl(Te.onFocus,Rt,()=>Ae(!0)),onBlur:Rl(Te.onBlur,$,Ie)}},[k,m,p,A,T,dt,_,b,l,u,s,f,U.value,U.valueAsNumber,U.isOutOfRange,i,o,ln,ut,ot,Rt,$,Ie]);return{value:dt(U.value),valueAsNumber:U.valueAsNumber,isFocused:Se,isDisabled:l,isReadOnly:s,getIncrementButtonProps:Ne,getDecrementButtonProps:kt,getInputProps:Nt,htmlProps:te}}var[A3e,dx]=An({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[O3e,pE]=An({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),gE=Oe(function(t,n){const r=qi("NumberInput",t),i=_n(t),o=Fk(i),{htmlProps:a,...s}=L3e(o),l=C.exports.useMemo(()=>s,[s]);return oe.createElement(O3e,{value:l},oe.createElement(A3e,{value:r},oe.createElement(_e.div,{...a,ref:n,className:CV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});gE.displayName="NumberInput";var _V=Oe(function(t,n){const r=dx();return oe.createElement(_e.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}})});_V.displayName="NumberInputStepper";var mE=Oe(function(t,n){const{getInputProps:r}=pE(),i=r(t,n),o=dx();return oe.createElement(_e.input,{...i,className:CV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});mE.displayName="NumberInputField";var kV=_e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),vE=Oe(function(t,n){var a;const r=dx(),{getDecrementButtonProps:i}=pE(),o=i(t,n);return y(kV,{...o,__css:r.stepper,children:(a=t.children)!=null?a:y(w3e,{})})});vE.displayName="NumberDecrementStepper";var yE=Oe(function(t,n){var a;const{getIncrementButtonProps:r}=pE(),i=r(t,n),o=dx();return y(kV,{...i,__css:o.stepper,children:(a=t.children)!=null?a:y(C3e,{})})});yE.displayName="NumberIncrementStepper";var _y=(...e)=>e.filter(Boolean).join(" ");function M3e(e,...t){return R3e(e)?e(...t):e}var R3e=e=>typeof e=="function";function Il(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function I3e(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[D3e,fp]=An({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[N3e,ky]=An({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),L0={click:"click",hover:"hover"};function B3e(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=L0.click,openDelay:f=200,closeDelay:p=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...x}=e,{isOpen:E,onClose:k,onOpen:_,onToggle:T}=PH(e),A=C.exports.useRef(null),R=C.exports.useRef(null),I=C.exports.useRef(null),D=C.exports.useRef(!1),B=C.exports.useRef(!1);E&&(B.current=!0);const[z,j]=C.exports.useState(!1),[Y,te]=C.exports.useState(!1),G=C.exports.useId(),$=i!=null?i:G,[V,J,Z,U]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${$}`),{referenceRef:X,getArrowProps:le,getPopperProps:fe,getArrowInnerProps:Se,forceUpdate:Ae}=EH({...x,enabled:E||!!b}),be=b2e({isOpen:E,ref:I});tme({enabled:E,ref:R}),Kme(I,{focusRef:R,visible:E,shouldFocus:o&&u===L0.click}),Zme(I,{focusRef:r,visible:E,shouldFocus:a&&u===L0.click});const ke=TH({wasSelected:B.current,enabled:m,mode:v,isSelected:be.present}),De=C.exports.useCallback((ut={},Rt=null)=>{const ot={...ut,style:{...ut.style,transformOrigin:ri.transformOrigin.varRef,[ri.arrowSize.var]:s?`${s}px`:void 0,[ri.arrowShadowColor.var]:l},ref:Gn(I,Rt),children:ke?ut.children:null,id:J,tabIndex:-1,role:"dialog",onKeyDown:Il(ut.onKeyDown,Ct=>{n&&Ct.key==="Escape"&&k()}),onBlur:Il(ut.onBlur,Ct=>{const ln=GM(Ct),ue=X6(I.current,ln),Ie=X6(R.current,ln);E&&t&&(!ue&&!Ie)&&k()}),"aria-labelledby":z?Z:void 0,"aria-describedby":Y?U:void 0};return u===L0.hover&&(ot.role="tooltip",ot.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0}),ot.onMouseLeave=Il(ut.onMouseLeave,Ct=>{Ct.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>k(),p))})),ot},[ke,J,z,Z,Y,U,u,n,k,E,t,p,l,s]),Je=C.exports.useCallback((ut={},Rt=null)=>fe({...ut,style:{visibility:E?"visible":"hidden",...ut.style}},Rt),[E,fe]),Ye=C.exports.useCallback((ut,Rt=null)=>({...ut,ref:Gn(Rt,A,X)}),[A,X]),mt=C.exports.useRef(),_t=C.exports.useRef(),dt=C.exports.useCallback(ut=>{A.current==null&&X(ut)},[X]),vt=C.exports.useCallback((ut={},Rt=null)=>{const ot={...ut,ref:Gn(R,Rt,dt),id:V,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":J};return u===L0.click&&(ot.onClick=Il(ut.onClick,T)),u===L0.hover&&(ot.onFocus=Il(ut.onFocus,()=>{mt.current===void 0&&_()}),ot.onBlur=Il(ut.onBlur,Ct=>{const ln=GM(Ct),ue=!X6(I.current,ln);E&&t&&ue&&k()}),ot.onKeyDown=Il(ut.onKeyDown,Ct=>{Ct.key==="Escape"&&k()}),ot.onMouseEnter=Il(ut.onMouseEnter,()=>{D.current=!0,mt.current=window.setTimeout(()=>_(),f)}),ot.onMouseLeave=Il(ut.onMouseLeave,()=>{D.current=!1,mt.current&&(clearTimeout(mt.current),mt.current=void 0),_t.current=window.setTimeout(()=>{D.current===!1&&k()},p)})),ot},[V,E,J,u,dt,T,_,t,k,f,p]);C.exports.useEffect(()=>()=>{mt.current&&clearTimeout(mt.current),_t.current&&clearTimeout(_t.current)},[]);const xt=C.exports.useCallback((ut={},Rt=null)=>({...ut,id:Z,ref:Gn(Rt,ot=>{j(!!ot)})}),[Z]),Le=C.exports.useCallback((ut={},Rt=null)=>({...ut,id:U,ref:Gn(Rt,ot=>{te(!!ot)})}),[U]);return{forceUpdate:Ae,isOpen:E,onAnimationComplete:be.onComplete,onClose:k,getAnchorProps:Ye,getArrowProps:le,getArrowInnerProps:Se,getPopoverPositionerProps:Je,getPopoverProps:De,getTriggerProps:vt,getHeaderProps:xt,getBodyProps:Le}}function X6(e,t){return e===t||(e==null?void 0:e.contains(t))}function GM(e){var n;const t=e.currentTarget.ownerDocument.activeElement;return(n=e.relatedTarget)!=null?n:t}function bE(e){const t=qi("Popover",e),{children:n,...r}=_n(e),i=h1(),o=B3e({...r,direction:i.direction});return y(D3e,{value:o,children:y(N3e,{value:t,children:M3e(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}bE.displayName="Popover";function SE(e){var l;const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=fp(),a=ky(),s=(l=t!=null?t:n)!=null?l:r;return oe.createElement(_e.div,{...i(),className:"chakra-popover__arrow-positioner"},oe.createElement(_e.div,{className:_y("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}SE.displayName="PopoverArrow";var $3e=Oe(function(t,n){const{getBodyProps:r}=fp(),i=ky();return oe.createElement(_e.div,{...r(t,n),className:_y("chakra-popover__body",t.className),__css:i.body})});$3e.displayName="PopoverBody";var F3e=Oe(function(t,n){const{onClose:r}=fp(),i=ky();return y(ax,{size:"sm",onClick:r,className:_y("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});F3e.displayName="PopoverCloseButton";function z3e(e){if(!!e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var j3e={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]}}},H3e=_e(gu.section),EV=Oe(function(t,n){const{variants:r=j3e,...i}=t,{isOpen:o}=fp();return oe.createElement(H3e,{ref:n,variants:z3e(r),initial:!1,animate:o?"enter":"exit",...i})});EV.displayName="PopoverTransition";var xE=Oe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=fp(),u=ky(),f={position:"relative",display:"flex",flexDirection:"column",...u.content};return oe.createElement(_e.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},y(EV,{...i,...a(o,n),onAnimationComplete:I3e(l,o.onAnimationComplete),className:_y("chakra-popover__content",t.className),__css:f}))});xE.displayName="PopoverContent";var V3e=Oe(function(t,n){const{getHeaderProps:r}=fp(),i=ky();return oe.createElement(_e.header,{...r(t,n),className:_y("chakra-popover__header",t.className),__css:i.header})});V3e.displayName="PopoverHeader";function wE(e){const t=C.exports.Children.only(e.children),{getTriggerProps:n}=fp();return C.exports.cloneElement(t,n(t.props,t.ref))}wE.displayName="PopoverTrigger";function U3e(e,t,n){return(e-t)*100/(n-t)}var W3e=uf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),G3e=uf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),q3e=uf({"0%":{left:"-40%"},"100%":{left:"100%"}}),Y3e=uf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function PV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=U3e(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,l):i})(),role:s},percent:l,value:t}}var TV=e=>{const{size:t,isIndeterminate:n,...r}=e;return oe.createElement(_e.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${G3e} 2s linear infinite`:void 0},...r})};TV.displayName="Shape";var B9=e=>oe.createElement(_e.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});B9.displayName="Circle";var K3e=Oe((e,t)=>{var A;const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:f="10px",color:p="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,x=PV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),E=v?void 0:((A=x.percent)!=null?A:0)*2.64,k=E==null?void 0:`${E} ${264-E}`,_=v?{css:{animation:`${W3e} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:k,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return oe.createElement(_e.div,{ref:t,className:"chakra-progress",...x.bind,...b,__css:T},K(TV,{size:n,isIndeterminate:v,children:[y(B9,{stroke:m,strokeWidth:f,className:"chakra-progress__track"}),y(B9,{stroke:p,strokeWidth:f,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:x.value===0&&!v?0:void 0,..._})]}),u)});K3e.displayName="CircularProgress";var[X3e,Z3e]=An({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Q3e=Oe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=PV({value:i,min:n,max:r,isIndeterminate:o,role:a}),f={height:"100%",...Z3e().filledTrack};return oe.createElement(_e.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:f})}),LV=Oe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:f,"aria-label":p,"aria-labelledby":m,title:v,role:b,...x}=_n(e),E=qi("Progress",e),k=u!=null?u:(n=E.track)==null?void 0:n.borderRadius,_={animation:`${Y3e} 1s linear infinite`},R={...!f&&a&&s&&_,...f&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${q3e} 1s ease infinite normal none running`}},I={overflow:"hidden",position:"relative",...E.track};return oe.createElement(_e.div,{ref:t,borderRadius:k,__css:I,...x},K(X3e,{value:E,children:[y(Q3e,{"aria-label":p,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:f,css:R,borderRadius:k,title:v,role:b}),l]}))});LV.displayName="Progress";var J3e=_e("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});J3e.displayName="CircularProgressLabel";var ebe=(...e)=>e.filter(Boolean).join(" "),tbe=e=>e?"":void 0;function nbe(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 AV=Oe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return oe.createElement(_e.select,{...a,ref:n,className:ebe("chakra-select",o)},i&&y("option",{value:"",children:i}),r)});AV.displayName="SelectField";var OV=Oe((e,t)=>{var n;const r=qi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:f,minHeight:p,iconColor:m,iconSize:v,...b}=_n(e),[x,E]=nbe(b,kre),k=$k(E),_={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 oe.createElement(_e.div,{className:"chakra-select__wrapper",__css:_,...x,...i},y(AV,{ref:t,height:u!=null?u:l,minH:f!=null?f:p,placeholder:o,...k,__css:T,children:e.children}),y(MV,{"data-disabled":tbe(k.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v},children:a}))});OV.displayName="Select";var rbe=e=>y("svg",{viewBox:"0 0 24 24",...e,children:y("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),ibe=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),MV=e=>{const{children:t=y(rbe,{}),...n}=e,r=C.exports.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return y(ibe,{...n,className:"chakra-select__icon-wrapper",children:C.exports.isValidElement(t)?r:null})};MV.displayName="SelectIcon";function obe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function abe(e){const t=lbe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function RV(e){return!!e.touches}function sbe(e){return RV(e)&&e.touches.length>1}function lbe(e){var t;return(t=e.view)!=null?t:window}function ube(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function cbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function IV(e,t="page"){return RV(e)?ube(e,t):cbe(e,t)}function dbe(e){return t=>{const n=abe(t);(!n||n&&t.button===0)&&e(t)}}function fbe(e,t=!1){function n(i){e(i,{point:IV(i)})}return t?dbe(n):n}function v4(e,t,n,r){return obe(e,t,fbe(n,t==="pointerdown"),r)}function DV(e){const t=C.exports.useRef(null);return t.current=e,t}var hbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=Z6(this.lastEventInfo,this.history),t=this.startEvent!==null,n=vbe(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=CA();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,Bie.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=Z6(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});var a;if(this.win=(a=e.view)!=null?a:window,sbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:IV(e)},{timestamp:i}=CA();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,Z6(r,this.history)),this.removeListeners=mbe(v4(this.win,"pointermove",this.onPointerMove),v4(this.win,"pointerup",this.onPointerUp),v4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),$ie.update(this.updatePoint)}};function qM(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Z6(e,t){return{point:e.point,delta:qM(e.point,t[t.length-1]),offset:qM(e.point,t[0]),velocity:gbe(t,.1)}}var pbe=e=>e*1e3;function gbe(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>pbe(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 mbe(...e){return t=>e.reduce((n,r)=>r(n),t)}function Q6(e,t){return Math.abs(e-t)}function YM(e){return"x"in e&&"y"in e}function vbe(e,t){if(typeof e=="number"&&typeof t=="number")return Q6(e,t);if(YM(e)&&YM(t)){const n=Q6(e.x,t.x),r=Q6(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function NV(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=C.exports.useRef(null),f=DV({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(p,m){u.current=null,i==null||i(p,m)}});C.exports.useEffect(()=>{var p;(p=u.current)==null||p.updateHandlers(f.current)}),C.exports.useEffect(()=>{const p=e.current;if(!p||!l)return;function m(v){u.current=new hbe(v,f.current,s)}return v4(p,"pointerdown",m)},[e,l,f,s]),C.exports.useEffect(()=>()=>{var p;(p=u.current)==null||p.end(),u.current=null},[])}function ybe(e,t){var i;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=(i=e.ownerDocument.defaultView)!=null?i:window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,l=f.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var bbe=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:C.exports.useEffect;function Sbe(e,t){var o;var n;if(!e||!e.parentElement)return;const r=(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function BV({getNodes:e,observeMutation:t=!0}){const[n,r]=C.exports.useState([]),[i,o]=C.exports.useState(0);return bbe(()=>{const a=e(),s=a.map((l,u)=>ybe(l,f=>{r(p=>[...p.slice(0,u),f,...p.slice(u+1)])}));if(t){const l=a[0];s.push(Sbe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function xbe(e){return typeof e=="object"&&e!==null&&"current"in e}function wbe(e){const[t]=BV({observeMutation:!1,getNodes(){return[xbe(e)?e.current:e]}});return t}var Cbe=Object.getOwnPropertyNames,_be=(e,t)=>function(){return e&&(t=(0,e[Cbe(e)[0]])(e=0)),t},ff=_be({"../../../react-shim.js"(){}});ff();ff();ff();var es=e=>e?"":void 0,Mg=e=>e?!0:void 0,hf=(...e)=>e.filter(Boolean).join(" ");ff();function Rg(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}ff();ff();function kbe(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 xv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var y4={width:0,height:0},pb=e=>e||y4;function $V(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=x=>{var k;const E=(k=r[x])!=null?k:y4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...xv({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${E.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${E.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,E)=>pb(x).height>pb(E).height?x:E,y4):r.reduce((x,E)=>pb(x).width>pb(E).width?x:E,y4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...xv({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",...xv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,f=[0,i?100-n[0]:n[0]],p=u?f:n;let m=p[0];!u&&i&&(m=100-m);const v=Math.abs(p[p.length-1]-p[0]),b={...l,...xv({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function FV(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Ebe(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:f,isReadOnly:p,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:x,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:R=0,...I}=e,D=br(m),B=br(v),z=br(x),j=FV({isReversed:a,direction:s,orientation:l}),[Y,te]=HS({value:i,defaultValue:o!=null?o:[25,75],onChange:r});if(!Array.isArray(Y))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof Y}\``);const[G,$]=C.exports.useState(!1),[V,J]=C.exports.useState(!1),[Z,U]=C.exports.useState(-1),X=!(f||p),le=C.exports.useRef(Y),fe=Y.map(ze=>Lg(ze,t,n)),Se=R*b,Ae=Pbe(fe,t,n,Se),be=C.exports.useRef({eventSource:null,value:[],valueBounds:[]});be.current.value=fe,be.current.valueBounds=Ae;const ke=fe.map(ze=>n-ze+t),Je=(j?ke:fe).map(ze=>_5(ze,t,n)),Ye=l==="vertical",mt=C.exports.useRef(null),_t=C.exports.useRef(null),dt=BV({getNodes(){const ze=_t.current,St=ze==null?void 0:ze.querySelectorAll("[role=slider]");return St?Array.from(St):[]}}),vt=C.exports.useId(),xt=u!=null?u:vt,Le=kbe(xt),ut=C.exports.useCallback(ze=>{var ia;var St;if(!mt.current)return;be.current.eventSource="pointer";const ct=mt.current.getBoundingClientRect(),{clientX:Vt,clientY:hn}=(ia=(St=ze.touches)==null?void 0:St[0])!=null?ia:ze,Er=Ye?ct.bottom-hn:Vt-ct.left,dr=Ye?ct.height:ct.width;let Kr=Er/dr;return j&&(Kr=1-Kr),Uj(Kr,t,n)},[Ye,j,n,t]),Rt=(n-t)/10,ot=b||(n-t)/100,Ct=C.exports.useMemo(()=>({setValueAtIndex(ze,St){if(!X)return;const ct=be.current.valueBounds[ze];St=parseFloat(E9(St,ct.min,ot)),St=Lg(St,ct.min,ct.max);const Vt=[...be.current.value];Vt[ze]=St,te(Vt)},setActiveIndex:U,stepUp(ze,St=ot){const ct=be.current.value[ze],Vt=j?ct-St:ct+St;Ct.setValueAtIndex(ze,Vt)},stepDown(ze,St=ot){const ct=be.current.value[ze],Vt=j?ct+St:ct-St;Ct.setValueAtIndex(ze,Vt)},reset(){te(le.current)}}),[ot,j,te,X]),ln=C.exports.useCallback(ze=>{const St=ze.key,Vt={ArrowRight:()=>Ct.stepUp(Z),ArrowUp:()=>Ct.stepUp(Z),ArrowLeft:()=>Ct.stepDown(Z),ArrowDown:()=>Ct.stepDown(Z),PageUp:()=>Ct.stepUp(Z,Rt),PageDown:()=>Ct.stepDown(Z,Rt),Home:()=>{const{min:hn}=Ae[Z];Ct.setValueAtIndex(Z,hn)},End:()=>{const{max:hn}=Ae[Z];Ct.setValueAtIndex(Z,hn)}}[St];Vt&&(ze.preventDefault(),ze.stopPropagation(),Vt(ze),be.current.eventSource="keyboard")},[Ct,Z,Rt,Ae]),{getThumbStyle:ue,rootStyle:Ie,trackStyle:We,innerTrackStyle:Xe}=C.exports.useMemo(()=>$V({isReversed:j,orientation:l,thumbRects:dt,thumbPercents:Je}),[j,l,Je,dt]),Ce=C.exports.useCallback(ze=>{var St;const ct=ze!=null?ze:Z;if(ct!==-1&&A){const Vt=Le.getThumb(ct),hn=(St=_t.current)==null?void 0:St.ownerDocument.getElementById(Vt);hn&&setTimeout(()=>hn.focus())}},[A,Z,Le]);Kd(()=>{be.current.eventSource==="keyboard"&&(B==null||B(be.current.value))},[fe,B]);const Ne=ze=>{const St=ut(ze)||0,ct=be.current.value.map(Kr=>Math.abs(Kr-St)),Vt=Math.min(...ct);let hn=ct.indexOf(Vt);const Er=ct.filter(Kr=>Kr===Vt);Er.length>1&&St>be.current.value[hn]&&(hn=hn+Er.length-1),U(hn),Ct.setValueAtIndex(hn,St),Ce(hn)},kt=ze=>{if(Z==-1)return;const St=ut(ze)||0;U(Z),Ct.setValueAtIndex(Z,St),Ce(Z)};NV(_t,{onPanSessionStart(ze){!X||($(!0),Ne(ze),D==null||D(be.current.value))},onPanSessionEnd(){!X||($(!1),B==null||B(be.current.value))},onPan(ze){!X||kt(ze)}});const Nt=C.exports.useCallback((ze={},St=null)=>({...ze,...I,id:Le.root,ref:Gn(St,_t),tabIndex:-1,"aria-disabled":Mg(f),"data-focused":es(V),style:{...ze.style,...Ie}}),[I,f,V,Ie,Le]),Te=C.exports.useCallback((ze={},St=null)=>({...ze,ref:Gn(St,mt),id:Le.track,"data-disabled":es(f),style:{...ze.style,...We}}),[f,We,Le]),Et=C.exports.useCallback((ze={},St=null)=>({...ze,ref:St,id:Le.innerTrack,style:{...ze.style,...Xe}}),[Xe,Le]),Ut=C.exports.useCallback((ze,St=null)=>{var dr;const{index:ct,...Vt}=ze,hn=fe[ct];if(hn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ct}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const Er=Ae[ct];return{...Vt,ref:St,role:"slider",tabIndex:X?0:void 0,id:Le.getThumb(ct),"data-active":es(G&&Z===ct),"aria-valuetext":(dr=z==null?void 0:z(hn))!=null?dr:E==null?void 0:E[ct],"aria-valuemin":Er.min,"aria-valuemax":Er.max,"aria-valuenow":hn,"aria-orientation":l,"aria-disabled":Mg(f),"aria-readonly":Mg(p),"aria-label":k==null?void 0:k[ct],"aria-labelledby":k!=null&&k[ct]||_==null?void 0:_[ct],style:{...ze.style,...ue(ct)},onKeyDown:Rg(ze.onKeyDown,ln),onFocus:Rg(ze.onFocus,()=>{J(!0),U(ct)}),onBlur:Rg(ze.onBlur,()=>{J(!1),U(-1)})}},[Le,fe,Ae,X,G,Z,z,E,l,f,p,k,_,ue,ln,J]),Ve=C.exports.useCallback((ze={},St=null)=>({...ze,ref:St,id:Le.output,htmlFor:fe.map((ct,Vt)=>Le.getThumb(Vt)).join(" "),"aria-live":"off"}),[Le,fe]),ft=C.exports.useCallback((ze,St=null)=>{const{value:ct,...Vt}=ze,hn=!(ctn),Er=ct>=fe[0]&&ct<=fe[fe.length-1];let dr=_5(ct,t,n);dr=j?100-dr:dr;const Kr={position:"absolute",pointerEvents:"none",...xv({orientation:l,vertical:{bottom:`${dr}%`},horizontal:{left:`${dr}%`}})};return{...Vt,ref:St,id:Le.getMarker(ze.value),role:"presentation","aria-hidden":!0,"data-disabled":es(f),"data-invalid":es(!hn),"data-highlighted":es(Er),style:{...ze.style,...Kr}}},[f,j,n,t,l,fe,Le]),un=C.exports.useCallback((ze,St=null)=>{const{index:ct,...Vt}=ze;return{...Vt,ref:St,id:Le.getInput(ct),type:"hidden",value:fe[ct],name:Array.isArray(T)?T[ct]:`${T}-${ct}`}},[T,fe,Le]);return{state:{value:fe,isFocused:V,isDragging:G,getThumbPercent:ze=>Je[ze],getThumbMinValue:ze=>Ae[ze].min,getThumbMaxValue:ze=>Ae[ze].max},actions:Ct,getRootProps:Nt,getTrackProps:Te,getInnerTrackProps:Et,getThumbProps:Ut,getMarkerProps:ft,getInputProps:un,getOutputProps:Ve}}function Pbe(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[Tbe,fx]=An({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[Lbe,CE]=An({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),zV=Oe(function(t,n){const r=qi("Slider",t),i=_n(t),{direction:o}=h1();i.direction=o;const{getRootProps:a,...s}=Ebe(i),l=C.exports.useMemo(()=>({...s,name:t.name}),[s,t.name]);return oe.createElement(Tbe,{value:l},oe.createElement(Lbe,{value:r},oe.createElement(_e.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});zV.defaultProps={orientation:"horizontal"};zV.displayName="RangeSlider";var Abe=Oe(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=fx(),a=CE(),s=r(t,n);return oe.createElement(_e.div,{...s,className:hf("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&y("input",{...i({index:t.index})}))});Abe.displayName="RangeSliderThumb";var Obe=Oe(function(t,n){const{getTrackProps:r}=fx(),i=CE(),o=r(t,n);return oe.createElement(_e.div,{...o,className:hf("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});Obe.displayName="RangeSliderTrack";var Mbe=Oe(function(t,n){const{getInnerTrackProps:r}=fx(),i=CE(),o=r(t,n);return oe.createElement(_e.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});Mbe.displayName="RangeSliderFilledTrack";var Rbe=Oe(function(t,n){const{getMarkerProps:r}=fx(),i=r(t,n);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__marker",t.className)})});Rbe.displayName="RangeSliderMark";ff();ff();function Ibe(e){var Ut;const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:f,isReadOnly:p,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:x,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,...R}=e,I=br(m),D=br(v),B=br(x),z=FV({isReversed:a,direction:s,orientation:l}),[j,Y]=HS({value:i,defaultValue:o!=null?o:Nbe(t,n),onChange:r}),[te,G]=C.exports.useState(!1),[$,V]=C.exports.useState(!1),J=!(f||p),Z=(n-t)/10,U=b||(n-t)/100,X=Lg(j,t,n),le=n-X+t,Se=_5(z?le:X,t,n),Ae=l==="vertical",be=DV({min:t,max:n,step:b,isDisabled:f,value:X,isInteractive:J,isReversed:z,isVertical:Ae,eventSource:null,focusThumbOnChange:A,orientation:l}),ke=C.exports.useRef(null),De=C.exports.useRef(null),Je=C.exports.useRef(null),Ye=C.exports.useId(),mt=u!=null?u:Ye,[_t,dt]=[`slider-thumb-${mt}`,`slider-track-${mt}`],vt=C.exports.useCallback(Ve=>{var Kr;var ft;if(!ke.current)return;const un=be.current;un.eventSource="pointer";const ze=ke.current.getBoundingClientRect(),{clientX:St,clientY:ct}=(Kr=(ft=Ve.touches)==null?void 0:ft[0])!=null?Kr:Ve,Vt=Ae?ze.bottom-ct:St-ze.left,hn=Ae?ze.height:ze.width;let Er=Vt/hn;z&&(Er=1-Er);let dr=Uj(Er,un.min,un.max);return un.step&&(dr=parseFloat(E9(dr,un.min,un.step))),dr=Lg(dr,un.min,un.max),dr},[Ae,z,be]),xt=C.exports.useCallback(Ve=>{const ft=be.current;!ft.isInteractive||(Ve=parseFloat(E9(Ve,ft.min,U)),Ve=Lg(Ve,ft.min,ft.max),Y(Ve))},[U,Y,be]),Le=C.exports.useMemo(()=>({stepUp(Ve=U){const ft=z?X-Ve:X+Ve;xt(ft)},stepDown(Ve=U){const ft=z?X+Ve:X-Ve;xt(ft)},reset(){xt(o||0)},stepTo(Ve){xt(Ve)}}),[xt,z,X,U,o]),ut=C.exports.useCallback(Ve=>{const ft=be.current,ze={ArrowRight:()=>Le.stepUp(),ArrowUp:()=>Le.stepUp(),ArrowLeft:()=>Le.stepDown(),ArrowDown:()=>Le.stepDown(),PageUp:()=>Le.stepUp(Z),PageDown:()=>Le.stepDown(Z),Home:()=>xt(ft.min),End:()=>xt(ft.max)}[Ve.key];ze&&(Ve.preventDefault(),Ve.stopPropagation(),ze(Ve),ft.eventSource="keyboard")},[Le,xt,Z,be]),Rt=(Ut=B==null?void 0:B(X))!=null?Ut:E,ot=wbe(De),{getThumbStyle:Ct,rootStyle:ln,trackStyle:ue,innerTrackStyle:Ie}=C.exports.useMemo(()=>{const Ve=be.current,ft=ot!=null?ot:{width:0,height:0};return $V({isReversed:z,orientation:Ve.orientation,thumbRects:[ft],thumbPercents:[Se]})},[z,ot,Se,be]),We=C.exports.useCallback(()=>{be.current.focusThumbOnChange&&setTimeout(()=>{var ft;return(ft=De.current)==null?void 0:ft.focus()})},[be]);Kd(()=>{const Ve=be.current;We(),Ve.eventSource==="keyboard"&&(D==null||D(Ve.value))},[X,D]);function Xe(Ve){const ft=vt(Ve);ft!=null&&ft!==be.current.value&&Y(ft)}NV(Je,{onPanSessionStart(Ve){const ft=be.current;!ft.isInteractive||(G(!0),We(),Xe(Ve),I==null||I(ft.value))},onPanSessionEnd(){const Ve=be.current;!Ve.isInteractive||(G(!1),D==null||D(Ve.value))},onPan(Ve){!be.current.isInteractive||Xe(Ve)}});const Ce=C.exports.useCallback((Ve={},ft=null)=>({...Ve,...R,ref:Gn(ft,Je),tabIndex:-1,"aria-disabled":Mg(f),"data-focused":es($),style:{...Ve.style,...ln}}),[R,f,$,ln]),Ne=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:Gn(ft,ke),id:dt,"data-disabled":es(f),style:{...Ve.style,...ue}}),[f,dt,ue]),kt=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:ft,style:{...Ve.style,...Ie}}),[Ie]),Nt=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:Gn(ft,De),role:"slider",tabIndex:J?0:void 0,id:_t,"data-active":es(te),"aria-valuetext":Rt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":X,"aria-orientation":l,"aria-disabled":Mg(f),"aria-readonly":Mg(p),"aria-label":k,"aria-labelledby":k?void 0:_,style:{...Ve.style,...Ct(0)},onKeyDown:Rg(Ve.onKeyDown,ut),onFocus:Rg(Ve.onFocus,()=>V(!0)),onBlur:Rg(Ve.onBlur,()=>V(!1))}),[J,_t,te,Rt,t,n,X,l,f,p,k,_,Ct,ut]),Te=C.exports.useCallback((Ve,ft=null)=>{const un=!(Ve.valuen),ze=X>=Ve.value,St=_5(Ve.value,t,n),ct={position:"absolute",pointerEvents:"none",...Dbe({orientation:l,vertical:{bottom:z?`${100-St}%`:`${St}%`},horizontal:{left:z?`${100-St}%`:`${St}%`}})};return{...Ve,ref:ft,role:"presentation","aria-hidden":!0,"data-disabled":es(f),"data-invalid":es(!un),"data-highlighted":es(ze),style:{...Ve.style,...ct}}},[f,z,n,t,l,X]),Et=C.exports.useCallback((Ve={},ft=null)=>({...Ve,ref:ft,type:"hidden",value:X,name:T}),[T,X]);return{state:{value:X,isFocused:$,isDragging:te},actions:Le,getRootProps:Ce,getTrackProps:Ne,getInnerTrackProps:kt,getThumbProps:Nt,getMarkerProps:Te,getInputProps:Et}}function Dbe(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function Nbe(e,t){return t"}),[$be,px]=An({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),_E=Oe((e,t)=>{const n=qi("Slider",e),r=_n(e),{direction:i}=h1();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=Ibe(r),l=a(),u=o({},t);return oe.createElement(Bbe,{value:s},oe.createElement($be,{value:n},oe.createElement(_e.div,{...l,className:hf("chakra-slider",e.className),__css:n.container},e.children,y("input",{...u}))))});_E.defaultProps={orientation:"horizontal"};_E.displayName="Slider";var jV=Oe((e,t)=>{const{getThumbProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__thumb",e.className),__css:r.thumb})});jV.displayName="SliderThumb";var HV=Oe((e,t)=>{const{getTrackProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__track",e.className),__css:r.track})});HV.displayName="SliderTrack";var VV=Oe((e,t)=>{const{getInnerTrackProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__filled-track",e.className),__css:r.filledTrack})});VV.displayName="SliderFilledTrack";var $9=Oe((e,t)=>{const{getMarkerProps:n}=hx(),r=px(),i=n(e,t);return oe.createElement(_e.div,{...i,className:hf("chakra-slider__marker",e.className),__css:r.mark})});$9.displayName="SliderMark";var Fbe=(...e)=>e.filter(Boolean).join(" "),KM=e=>e?"":void 0,kE=Oe(function(t,n){const r=qi("Switch",t),{spacing:i="0.5rem",children:o,...a}=_n(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:f,getLabelProps:p}=Hj(a),m=C.exports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=C.exports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=C.exports.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return oe.createElement(_e.label,{...f(),className:Fbe("chakra-switch",t.className),__css:m},y("input",{className:"chakra-switch__input",...l({},n)}),oe.createElement(_e.span,{...u(),className:"chakra-switch__track",__css:v},oe.createElement(_e.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":KM(s.isChecked),"data-hover":KM(s.isHovered)})),o&&oe.createElement(_e.span,{className:"chakra-switch__label",...p(),__css:b},o))});kE.displayName="Switch";var x1=(...e)=>e.filter(Boolean).join(" ");function F9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[zbe,UV,jbe,Hbe]=nz();function Vbe(e){var _;const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[f,p]=C.exports.useState(t!=null?t:0),[m,v]=HS({defaultValue:t!=null?t:0,value:r,onChange:n});C.exports.useEffect(()=>{r!=null&&p(r)},[r]);const b=jbe(),x=C.exports.useId();return{id:`tabs-${(_=e.id)!=null?_:x}`,selectedIndex:m,focusedIndex:f,setSelectedIndex:v,setFocusedIndex:p,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[Ube,Ey]=An({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function Wbe(e){const{focusedIndex:t,orientation:n,direction:r}=Ey(),i=UV(),o=C.exports.useCallback(a=>{const s=()=>{var _;const T=i.nextEnabled(t);T&&((_=T.node)==null||_.focus())},l=()=>{var _;const T=i.prevEnabled(t);T&&((_=T.node)==null||_.focus())},u=()=>{var _;const T=i.firstEnabled();T&&((_=T.node)==null||_.focus())},f=()=>{var _;const T=i.lastEnabled();T&&((_=T.node)==null||_.focus())},p=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",k={[b]:()=>p&&l(),[x]:()=>p&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:f}[v];k&&(a.preventDefault(),k(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:F9(e.onKeyDown,o)}}function Gbe(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=Ey(),{index:u,register:f}=Hbe({disabled:t&&!n}),p=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=$me({...r,ref:Gn(f,e.ref),isDisabled:t,isFocusable:n,onClick:F9(e.onClick,m)}),x="button";return{...b,id:WV(a,u),role:"tab",tabIndex:p?0:-1,type:x,"aria-selected":p,"aria-controls":GV(a,u),onFocus:t?void 0:F9(e.onFocus,v)}}var[qbe,Ybe]=An({});function Kbe(e){const t=Ey(),{id:n,selectedIndex:r}=t,o=rx(e.children).map((a,s)=>C.exports.createElement(qbe,{key:s,value:{isSelected:s===r,id:GV(n,s),tabId:WV(n,s),selectedIndex:r}},a));return{...e,children:o}}function Xbe(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Ey(),{isSelected:o,id:a,tabId:s}=Ybe(),l=C.exports.useRef(!1);o&&(l.current=!0);const u=TH({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function Zbe(){const e=Ey(),t=UV(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=C.exports.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=C.exports.useState(!1);return Ys(()=>{if(n==null)return;const f=t.item(n);if(f==null)return;i&&s({left:f.node.offsetLeft,width:f.node.offsetWidth}),o&&s({top:f.node.offsetTop,height:f.node.offsetHeight});const p=requestAnimationFrame(()=>{u(!0)});return()=>{p&&cancelAnimationFrame(p)}},[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 WV(e,t){return`${e}--tab-${t}`}function GV(e,t){return`${e}--tabpanel-${t}`}var[Qbe,Py]=An({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),qV=Oe(function(t,n){const r=qi("Tabs",t),{children:i,className:o,...a}=_n(t),{htmlProps:s,descendants:l,...u}=Vbe(a),f=C.exports.useMemo(()=>u,[u]),{isFitted:p,...m}=s;return oe.createElement(zbe,{value:l},oe.createElement(Ube,{value:f},oe.createElement(Qbe,{value:r},oe.createElement(_e.div,{className:x1("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});qV.displayName="Tabs";var Jbe=Oe(function(t,n){const r=Zbe(),i={...t.style,...r},o=Py();return oe.createElement(_e.div,{ref:n,...t,className:x1("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});Jbe.displayName="TabIndicator";var e4e=Oe(function(t,n){const r=Wbe({...t,ref:n}),o={display:"flex",...Py().tablist};return oe.createElement(_e.div,{...r,className:x1("chakra-tabs__tablist",t.className),__css:o})});e4e.displayName="TabList";var YV=Oe(function(t,n){const r=Xbe({...t,ref:n}),i=Py();return oe.createElement(_e.div,{outline:"0",...r,className:x1("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});YV.displayName="TabPanel";var KV=Oe(function(t,n){const r=Kbe(t),i=Py();return oe.createElement(_e.div,{...r,width:"100%",ref:n,className:x1("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});KV.displayName="TabPanels";var XV=Oe(function(t,n){const r=Py(),i=Gbe({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return oe.createElement(_e.button,{...i,className:x1("chakra-tabs__tab",t.className),__css:o})});XV.displayName="Tab";var t4e=(...e)=>e.filter(Boolean).join(" ");function n4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var r4e=["h","minH","height","minHeight"],ZV=Oe((e,t)=>{const n=Lo("Textarea",e),{className:r,rows:i,...o}=_n(e),a=$k(o),s=i?n4e(n,r4e):n;return oe.createElement(_e.textarea,{ref:t,rows:i,...a,className:t4e("chakra-textarea",r),__css:s})});ZV.displayName="Textarea";function i4e(e,t){const n=br(e);C.exports.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function z9(e,...t){return o4e(e)?e(...t):e}var o4e=e=>typeof e=="function";function a4e(e,t){var o;const n=e!=null?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(o=i==null?void 0:i[t])!=null?o:n}var s4e=(e,t)=>e.find(n=>n.id===t);function XM(e,t){const n=QV(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function QV(e,t){for(const[n,r]of Object.entries(e))if(s4e(r,t))return n}function l4e(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 u4e(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 c4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Wl=d4e(c4e);function d4e(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=f4e(i,o),{position:s,id:l}=a;return r(u=>{var m,v;const p=s.includes("top")?[a,...(m=u[s])!=null?m:[]]:[...(v=u[s])!=null?v:[],a];return{...u,[s]:p}}),l},update:(i,o)=>{!i||r(a=>{const s={...a},{position:l,index:u}=XM(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:JV(o)}),s})},closeAll:({positions:i}={})=>{r(o=>{const a=["bottom","bottom-right","bottom-left","top","top-left","top-right"];return(i!=null?i:a).reduce((l,u)=>(l[u]=o[u].map(f=>({...f,requestClose:!0})),l),{...o})})},close:i=>{r(o=>{const a=QV(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(XM(Wl.getState(),i).position)}}var ZM=0;function f4e(e,t={}){var i,o;ZM+=1;const n=(i=t.id)!=null?i:ZM,r=(o=t.position)!=null?o:"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 h4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return oe.createElement(Nj,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},y($j,{children:l}),oe.createElement(_e.div,{flex:"1",maxWidth:"100%"},i&&y(Fj,{id:u==null?void 0:u.title,children:i}),s&&y(Bj,{id:u==null?void 0:u.description,display:"block",children:s})),o&&y(ax,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function JV(e={}){const{render:t,toastComponent:n=h4e}=e;return i=>typeof t=="function"?t({...i,...e}):y(n,{...i,...e})}function p4e(e,t){const n=i=>{var o;return{...t,...i,position:a4e((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=JV(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,...z9(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...z9(o.error,s)}))},r.closeAll=Wl.closeAll,r.close=Wl.close,r.isActive=Wl.isActive,r}function Ty(e){const{theme:t}=JF();return C.exports.useMemo(()=>p4e(t.direction,e),[e,t.direction])}var g4e={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]}}},eU=C.exports.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=g4e,toastSpacing:f="0.5rem"}=e,[p,m]=C.exports.useState(s),v=mpe();Kd(()=>{v||r==null||r()},[v]),Kd(()=>{m(s)},[s]);const b=()=>m(null),x=()=>m(s),E=()=>{v&&i()};C.exports.useEffect(()=>{v&&o&&i()},[v,o,i]),i4e(E,p);const k=C.exports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:f,...l}),[l,f]),_=C.exports.useMemo(()=>l4e(a),[a]);return oe.createElement(gu.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:x,custom:{position:a},style:_},oe.createElement(_e.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:k},z9(n,{id:t,onClose:E})))});eU.displayName="ToastComponent";var m4e=e=>{const t=C.exports.useSyncExternalStore(Wl.subscribe,Wl.getState,Wl.getState),{children:n,motionVariants:r,component:i=eU,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return y("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${l}`,style:u4e(l),children:y(cf,{initial:!1,children:u.map(f=>y(i,{motionVariants:r,...f},f.id))})},l)});return K(fn,{children:[n,y(up,{...o,children:s})]})};function v4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function y4e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var b4e={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 Jm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var T5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},j9=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function S4e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:f,id:p,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:x,arrowPadding:E,modifiers:k,isDisabled:_,gutter:T,offset:A,direction:R,...I}=e,{isOpen:D,onOpen:B,onClose:z}=PH({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:j,getPopperProps:Y,getArrowInnerProps:te,getArrowProps:G}=EH({enabled:D,placement:f,arrowPadding:E,modifiers:k,gutter:T,offset:A,direction:R}),$=C.exports.useId(),J=`tooltip-${p!=null?p:$}`,Z=C.exports.useRef(null),U=C.exports.useRef(),X=C.exports.useCallback(()=>{U.current&&(clearTimeout(U.current),U.current=void 0)},[]),le=C.exports.useRef(),fe=C.exports.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=void 0)},[]),Se=C.exports.useCallback(()=>{fe(),z()},[z,fe]),Ae=x4e(Z,Se),be=C.exports.useCallback(()=>{if(!_&&!U.current){Ae();const vt=j9(Z);U.current=vt.setTimeout(B,t)}},[Ae,_,B,t]),ke=C.exports.useCallback(()=>{X();const vt=j9(Z);le.current=vt.setTimeout(Se,n)},[n,Se,X]),De=C.exports.useCallback(()=>{D&&r&&ke()},[r,ke,D]),Je=C.exports.useCallback(()=>{D&&a&&ke()},[a,ke,D]),Ye=C.exports.useCallback(vt=>{D&&vt.key==="Escape"&&ke()},[D,ke]);jh(()=>T5(Z),"keydown",s?Ye:void 0),jh(()=>T5(Z),"scroll",()=>{D&&o&&Se()}),C.exports.useEffect(()=>{!_||(X(),D&&z())},[_,D,z,X]),C.exports.useEffect(()=>()=>{X(),fe()},[X,fe]),jh(()=>Z.current,"pointerleave",ke);const mt=C.exports.useCallback((vt={},xt=null)=>({...vt,ref:Gn(Z,xt,j),onPointerEnter:Jm(vt.onPointerEnter,ut=>{ut.pointerType!=="touch"&&be()}),onClick:Jm(vt.onClick,De),onPointerDown:Jm(vt.onPointerDown,Je),onFocus:Jm(vt.onFocus,be),onBlur:Jm(vt.onBlur,ke),"aria-describedby":D?J:void 0}),[be,ke,Je,D,J,De,j]),_t=C.exports.useCallback((vt={},xt=null)=>Y({...vt,style:{...vt.style,[ri.arrowSize.var]:b?`${b}px`:void 0,[ri.arrowShadowColor.var]:x}},xt),[Y,b,x]),dt=C.exports.useCallback((vt={},xt=null)=>{const Le={...vt.style,position:"relative",transformOrigin:ri.transformOrigin.varRef};return{ref:xt,...I,...vt,id:J,role:"tooltip",style:Le}},[I,J]);return{isOpen:D,show:be,hide:ke,getTriggerProps:mt,getTooltipProps:dt,getTooltipPositionerProps:_t,getArrowProps:G,getArrowInnerProps:te}}var J6="chakra-ui:close-tooltip";function x4e(e,t){return C.exports.useEffect(()=>{const n=T5(e);return n.addEventListener(J6,t),()=>n.removeEventListener(J6,t)},[t,e]),()=>{const n=T5(e),r=j9(e);n.dispatchEvent(new r.CustomEvent(J6))}}var w4e=_e(gu.div),so=Oe((e,t)=>{var z,j;const n=Lo("Tooltip",e),r=_n(e),i=h1(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:f,portalProps:p,background:m,backgroundColor:v,bgColor:b,motionProps:x,...E}=r,k=(j=(z=m!=null?m:v)!=null?z:f)!=null?j:b;if(k){n.bg=k;const Y=Fre(i,"colors",k);n[ri.arrowBg.var]=Y}const _=S4e({...E,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=oe.createElement(_e.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const Y=C.exports.Children.only(o);A=C.exports.cloneElement(Y,_.getTriggerProps(Y.props,Y.ref))}const R=!!l,I=_.getTooltipProps({},t),D=R?v4e(I,["role","id"]):I,B=y4e(I,["role","id"]);return a?K(fn,{children:[A,y(cf,{children:_.isOpen&&oe.createElement(up,{...p},oe.createElement(_e.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},K(w4e,{variants:b4e,initial:"exit",animate:"enter",exit:"exit",...x,...D,__css:n,children:[a,R&&oe.createElement(_e.span,{srOnly:!0,...B},l),u&&oe.createElement(_e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},oe.createElement(_e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))]})))})]}):y(fn,{children:o})});so.displayName="Tooltip";var C4e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=y(uH,{environment:a,children:t});return y(Lde,{theme:o,cssVarsRoot:s,children:K(nF,{colorModeManager:n,options:o.config,children:[i?y(Y1e,{}):y(q1e,{}),y(Ode,{}),r?y(LH,{zIndex:r,children:l}):l]})})};function _4e({children:e,theme:t=Sde,toastOptions:n,...r}){return K(C4e,{theme:t,...r,children:[e,y(m4e,{...n})]})}function Us(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:EE(e)?2:PE(e)?3:0}function Ig(e,t){return w1(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k4e(e,t){return w1(e)===2?e.get(t):e[t]}function tU(e,t,n){var r=w1(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function nU(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function EE(e){return O4e&&e instanceof Map}function PE(e){return M4e&&e instanceof Set}function yh(e){return e.o||e.t}function TE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=iU(e);delete t[ur];for(var n=Dg(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=E4e),Object.freeze(e),t&&tp(e,function(n,r){return LE(r,!0)},!0)),e}function E4e(){Us(2)}function AE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ru(e){var t=W9[e];return t||Us(18,e),t}function P4e(e,t){W9[e]||(W9[e]=t)}function H9(){return G2}function eC(e,t){t&&(ru("Patches"),e.u=[],e.s=[],e.v=t)}function L5(e){V9(e),e.p.forEach(T4e),e.p=null}function V9(e){e===G2&&(G2=e.l)}function QM(e){return G2={p:[],l:G2,h:e,m:!0,_:0}}function T4e(e){var t=e[ur];t.i===0||t.i===1?t.j():t.O=!0}function tC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||ru("ES5").S(t,e,r),r?(n[ur].P&&(L5(t),Us(4)),lc(e)&&(e=A5(t,e),t.l||O5(t,e)),t.u&&ru("Patches").M(n[ur].t,e,t.u,t.s)):e=A5(t,n,[]),L5(t),t.u&&t.v(t.u,t.s),e!==rU?e:void 0}function A5(e,t,n){if(AE(t))return t;var r=t[ur];if(!r)return tp(t,function(o,a){return JM(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return O5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=TE(r.k):r.o;tp(r.i===3?new Set(i):i,function(o,a){return JM(e,r,i,o,a,n)}),O5(e,i,!1),n&&e.u&&ru("Patches").R(r,n,e.u,e.s)}return r.o}function JM(e,t,n,r,i,o){if(ef(i)){var a=A5(e,i,o&&t&&t.i!==3&&!Ig(t.D,r)?o.concat(r):void 0);if(tU(n,r,a),!ef(a))return;e.m=!1}if(lc(i)&&!AE(i)){if(!e.h.F&&e._<1)return;A5(e,i),t&&t.A.l||O5(e,i)}}function O5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&LE(t,n)}function nC(e,t){var n=e[ur];return(n?yh(n):e)[t]}function eR(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 _d(e){e.P||(e.P=!0,e.l&&_d(e.l))}function rC(e){e.o||(e.o=TE(e.t))}function U9(e,t,n){var r=EE(t)?ru("MapSet").N(t,n):PE(t)?ru("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:H9(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=q2;a&&(l=[s],u=wv);var f=Proxy.revocable(l,u),p=f.revoke,m=f.proxy;return s.k=m,s.j=p,m}(t,n):ru("ES5").J(t,n);return(n?n.A:H9()).p.push(r),r}function L4e(e){return ef(e)||Us(22,e),function t(n){if(!lc(n))return n;var r,i=n[ur],o=w1(n);if(i){if(!i.P&&(i.i<4||!ru("ES5").K(i)))return i.t;i.I=!0,r=tR(n,o),i.I=!1}else r=tR(n,o);return tp(r,function(a,s){i&&k4e(i.t,a)===s||tU(r,a,t(s))}),o===3?new Set(r):r}(e)}function tR(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return TE(e)}function A4e(){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[ur];return q2.get(l,o)},set:function(l){var u=this[ur];q2.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][ur];if(!s.P)switch(s.i){case 5:r(s)&&_d(s);break;case 4:n(s)&&_d(s)}}}function n(o){for(var a=o.t,s=o.k,l=Dg(s),u=l.length-1;u>=0;u--){var f=l[u];if(f!==ur){var p=a[f];if(p===void 0&&!Ig(a,f))return!0;var m=s[f],v=m&&m[ur];if(v?v.t!==p:!nU(m,p))return!0}}var b=!!a[ur];return l.length!==Dg(a).length+(b?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?k-1:0),T=1;T1?f-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=ru("Patches").$;return ef(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ia=new I4e,oU=Ia.produce;Ia.produceWithPatches.bind(Ia);Ia.setAutoFreeze.bind(Ia);Ia.setUseProxies.bind(Ia);Ia.applyPatches.bind(Ia);Ia.createDraft.bind(Ia);Ia.finishDraft.bind(Ia);function oR(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 aR(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(no(1));return n(ME)(e,t)}if(typeof e!="function")throw new Error(no(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function f(){if(l)throw new Error(no(3));return o}function p(x){if(typeof x!="function")throw new Error(no(4));if(l)throw new Error(no(5));var E=!0;return u(),s.push(x),function(){if(!!E){if(l)throw new Error(no(6));E=!1,u();var _=s.indexOf(x);s.splice(_,1),a=null}}}function m(x){if(!D4e(x))throw new Error(no(7));if(typeof x.type>"u")throw new Error(no(8));if(l)throw new Error(no(9));try{l=!0,o=i(o,x)}finally{l=!1}for(var E=a=s,k=0;k"u")throw new Error(no(12));if(typeof n(void 0,{type:M5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(no(13))})}function aU(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(no(14));p[v]=E,f=f||E!==x}return f=f||o.length!==Object.keys(l).length,f?p:l}}function R5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return I5}function i(s,l){r(s)===I5&&(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 z4e=function(t,n){return t===n};function j4e(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;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(I).forEach(function(D){!T(D)||f[D]!==I[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(f).forEach(function(D){I[D]===void 0&&T(D)&&m.indexOf(D)===-1&&f[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(k,i)),f=I},o)}function k(){if(m.length===0){v&&clearInterval(v),v=null;return}var I=m.shift(),D=r.reduce(function(B,z){return z.in(B,I,f)},f[I]);if(D!==void 0)try{p[I]=l(D)}catch(B){console.error("redux-persist/createPersistoid: error serializing state",B)}else delete p[I];m.length===0&&_()}function _(){Object.keys(p).forEach(function(I){f[I]===void 0&&delete p[I]}),b=s.setItem(a,l(p)).catch(A)}function T(I){return!(n&&n.indexOf(I)===-1&&I!=="_persist"||t&&t.indexOf(I)!==-1)}function A(I){u&&u(I)}var R=function(){for(;m.length!==0;)k();return b||Promise.resolve()};return{update:E,flush:R}}function x5e(e){return JSON.stringify(e)}function w5e(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:IE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=C5e,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,f){return f.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function C5e(e){return JSON.parse(e)}function _5e(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:IE).concat(e.key);return t.removeItem(n,k5e)}function k5e(e){}function pR(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 Vu(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function T5e(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 L5e=5e3;function A5e(e,t){var n=e.version!==void 0?e.version:m5e;e.debug;var r=e.stateReconciler===void 0?b5e:e.stateReconciler,i=e.getStoredState||w5e,o=e.timeout!==void 0?e.timeout:L5e,a=null,s=!1,l=!0,u=function(p){return p._persist.rehydrated&&a&&!l&&a.update(p),p};return function(f,p){var m=f||{},v=m._persist,b=P5e(m,["_persist"]),x=b;if(p.type===fU){var E=!1,k=function(B,z){E||(p.rehydrate(e.key,B,z),E=!0)};if(o&&setTimeout(function(){!E&&k(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=S5e(e)),v)return Vu({},t(x,p),{_persist:v});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),i(e).then(function(D){var B=e.migrate||function(z,j){return Promise.resolve(z)};B(D,n).then(function(z){k(z)},function(z){k(void 0,z)})},function(D){k(void 0,D)}),Vu({},t(x,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===hU)return s=!0,p.result(_5e(e)),Vu({},t(x,p),{_persist:v});if(p.type===cU)return p.result(a&&a.flush()),Vu({},t(x,p),{_persist:v});if(p.type===dU)l=!0;else if(p.type===DE){if(s)return Vu({},x,{_persist:Vu({},v,{rehydrated:!0})});if(p.key===e.key){var _=t(x,p),T=p.payload,A=r!==!1&&T!==void 0?r(T,f,_,e):_,R=Vu({},A,{_persist:Vu({},v,{rehydrated:!0})});return u(R)}}}if(!v)return t(f,p);var I=t(x,p);return I===x?f:u(Vu({},I,{_persist:v}))}}function gR(e){return R5e(e)||M5e(e)||O5e()}function O5e(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function M5e(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function R5e(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:gU,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case pU:return q9({},t,{registry:[].concat(gR(t.registry),[n.key])});case DE:var r=t.registry.indexOf(n.key),i=gR(t.registry);return i.splice(r,1),q9({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function N5e(e,t,n){var r=n||!1,i=ME(D5e,gU,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:pU,key:u})},a=function(u,f,p){var m={type:DE,payload:f,err:p,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=q9({},i,{purge:function(){var u=[];return e.dispatch({type:hU,result:function(p){u.push(p)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:cU,result:function(p){u.push(p)}}),Promise.all(u)},pause:function(){e.dispatch({type:dU})},persist:function(){e.dispatch({type:fU,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var NE={},BE={};BE.__esModule=!0;BE.default=F5e;function S4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S4=function(n){return typeof n}:S4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},S4(e)}function sC(){}var B5e={getItem:sC,setItem:sC,removeItem:sC};function $5e(e){if((typeof self>"u"?"undefined":S4(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(r){return!1}return!0}function F5e(e){var t="".concat(e,"Storage");return $5e(t)?self[t]:B5e}NE.__esModule=!0;NE.default=H5e;var z5e=j5e(BE);function j5e(e){return e&&e.__esModule?e:{default:e}}function H5e(e){var t=(0,z5e.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 mU=void 0,V5e=U5e(NE);function U5e(e){return e&&e.__esModule?e:{default:e}}var W5e=(0,V5e.default)("local");mU=W5e;var vU={},yU={},np={};Object.defineProperty(np,"__esModule",{value:!0});np.PLACEHOLDER_UNDEFINED=np.PACKAGE_NAME=void 0;np.PACKAGE_NAME="redux-deep-persist";np.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var $E={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})($E);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=np,n=$E,r=function(G){return typeof G=="object"&&G!==null};e.isObjectLike=r;const i=function(G){return typeof G=="number"&&G>-1&&G%1==0&&G<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(G){return(0,e.isLength)(G&&G.length)&&Object.prototype.toString.call(G)==="[object Array]"};const o=function(G){return!!G&&typeof G=="object"&&!(0,e.isArray)(G)};e.isPlainObject=o;const a=function(G){return String(~~G)===G&&Number(G)>=0};e.isIntegerString=a;const s=function(G){return Object.prototype.toString.call(G)==="[object String]"};e.isString=s;const l=function(G){return Object.prototype.toString.call(G)==="[object Date]"};e.isDate=l;const u=function(G){return Object.keys(G).length===0};e.isEmpty=u;const f=Object.prototype.hasOwnProperty,p=function(G,$,V){V||(V=new Set([G])),$||($="");for(const J in G){const Z=$?`${$}.${J}`:J,U=G[J];if((0,e.isObjectLike)(U))return V.has(U)?`${$}.${J}:`:(V.add(U),(0,e.getCircularPath)(U,Z,V))}return null};e.getCircularPath=p;const m=function(G){if(!(0,e.isObjectLike)(G))return G;if((0,e.isDate)(G))return new Date(+G);const $=(0,e.isArray)(G)?[]:{};for(const V in G){const J=G[V];$[V]=(0,e._cloneDeep)(J)}return $};e._cloneDeep=m;const v=function(G){const $=(0,e.getCircularPath)(G);if($)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${$}' of object you're trying to persist: ${G}`);return(0,e._cloneDeep)(G)};e.cloneDeep=v;const b=function(G,$){if(G===$)return{};if(!(0,e.isObjectLike)(G)||!(0,e.isObjectLike)($))return $;const V=(0,e.cloneDeep)(G),J=(0,e.cloneDeep)($),Z=Object.keys(V).reduce((X,le)=>(f.call(J,le)||(X[le]=void 0),X),{});if((0,e.isDate)(V)||(0,e.isDate)(J))return V.valueOf()===J.valueOf()?{}:J;const U=Object.keys(J).reduce((X,le)=>{if(!f.call(V,le))return X[le]=J[le],X;const fe=(0,e.difference)(V[le],J[le]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(V)&&!(0,e.isArray)(J)||!(0,e.isArray)(V)&&(0,e.isArray)(J)?J:X:(X[le]=fe,X)},Z);return delete U._persist,U};e.difference=b;const x=function(G,$){return $.reduce((V,J)=>{if(V){const Z=parseInt(J,10),U=(0,e.isIntegerString)(J)&&Z<0?V.length+Z:J;return(0,e.isString)(V)?V.charAt(U):V[U]}},G)};e.path=x;const E=function(G,$){return[...G].reverse().reduce((Z,U,X)=>{const le=(0,e.isIntegerString)(U)?[]:{};return le[U]=X===0?$:Z,le},{})};e.assocPath=E;const k=function(G,$){const V=(0,e.cloneDeep)(G);return $.reduce((J,Z,U)=>(U===$.length-1&&J&&(0,e.isObjectLike)(J)&&delete J[Z],J&&J[Z]),V),V};e.dissocPath=k;const _=function(G,$,...V){if(!V||!V.length)return $;const J=V.shift(),{preservePlaceholder:Z,preserveUndefined:U}=G;if((0,e.isObjectLike)($)&&(0,e.isObjectLike)(J))for(const X in J)if((0,e.isObjectLike)(J[X])&&(0,e.isObjectLike)($[X]))$[X]||($[X]={}),_(G,$[X],J[X]);else if((0,e.isArray)($)){let le=J[X];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;U||(le=typeof le<"u"?le:$[parseInt(X,10)]),le=le!==t.PLACEHOLDER_UNDEFINED?le:fe,$[parseInt(X,10)]=le}else{const le=J[X]!==t.PLACEHOLDER_UNDEFINED?J[X]:void 0;$[X]=le}return _(G,$,...V)},T=function(G,$,V){return _({preservePlaceholder:V==null?void 0:V.preservePlaceholder,preserveUndefined:V==null?void 0:V.preserveUndefined},(0,e.cloneDeep)(G),(0,e.cloneDeep)($))};e.mergeDeep=T;const A=function(G,$=[],V,J,Z){if(!(0,e.isObjectLike)(G))return G;for(const U in G){const X=G[U],le=(0,e.isArray)(G),fe=J?J+"."+U:U;X===null&&(V===n.ConfigType.WHITELIST&&$.indexOf(fe)===-1||V===n.ConfigType.BLACKLIST&&$.indexOf(fe)!==-1)&&le&&(G[parseInt(U,10)]=void 0),X===void 0&&Z&&V===n.ConfigType.BLACKLIST&&$.indexOf(fe)===-1&&le&&(G[parseInt(U,10)]=t.PLACEHOLDER_UNDEFINED),A(X,$,V,fe,Z)}},R=function(G,$,V,J){const Z=(0,e.cloneDeep)(G);return A(Z,$,V,"",J),Z};e.preserveUndefined=R;const I=function(G,$,V){return V.indexOf(G)===$};e.unique=I;const D=function(G){return G.reduce(($,V)=>{const J=G.filter(Se=>Se===V),Z=G.filter(Se=>(V+".").indexOf(Se+".")===0),{duplicates:U,subsets:X}=$,le=J.length>1&&U.indexOf(V)===-1,fe=Z.length>1;return{duplicates:[...U,...le?J:[]],subsets:[...X,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const B=function(G,$,V){const J=V===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${J} configuration.`,U=`Check your create${V===n.ConfigType.WHITELIST?"White":"Black"}list arguments. `;if(!(0,e.isString)($)||$.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${U}`);if(!G||!G.length)return;const{duplicates:X,subsets:le}=(0,e.findDuplicatesAndSubsets)(G);if(X.length>1)throw new Error(`${Z} Duplicated paths. @@ -423,7 +423,7 @@ ${JSON.stringify(le)} ${JSON.stringify(G)}`);if($.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${V}. You must decide if you want to persist an entire path or its specific subset. - ${JSON.stringify($)}`)};e.throwError=Y;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce(($,V)=>{const J=V.split("."),Z=J[0],U=J.slice(1).join(".")||void 0,X=$.filter(fe=>Object.keys(fe)[0]===Z)[0],le=X?Object.values(X)[0]:void 0;return X||$.push({[Z]:U?[U]:void 0}),X&&!le&&U&&(X[Z]=[U]),X&&le&&U&&le.push(U),$},[]):[]};e.getRootKeysGroup=te})(yU);(function(e){var t=xo&&xo.__rest||function(p,m){var v={};for(var b in p)Object.prototype.hasOwnProperty.call(p,b)&&m.indexOf(b)<0&&(v[b]=p[b]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,b=Object.getOwnPropertySymbols(p);x!E(_)&&p?p(k,_,T):k,out:(k,_,T)=>!E(_)&&m?m(k,_,T):k,deepPersistKey:b&&b[0]}},a=(p,m,v,{debug:b,whitelist:x,blacklist:E,transforms:k})=>{if(x||E)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(k);const _=(0,n.cloneDeep)(v);let T=p;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,v);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(p,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(R=>{if(R!=="_persist"){if((0,n.isObjectLike)(_[R])){_[R]=(0,n.mergeDeep)(_[R],T[R]);return}_[R]=T[R]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),_};e.autoMergeDeep=a;const s=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,x;return m.forEach(E=>{const k=E.split(".");x=(0,n.path)(v,k),typeof x>"u"&&(0,n.isIntegerString)(k[k.length-1])&&(x=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(k,x),T=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||T,_,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[p]}));e.createWhitelist=s;const l=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(E=>E.split(".")).reduce((E,k)=>(0,n.dissocPath)(E,k),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[p]}));e.createBlacklist=l;const u=function(p,m){return m.map(v=>{const b=Object.keys(v)[0],x=v[b];return p===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,x):(0,e.createBlacklist)(b,x)})};e.getTransforms=u;const f=p=>{var{key:m,whitelist:v,blacklist:b,storage:x,transforms:E,rootReducer:k}=p,_=t(p,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),A=(0,n.getRootKeysGroup)(b),R=Object.keys(k(void 0,{type:""})),I=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),B=R.filter(te=>I.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),j=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),Y=(0,n.isArray)(v)?B.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:x,transforms:[...z,...j,...Y,...E||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=f})(vU);const x4=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" "),G5e=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return FE(r)?r:!1},FE=e=>Boolean(typeof e=="string"?G5e(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)})),N5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),q5e=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0]),parseFloat(r[1])]),zE=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],bU={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1},Y5e=bU,SU=gx({name:"options",initialState:Y5e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=x4(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,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:f,hires_fix:p,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=N5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=x4(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof f=="boolean"&&(e.seamless=f),typeof p=="boolean"&&(e.hiresFix=p),m&&(e.width=m),v&&(e.height=v)},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:u,perlin:f,seamless:p,hires_fix:m,width:v,height:b,strength:x,fit:E,init_image_path:k,mask_image_path:_}=t.payload.image;n==="img2img"&&(k&&(e.initialImage=k),_&&(e.maskPath=_),x&&(e.img2imgStrength=x),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=N5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=x4(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"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),v&&(e.width=v),b&&(e.height=b),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...bU}),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=zE.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},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload}}}),{clearInitialImage:xU,resetOptionsState:Eze,resetSeed:Pze,setActiveTab:Go,setAllImageToImageParameters:K5e,setAllParameters:X5e,setAllTextToImageParameters:Z5e,setCfgScale:wU,setCodeformerFidelity:CU,setCurrentTheme:Q5e,setFacetoolStrength:w4,setFacetoolType:C4,setHeight:_U,setHiresFix:jE,setImg2imgStrength:Y9,setInfillMethod:kU,setInitialImage:C1,setIsLightBoxOpen:Qu,setIterations:J5e,setMaskPath:EU,setOptionsPanelScrollPosition:eSe,setParameter:Tze,setPerlin:PU,setPrompt:mx,setSampler:TU,setSeamBlur:vR,setSeamless:LU,setSeamSize:yR,setSeamSteps:bR,setSeamStrength:SR,setSeed:Ly,setSeedWeights:AU,setShouldFitToWidthHeight:OU,setShouldGenerateVariations:tSe,setShouldHoldOptionsPanelOpen:nSe,setShouldLoopback:rSe,setShouldPinOptionsPanel:iSe,setShouldRandomizeSeed:oSe,setShouldRunESRGAN:aSe,setShouldRunFacetool:sSe,setShouldShowImageDetails:MU,setShouldShowOptionsPanel:Ju,setShowAdvancedOptions:Lze,setShowDualDisplay:lSe,setSteps:RU,setThreshold:IU,setTileSize:xR,setUpscalingLevel:K9,setUpscalingStrength:X9,setVariationAmount:uSe,setWidth:DU,setShouldUseCanvasBetaLayout:cSe,setShouldShowExistingModelsInSearch:dSe}=SU.actions,fSe=SU.reducer;var gi={exports:{}};/** + ${JSON.stringify($)}`)};e.throwError=Y;const te=function(G){return(0,e.isArray)(G)?G.filter(e.unique).reduce(($,V)=>{const J=V.split("."),Z=J[0],U=J.slice(1).join(".")||void 0,X=$.filter(fe=>Object.keys(fe)[0]===Z)[0],le=X?Object.values(X)[0]:void 0;return X||$.push({[Z]:U?[U]:void 0}),X&&!le&&U&&(X[Z]=[U]),X&&le&&U&&le.push(U),$},[]):[]};e.getRootKeysGroup=te})(yU);(function(e){var t=xo&&xo.__rest||function(p,m){var v={};for(var b in p)Object.prototype.hasOwnProperty.call(p,b)&&m.indexOf(b)<0&&(v[b]=p[b]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,b=Object.getOwnPropertySymbols(p);x!E(_)&&p?p(k,_,T):k,out:(k,_,T)=>!E(_)&&m?m(k,_,T):k,deepPersistKey:b&&b[0]}},a=(p,m,v,{debug:b,whitelist:x,blacklist:E,transforms:k})=>{if(x||E)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(k);const _=(0,n.cloneDeep)(v);let T=p;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,v);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(p,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(R=>{if(R!=="_persist"){if((0,n.isObjectLike)(_[R])){_[R]=(0,n.mergeDeep)(_[R],T[R]);return}_[R]=T[R]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),_};e.autoMergeDeep=a;const s=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,x;return m.forEach(E=>{const k=E.split(".");x=(0,n.path)(v,k),typeof x>"u"&&(0,n.isIntegerString)(k[k.length-1])&&(x=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(k,x),T=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||T,_,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[p]}));e.createWhitelist=s;const l=(p,m)=>((0,n.singleTransformValidator)(m,p,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(E=>E.split(".")).reduce((E,k)=>(0,n.dissocPath)(E,k),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[p]}));e.createBlacklist=l;const u=function(p,m){return m.map(v=>{const b=Object.keys(v)[0],x=v[b];return p===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,x):(0,e.createBlacklist)(b,x)})};e.getTransforms=u;const f=p=>{var{key:m,whitelist:v,blacklist:b,storage:x,transforms:E,rootReducer:k}=p,_=t(p,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),A=(0,n.getRootKeysGroup)(b),R=Object.keys(k(void 0,{type:""})),I=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),B=R.filter(te=>I.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),j=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),Y=(0,n.isArray)(v)?B.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:x,transforms:[...z,...j,...Y,...E||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=f})(vU);const x4=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" "),G5e=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return FE(r)?r:!1},FE=e=>Boolean(typeof e=="string"?G5e(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)})),N5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),q5e=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0]),parseFloat(r[1])]),zE=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],bU={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1},Y5e=bU,SU=gx({name:"options",initialState:Y5e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=x4(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,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:f,hires_fix:p,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=N5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=x4(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof f=="boolean"&&(e.seamless=f),typeof p=="boolean"&&(e.hiresFix=p),m&&(e.width=m),v&&(e.height=v)},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:u,perlin:f,seamless:p,hires_fix:m,width:v,height:b,strength:x,fit:E,init_image_path:k,mask_image_path:_}=t.payload.image;n==="img2img"&&(k&&(e.initialImage=k),_&&(e.maskPath=_),x&&(e.img2imgStrength=x),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=N5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=x4(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"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),v&&(e.width=v),b&&(e.height=b),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...bU}),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=zE.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},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload}}}),{clearInitialImage:xU,resetOptionsState:Pze,resetSeed:Tze,setActiveTab:Go,setAllImageToImageParameters:K5e,setAllParameters:X5e,setAllTextToImageParameters:Z5e,setCfgScale:wU,setCodeformerFidelity:CU,setCurrentTheme:Q5e,setFacetoolStrength:w4,setFacetoolType:C4,setHeight:_U,setHiresFix:jE,setImg2imgStrength:Y9,setInfillMethod:kU,setInitialImage:C1,setIsLightBoxOpen:Qu,setIterations:J5e,setMaskPath:EU,setOptionsPanelScrollPosition:eSe,setParameter:Lze,setPerlin:PU,setPrompt:mx,setSampler:TU,setSeamBlur:vR,setSeamless:LU,setSeamSize:yR,setSeamSteps:bR,setSeamStrength:SR,setSeed:Ly,setSeedWeights:AU,setShouldFitToWidthHeight:OU,setShouldGenerateVariations:tSe,setShouldHoldOptionsPanelOpen:nSe,setShouldLoopback:rSe,setShouldPinOptionsPanel:iSe,setShouldRandomizeSeed:oSe,setShouldRunESRGAN:aSe,setShouldRunFacetool:sSe,setShouldShowImageDetails:MU,setShouldShowOptionsPanel:Ju,setShowAdvancedOptions:Aze,setShowDualDisplay:lSe,setSteps:RU,setThreshold:IU,setTileSize:xR,setUpscalingLevel:K9,setUpscalingStrength:X9,setVariationAmount:uSe,setWidth:DU,setShouldUseCanvasBetaLayout:cSe,setShouldShowExistingModelsInSearch:dSe}=SU.actions,fSe=SU.reducer;var gi={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors @@ -451,7 +451,7 @@ function print() { __p += __j.call(arguments, '') } `)+Re+`return __p }`;var Kt=qT(function(){return on(H,wt+"return "+Re).apply(n,Q)});if(Kt.source=Re,kw(Kt))throw Kt;return Kt}function tJ(c){return Pn(c).toLowerCase()}function nJ(c){return Pn(c).toUpperCase()}function rJ(c,g,w){if(c=Pn(c),c&&(w||g===n))return uo(c);if(!c||!(g=ho(g)))return c;var O=Ki(c),N=Ki(g),H=da(O,N),Q=ws(O,N)+1;return Ls(O,H,Q).join("")}function iJ(c,g,w){if(c=Pn(c),c&&(w||g===n))return c.slice(0,J1(c)+1);if(!c||!(g=ho(g)))return c;var O=Ki(c),N=ws(O,Ki(g))+1;return Ls(O,0,N).join("")}function oJ(c,g,w){if(c=Pn(c),c&&(w||g===n))return c.replace(Cc,"");if(!c||!(g=ho(g)))return c;var O=Ki(c),N=da(O,Ki(g));return Ls(O,N).join("")}function aJ(c,g){var w=j,O=Y;if(gr(g)){var N="separator"in g?g.separator:N;w="length"in g?Wt(g.length):w,O="omission"in g?ho(g.omission):O}c=Pn(c);var H=c.length;if(Tu(c)){var Q=Ki(c);H=Q.length}if(w>=H)return c;var ne=w-Va(O);if(ne<1)return O;var de=Q?Ls(Q,0,ne).join(""):c.slice(0,ne);if(N===n)return de+O;if(Q&&(ne+=de.length-ne),Ew(N)){if(c.slice(ne).search(N)){var Ee,Pe=de;for(N.global||(N=zf(N.source,Pn(ys.exec(N))+"g")),N.lastIndex=0;Ee=N.exec(Pe);)var Re=Ee.index;de=de.slice(0,Re===n?ne:Re)}}else if(c.indexOf(ho(N),ne)!=ne){var tt=de.lastIndexOf(N);tt>-1&&(de=de.slice(0,tt))}return de+O}function sJ(c){return c=Pn(c),c&&O1.test(c)?c.replace(Kr,Ky):c}var lJ=Ll(function(c,g,w){return c+(w?" ":"")+g.toUpperCase()}),Lw=v0("toUpperCase");function GT(c,g,w){return c=Pn(c),g=w?n:g,g===n?Fp(c)?Ff(c):X1(c):c.match(g)||[]}var qT=Mt(function(c,g){try{return Mi(c,n,g)}catch(w){return kw(w)?w:new It(w)}}),uJ=lr(function(c,g){return Kn(g,function(w){w=Al(w),ga(c,w,Cw(c[w],c))}),c});function cJ(c){var g=c==null?0:c.length,w=Me();return c=g?Vn(c,function(O){if(typeof O[1]!="function")throw new Ri(a);return[w(O[0]),O[1]]}):[],Mt(function(O){for(var N=-1;++NU)return[];var w=fe,O=ci(c,fe);g=Me(g),c-=fe;for(var N=Nf(O,g);++w0||g<0)?new Jt(w):(c<0?w=w.takeRight(-c):c&&(w=w.drop(c)),g!==n&&(g=Wt(g),w=g<0?w.dropRight(-g):w.take(g-c)),w)},Jt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Jt.prototype.toArray=function(){return this.take(fe)},ya(Jt.prototype,function(c,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),N=F[O?"take"+(g=="last"?"Right":""):g],H=O||/^find/.test(g);!N||(F.prototype[g]=function(){var Q=this.__wrapped__,ne=O?[1]:arguments,de=Q instanceof Jt,Ee=ne[0],Pe=de||jt(Q),Re=function(en){var an=N.apply(F,Ha([en],ne));return O&&tt?an[0]:an};Pe&&w&&typeof Ee=="function"&&Ee.length!=1&&(de=Pe=!1);var tt=this.__chain__,wt=!!this.__actions__.length,Lt=H&&!tt,Kt=de&&!wt;if(!H&&Pe){Q=Kt?Q:new Jt(this);var At=c.apply(Q,ne);return At.__actions__.push({func:S3,args:[Re],thisArg:n}),new co(At,tt)}return Lt&&Kt?c.apply(this,ne):(At=this.thru(Re),Lt?O?At.value()[0]:At.value():At)})}),Kn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Bc[c],w=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var N=arguments;if(O&&!this.__chain__){var H=this.value();return g.apply(jt(H)?H:[],N)}return this[w](function(Q){return g.apply(jt(Q)?Q:[],N)})}}),ya(Jt.prototype,function(c,g){var w=F[g];if(w){var O=w.name+"";cn.call(_s,O)||(_s[O]=[]),_s[O].push({name:g,func:w})}}),_s[ih(n,k).name]=[{name:"wrapper",func:n}],Jt.prototype.clone=Xi,Jt.prototype.reverse=Di,Jt.prototype.value=i3,F.prototype.at=$X,F.prototype.chain=FX,F.prototype.commit=zX,F.prototype.next=jX,F.prototype.plant=VX,F.prototype.reverse=UX,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=WX,F.prototype.first=F.prototype.head,Hc&&(F.prototype[Hc]=HX),F},Ua=Io();Qt?((Qt.exports=Ua)._=Ua,Bt._=Ua):Pt._=Ua}).call(xo)})(gi,gi.exports);const He=gi.exports,hSe={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,shouldUseSingleGalleryColumn:!1},NU=gx({name:"gallery",initialState:hSe,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=gi.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,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.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},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:ag,clearIntermediateImage:lC,removeImage:BU,setCurrentImage:wR,addGalleryImages:pSe,setIntermediateImage:gSe,selectNextImage:HE,selectPrevImage:VE,setShouldPinGallery:mSe,setShouldShowGallery:Vd,setGalleryScrollPosition:vSe,setGalleryImageMinimumWidth:ev,setGalleryImageObjectFit:ySe,setShouldHoldGalleryOpen:$U,setShouldAutoSwitchToNewImages:bSe,setCurrentCategory:gb,setGalleryWidth:SSe,setShouldUseSingleGalleryColumn:xSe}=NU.actions,wSe=NU.reducer;function Qs(e){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function vu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CSe(e,t){if(Qs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FU(e){var t=CSe(e,"string");return Qs(t)==="symbol"?t:String(t)}function CR(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};vu(this,e),this.init(t,n)}return yu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||LSe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function TR(e,t,n){var r=UE(e,t,Object),i=r.obj,o=r.k;i[o]=n}function MSe(e,t,n,r){var i=UE(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function B5(e,t){var n=UE(e,t),r=n.obj,i=n.k;if(!!r)return r[i]}function LR(e,t,n){var r=B5(e,n);return r!==void 0?r:B5(t,n)}function zU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):zU(e[r],t[r],n):e[r]=t[r]);return e}function A0(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var RSe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ISe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return RSe[t]}):e}var yx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,DSe=[" ",",","?","!",";"];function NSe(e,t,n){t=t||"",n=n||"";var r=DSe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function AR(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 mb(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function jU(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?jU(l,u,n):void 0}i=i[r[o]]}return i}}var FSe=function(e){vx(n,e);var t=BSe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return vu(this,n),i=t.call(this),yx&&tf.call(Ud(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return yu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,f=[i,o];a&&typeof a!="string"&&(f=f.concat(a)),a&&typeof a=="string"&&(f=f.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(f=i.split("."));var p=B5(this.data,f);return p||!u||typeof a!="string"?p:jU(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var f=[i,o];a&&(f=f.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(f=i.split("."),s=o,o=f[1]),this.addNamespaces(o),TR(this.data,f,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[i,o];i.indexOf(".")>-1&&(f=i.split("."),s=a,a=o,o=f[1]),this.addNamespaces(o);var p=B5(this.data,f)||{};s?zU(p,a,l):p=mb(mb({},p),a),TR(this.data,f,p),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?mb(mb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(tf),HU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function OR(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 yo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var MR={},RR=function(e){vx(n,e);var t=zSe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vu(this,n),i=t.call(this),yx&&tf.call(Ud(i)),OSe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Ud(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Kl.create("translator"),i}return yu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,f=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!NSe(i,a,s);if(u&&!f){var p=i.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Qs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,f=this.extractFromKey(i[i.length-1],o),p=f.key,m=f.namespaces,v=m[m.length-1],b=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(x){var E=o.nsSeparator||this.options.nsSeparator;return l?(k.res="".concat(v).concat(E).concat(p),k):"".concat(v).concat(E).concat(p)}return l?(k.res=p,k):p}var k=this.resolve(i,o),_=k&&k.res,T=k&&k.usedKey||p,A=k&&k.exactUsedKey||p,R=Object.prototype.toString.apply(_),I=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,B=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(B&&_&&z&&I.indexOf(R)<0&&!(typeof D=="string"&&R==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,_,yo(yo({},o),{},{ns:m})):"key '".concat(p," (").concat(this.language,")' returned an object instead of string.");return l?(k.res=j,k):j}if(u){var Y=R==="[object Array]",te=Y?[]:{},G=Y?A:T;for(var $ in _)if(Object.prototype.hasOwnProperty.call(_,$)){var V="".concat(G).concat(u).concat($);te[$]=this.translate(V,yo(yo({},o),{joinArrays:!1,ns:m})),te[$]===V&&(te[$]=_[$])}_=te}}else if(B&&typeof D=="string"&&R==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var J=!1,Z=!1,U=o.count!==void 0&&typeof o.count!="string",X=n.hasDefaultValue(o),le=U?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(le)]||o.defaultValue;!this.isValidLookup(_)&&X&&(J=!0,_=fe),this.isValidLookup(_)||(Z=!0,_=p);var Se=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Ae=Se&&Z?void 0:_,be=X&&fe!==_&&this.options.updateMissing;if(Z||J||be){if(this.logger.log(be?"updateKey":"missingKey",b,v,p,be?fe:_),u){var ke=this.resolve(p,yo(yo({},o),{},{keySeparator:!1}));ke&&ke.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var De=[],Je=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Je&&Je[0])for(var Ye=0;Ye1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,f,p;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var v=o.extractFromKey(m,a),b=v.key;l=b;var x=v.namespaces;o.options.fallbackNS&&(x=x.concat(o.options.fallbackNS));var E=a.count!==void 0&&typeof a.count!="string",k=E&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);x.forEach(function(A){o.isValidLookup(s)||(p=A,!MR["".concat(T[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(p)&&(MR["".concat(T[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(p,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(R){if(!o.isValidLookup(s)){f=R;var I=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(I,b,R,A,a);else{var D;E&&(D=o.pluralResolver.getSuffix(R,a.count,a));var B="".concat(o.options.pluralSeparator,"zero");if(E&&(I.push(b+D),k&&I.push(b+B)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);I.push(z),E&&(I.push(z+D),k&&I.push(z+B))}}for(var j;j=I.pop();)o.isValidLookup(s)||(u=j,s=o.getResource(R,A,j,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:f,usedNS:p}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(tf);function uC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var IR=function(){function e(t){vu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kl.create("languageUtils")}return yu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=uC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=uC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=uC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){!u||(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),HSe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],VSe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},USe=["v1","v2","v3"],DR={zero:0,one:1,two:2,few:3,many:4,other:5};function WSe(){var e={};return HSe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:VSe[t.fc]}})}),e}var GSe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vu(this,e),this.languageUtils=t,this.options=n,this.logger=Kl.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=WSe()}return yu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch(i){return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return DR[a]-DR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!USe.includes(this.options.compatibilityJSON)}}]),e}();function NR(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 Bs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};vu(this,e),this.logger=Kl.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return yu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ISe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?A0(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?A0(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?A0(r.nestingPrefix):r.nestingPrefixEscaped||A0("$t("),this.nestingSuffix=r.nestingSuffix?A0(r.nestingSuffix):r.nestingSuffixEscaped||A0(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(E){return E.replace(/\$/g,"$$$$")}var m=function(k){if(k.indexOf(a.formatSeparator)<0){var _=LR(r,f,k);return a.alwaysFormat?a.format(_,void 0,i,Bs(Bs(Bs({},o),r),{},{interpolationkey:k})):_}var T=k.split(a.formatSeparator),A=T.shift().trim(),R=T.join(a.formatSeparator).trim();return a.format(LR(r,f,A),R,i,Bs(Bs(Bs({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var v=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:function(k){return p(k)}},{regex:this.regexp,safeValue:function(k){return a.escapeValue?p(a.escape(k)):p(k)}}];return x.forEach(function(E){for(u=0;s=E.regex.exec(n);){var k=s[1].trim();if(l=m(k),l===void 0)if(typeof v=="function"){var _=v(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(k))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(k," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=PR(l));var T=E.safeValue(l);if(n=n.replace(s[0],T),b?(E.regex.lastIndex+=l.length,E.regex.lastIndex-=s[0].length):E.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(v,b){var x=this.nestingOptionsSeparator;if(v.indexOf(x)<0)return v;var E=v.split(new RegExp("".concat(x,"[ ]*{"))),k="{".concat(E[1]);v=E[0],k=this.interpolate(k,l);var _=k.match(/'/g),T=k.match(/"/g);(_&&_.length%2===0&&!T||T.length%2!==0)&&(k=k.replace(/'/g,'"'));try{l=JSON.parse(k),b&&(l=Bs(Bs({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(v),A),"".concat(v).concat(x).concat(k)}return delete l.defaultValue,v}for(;a=this.nestingRegexp.exec(n);){var f=[];l=Bs({},o),l.applyPostProcessor=!1,delete l.defaultValue;var p=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(v){return v.trim()});a[1]=m.shift(),f=m,p=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=PR(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),p&&(s=f.reduce(function(v,b){return i.format(v,b,o.lng,Bs(Bs({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function BR(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 fd(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(!!a){var s=a.split(":"),l=TSe(s),u=l[0],f=l.slice(1),p=f.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=p),p==="false"&&(n[u.trim()]=!1),p==="true"&&(n[u.trim()]=!0),isNaN(p)||(n[u.trim()]=parseInt(p,10))}})}}return{formatName:t,formatOptions:n}}function O0(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var KSe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vu(this,e),this.logger=Kl.create("formatter"),this.options=t,this.formats={number:O0(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:O0(function(n,r){var i=new Intl.NumberFormat(n,fd(fd({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:O0(function(n,r){var i=new Intl.DateTimeFormat(n,fd({},r));return function(o){return i.format(o)}}),relativetime:O0(function(n,r){var i=new Intl.RelativeTimeFormat(n,fd({},r));return function(o){return i.format(o,r.range||"day")}}),list:O0(function(n,r){var i=new Intl.ListFormat(n,fd({},r));return function(o){return i.format(o)}})},this.init(t)}return yu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=O0(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,f){var p=YSe(f),m=p.formatName,v=p.formatOptions;if(a.formats[m]){var b=u;try{var x=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},E=x.locale||x.lng||o.locale||o.lng||i;b=a.formats[m](u,E,fd(fd(fd({},v),o),x))}catch(k){a.logger.warn(k)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function $R(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 FR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function QSe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var JSe=function(e){vx(n,e);var t=XSe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return vu(this,n),a=t.call(this),yx&&tf.call(Ud(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Kl.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return yu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},f={},p={},m={};return i.forEach(function(v){var b=!0;o.forEach(function(x){var E="".concat(v,"|").concat(x);!a.reload&&l.store.hasResourceBundle(v,x)?l.state[E]=2:l.state[E]<0||(l.state[E]===1?f[E]===void 0&&(f[E]=!0):(l.state[E]=1,b=!1,f[E]===void 0&&(f[E]=!0),u[E]===void 0&&(u[E]=!0),m[x]===void 0&&(m[x]=!0)))}),b||(p[v]=!0)}),(Object.keys(u).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(f),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var f={};this.queue.forEach(function(p){MSe(p.loaded,[l],u),QSe(p,i),o&&p.errors.push(o),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(function(m){f[m]||(f[m]={});var v=p.loaded[m];v.length&&v.forEach(function(b){f[m][b]===void 0&&(f[m][b]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(p){return!p.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,f=arguments.length>5?arguments[5]:void 0;if(!i.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:f});return}this.readingCalls++;var p=function(x,E){if(s.readingCalls--,s.waitingReads.length>0){var k=s.waitingReads.shift();s.read(k.lng,k.ns,k.fcName,k.tried,k.wait,k.callback)}if(x&&E&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(f){a.loadOne(f)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(f,p){f&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),f),!f&&p&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),p),o.loaded(i,f,p)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},f=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var p=FR(FR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var v;m.length===5?v=m(i,o,a,s,p):v=m(i,o,a,s),v&&typeof v.then=="function"?v.then(function(b){return f(null,b)}).catch(f):f(null,v)}catch(b){f(b)}else m(i,o,a,s,f,p)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(tf);function zR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qs(t[2])==="object"||Qs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function jR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function HR(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 Dl(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function vb(){}function nxe(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var $5=function(e){vx(n,e);var t=exe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(vu(this,n),r=t.call(this),yx&&tf.call(Ud(r)),r.options=jR(i),r.services={},r.logger=Kl,r.modules={external:[]},nxe(Ud(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),Ay(r,Ud(r));setTimeout(function(){r.init(i,o)},0)}return r}return yu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=zR();this.options=Dl(Dl(Dl({},s),this.options),jR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Dl(Dl({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(k){return k?typeof k=="function"?new k:k:null}if(!this.options.isClone){this.modules.logger?Kl.init(l(this.modules.logger),this.options):Kl.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=KSe);var f=new IR(this.options);this.store=new FSe(this.options.resources,this.options);var p=this.services;p.logger=Kl,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new GSe(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=l(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new qSe(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new JSe(l(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(k){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[k].concat(T))}),this.modules.languageDetector&&(p.languageDetector=l(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=l(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new RR(this.services,this.options),this.translator.on("*",function(k){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[k].concat(T))}),this.modules.external.forEach(function(k){k.init&&k.init(i)})}if(this.format=this.options.interpolation.format,a||(a=vb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(k){i[k]=function(){var _;return(_=i.store)[k].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(k){i[k]=function(){var _;return(_=i.store)[k].apply(_,arguments),i}});var x=tv(),E=function(){var _=function(A,R){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),x.resolve(R),a(A,R)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),x}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vb,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],f=function(v){if(!!v){var b=o.services.languageUtils.toResolveHierarchy(v);b.forEach(function(x){u.indexOf(x)<0&&u.push(x)})}};if(l)f(l);else{var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.forEach(function(m){return f(m)})}this.options.preload&&this.options.preload.forEach(function(m){return f(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=tv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=vb),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&HU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=tv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,v){v?(l(v),a.translator.changeLanguage(v),a.isLanguageChangingTo=void 0,a.emit("languageChanged",v),a.logger.log("languageChanged",v)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},f=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var v=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);v&&(a.language||l(v),a.translator.language||a.translator.changeLanguage(v),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(v)),a.loadResources(v,function(b){u(b,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(f,p){var m;if(Qs(p)!=="object"){for(var v=arguments.length,b=new Array(v>2?v-2:0),x=2;x1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var f=function(v,b){var x=o.services.backendConnector.state["".concat(v,"|").concat(b)];return x===-1||x===2};if(a.precheck){var p=a.precheck(this,f);if(p!==void 0)return p}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(s,i)&&(!l||f(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=tv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=tv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new IR(zR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vb,s=Dl(Dl(Dl({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(f){l[f]=i[f]}),l.services=Dl({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new RR(l.services,l.options),l.translator.on("*",function(f){for(var p=arguments.length,m=new Array(p>1?p-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new $5(e,t)});var Ht=$5.createInstance();Ht.createInstance=$5.createInstance;Ht.createInstance;Ht.dir;Ht.init;Ht.loadResources;Ht.reloadResources;Ht.use;Ht.changeLanguage;Ht.getFixedT;Ht.t;Ht.exists;Ht.setDefaultNamespace;Ht.hasLoadedNamespace;Ht.loadNamespaces;Ht.loadLanguages;function rxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y2(e){return Y2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y2(e)}function ixe(e,t){if(Y2(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Y2(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oxe(e){var t=ixe(e,"string");return Y2(t)==="symbol"?t:String(t)}function VR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!UR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!UR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},WR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=cxe(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},nv=null,GR=function(){if(nv!==null)return nv;try{nv=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(n){nv=!1}return nv},hxe={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&GR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&GR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},rv=null,qR=function(){if(rv!==null)return rv;try{rv=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(n){rv=!1}return rv},pxe={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&qR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&qR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},gxe={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},mxe={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},vxe={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},yxe={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!r)return r[n]}};function bxe(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var UU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};rxe(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return axe(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=uxe(r,this.options||{},bxe()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(dxe),this.addDetector(fxe),this.addDetector(hxe),this.addDetector(pxe),this.addDetector(gxe),this.addDetector(mxe),this.addDetector(vxe),this.addDetector(yxe)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();UU.type="languageDetector";function Q9(e){return Q9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q9(e)}var WU=[],Sxe=WU.forEach,xxe=WU.slice;function J9(e){return Sxe.call(xxe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function GU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Q9(XMLHttpRequest))==="object"}function wxe(e){return!!e&&typeof e.then=="function"}function Cxe(e){return wxe(e)?e:Promise.resolve(e)}function _xe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F5={exports:{}},yb={exports:{}},YR;function kxe(){return YR||(YR=1,function(e,t){var n=typeof self<"u"?self:xo,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch($){return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l($){return $&&DataView.prototype.isPrototypeOf($)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function($){return $&&u.indexOf(Object.prototype.toString.call($))>-1};function p($){if(typeof $!="string"&&($=String($)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test($))throw new TypeError("Invalid character in header field name");return $.toLowerCase()}function m($){return typeof $!="string"&&($=String($)),$}function v($){var V={next:function(){var J=$.shift();return{done:J===void 0,value:J}}};return s.iterable&&(V[Symbol.iterator]=function(){return V}),V}function b($){this.map={},$ instanceof b?$.forEach(function(V,J){this.append(J,V)},this):Array.isArray($)?$.forEach(function(V){this.append(V[0],V[1])},this):$&&Object.getOwnPropertyNames($).forEach(function(V){this.append(V,$[V])},this)}b.prototype.append=function($,V){$=p($),V=m(V);var J=this.map[$];this.map[$]=J?J+", "+V:V},b.prototype.delete=function($){delete this.map[p($)]},b.prototype.get=function($){return $=p($),this.has($)?this.map[$]:null},b.prototype.has=function($){return this.map.hasOwnProperty(p($))},b.prototype.set=function($,V){this.map[p($)]=m(V)},b.prototype.forEach=function($,V){for(var J in this.map)this.map.hasOwnProperty(J)&&$.call(V,this.map[J],J,this)},b.prototype.keys=function(){var $=[];return this.forEach(function(V,J){$.push(J)}),v($)},b.prototype.values=function(){var $=[];return this.forEach(function(V){$.push(V)}),v($)},b.prototype.entries=function(){var $=[];return this.forEach(function(V,J){$.push([J,V])}),v($)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function x($){if($.bodyUsed)return Promise.reject(new TypeError("Already read"));$.bodyUsed=!0}function E($){return new Promise(function(V,J){$.onload=function(){V($.result)},$.onerror=function(){J($.error)}})}function k($){var V=new FileReader,J=E(V);return V.readAsArrayBuffer($),J}function _($){var V=new FileReader,J=E(V);return V.readAsText($),J}function T($){for(var V=new Uint8Array($),J=new Array(V.length),Z=0;Z-1?V:$}function B($,V){V=V||{};var J=V.body;if($ instanceof B){if($.bodyUsed)throw new TypeError("Already read");this.url=$.url,this.credentials=$.credentials,V.headers||(this.headers=new b($.headers)),this.method=$.method,this.mode=$.mode,this.signal=$.signal,!J&&$._bodyInit!=null&&(J=$._bodyInit,$.bodyUsed=!0)}else this.url=String($);if(this.credentials=V.credentials||this.credentials||"same-origin",(V.headers||!this.headers)&&(this.headers=new b(V.headers)),this.method=D(V.method||this.method||"GET"),this.mode=V.mode||this.mode||null,this.signal=V.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&J)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(J)}B.prototype.clone=function(){return new B(this,{body:this._bodyInit})};function z($){var V=new FormData;return $.trim().split("&").forEach(function(J){if(J){var Z=J.split("="),U=Z.shift().replace(/\+/g," "),X=Z.join("=").replace(/\+/g," ");V.append(decodeURIComponent(U),decodeURIComponent(X))}}),V}function j($){var V=new b,J=$.replace(/\r?\n[\t ]+/g," ");return J.split(/\r?\n/).forEach(function(Z){var U=Z.split(":"),X=U.shift().trim();if(X){var le=U.join(":").trim();V.append(X,le)}}),V}R.call(B.prototype);function Y($,V){V||(V={}),this.type="default",this.status=V.status===void 0?200:V.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in V?V.statusText:"OK",this.headers=new b(V.headers),this.url=V.url||"",this._initBody($)}R.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},Y.error=function(){var $=new Y(null,{status:0,statusText:""});return $.type="error",$};var te=[301,302,303,307,308];Y.redirect=function($,V){if(te.indexOf(V)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:V,headers:{location:$}})},a.DOMException=o.DOMException;try{new a.DOMException}catch($){a.DOMException=function(V,J){this.message=V,this.name=J;var Z=Error(V);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function G($,V){return new Promise(function(J,Z){var U=new B($,V);if(U.signal&&U.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var X=new XMLHttpRequest;function le(){X.abort()}X.onload=function(){var fe={status:X.status,statusText:X.statusText,headers:j(X.getAllResponseHeaders()||"")};fe.url="responseURL"in X?X.responseURL:fe.headers.get("X-Request-URL");var Se="response"in X?X.response:X.responseText;J(new Y(Se,fe))},X.onerror=function(){Z(new TypeError("Network request failed"))},X.ontimeout=function(){Z(new TypeError("Network request failed"))},X.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},X.open(U.method,U.url,!0),U.credentials==="include"?X.withCredentials=!0:U.credentials==="omit"&&(X.withCredentials=!1),"responseType"in X&&s.blob&&(X.responseType="blob"),U.headers.forEach(function(fe,Se){X.setRequestHeader(Se,fe)}),U.signal&&(U.signal.addEventListener("abort",le),X.onreadystatechange=function(){X.readyState===4&&U.signal.removeEventListener("abort",le)}),X.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return G.polyfill=!0,o.fetch||(o.fetch=G,o.Headers=b,o.Request=B,o.Response=Y),a.Headers=b,a.Request=B,a.Response=Y,a.fetch=G,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(yb,yb.exports)),yb.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof xo<"u"&&xo.fetch?n=xo.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof _xe<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||kxe();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(F5,F5.exports);const qU=F5.exports,KR=qN({__proto__:null,default:qU},[F5.exports]);function z5(e){return z5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z5(e)}var ec;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?ec=global.fetch:typeof window<"u"&&window.fetch?ec=window.fetch:ec=fetch);var K2;GU()&&(typeof global<"u"&&global.XMLHttpRequest?K2=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(K2=window.XMLHttpRequest));var j5;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?j5=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(j5=window.ActiveXObject));!ec&&KR&&!K2&&!j5&&(ec=qU||KR);typeof ec!="function"&&(ec=void 0);var e8=function(t,n){if(n&&z5(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},XR=function(t,n,r){ec(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},ZR=!1,Exe=function(t,n,r,i){t.queryStringParams&&(n=e8(n,t.queryStringParams));var o=J9({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=J9({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},ZR?{}:a);try{XR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),XR(n,s,i),ZR=!0}catch(u){i(u)}}},Pxe=function(t,n,r,i){r&&z5(r)==="object"&&(r=e8("",r).slice(1)),t.queryStringParams&&(n=e8(n,t.queryStringParams));try{var o;K2?o=new K2:o=new j5("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},Txe=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},ec&&n.indexOf("file:")!==0)return Exe(t,n,r,i);if(GU()||typeof ActiveXObject=="function")return Pxe(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function X2(e){return X2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X2(e)}function Lxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Lxe(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Axe(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=J9(i,this.options||{},Rxe()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=Cxe(l),l.then(function(u){if(!u)return a(null,{});var f=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(f,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,f;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch(p){f="failed parsing "+n+" to json"}if(f)return r(f,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,f=[],p=[];n.forEach(function(m){var v=s.options.addPath;typeof s.options.addPath=="function"&&(v=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(v,{lng:m,ns:r});s.options.request(s.options,b,l,function(x,E){u+=1,f.push(x),p.push(E),u===n.length&&a&&a(f,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(p){var m=o.toResolveHierarchy(p);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(f){return u(f)}),l.forEach(function(f){n.allOptions.ns.forEach(function(p){i.read(f,p,"read",null,null,function(m,v){m&&a.warn("loading namespace ".concat(p," for language ").concat(f," failed"),m),!m&&v&&a.log("loaded namespace ".concat(p," for language ").concat(f),v),i.loaded("".concat(f,"|").concat(p),m,v)})})})}}}]),e}();KU.type="backend";function Z2(e){return Z2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z2(e)}function Ixe(e,t){if(Z2(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Z2(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XU(e){var t=Ixe(e,"string");return Z2(t)==="symbol"?t:String(t)}function ZU(e,t,n){return t=XU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dxe(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var f=t.services.backendConnector.state["".concat(l,"|").concat(u)];return f===-1||f===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function Bxe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return t8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Nxe(e,t,n)}var $xe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Fxe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},zxe=function(t){return Fxe[t]},jxe=function(t){return t.replace($xe,zxe)};function tI(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 nI(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};n8=nI(nI({},n8),e)}function Vxe(){return n8}var QU;function Uxe(e){QU=e}function Wxe(){return QU}function Gxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=C.exports.useContext(Kxe)||{},i=r.i18n,o=r.defaultNS,a=n||i||Wxe();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Xxe),!a){t8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&t8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=cC(cC(cC({},Vxe()),a.options.react),t),f=u.useSuspense,p=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var v=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(B){return Bxe(B,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],p)}var x=C.exports.useState(b),E=twe(x,2),k=E[0],_=E[1],T=m.join(),A=nwe(T),R=C.exports.useRef(!0);C.exports.useEffect(function(){var B=u.bindI18n,z=u.bindI18nStore;R.current=!0,!v&&!f&&eI(a,m,function(){R.current&&_(b)}),v&&A&&A!==T&&R.current&&_(b);function j(){R.current&&_(b)}return B&&a&&a.on(B,j),z&&a&&a.store.on(z,j),function(){R.current=!1,B&&a&&B.split(" ").forEach(function(Y){return a.off(Y,j)}),z&&a&&z.split(" ").forEach(function(Y){return a.store.off(Y,j)})}},[a,T]);var I=C.exports.useRef(!0);C.exports.useEffect(function(){R.current&&!I.current&&_(b),I.current=!1},[a,p]);var D=[k,a,v];if(D.t=k,D.i18n=a,D.ready=v,v||!v&&!f)return D;throw new Promise(function(B){eI(a,m,function(){B()})})}Ht.use(KU).use(UU).use(Yxe).init({fallbackLng:"en",debug:!1,ns:["common","options","unifiedcanvas","gallery","toast","hotkeys","settings","modelmanager"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const rwe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Ht.isInitialized?Ht.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},JU=gx({name:"system",initialState:rwe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=Ht.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?Ht.t("common:statusConnected"):Ht.t("common:statusDisconnected")},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=Ht.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Ht.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=Ht.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:iwe,setIsProcessing:Ws,addLogEntry:eo,setShouldShowLogViewer:dC,setIsConnected:aI,setSocketId:Aze,setShouldConfirmOnDelete:eW,setOpenAccordions:owe,setSystemStatus:awe,setCurrentStatus:_4,setSystemConfig:swe,setShouldDisplayGuides:lwe,processingCanceled:uwe,errorOccurred:sI,errorSeen:tW,setModelList:bb,setIsCancelable:sg,modelChangeRequested:cwe,setSaveIntermediatesInterval:dwe,setEnableImageDebugging:fwe,generationRequested:hwe,addToast:Rh,clearToastQueue:pwe,setProcessingIndeterminateTask:gwe,setSearchFolder:nW,setFoundModels:rW,setOpenModel:lI}=JU.actions,mwe=JU.reducer,Od=(e,t)=>Math.floor(e/t)*t,Xl=(e,t)=>Math.round(e/t)*t,M0=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},R0=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},vwe=.999,ywe=.1,bwe=20,iv=.95,uI=30,r8=10,cI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),ch=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Xl(s/o,64)):o<1&&(r.height=s,r.width=Xl(s*o,64)),a=r.width*r.height;return r},Swe=e=>({width:Xl(e.width,64),height:Xl(e.height,64)}),iW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],xwe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],WE=e=>e.kind==="line"&&e.layer==="mask",wwe=e=>e.kind==="line"&&e.layer==="base",H5=e=>e.kind==="image"&&e.layer==="base",Cwe=e=>e.kind==="fillRect"&&e.layer==="base",_we=e=>e.kind==="eraseRect"&&e.layer==="base",kwe=e=>e.kind==="line",Cv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Ewe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Cv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},oW=gx({name:"canvas",initialState:Ewe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!WE(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Od(He.clamp(n.width,64,512),64),height:Od(He.clamp(n.height,64,512),64)},o={x:Xl(n.width/2-i.width/2,64),y:Xl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=ch(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState={...Cv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=R0(r.width,r.height,n.width,n.height,iv),s=M0(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Swe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=ch(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=cI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Cv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(kwe);!n||n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();!t||(e.futureLayerStates.unshift(He.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();!t||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState=Cv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(H5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const f=R0(i.width,i.height,512,512,iv),p=M0(i.width,i.height,0,0,512,512,f),m={width:512,height:512};if(e.stageScale=f,e.stageCoordinates=p,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=ch(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=R0(t,n,o,a,.95),u=M0(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=cI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(H5)){const i=R0(r.width,r.height,512,512,iv),o=M0(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=ch(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:i}}=e,{x:o,y:a,width:s,height:l}=n;if(s!==0&&l!==0){const u=R0(r,i,s,l,iv),f=M0(r,i,o,a,s,l,u);e.stageScale=u,e.stageCoordinates=f}else{const u=R0(r,i,512,512,iv),f=M0(r,i,0,0,512,512,u),p={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=f,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=p,e.boundingBoxScaleMethod==="auto"){const m=ch(p);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Cv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Od(He.clamp(o,64,512),64),height:Od(He.clamp(a,64,512),64)},l={x:Xl(o/2-s.width/2,64),y:Xl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=ch(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=ch(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:aW,addFillRect:sW,addImageToStagingArea:Pwe,addLine:Twe,addPointToCurrentLine:lW,clearCanvasHistory:uW,clearMask:GE,commitColorPickerColor:Lwe,commitStagingAreaImage:Awe,discardStagedImages:Owe,fitBoundingBoxToStage:Oze,mouseLeftCanvas:Mwe,nextStagingAreaImage:Rwe,prevStagingAreaImage:Iwe,redo:Dwe,resetCanvas:qE,resetCanvasInteractionState:Nwe,resetCanvasView:cW,resizeAndScaleCanvas:bx,resizeCanvas:Bwe,setBoundingBoxCoordinates:fC,setBoundingBoxDimensions:_v,setBoundingBoxPreviewFill:Mze,setBoundingBoxScaleMethod:$we,setBrushColor:Ng,setBrushSize:Bg,setCanvasContainerDimensions:Fwe,setColorPickerColor:zwe,setCursorPosition:jwe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Sx,setInpaintReplace:dI,setIsDrawing:dW,setIsMaskEnabled:Oy,setIsMouseOverBoundingBox:Sb,setIsMoveBoundingBoxKeyHeld:Rze,setIsMoveStageKeyHeld:Ize,setIsMovingBoundingBox:hC,setIsMovingStage:V5,setIsTransformingBoundingBox:pC,setLayer:U5,setMaskColor:fW,setMergedCanvas:Hwe,setShouldAutoSave:hW,setShouldCropToBoundingBoxOnSave:pW,setShouldDarkenOutsideBoundingBox:gW,setShouldLockBoundingBox:Dze,setShouldPreserveMaskedArea:mW,setShouldShowBoundingBox:Vwe,setShouldShowBrush:Nze,setShouldShowBrushPreview:Bze,setShouldShowCanvasDebugInfo:vW,setShouldShowCheckboardTransparency:$ze,setShouldShowGrid:yW,setShouldShowIntermediates:bW,setShouldShowStagingImage:Uwe,setShouldShowStagingOutline:fI,setShouldSnapToGrid:W5,setShouldUseInpaintReplace:Wwe,setStageCoordinates:SW,setStageScale:Gwe,setTool:iu,toggleShouldLockBoundingBox:Fze,toggleTool:zze,undo:qwe,setScaledBoundingBoxDimensions:xb,setShouldRestrictStrokesToBox:xW}=oW.actions,Ywe=oW.reducer,du=Object.create(null);du.open="0";du.close="1";du.ping="2";du.pong="3";du.message="4";du.upgrade="5";du.noop="6";const k4=Object.create(null);Object.keys(du).forEach(e=>{k4[du[e]]=e});const Kwe={type:"error",data:"parser error"},Xwe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Zwe=typeof ArrayBuffer=="function",Qwe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,wW=({type:e,data:t},n,r)=>Xwe&&t instanceof Blob?n?r(t):hI(t,r):Zwe&&(t instanceof ArrayBuffer||Qwe(t))?n?r(t):hI(new Blob([t]),r):r(du[e]+(t||"")),hI=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},pI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kv=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 u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r>4,f[i++]=(a&15)<<4|s>>2,f[i++]=(s&3)<<6|l&63;return u},e6e=typeof ArrayBuffer=="function",CW=(e,t)=>{if(typeof e!="string")return{type:"message",data:_W(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:t6e(e.substring(1),t)}:k4[n]?e.length>1?{type:k4[n],data:e.substring(1)}:{type:k4[n]}:Kwe},t6e=(e,t)=>{if(e6e){const n=Jwe(e);return _W(n,t)}else return{base64:!0,data:e}},_W=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},kW=String.fromCharCode(30),n6e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{wW(o,!1,s=>{r[a]=s,++i===n&&t(r.join(kW))})})},r6e=(e,t)=>{const n=e.split(kW),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function PW(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const o6e=setTimeout,a6e=clearTimeout;function xx(e,t){t.useNativeTimers?(e.setTimeoutFn=o6e.bind(Md),e.clearTimeoutFn=a6e.bind(Md)):(e.setTimeoutFn=setTimeout.bind(Md),e.clearTimeoutFn=clearTimeout.bind(Md))}const s6e=1.33;function l6e(e){return typeof e=="string"?u6e(e):Math.ceil((e.byteLength||e.size)*s6e)}function u6e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class c6e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class TW extends oi{constructor(t){super(),this.writable=!1,xx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new c6e(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=CW(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const LW="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i8=64,d6e={};let gI=0,wb=0,mI;function vI(e){let t="";do t=LW[e%i8]+t,e=Math.floor(e/i8);while(e>0);return t}function AW(){const e=vI(+new Date);return e!==mI?(gI=0,mI=e):e+"."+vI(gI++)}for(;wb{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)};r6e(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,n6e(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]=AW()),!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=OW(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 ou(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 ou extends oi{constructor(t,n){super(),xx(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=PW(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 RW(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(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"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=ou.requestsCount++,ou.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=p6e,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete ou.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()}}ou.requestsCount=0;ou.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",yI);else if(typeof addEventListener=="function"){const e="onpagehide"in Md?"pagehide":"unload";addEventListener(e,yI,!1)}}function yI(){for(let e in ou.requests)ou.requests.hasOwnProperty(e)&&ou.requests[e].abort()}const IW=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Cb=Md.WebSocket||Md.MozWebSocket,bI=!0,v6e="arraybuffer",SI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class y6e extends TW{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=SI?{}:PW(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=bI&&!SI?n?new Cb(t,n):new Cb(t):new Cb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||v6e,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{bI&&this.ws.send(o)}catch(s){}i&&IW(()=>{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]=AW()),this.supportsBinary||(t.b64=1);const i=OW(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!!Cb}}const b6e={websocket:y6e,polling:m6e},S6e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,x6e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function o8(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=S6e.exec(e||""),o={},a=14;for(;a--;)o[x6e[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=w6e(o,o.path),o.queryKey=C6e(o,o.query),o}function w6e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function C6e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class kd extends oi{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=o8(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=o8(n.host).host),xx(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=f6e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=EW,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 b6e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&kd.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(n){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;kd.priorWebsocketSuccess=!1;const i=()=>{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;kd.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 o(){r||(r=!0,f(),n.close(),n=null)}const a=p=>{const m=new Error("probe error: "+p);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(p){n&&p.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",kd.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){kd.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,DW=Object.prototype.toString,P6e=typeof Blob=="function"||typeof Blob<"u"&&DW.call(Blob)==="[object BlobConstructor]",T6e=typeof File=="function"||typeof File<"u"&&DW.call(File)==="[object FileConstructor]";function YE(e){return k6e&&(e instanceof ArrayBuffer||E6e(e))||P6e&&e instanceof Blob||T6e&&e instanceof File}function E4(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 dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class R6e{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=A6e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const I6e=Object.freeze(Object.defineProperty({__proto__:null,protocol:O6e,get PacketType(){return dn},Encoder:M6e,Decoder:KE},Symbol.toStringTag,{value:"Module"}));function js(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const D6e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class NW extends oi{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=[js(t,"open",this.onopen.bind(this)),js(t,"packet",this.onpacket.bind(this)),js(t,"error",this.onerror.bind(this)),js(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(D6e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.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:dn.CONNECT,data:t})}):this.packet({type:dn.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 dn.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 dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.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:dn.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:dn.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}_1.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};_1.prototype.reset=function(){this.attempts=0};_1.prototype.setMin=function(e){this.ms=e};_1.prototype.setMax=function(e){this.max=e};_1.prototype.setJitter=function(e){this.jitter=e};class l8 extends oi{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,xx(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 _1({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||I6e;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 kd(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=js(n,"open",function(){r.onopen(),t&&t()}),o=js(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(js(t,"ping",this.onping.bind(this)),js(t,"data",this.ondata.bind(this)),js(t,"error",this.onerror.bind(this)),js(t,"close",this.onclose.bind(this)),js(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){IW(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new NW(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 ov={};function P4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=_6e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=ov[i]&&o in ov[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new l8(r,t):(ov[i]||(ov[i]=new l8(r,t)),l=ov[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(P4,{Manager:l8,Socket:NW,io:P4,connect:P4});let _b;const N6e=new Uint8Array(16);function B6e(){if(!_b&&(_b=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_b))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _b(N6e)}const zi=[];for(let e=0;e<256;++e)zi.push((e+256).toString(16).slice(1));function $6e(e,t=0){return(zi[e[t+0]]+zi[e[t+1]]+zi[e[t+2]]+zi[e[t+3]]+"-"+zi[e[t+4]]+zi[e[t+5]]+"-"+zi[e[t+6]]+zi[e[t+7]]+"-"+zi[e[t+8]]+zi[e[t+9]]+"-"+zi[e[t+10]]+zi[e[t+11]]+zi[e[t+12]]+zi[e[t+13]]+zi[e[t+14]]+zi[e[t+15]]).toLowerCase()}const F6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xI={randomUUID:F6e};function lg(e,t,n){if(xI.randomUUID&&!t&&!e)return xI.randomUUID();e=e||{};const r=e.random||(e.rng||B6e)();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 $6e(r)}var z6e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,j6e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,H6e=/[^-+\dA-Z]/g;function to(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(wI[t]||t||wI.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"]()},u=function(){return e[o()+"FullYear"]()},f=function(){return e[o()+"Hours"]()},p=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},x=function(){return V6e(e)},E=function(){return U6e(e)},k={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Ho.dayNames[s()]},DDD:function(){return CI({y:u(),m:l(),d:a(),_:o(),dayName:Ho.dayNames[s()],short:!0})},dddd:function(){return Ho.dayNames[s()+7]},DDDD:function(){return CI({y:u(),m:l(),d:a(),_:o(),dayName:Ho.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Ho.monthNames[l()]},mmmm:function(){return Ho.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return f()%12||12},hh:function(){return Ca(f()%12||12)},H:function(){return f()},HH:function(){return Ca(f())},M:function(){return p()},MM:function(){return Ca(p())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(v(),3)},L:function(){return Ca(Math.floor(v()/10))},t:function(){return f()<12?Ho.timeNames[0]:Ho.timeNames[1]},tt:function(){return f()<12?Ho.timeNames[2]:Ho.timeNames[3]},T:function(){return f()<12?Ho.timeNames[4]:Ho.timeNames[5]},TT:function(){return f()<12?Ho.timeNames[6]:Ho.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W6e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return x()},WW:function(){return Ca(x())},N:function(){return E()}};return t.replace(z6e,function(_){return _ in k?k[_]():_.slice(1,_.length-1)})}var wI={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"},Ho={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")},CI=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,u=new Date,f=new Date;f.setDate(f[o+"Date"]()-1);var p=new Date;p.setDate(p[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},x=function(){return f[o+"Date"]()},E=function(){return f[o+"Month"]()},k=function(){return f[o+"FullYear"]()},_=function(){return p[o+"Date"]()},T=function(){return p[o+"Month"]()},A=function(){return p[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":k()===n&&E()===r&&x()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},V6e=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)},U6e=function(t){var n=t.getDay();return n===0&&(n=7),n},W6e=function(t){return(String(t).match(j6e)||[""]).pop().replace(H6e,"").replace(/GMT\+0000/g,"UTC")};const u8=Nr("socketio/generateImage"),G6e=Nr("socketio/runESRGAN"),q6e=Nr("socketio/runFacetool"),Y6e=Nr("socketio/deleteImage"),c8=Nr("socketio/requestImages"),_I=Nr("socketio/requestNewImages"),K6e=Nr("socketio/cancelProcessing"),X6e=Nr("socketio/requestSystemConfig"),kI=Nr("socketio/searchForModels"),XE=Nr("socketio/addNewModel"),Z6e=Nr("socketio/deleteModel"),BW=Nr("socketio/requestModelChange"),Q6e=Nr("socketio/saveStagingAreaImageToGallery"),J6e=Nr("socketio/requestEmptyTempFolder"),eCe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(aI(!0)),t(_4(Ht.t("common:statusConnected"))),t(X6e());const r=n().gallery;r.categories.result.latest_mtime?t(_I("result")):t(c8("result")),r.categories.user.latest_mtime?t(_I("user")):t(c8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(aI(!1)),t(_4(Ht.t("common:statusDisconnected"))),t(eo({timestamp:to(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{shouldLoopback:o,activeTab:a}=i.options,{boundingBox:s,generationMode:l,...u}=r,f={uuid:lg(),...u};if(["txt2img","img2img"].includes(l)&&t(ag({category:"result",image:{...f,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:p}=r;t(Pwe({image:{...f,category:"temp"},boundingBox:p})),i.canvas.shouldAutoSave&&t(ag({image:{...f,category:"result"},category:"result"}))}if(o)switch(zE[a]){case"img2img":{t(C1(f));break}}t(lC()),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(gSe({uuid:lg(),...r,category:"result"})),r.isBase64||t(eo({timestamp:to(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(ag({category:"result",image:{uuid:lg(),...r,category:"result"}})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Ws(!0)),t(awe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(eo({timestamp:to(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(sI()),t(lC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:lg(),...l}));t(pSe({images:s,areMoreImagesAvailable:o,category:a})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(uwe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(ag({category:"result",image:r})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(lC())),t(eo({timestamp:to(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(BU(r));const{initialImage:o,maskPath:a}=n().options;(o===i||(o==null?void 0:o.url)===i)&&t(xU()),a===i&&t(EU("")),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(swe(r)),r.infill_methods.includes("patchmatch")||t(kU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(nW(i)),t(rW(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(bb(o)),t(Ws(!1)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Rh({title:a?`${Ht.t("modelmanager:modelUpdated")}: ${i}`:`${Ht.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(bb(o)),t(Ws(!1)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`${Ht.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Rh({title:`${Ht.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(bb(o)),t(_4(Ht.t("common:statusModelChanged"))),t(Ws(!1)),t(sg(!0)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(bb(o)),t(Ws(!1)),t(sg(!0)),t(sI()),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Rh({title:Ht.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},tCe=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],nCe=[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],rCe=[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],iCe=[{key:"2x",value:2},{key:"4x",value:4}],ZE=0,QE=4294967295,oCe=["gfpgan","codeformer"],aCe=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],$W=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var sCe=Math.PI/180;function lCe(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const $g=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:$g,version:"8.3.14",isBrowser:lCe(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*sCe: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 gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:$g.document,_injectGlobal(e){$g.Konva=e}},Cr=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{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 Ea(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 u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var f=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/f):-Math.acos(r/f)),l.scaleX=s/f,l.scaleY=f,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=he._getRotation(l.rotation),l}}var uCe="[object Array]",cCe="[object Number]",dCe="[object String]",fCe="[object Boolean]",hCe=Math.PI/180,pCe=180/Math.PI,gC="#",gCe="",mCe="0",vCe="Konva warning: ",EI="Konva error: ",yCe="rgb(",mC={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]},bCe=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,kb=[];const SCe=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},he={_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)===uCe},_isNumber(e){return Object.prototype.toString.call(e)===cCe&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===dCe},_isBoolean(e){return Object.prototype.toString.call(e)===fCe},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){kb.push(e),kb.length===1&&SCe(function(){const t=kb;kb=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(t){}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=he.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(gC,gCe);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=mCe+e;return gC+e},getRGB(e){var t;return e in mC?(t=mC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===gC?this._hexToRgb(e.substring(1)):e.substr(0,4)===yCe?(t=bCe.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",he._namedColorToRBA(e)||he._hex3ColorToRGBA(e)||he._hex6ColorToRGBA(e)||he._rgbColorToRGBA(e)||he._rgbaColorToRGBA(e)||he._hslColorToRGBA(e)},_namedColorToRBA(e){var t=mC[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 u=2*o-a,f=[0,0,0];for(let p=0;p<3;p++)s=r+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,f[p]=l*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[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+f*(n-e),s=t+f*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=he.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=he._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],f=l[1],p=l[2];pt.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function gf(e){return he._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||he._isBoolean(e)?e:Object.prototype.toString.call(e)}function FW(e){return e>255?255:e<0?0:Math.round(e)}function Ge(){if(gt.isUnminified)return function(e,t){return he._isNumber(e)||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function zW(e){if(gt.isUnminified)return function(t,n){let r=he._isNumber(t),i=he._isArray(t)&&t.length==e;return!r&&!i&&he.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function JE(){if(gt.isUnminified)return function(e,t){var n=he._isNumber(e),r=e==="auto";return n||r||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function k1(){if(gt.isUnminified)return function(e,t){return he._isString(e)||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function jW(){if(gt.isUnminified)return function(e,t){const n=he._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function xCe(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(he._isArray(e)?e.forEach(function(r){he._isNumber(r)||he.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function wCe(e){if(gt.isUnminified)return function(t,n){return t==null||he.isObject(t)||he.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var av="get",sv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=av+he._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=sv+he._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=sv+he._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=he._capitalize,s=av+a(t),l=sv+a(t),u,f;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(x),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=he._capitalize(t),r=sv+n,i=av+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){he.error("Adding deprecated "+t);var i=av+he._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){he.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){he.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){he.each(t,function(n,r){var i=e.prototype[r],o=av+he._capitalize(n),a=sv+he._capitalize(n);function s(){i.apply(this,arguments),he.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 CCe(e){var t=[],n=e.length,r=he,i,o;for(i=0;itypeof f=="number"?Math.floor(f):f)),o+=_Ce+u.join(PI)+kCe)):(o+=s.property,t||(o+=ACe+s.val)),o+=TCe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=MCe&&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,u){var f=arguments,p=this._context;f.length===3?p.drawImage(t,n,r):f.length===5?p.drawImage(t,n,r,i,o):f.length===9&&p.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){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=TI.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=CCe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return yn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];yn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=he._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.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=[];yn._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")&&(yn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){yn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&yn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",yn._endDragBefore,!0),window.addEventListener("touchend",yn._endDragBefore,!0),window.addEventListener("mousemove",yn._drag),window.addEventListener("touchmove",yn._drag),window.addEventListener("mouseup",yn._endDragAfter,!1),window.addEventListener("touchend",yn._endDragAfter,!1));var T4="absoluteOpacity",Pb="allEventListeners",Uu="absoluteTransform",LI="absoluteScale",dh="canvas",NCe="Change",BCe="children",$Ce="konva",d8="listening",AI="mouseenter",OI="mouseleave",MI="set",RI="Shape",L4=" ",II="stage",md="transform",FCe="Stage",f8="visible",zCe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(L4);let jCe=1;class qe{constructor(t){this._id=jCe++,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===md||t===Uu)&&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===md||t===Uu,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(L4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(dh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Uu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(dh)){const{scene:t,filter:n,hit:r}=this._cache.get(dh);he.releaseCanvas(t,n,r),this._cache.delete(dh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,f=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!o){he.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Fg({pixelRatio:a,width:i,height:o}),v=new Fg({pixelRatio:a,width:0,height:0}),b=new eP({pixelRatio:p,width:i,height:o}),x=m.getContext(),E=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(dh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),x.save(),E.save(),x.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(T4),this._clearSelfAndDescendantCache(LI),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),E.restore(),f&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),this._cache.set(dh,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(dh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var f=l.point(u);i===void 0&&(i=a=f.x,o=s=f.y),i=Math.min(i,f.x),o=Math.min(o,f.y),a=Math.max(a,f.x),s=Math.max(s,f.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var f=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()/f,r.getHeight()/f),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==BCe&&(r=MI+he._capitalize(n),he._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(d8,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(f8,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;yn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==FCe&&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(md),this._clearSelfAndDescendantCache(Uu)),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 Ea,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(md);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(md),this._clearSelfAndDescendantCache(Uu),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 he.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 he.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&he.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(T4,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=he.isObject(i)&&!he._isPlainObject(i)&&!he._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(),he._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==null?void 0:t.callback;i&&delete t.callback,he._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.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;yn._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=yn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&yn._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 he.haveIntersection(r,this.getClientRect())}static create(t,n){return he._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=qe.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(he.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[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=qe.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=qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const f=r===this;if(u){o.save();var p=this.getAbsoluteTransform(r),m=p.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 v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=p.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var x=!f&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),x&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},f=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(!!x.visible()){var E=x.getClientRect({relativeTo:f,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 p=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",I0=e=>{const t=Lv(e);if(t==="pointer")return gt.pointerEventsEnabled&&yC.pointer;if(t==="touch")return yC.touch;if(t==="mouse")return yC.mouse};function NI(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&he.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const YCe="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);",A4=[];class _x extends Oa{constructor(t){super(NI(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),A4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{NI(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||he.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===VCe){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&&A4.splice(n,1),he.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(he.warn(YCe),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 Fg({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+DI,this.content.style.height=n+DI),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;rGCe&&he.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(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return VW(t,this)}setPointerCapture(t){UW(t,this)}releaseCapture(t){n2(t)}getLayers(){return this.children}_bindContentEvents(){!gt.isBrowser||qCe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=I0(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=I0(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=I0(t.type),r=Lv(t.type);if(!!n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!yn.isDragging||gt.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=I0(t.type),r=Lv(t.type);if(!!n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(yn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.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=I0(t.type),r=Lv(t.type);if(!n)return;yn.isDragging&&yn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!yn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=vC(l.id)||this.getIntersection(l),f=l.id,p={evt:t,pointerId:f};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},p),u),s._fireAndBubble(n.pointerleave,Object.assign({},p),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},p),s),u._fireAndBubble(n.pointerenter,Object.assign({},p),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},p))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:f}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=I0(t.type),r=Lv(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 u=vC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const f=l.id,p={evt:t,pointerId:f};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):yn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},p)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},p)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},p)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:f}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:f}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+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(h8,{evt:t}):this._fire(h8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(p8,{evt:t}):this._fire(p8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=vC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(ug,tP(t)),n2(t.pointerId)}_lostpointercapture(t){n2(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:he._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:he._getFirstPointerId(t)}])}_setPointerPosition(t){he.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 Fg({width:this.width(),height:this.height()}),this.bufferHitCanvas=new eP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.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 he.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}}_x.prototype.nodeType=HCe;Cr(_x);ee.addGetterSetter(_x,"container");var tG="hasShadow",nG="shadowRGBA",rG="patternImage",iG="linearGradient",oG="radialGradient";let Mb;function bC(){return Mb||(Mb=he.createCanvasElement().getContext("2d"),Mb)}const r2={};function KCe(e){e.fill()}function XCe(e){e.stroke()}function ZCe(e){e.fill()}function QCe(e){e.stroke()}function JCe(){this._clearCache(tG)}function e7e(){this._clearCache(nG)}function t7e(){this._clearCache(rG)}function n7e(){this._clearCache(iG)}function r7e(){this._clearCache(oG)}class $e extends qe{constructor(t){super(t);let n;for(;n=he.getRandomColor(),!(n&&!(n in r2)););this.colorKey=n,r2[n]=this}getContext(){return he.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return he.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(tG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(rG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=bC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.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(iG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=bC(),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 qe.prototype.destroy.call(this),delete r2[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){he.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,u=!t.skipShadow&&this.hasShadow(),f=u?this.shadowOffsetX():0,p=u?this.shadowOffsetY():0,m=s+Math.abs(f),v=l+Math.abs(p),b=u&&this.shadowBlur()||0,x=m+b*2,E=v+b*2,k={width:x,height:E,x:-(a/2+b)+Math.min(f,0)+i.x,y:-(a/2+b)+Math.min(p,0)+i.y};return n?k:this._transformedRect(k,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,f,p,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),f=u.bufferCanvas,p=f.getContext(),p.clear(),p.save(),p._applyLineJoin(this);var x=this.getAbsoluteTransform(n).getMatrix();p.transform(x[0],x[1],x[2],x[3],x[4],x[5]),s.call(this,p,this),p.restore();var E=f.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(f._canvas,0,0,f.width/E,f.height/E)}else{if(o._applyLineJoin(this),!v){var x=this.getAbsoluteTransform(n).getMatrix();o.transform(x[0],x[1],x[2],x[3],x[4],x[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(),u=l&&l.hit;if(this.colorKey||he.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()"),u){a.save();var f=this.getAbsoluteTransform(n).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[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,u,f,p,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,f=u.length,p=he._hexToRgb(this.colorKey),m=0;mt?(u[m]=p.r,u[m+1]=p.g,u[m+2]=p.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){he.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return VW(t,this)}setPointerCapture(t){UW(t,this)}releaseCapture(t){n2(t)}}$e.prototype._fillFunc=KCe;$e.prototype._strokeFunc=XCe;$e.prototype._fillFuncHit=ZCe;$e.prototype._strokeFuncHit=QCe;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Cr($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",JCe);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",e7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",t7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",n7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",r7e);ee.addGetterSetter($e,"stroke",void 0,jW());ee.addGetterSetter($e,"strokeWidth",2,Ge());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",JE());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ge());ee.addGetterSetter($e,"shadowColor",void 0,k1());ee.addGetterSetter($e,"shadowBlur",0,Ge());ee.addGetterSetter($e,"shadowOpacity",1,Ge());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ge());ee.addGetterSetter($e,"shadowOffsetY",0,Ge());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,jW());ee.addGetterSetter($e,"fillPatternX",0,Ge());ee.addGetterSetter($e,"fillPatternY",0,Ge());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ge());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ge());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ge());ee.addGetterSetter($e,"fillPatternScaleY",1,Ge());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var i7e="#",o7e="beforeDraw",a7e="draw",aG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],s7e=aG.length;class hp extends Oa{constructor(t){super(t),this.canvas=new Fg,this.hitCanvas=new eP({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(o7e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(a7e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){he.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return he.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return he.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}hp.prototype.nodeType="Layer";Cr(hp);ee.addGetterSetter(hp,"imageSmoothingEnabled",!0);ee.addGetterSetter(hp,"clearBeforeDraw",!0);ee.addGetterSetter(hp,"hitGraphEnabled",!0,il());class nP extends hp{constructor(t){super(t),this.listening(!1),he.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}nP.prototype.nodeType="FastLayer";Cr(nP);class n1 extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&he.throw("You may only add groups and shapes to groups.")}}n1.prototype.nodeType="Group";Cr(n1);var SC=function(){return $g.performance&&$g.performance.now?function(){return $g.performance.now()}:function(){return new Date().getTime()}}();class ns{constructor(t,n){this.id=ns.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:SC(),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=BI,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=$I,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===BI?this.setTime(t):this.state===$I&&this.setTime(this.duration-t)}pause(){this.state=u7e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Wr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||i2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=c7e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||he.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ns(function(){n.tween.onEnterFrame()},u),this.tween=new d7e(l,function(f){n._tweenFunc(f)},a,0,1,o*1e3,s),this._addListeners(),Wr.attrs[i]||(Wr.attrs[i]={}),Wr.attrs[i][this._id]||(Wr.attrs[i][this._id]={}),Wr.tweens[i]||(Wr.tweens[i]={});for(l in t)l7e[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,u,f,p,m;if(s=Wr.tweens[i][t],s&&delete Wr.attrs[i][s][t],o=r.getAttr(t),he._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(p=o,o=he._prepareArrayForTween(o,n,r.closed())):(f=n,n=he._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=Wr.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=Wr.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=Wr.tweens[t],i;this.pause();for(i in r)delete Wr.tweens[t][i];delete Wr.attrs[t][n]}}Wr.attrs={};Wr.tweens={};qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Wr(e);n.play()};const i2={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),f=a*n,p=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:p,width:f-u,height:m-p}}}gc.prototype._centroid=!0;gc.prototype.className="Arc";gc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Cr(gc);ee.addGetterSetter(gc,"innerRadius",0,Ge());ee.addGetterSetter(gc,"outerRadius",0,Ge());ee.addGetterSetter(gc,"angle",0,Ge());ee.addGetterSetter(gc,"clockwise",!1,il());function g8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),f=a*l/(s+l),p=n-u*(i-e),m=r-u*(o-t),v=n+f*(i-e),b=r+f*(o-t);return[p,m,v,b]}function zI(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);uf?u:f,E=u>f?1:u/f,k=u>f?f/u:1;t.translate(s,l),t.rotate(v),t.scale(E,k),t.arc(0,0,x,p,p+m,1-b),t.scale(1/E,1/k),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var f=u.points[4],p=u.points[5],m=u.points[4]+p,v=Math.PI/180;if(Math.abs(f-m)m;b-=v){const x=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(x.x,x.y)}else for(let b=f+v;bthis.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 zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.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 zn.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],u=a[2],f=a[3],p=a[4],m=a[5],v=a[6];return p+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,f,p,v)}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),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,T=[],A=l,R=u,I,D,B,z,j,Y,te,G,$,V;switch(v){case"l":l+=b.shift(),u+=b.shift(),_="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var J=b.shift(),Z=b.shift();if(l+=J,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+J,u=a[U].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),_="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),_="L",T.push(l,u);break;case"H":l=b.shift(),_="L",T.push(l,u);break;case"v":u+=b.shift(),_="L",T.push(l,u);break;case"V":u=b.shift(),_="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"S":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",T.push(l,u);break;case"s":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",T.push(l,u);break;case"T":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l=b.shift(),u=b.shift(),_="Q",T.push(D,B,l,u);break;case"t":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l+=b.shift(),u+=b.shift(),_="Q",T.push(D,B,l,u);break;case"A":z=b.shift(),j=b.shift(),Y=b.shift(),te=b.shift(),G=b.shift(),$=l,V=u,l=b.shift(),u=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,V,l,u,te,G,z,j,Y);break;case"a":z=b.shift(),j=b.shift(),Y=b.shift(),te=b.shift(),G=b.shift(),$=l,V=u,l+=b.shift(),u+=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,V,l,u,te,G,z,j,Y);break}a.push({command:_||v,points:T,start:{x:A,y:R},pathLength:this.calcLength(A,R,_||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var f=i[4],p=i[5],m=i[4]+p,v=Math.PI/180;if(Math.abs(f-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=f+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(p*p))/(s*s*(m*m)+l*l*(p*p)));o===a&&(b*=-1),isNaN(b)&&(b=0);var x=b*s*m/l,E=b*-l*p/s,k=(t+r)/2+Math.cos(f)*x-Math.sin(f)*E,_=(n+i)/2+Math.sin(f)*x+Math.cos(f)*E,T=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},A=function(j,Y){return(j[0]*Y[0]+j[1]*Y[1])/(T(j)*T(Y))},R=function(j,Y){return(j[0]*Y[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[k,_,s,l,I,z,f,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Cr(zn);ee.addGetterSetter(zn,"data");class pp extends mc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var f=(Math.atan2(u,l)+n)%n,p=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(f),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/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}}}pp.prototype.className="Arrow";Cr(pp);ee.addGetterSetter(pp,"pointerLength",10,Ge());ee.addGetterSetter(pp,"pointerWidth",10,Ge());ee.addGetterSetter(pp,"pointerAtBeginning",!1);ee.addGetterSetter(pp,"pointerAtEnding",!0);class E1 extends $e{_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)}}E1.prototype._centroid=!0;E1.prototype.className="Circle";E1.prototype._attrsAffectingSize=["radius"];Cr(E1);ee.addGetterSetter(E1,"radius",0,Ge());class mf extends $e{_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)}}mf.prototype.className="Ellipse";mf.prototype._centroid=!0;mf.prototype._attrsAffectingSize=["radiusX","radiusY"];Cr(mf);ee.addComponentsGetterSetter(mf,"radius",["x","y"]);ee.addGetterSetter(mf,"radiusX",0,Ge());ee.addGetterSetter(mf,"radiusY",0,Ge());class ol extends $e{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=he.createImageElement();i.onload=function(){var o=new ol({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}}ol.prototype.className="Image";Cr(ol);ee.addGetterSetter(ol,"image");ee.addComponentsGetterSetter(ol,"crop",["x","y","width","height"]);ee.addGetterSetter(ol,"cropX",0,Ge());ee.addGetterSetter(ol,"cropY",0,Ge());ee.addGetterSetter(ol,"cropWidth",0,Ge());ee.addGetterSetter(ol,"cropHeight",0,Ge());var sG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],f7e="Change.konva",h7e="none",m8="up",v8="right",y8="down",b8="left",p7e=sG.length;class rP extends n1{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)}}mp.prototype.className="RegularPolygon";mp.prototype._centroid=!0;mp.prototype._attrsAffectingSize=["radius"];Cr(mp);ee.addGetterSetter(mp,"radius",0,Ge());ee.addGetterSetter(mp,"sides",0,Ge());var jI=Math.PI*2;class vp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,jI,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),jI,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)}}vp.prototype.className="Ring";vp.prototype._centroid=!0;vp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Cr(vp);ee.addGetterSetter(vp,"innerRadius",0,Ge());ee.addGetterSetter(vp,"outerRadius",0,Ge());class bu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new ns(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){!this.anim.isRunning()||(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],f=o[i+3],p=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,f),t.closePath(),t.fillStrokeShape(this)),p)if(a){var m=a[n],v=r*2;t.drawImage(p,s,l,u,f,m[v+0],m[v+1],u,f)}else t.drawImage(p,s,l,u,f,0,0,u,f)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],f=r*2;t.rect(u[f+0],u[f+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 Ib;function wC(){return Ib||(Ib=he.createCanvasElement().getContext(v7e),Ib)}function T7e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function L7e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function A7e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class wr extends $e{constructor(t){super(A7e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(k+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=he._isString(t)?t:t==null?"":t+"";return this._setAttr(y7e,n),this}getWidth(){var t=this.attrs.width===D0||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===D0||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return he.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=wC(),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()+Rb+this.fontVariant()+Rb+(this.fontSize()+w7e)+P7e(this.fontFamily())}_addTextLine(t){this.align()===lv&&(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 wC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function twe(e,t){return Zxe(e)||Qxe(e,t)||Jxe(e,t)||ewe()}function oI(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 cC(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=C.exports.useContext(Kxe)||{},i=r.i18n,o=r.defaultNS,a=n||i||Wxe();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Xxe),!a){t8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&t8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=cC(cC(cC({},Vxe()),a.options.react),t),f=u.useSuspense,p=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var v=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(B){return Bxe(B,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],p)}var x=C.exports.useState(b),E=twe(x,2),k=E[0],_=E[1],T=m.join(),A=nwe(T),R=C.exports.useRef(!0);C.exports.useEffect(function(){var B=u.bindI18n,z=u.bindI18nStore;R.current=!0,!v&&!f&&eI(a,m,function(){R.current&&_(b)}),v&&A&&A!==T&&R.current&&_(b);function j(){R.current&&_(b)}return B&&a&&a.on(B,j),z&&a&&a.store.on(z,j),function(){R.current=!1,B&&a&&B.split(" ").forEach(function(Y){return a.off(Y,j)}),z&&a&&z.split(" ").forEach(function(Y){return a.store.off(Y,j)})}},[a,T]);var I=C.exports.useRef(!0);C.exports.useEffect(function(){R.current&&!I.current&&_(b),I.current=!1},[a,p]);var D=[k,a,v];if(D.t=k,D.i18n=a,D.ready=v,v||!v&&!f)return D;throw new Promise(function(B){eI(a,m,function(){B()})})}Ht.use(KU).use(UU).use(Yxe).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","options","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const rwe={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Ht.isInitialized?Ht.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},JU=gx({name:"system",initialState:rwe,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=Ht.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?Ht.t("common:statusConnected"):Ht.t("common:statusDisconnected")},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=Ht.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=Ht.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=Ht.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:iwe,setIsProcessing:Ws,addLogEntry:eo,setShouldShowLogViewer:dC,setIsConnected:aI,setSocketId:Oze,setShouldConfirmOnDelete:eW,setOpenAccordions:owe,setSystemStatus:awe,setCurrentStatus:_4,setSystemConfig:swe,setShouldDisplayGuides:lwe,processingCanceled:uwe,errorOccurred:sI,errorSeen:tW,setModelList:bb,setIsCancelable:sg,modelChangeRequested:cwe,setSaveIntermediatesInterval:dwe,setEnableImageDebugging:fwe,generationRequested:hwe,addToast:Rh,clearToastQueue:pwe,setProcessingIndeterminateTask:gwe,setSearchFolder:nW,setFoundModels:rW,setOpenModel:lI}=JU.actions,mwe=JU.reducer,Od=(e,t)=>Math.floor(e/t)*t,Xl=(e,t)=>Math.round(e/t)*t,M0=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},R0=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},vwe=.999,ywe=.1,bwe=20,iv=.95,uI=30,r8=10,cI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),ch=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Xl(s/o,64)):o<1&&(r.height=s,r.width=Xl(s*o,64)),a=r.width*r.height;return r},Swe=e=>({width:Xl(e.width,64),height:Xl(e.height,64)}),iW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],xwe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],WE=e=>e.kind==="line"&&e.layer==="mask",wwe=e=>e.kind==="line"&&e.layer==="base",H5=e=>e.kind==="image"&&e.layer==="base",Cwe=e=>e.kind==="fillRect"&&e.layer==="base",_we=e=>e.kind==="eraseRect"&&e.layer==="base",kwe=e=>e.kind==="line",Cv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},Ewe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Cv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},oW=gx({name:"canvas",initialState:Ewe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!WE(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Od(He.clamp(n.width,64,512),64),height:Od(He.clamp(n.height,64,512),64)},o={x:Xl(n.width/2-i.width/2,64),y:Xl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=ch(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState={...Cv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=R0(r.width,r.height,n.width,n.height,iv),s=M0(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Swe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=ch(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=cI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Cv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(kwe);!n||n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();!t||(e.futureLayerStates.unshift(He.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();!t||(e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.layerState=Cv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(H5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const f=R0(i.width,i.height,512,512,iv),p=M0(i.width,i.height,0,0,512,512,f),m={width:512,height:512};if(e.stageScale=f,e.stageCoordinates=p,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=ch(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=R0(t,n,o,a,.95),u=M0(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=cI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(H5)){const i=R0(r.width,r.height,512,512,iv),o=M0(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=ch(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:i}}=e,{x:o,y:a,width:s,height:l}=n;if(s!==0&&l!==0){const u=R0(r,i,s,l,iv),f=M0(r,i,o,a,s,l,u);e.stageScale=u,e.stageCoordinates=f}else{const u=R0(r,i,512,512,iv),f=M0(r,i,0,0,512,512,u),p={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=f,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=p,e.boundingBoxScaleMethod==="auto"){const m=ch(p);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...Cv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Od(He.clamp(o,64,512),64),height:Od(He.clamp(a,64,512),64)},l={x:Xl(o/2-s.width/2,64),y:Xl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=ch(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=ch(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(He.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:aW,addFillRect:sW,addImageToStagingArea:Pwe,addLine:Twe,addPointToCurrentLine:lW,clearCanvasHistory:uW,clearMask:GE,commitColorPickerColor:Lwe,commitStagingAreaImage:Awe,discardStagedImages:Owe,fitBoundingBoxToStage:Mze,mouseLeftCanvas:Mwe,nextStagingAreaImage:Rwe,prevStagingAreaImage:Iwe,redo:Dwe,resetCanvas:qE,resetCanvasInteractionState:Nwe,resetCanvasView:cW,resizeAndScaleCanvas:bx,resizeCanvas:Bwe,setBoundingBoxCoordinates:fC,setBoundingBoxDimensions:_v,setBoundingBoxPreviewFill:Rze,setBoundingBoxScaleMethod:$we,setBrushColor:Ng,setBrushSize:Bg,setCanvasContainerDimensions:Fwe,setColorPickerColor:zwe,setCursorPosition:jwe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Sx,setInpaintReplace:dI,setIsDrawing:dW,setIsMaskEnabled:Oy,setIsMouseOverBoundingBox:Sb,setIsMoveBoundingBoxKeyHeld:Ize,setIsMoveStageKeyHeld:Dze,setIsMovingBoundingBox:hC,setIsMovingStage:V5,setIsTransformingBoundingBox:pC,setLayer:U5,setMaskColor:fW,setMergedCanvas:Hwe,setShouldAutoSave:hW,setShouldCropToBoundingBoxOnSave:pW,setShouldDarkenOutsideBoundingBox:gW,setShouldLockBoundingBox:Nze,setShouldPreserveMaskedArea:mW,setShouldShowBoundingBox:Vwe,setShouldShowBrush:Bze,setShouldShowBrushPreview:$ze,setShouldShowCanvasDebugInfo:vW,setShouldShowCheckboardTransparency:Fze,setShouldShowGrid:yW,setShouldShowIntermediates:bW,setShouldShowStagingImage:Uwe,setShouldShowStagingOutline:fI,setShouldSnapToGrid:W5,setShouldUseInpaintReplace:Wwe,setStageCoordinates:SW,setStageScale:Gwe,setTool:iu,toggleShouldLockBoundingBox:zze,toggleTool:jze,undo:qwe,setScaledBoundingBoxDimensions:xb,setShouldRestrictStrokesToBox:xW}=oW.actions,Ywe=oW.reducer,du=Object.create(null);du.open="0";du.close="1";du.ping="2";du.pong="3";du.message="4";du.upgrade="5";du.noop="6";const k4=Object.create(null);Object.keys(du).forEach(e=>{k4[du[e]]=e});const Kwe={type:"error",data:"parser error"},Xwe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Zwe=typeof ArrayBuffer=="function",Qwe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,wW=({type:e,data:t},n,r)=>Xwe&&t instanceof Blob?n?r(t):hI(t,r):Zwe&&(t instanceof ArrayBuffer||Qwe(t))?n?r(t):hI(new Blob([t]),r):r(du[e]+(t||"")),hI=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},pI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kv=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 u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r>4,f[i++]=(a&15)<<4|s>>2,f[i++]=(s&3)<<6|l&63;return u},e6e=typeof ArrayBuffer=="function",CW=(e,t)=>{if(typeof e!="string")return{type:"message",data:_W(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:t6e(e.substring(1),t)}:k4[n]?e.length>1?{type:k4[n],data:e.substring(1)}:{type:k4[n]}:Kwe},t6e=(e,t)=>{if(e6e){const n=Jwe(e);return _W(n,t)}else return{base64:!0,data:e}},_W=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},kW=String.fromCharCode(30),n6e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{wW(o,!1,s=>{r[a]=s,++i===n&&t(r.join(kW))})})},r6e=(e,t)=>{const n=e.split(kW),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function PW(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const o6e=setTimeout,a6e=clearTimeout;function xx(e,t){t.useNativeTimers?(e.setTimeoutFn=o6e.bind(Md),e.clearTimeoutFn=a6e.bind(Md)):(e.setTimeoutFn=setTimeout.bind(Md),e.clearTimeoutFn=clearTimeout.bind(Md))}const s6e=1.33;function l6e(e){return typeof e=="string"?u6e(e):Math.ceil((e.byteLength||e.size)*s6e)}function u6e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class c6e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class TW extends oi{constructor(t){super(),this.writable=!1,xx(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new c6e(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=CW(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const LW="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i8=64,d6e={};let gI=0,wb=0,mI;function vI(e){let t="";do t=LW[e%i8]+t,e=Math.floor(e/i8);while(e>0);return t}function AW(){const e=vI(+new Date);return e!==mI?(gI=0,mI=e):e+"."+vI(gI++)}for(;wb{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)};r6e(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,n6e(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]=AW()),!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=OW(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 ou(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 ou extends oi{constructor(t,n){super(),xx(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=PW(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 RW(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(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"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=ou.requestsCount++,ou.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=p6e,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete ou.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()}}ou.requestsCount=0;ou.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",yI);else if(typeof addEventListener=="function"){const e="onpagehide"in Md?"pagehide":"unload";addEventListener(e,yI,!1)}}function yI(){for(let e in ou.requests)ou.requests.hasOwnProperty(e)&&ou.requests[e].abort()}const IW=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Cb=Md.WebSocket||Md.MozWebSocket,bI=!0,v6e="arraybuffer",SI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class y6e extends TW{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=SI?{}:PW(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=bI&&!SI?n?new Cb(t,n):new Cb(t):new Cb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||v6e,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{bI&&this.ws.send(o)}catch(s){}i&&IW(()=>{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]=AW()),this.supportsBinary||(t.b64=1);const i=OW(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!!Cb}}const b6e={websocket:y6e,polling:m6e},S6e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,x6e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function o8(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=S6e.exec(e||""),o={},a=14;for(;a--;)o[x6e[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=w6e(o,o.path),o.queryKey=C6e(o,o.query),o}function w6e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function C6e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class kd extends oi{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=o8(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=o8(n.host).host),xx(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=f6e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=EW,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 b6e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&kd.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(n){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;kd.priorWebsocketSuccess=!1;const i=()=>{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;kd.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 o(){r||(r=!0,f(),n.close(),n=null)}const a=p=>{const m=new Error("probe error: "+p);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(p){n&&p.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",kd.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){kd.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,DW=Object.prototype.toString,P6e=typeof Blob=="function"||typeof Blob<"u"&&DW.call(Blob)==="[object BlobConstructor]",T6e=typeof File=="function"||typeof File<"u"&&DW.call(File)==="[object FileConstructor]";function YE(e){return k6e&&(e instanceof ArrayBuffer||E6e(e))||P6e&&e instanceof Blob||T6e&&e instanceof File}function E4(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 dn.ACK:case dn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class R6e{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=A6e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const I6e=Object.freeze(Object.defineProperty({__proto__:null,protocol:O6e,get PacketType(){return dn},Encoder:M6e,Decoder:KE},Symbol.toStringTag,{value:"Module"}));function js(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const D6e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class NW extends oi{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=[js(t,"open",this.onopen.bind(this)),js(t,"packet",this.onpacket.bind(this)),js(t,"error",this.onerror.bind(this)),js(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(D6e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:dn.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:dn.CONNECT,data:t})}):this.packet({type:dn.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 dn.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 dn.EVENT:case dn.BINARY_EVENT:this.onevent(t);break;case dn.ACK:case dn.BINARY_ACK:this.onack(t);break;case dn.DISCONNECT:this.ondisconnect();break;case dn.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:dn.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:dn.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}_1.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};_1.prototype.reset=function(){this.attempts=0};_1.prototype.setMin=function(e){this.ms=e};_1.prototype.setMax=function(e){this.max=e};_1.prototype.setJitter=function(e){this.jitter=e};class l8 extends oi{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,xx(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 _1({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||I6e;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 kd(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=js(n,"open",function(){r.onopen(),t&&t()}),o=js(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(js(t,"ping",this.onping.bind(this)),js(t,"data",this.ondata.bind(this)),js(t,"error",this.onerror.bind(this)),js(t,"close",this.onclose.bind(this)),js(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){IW(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new NW(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 ov={};function P4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=_6e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=ov[i]&&o in ov[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new l8(r,t):(ov[i]||(ov[i]=new l8(r,t)),l=ov[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(P4,{Manager:l8,Socket:NW,io:P4,connect:P4});let _b;const N6e=new Uint8Array(16);function B6e(){if(!_b&&(_b=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_b))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _b(N6e)}const zi=[];for(let e=0;e<256;++e)zi.push((e+256).toString(16).slice(1));function $6e(e,t=0){return(zi[e[t+0]]+zi[e[t+1]]+zi[e[t+2]]+zi[e[t+3]]+"-"+zi[e[t+4]]+zi[e[t+5]]+"-"+zi[e[t+6]]+zi[e[t+7]]+"-"+zi[e[t+8]]+zi[e[t+9]]+"-"+zi[e[t+10]]+zi[e[t+11]]+zi[e[t+12]]+zi[e[t+13]]+zi[e[t+14]]+zi[e[t+15]]).toLowerCase()}const F6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xI={randomUUID:F6e};function lg(e,t,n){if(xI.randomUUID&&!t&&!e)return xI.randomUUID();e=e||{};const r=e.random||(e.rng||B6e)();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 $6e(r)}var z6e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,j6e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,H6e=/[^-+\dA-Z]/g;function to(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(wI[t]||t||wI.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"]()},u=function(){return e[o()+"FullYear"]()},f=function(){return e[o()+"Hours"]()},p=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},x=function(){return V6e(e)},E=function(){return U6e(e)},k={d:function(){return a()},dd:function(){return Ca(a())},ddd:function(){return Ho.dayNames[s()]},DDD:function(){return CI({y:u(),m:l(),d:a(),_:o(),dayName:Ho.dayNames[s()],short:!0})},dddd:function(){return Ho.dayNames[s()+7]},DDDD:function(){return CI({y:u(),m:l(),d:a(),_:o(),dayName:Ho.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Ca(l()+1)},mmm:function(){return Ho.monthNames[l()]},mmmm:function(){return Ho.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Ca(u(),4)},h:function(){return f()%12||12},hh:function(){return Ca(f()%12||12)},H:function(){return f()},HH:function(){return Ca(f())},M:function(){return p()},MM:function(){return Ca(p())},s:function(){return m()},ss:function(){return Ca(m())},l:function(){return Ca(v(),3)},L:function(){return Ca(Math.floor(v()/10))},t:function(){return f()<12?Ho.timeNames[0]:Ho.timeNames[1]},tt:function(){return f()<12?Ho.timeNames[2]:Ho.timeNames[3]},T:function(){return f()<12?Ho.timeNames[4]:Ho.timeNames[5]},TT:function(){return f()<12?Ho.timeNames[6]:Ho.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":W6e(e)},o:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+Ca(Math.floor(Math.abs(b())/60),2)+":"+Ca(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return x()},WW:function(){return Ca(x())},N:function(){return E()}};return t.replace(z6e,function(_){return _ in k?k[_]():_.slice(1,_.length-1)})}var wI={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"},Ho={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")},CI=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,u=new Date,f=new Date;f.setDate(f[o+"Date"]()-1);var p=new Date;p.setDate(p[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},x=function(){return f[o+"Date"]()},E=function(){return f[o+"Month"]()},k=function(){return f[o+"FullYear"]()},_=function(){return p[o+"Date"]()},T=function(){return p[o+"Month"]()},A=function(){return p[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":k()===n&&E()===r&&x()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},V6e=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)},U6e=function(t){var n=t.getDay();return n===0&&(n=7),n},W6e=function(t){return(String(t).match(j6e)||[""]).pop().replace(H6e,"").replace(/GMT\+0000/g,"UTC")};const u8=Nr("socketio/generateImage"),G6e=Nr("socketio/runESRGAN"),q6e=Nr("socketio/runFacetool"),Y6e=Nr("socketio/deleteImage"),c8=Nr("socketio/requestImages"),_I=Nr("socketio/requestNewImages"),K6e=Nr("socketio/cancelProcessing"),X6e=Nr("socketio/requestSystemConfig"),kI=Nr("socketio/searchForModels"),XE=Nr("socketio/addNewModel"),Z6e=Nr("socketio/deleteModel"),BW=Nr("socketio/requestModelChange"),Q6e=Nr("socketio/saveStagingAreaImageToGallery"),J6e=Nr("socketio/requestEmptyTempFolder"),eCe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(aI(!0)),t(_4(Ht.t("common:statusConnected"))),t(X6e());const r=n().gallery;r.categories.result.latest_mtime?t(_I("result")):t(c8("result")),r.categories.user.latest_mtime?t(_I("user")):t(c8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(aI(!1)),t(_4(Ht.t("common:statusDisconnected"))),t(eo({timestamp:to(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{shouldLoopback:o,activeTab:a}=i.options,{boundingBox:s,generationMode:l,...u}=r,f={uuid:lg(),...u};if(["txt2img","img2img"].includes(l)&&t(ag({category:"result",image:{...f,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:p}=r;t(Pwe({image:{...f,category:"temp"},boundingBox:p})),i.canvas.shouldAutoSave&&t(ag({image:{...f,category:"result"},category:"result"}))}if(o)switch(zE[a]){case"img2img":{t(C1(f));break}}t(lC()),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(gSe({uuid:lg(),...r,category:"result"})),r.isBase64||t(eo({timestamp:to(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(ag({category:"result",image:{uuid:lg(),...r,category:"result"}})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Ws(!0)),t(awe(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(eo({timestamp:to(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(sI()),t(lC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:lg(),...l}));t(pSe({images:s,areMoreImagesAvailable:o,category:a})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(uwe());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(ag({category:"result",image:r})),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(lC())),t(eo({timestamp:to(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(BU(r));const{initialImage:o,maskPath:a}=n().options;(o===i||(o==null?void 0:o.url)===i)&&t(xU()),a===i&&t(EU("")),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(swe(r)),r.infill_methods.includes("patchmatch")||t(kU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(nW(i)),t(rW(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(bb(o)),t(Ws(!1)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Rh({title:a?`${Ht.t("modelmanager:modelUpdated")}: ${i}`:`${Ht.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(bb(o)),t(Ws(!1)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`${Ht.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Rh({title:`${Ht.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(bb(o)),t(_4(Ht.t("common:statusModelChanged"))),t(Ws(!1)),t(sg(!0)),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(bb(o)),t(Ws(!1)),t(sg(!0)),t(sI()),t(eo({timestamp:to(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Rh({title:Ht.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},tCe=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],nCe=[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],rCe=[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],iCe=[{key:"2x",value:2},{key:"4x",value:4}],ZE=0,QE=4294967295,oCe=["gfpgan","codeformer"],aCe=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],$W=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var sCe=Math.PI/180;function lCe(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const $g=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},gt={_global:$g,version:"8.3.14",isBrowser:lCe(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return gt.angleDeg?e*sCe: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 gt.DD.isDragging},isDragReady(){return!!gt.DD.node},releaseCanvasOnDestroy:!0,document:$g.document,_injectGlobal(e){$g.Konva=e}},Cr=e=>{gt[e.prototype.getClassName()]=e};gt._injectGlobal(gt);class Ea{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 Ea(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 u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var f=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/f):-Math.acos(r/f)),l.scaleX=s/f,l.scaleY=f,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=he._getRotation(l.rotation),l}}var uCe="[object Array]",cCe="[object Number]",dCe="[object String]",fCe="[object Boolean]",hCe=Math.PI/180,pCe=180/Math.PI,gC="#",gCe="",mCe="0",vCe="Konva warning: ",EI="Konva error: ",yCe="rgb(",mC={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]},bCe=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,kb=[];const SCe=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},he={_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)===uCe},_isNumber(e){return Object.prototype.toString.call(e)===cCe&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===dCe},_isBoolean(e){return Object.prototype.toString.call(e)===fCe},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){kb.push(e),kb.length===1&&SCe(function(){const t=kb;kb=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(t){}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=he.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(gC,gCe);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=mCe+e;return gC+e},getRGB(e){var t;return e in mC?(t=mC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===gC?this._hexToRgb(e.substring(1)):e.substr(0,4)===yCe?(t=bCe.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",he._namedColorToRBA(e)||he._hex3ColorToRGBA(e)||he._hex6ColorToRGBA(e)||he._rgbColorToRGBA(e)||he._rgbaColorToRGBA(e)||he._hslColorToRGBA(e)},_namedColorToRBA(e){var t=mC[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 u=2*o-a,f=[0,0,0];for(let p=0;p<3;p++)s=r+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,f[p]=l*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[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+f*(n-e),s=t+f*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=he.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=he._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],f=l[1],p=l[2];pt.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function gf(e){return he._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||he._isBoolean(e)?e:Object.prototype.toString.call(e)}function FW(e){return e>255?255:e<0?0:Math.round(e)}function Ge(){if(gt.isUnminified)return function(e,t){return he._isNumber(e)||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function zW(e){if(gt.isUnminified)return function(t,n){let r=he._isNumber(t),i=he._isArray(t)&&t.length==e;return!r&&!i&&he.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function JE(){if(gt.isUnminified)return function(e,t){var n=he._isNumber(e),r=e==="auto";return n||r||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function k1(){if(gt.isUnminified)return function(e,t){return he._isString(e)||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function jW(){if(gt.isUnminified)return function(e,t){const n=he._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function xCe(){if(gt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(he._isArray(e)?e.forEach(function(r){he._isNumber(r)||he.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function il(){if(gt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||he.warn(gf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function wCe(e){if(gt.isUnminified)return function(t,n){return t==null||he.isObject(t)||he.warn(gf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var av="get",sv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=av+he._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=sv+he._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=sv+he._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=he._capitalize,s=av+a(t),l=sv+a(t),u,f;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(x),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=he._capitalize(t),r=sv+n,i=av+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){he.error("Adding deprecated "+t);var i=av+he._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){he.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){he.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){he.each(t,function(n,r){var i=e.prototype[r],o=av+he._capitalize(n),a=sv+he._capitalize(n);function s(){i.apply(this,arguments),he.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 CCe(e){var t=[],n=e.length,r=he,i,o;for(i=0;itypeof f=="number"?Math.floor(f):f)),o+=_Ce+u.join(PI)+kCe)):(o+=s.property,t||(o+=ACe+s.val)),o+=TCe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=MCe&&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,u){var f=arguments,p=this._context;f.length===3?p.drawImage(t,n,r):f.length===5?p.drawImage(t,n,r,i,o):f.length===9&&p.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){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=TI.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=CCe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return yn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];yn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=he._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.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=[];yn._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")&&(yn.justDragged=!0,gt._mouseListenClick=!1,gt._touchListenClick=!1,gt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof gt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){yn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&yn._dragElements.delete(n)})}};gt.isBrowser&&(window.addEventListener("mouseup",yn._endDragBefore,!0),window.addEventListener("touchend",yn._endDragBefore,!0),window.addEventListener("mousemove",yn._drag),window.addEventListener("touchmove",yn._drag),window.addEventListener("mouseup",yn._endDragAfter,!1),window.addEventListener("touchend",yn._endDragAfter,!1));var T4="absoluteOpacity",Pb="allEventListeners",Uu="absoluteTransform",LI="absoluteScale",dh="canvas",NCe="Change",BCe="children",$Ce="konva",d8="listening",AI="mouseenter",OI="mouseleave",MI="set",RI="Shape",L4=" ",II="stage",md="transform",FCe="Stage",f8="visible",zCe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(L4);let jCe=1;class qe{constructor(t){this._id=jCe++,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===md||t===Uu)&&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===md||t===Uu,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(L4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(dh)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Uu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(dh)){const{scene:t,filter:n,hit:r}=this._cache.get(dh);he.releaseCanvas(t,n,r),this._cache.delete(dh)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,f=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!o){he.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new Fg({pixelRatio:a,width:i,height:o}),v=new Fg({pixelRatio:a,width:0,height:0}),b=new eP({pixelRatio:p,width:i,height:o}),x=m.getContext(),E=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(dh),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),x.save(),E.save(),x.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(T4),this._clearSelfAndDescendantCache(LI),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),E.restore(),f&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),this._cache.set(dh,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(dh)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var f=l.point(u);i===void 0&&(i=a=f.x,o=s=f.y),i=Math.min(i,f.x),o=Math.min(o,f.y),a=Math.max(a,f.x),s=Math.max(s,f.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var f=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()/f,r.getHeight()/f),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==BCe&&(r=MI+he._capitalize(n),he._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(d8,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(f8,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;yn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!gt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==FCe&&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(md),this._clearSelfAndDescendantCache(Uu)),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 Ea,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(md);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(md),this._clearSelfAndDescendantCache(Uu),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 he.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 he.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&he.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(T4,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=he.isObject(i)&&!he._isPlainObject(i)&&!he._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(),he._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==null?void 0:t.callback;i&&delete t.callback,he._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():gt.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;yn._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=yn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&yn._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 he.haveIntersection(r,this.getClientRect())}static create(t,n){return he._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=qe.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),gt[r]||(he.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=gt[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=qe.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=qe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const f=r===this;if(u){o.save();var p=this.getAbsoluteTransform(r),m=p.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 v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=p.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var x=!f&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),x&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},f=this;(n=this.children)===null||n===void 0||n.forEach(function(x){if(!!x.visible()){var E=x.getClientRect({relativeTo:f,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 p=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",I0=e=>{const t=Lv(e);if(t==="pointer")return gt.pointerEventsEnabled&&yC.pointer;if(t==="touch")return yC.touch;if(t==="mouse")return yC.mouse};function NI(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&he.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const YCe="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);",A4=[];class _x extends Oa{constructor(t){super(NI(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),A4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{NI(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||he.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===VCe){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&&A4.splice(n,1),he.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(he.warn(YCe),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 Fg({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+DI,this.content.style.height=n+DI),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;rGCe&&he.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(),gt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return VW(t,this)}setPointerCapture(t){UW(t,this)}releaseCapture(t){n2(t)}getLayers(){return this.children}_bindContentEvents(){!gt.isBrowser||qCe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=I0(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=I0(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=I0(t.type),r=Lv(t.type);if(!!n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!yn.isDragging||gt.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=I0(t.type),r=Lv(t.type);if(!!n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(yn.justDragged=!1,gt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;gt.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=I0(t.type),r=Lv(t.type);if(!n)return;yn.isDragging&&yn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!yn.isDragging||gt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=vC(l.id)||this.getIntersection(l),f=l.id,p={evt:t,pointerId:f};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},p),u),s._fireAndBubble(n.pointerleave,Object.assign({},p),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},p),s),u._fireAndBubble(n.pointerenter,Object.assign({},p),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},p))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:f}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=I0(t.type),r=Lv(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 u=vC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const f=l.id,p={evt:t,pointerId:f};let m=!1;gt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):yn.justDragged||(gt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){gt["_"+r+"InDblClickWindow"]=!1},gt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},p)),gt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},p)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},p)))):(this[r+"ClickEndShape"]=null,gt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:f}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:f}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),gt["_"+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(h8,{evt:t}):this._fire(h8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(p8,{evt:t}):this._fire(p8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=vC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(ug,tP(t)),n2(t.pointerId)}_lostpointercapture(t){n2(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:he._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:he._getFirstPointerId(t)}])}_setPointerPosition(t){he.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 Fg({width:this.width(),height:this.height()}),this.bufferHitCanvas=new eP({pixelRatio:1,width:this.width(),height:this.height()}),!!gt.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 he.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}}_x.prototype.nodeType=HCe;Cr(_x);ee.addGetterSetter(_x,"container");var tG="hasShadow",nG="shadowRGBA",rG="patternImage",iG="linearGradient",oG="radialGradient";let Mb;function bC(){return Mb||(Mb=he.createCanvasElement().getContext("2d"),Mb)}const r2={};function KCe(e){e.fill()}function XCe(e){e.stroke()}function ZCe(e){e.fill()}function QCe(e){e.stroke()}function JCe(){this._clearCache(tG)}function e7e(){this._clearCache(nG)}function t7e(){this._clearCache(rG)}function n7e(){this._clearCache(iG)}function r7e(){this._clearCache(oG)}class $e extends qe{constructor(t){super(t);let n;for(;n=he.getRandomColor(),!(n&&!(n in r2)););this.colorKey=n,r2[n]=this}getContext(){return he.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return he.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(tG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(rG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=bC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Ea;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(gt.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(iG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=bC(),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 qe.prototype.destroy.call(this),delete r2[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){he.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,u=!t.skipShadow&&this.hasShadow(),f=u?this.shadowOffsetX():0,p=u?this.shadowOffsetY():0,m=s+Math.abs(f),v=l+Math.abs(p),b=u&&this.shadowBlur()||0,x=m+b*2,E=v+b*2,k={width:x,height:E,x:-(a/2+b)+Math.min(f,0)+i.x,y:-(a/2+b)+Math.min(p,0)+i.y};return n?k:this._transformedRect(k,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,f,p,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),f=u.bufferCanvas,p=f.getContext(),p.clear(),p.save(),p._applyLineJoin(this);var x=this.getAbsoluteTransform(n).getMatrix();p.transform(x[0],x[1],x[2],x[3],x[4],x[5]),s.call(this,p,this),p.restore();var E=f.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(f._canvas,0,0,f.width/E,f.height/E)}else{if(o._applyLineJoin(this),!v){var x=this.getAbsoluteTransform(n).getMatrix();o.transform(x[0],x[1],x[2],x[3],x[4],x[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(),u=l&&l.hit;if(this.colorKey||he.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()"),u){a.save();var f=this.getAbsoluteTransform(n).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[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,u,f,p,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,f=u.length,p=he._hexToRgb(this.colorKey),m=0;mt?(u[m]=p.r,u[m+1]=p.g,u[m+2]=p.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){he.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return VW(t,this)}setPointerCapture(t){UW(t,this)}releaseCapture(t){n2(t)}}$e.prototype._fillFunc=KCe;$e.prototype._strokeFunc=XCe;$e.prototype._fillFuncHit=ZCe;$e.prototype._strokeFuncHit=QCe;$e.prototype._centroid=!1;$e.prototype.nodeType="Shape";Cr($e);$e.prototype.eventListeners={};$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",JCe);$e.prototype.on.call($e.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",e7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",t7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",n7e);$e.prototype.on.call($e.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",r7e);ee.addGetterSetter($e,"stroke",void 0,jW());ee.addGetterSetter($e,"strokeWidth",2,Ge());ee.addGetterSetter($e,"fillAfterStrokeEnabled",!1);ee.addGetterSetter($e,"hitStrokeWidth","auto",JE());ee.addGetterSetter($e,"strokeHitEnabled",!0,il());ee.addGetterSetter($e,"perfectDrawEnabled",!0,il());ee.addGetterSetter($e,"shadowForStrokeEnabled",!0,il());ee.addGetterSetter($e,"lineJoin");ee.addGetterSetter($e,"lineCap");ee.addGetterSetter($e,"sceneFunc");ee.addGetterSetter($e,"hitFunc");ee.addGetterSetter($e,"dash");ee.addGetterSetter($e,"dashOffset",0,Ge());ee.addGetterSetter($e,"shadowColor",void 0,k1());ee.addGetterSetter($e,"shadowBlur",0,Ge());ee.addGetterSetter($e,"shadowOpacity",1,Ge());ee.addComponentsGetterSetter($e,"shadowOffset",["x","y"]);ee.addGetterSetter($e,"shadowOffsetX",0,Ge());ee.addGetterSetter($e,"shadowOffsetY",0,Ge());ee.addGetterSetter($e,"fillPatternImage");ee.addGetterSetter($e,"fill",void 0,jW());ee.addGetterSetter($e,"fillPatternX",0,Ge());ee.addGetterSetter($e,"fillPatternY",0,Ge());ee.addGetterSetter($e,"fillLinearGradientColorStops");ee.addGetterSetter($e,"strokeLinearGradientColorStops");ee.addGetterSetter($e,"fillRadialGradientStartRadius",0);ee.addGetterSetter($e,"fillRadialGradientEndRadius",0);ee.addGetterSetter($e,"fillRadialGradientColorStops");ee.addGetterSetter($e,"fillPatternRepeat","repeat");ee.addGetterSetter($e,"fillEnabled",!0);ee.addGetterSetter($e,"strokeEnabled",!0);ee.addGetterSetter($e,"shadowEnabled",!0);ee.addGetterSetter($e,"dashEnabled",!0);ee.addGetterSetter($e,"strokeScaleEnabled",!0);ee.addGetterSetter($e,"fillPriority","color");ee.addComponentsGetterSetter($e,"fillPatternOffset",["x","y"]);ee.addGetterSetter($e,"fillPatternOffsetX",0,Ge());ee.addGetterSetter($e,"fillPatternOffsetY",0,Ge());ee.addComponentsGetterSetter($e,"fillPatternScale",["x","y"]);ee.addGetterSetter($e,"fillPatternScaleX",1,Ge());ee.addGetterSetter($e,"fillPatternScaleY",1,Ge());ee.addComponentsGetterSetter($e,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientStartPointX",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointX",0);ee.addGetterSetter($e,"fillLinearGradientStartPointY",0);ee.addGetterSetter($e,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter($e,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillLinearGradientEndPointX",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointX",0);ee.addGetterSetter($e,"fillLinearGradientEndPointY",0);ee.addGetterSetter($e,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientStartPointX",0);ee.addGetterSetter($e,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter($e,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter($e,"fillRadialGradientEndPointX",0);ee.addGetterSetter($e,"fillRadialGradientEndPointY",0);ee.addGetterSetter($e,"fillPatternRotation",0);ee.backCompat($e,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var i7e="#",o7e="beforeDraw",a7e="draw",aG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],s7e=aG.length;class hp extends Oa{constructor(t){super(t),this.canvas=new Fg,this.hitCanvas=new eP({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(o7e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Oa.prototype.drawScene.call(this,i,n),this._fire(a7e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Oa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){he.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return he.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return he.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}hp.prototype.nodeType="Layer";Cr(hp);ee.addGetterSetter(hp,"imageSmoothingEnabled",!0);ee.addGetterSetter(hp,"clearBeforeDraw",!0);ee.addGetterSetter(hp,"hitGraphEnabled",!0,il());class nP extends hp{constructor(t){super(t),this.listening(!1),he.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}nP.prototype.nodeType="FastLayer";Cr(nP);class n1 extends Oa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&he.throw("You may only add groups and shapes to groups.")}}n1.prototype.nodeType="Group";Cr(n1);var SC=function(){return $g.performance&&$g.performance.now?function(){return $g.performance.now()}:function(){return new Date().getTime()}}();class ns{constructor(t,n){this.id=ns.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:SC(),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=BI,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=$I,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===BI?this.setTime(t):this.state===$I&&this.setTime(this.duration-t)}pause(){this.state=u7e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Wr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||i2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=c7e++;var u=r.getLayer()||(r instanceof gt.Stage?r.getLayers():null);u||he.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ns(function(){n.tween.onEnterFrame()},u),this.tween=new d7e(l,function(f){n._tweenFunc(f)},a,0,1,o*1e3,s),this._addListeners(),Wr.attrs[i]||(Wr.attrs[i]={}),Wr.attrs[i][this._id]||(Wr.attrs[i][this._id]={}),Wr.tweens[i]||(Wr.tweens[i]={});for(l in t)l7e[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,u,f,p,m;if(s=Wr.tweens[i][t],s&&delete Wr.attrs[i][s][t],o=r.getAttr(t),he._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(p=o,o=he._prepareArrayForTween(o,n,r.closed())):(f=n,n=he._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=Wr.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=Wr.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=Wr.tweens[t],i;this.pause();for(i in r)delete Wr.tweens[t][i];delete Wr.attrs[t][n]}}Wr.attrs={};Wr.tweens={};qe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Wr(e);n.play()};const i2={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),f=a*n,p=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:p,width:f-u,height:m-p}}}gc.prototype._centroid=!0;gc.prototype.className="Arc";gc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Cr(gc);ee.addGetterSetter(gc,"innerRadius",0,Ge());ee.addGetterSetter(gc,"outerRadius",0,Ge());ee.addGetterSetter(gc,"angle",0,Ge());ee.addGetterSetter(gc,"clockwise",!1,il());function g8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),f=a*l/(s+l),p=n-u*(i-e),m=r-u*(o-t),v=n+f*(i-e),b=r+f*(o-t);return[p,m,v,b]}function zI(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);uf?u:f,E=u>f?1:u/f,k=u>f?f/u:1;t.translate(s,l),t.rotate(v),t.scale(E,k),t.arc(0,0,x,p,p+m,1-b),t.scale(1/E,1/k),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var f=u.points[4],p=u.points[5],m=u.points[4]+p,v=Math.PI/180;if(Math.abs(f-m)m;b-=v){const x=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(x.x,x.y)}else for(let b=f+v;bthis.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 zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.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 zn.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],u=a[2],f=a[3],p=a[4],m=a[5],v=a[6];return p+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,f,p,v)}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),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,T=[],A=l,R=u,I,D,B,z,j,Y,te,G,$,V;switch(v){case"l":l+=b.shift(),u+=b.shift(),_="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var J=b.shift(),Z=b.shift();if(l+=J,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var U=a.length-2;U>=0;U--)if(a[U].command==="M"){l=a[U].points[0]+J,u=a[U].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),_="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),_="L",T.push(l,u);break;case"H":l=b.shift(),_="L",T.push(l,u);break;case"v":u+=b.shift(),_="L",T.push(l,u);break;case"V":u=b.shift(),_="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"S":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",T.push(l,u);break;case"s":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",T.push(l,u);break;case"T":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l=b.shift(),u=b.shift(),_="Q",T.push(D,B,l,u);break;case"t":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l+=b.shift(),u+=b.shift(),_="Q",T.push(D,B,l,u);break;case"A":z=b.shift(),j=b.shift(),Y=b.shift(),te=b.shift(),G=b.shift(),$=l,V=u,l=b.shift(),u=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,V,l,u,te,G,z,j,Y);break;case"a":z=b.shift(),j=b.shift(),Y=b.shift(),te=b.shift(),G=b.shift(),$=l,V=u,l+=b.shift(),u+=b.shift(),_="A",T=this.convertEndpointToCenterParameterization($,V,l,u,te,G,z,j,Y);break}a.push({command:_||v,points:T,start:{x:A,y:R},pathLength:this.calcLength(A,R,_||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var f=i[4],p=i[5],m=i[4]+p,v=Math.PI/180;if(Math.abs(f-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=f+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(p*p))/(s*s*(m*m)+l*l*(p*p)));o===a&&(b*=-1),isNaN(b)&&(b=0);var x=b*s*m/l,E=b*-l*p/s,k=(t+r)/2+Math.cos(f)*x-Math.sin(f)*E,_=(n+i)/2+Math.sin(f)*x+Math.cos(f)*E,T=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},A=function(j,Y){return(j[0]*Y[0]+j[1]*Y[1])/(T(j)*T(Y))},R=function(j,Y){return(j[0]*Y[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[k,_,s,l,I,z,f,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];Cr(zn);ee.addGetterSetter(zn,"data");class pp extends mc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var f=(Math.atan2(u,l)+n)%n,p=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(f),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,p/2),t.lineTo(-a,-p/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}}}pp.prototype.className="Arrow";Cr(pp);ee.addGetterSetter(pp,"pointerLength",10,Ge());ee.addGetterSetter(pp,"pointerWidth",10,Ge());ee.addGetterSetter(pp,"pointerAtBeginning",!1);ee.addGetterSetter(pp,"pointerAtEnding",!0);class E1 extends $e{_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)}}E1.prototype._centroid=!0;E1.prototype.className="Circle";E1.prototype._attrsAffectingSize=["radius"];Cr(E1);ee.addGetterSetter(E1,"radius",0,Ge());class mf extends $e{_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)}}mf.prototype.className="Ellipse";mf.prototype._centroid=!0;mf.prototype._attrsAffectingSize=["radiusX","radiusY"];Cr(mf);ee.addComponentsGetterSetter(mf,"radius",["x","y"]);ee.addGetterSetter(mf,"radiusX",0,Ge());ee.addGetterSetter(mf,"radiusY",0,Ge());class ol extends $e{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=he.createImageElement();i.onload=function(){var o=new ol({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}}ol.prototype.className="Image";Cr(ol);ee.addGetterSetter(ol,"image");ee.addComponentsGetterSetter(ol,"crop",["x","y","width","height"]);ee.addGetterSetter(ol,"cropX",0,Ge());ee.addGetterSetter(ol,"cropY",0,Ge());ee.addGetterSetter(ol,"cropWidth",0,Ge());ee.addGetterSetter(ol,"cropHeight",0,Ge());var sG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],f7e="Change.konva",h7e="none",m8="up",v8="right",y8="down",b8="left",p7e=sG.length;class rP extends n1{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)}}mp.prototype.className="RegularPolygon";mp.prototype._centroid=!0;mp.prototype._attrsAffectingSize=["radius"];Cr(mp);ee.addGetterSetter(mp,"radius",0,Ge());ee.addGetterSetter(mp,"sides",0,Ge());var jI=Math.PI*2;class vp extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,jI,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),jI,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)}}vp.prototype.className="Ring";vp.prototype._centroid=!0;vp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Cr(vp);ee.addGetterSetter(vp,"innerRadius",0,Ge());ee.addGetterSetter(vp,"outerRadius",0,Ge());class bu extends $e{constructor(t){super(t),this._updated=!0,this.anim=new ns(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){!this.anim.isRunning()||(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],f=o[i+3],p=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,f),t.closePath(),t.fillStrokeShape(this)),p)if(a){var m=a[n],v=r*2;t.drawImage(p,s,l,u,f,m[v+0],m[v+1],u,f)}else t.drawImage(p,s,l,u,f,0,0,u,f)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],f=r*2;t.rect(u[f+0],u[f+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 Ib;function wC(){return Ib||(Ib=he.createCanvasElement().getContext(v7e),Ib)}function T7e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function L7e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function A7e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class wr extends $e{constructor(t){super(A7e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(k+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=he._isString(t)?t:t==null?"":t+"";return this._setAttr(y7e,n),this}getWidth(){var t=this.attrs.width===D0||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===D0||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return he.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=wC(),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()+Rb+this.fontVariant()+Rb+(this.fontSize()+w7e)+P7e(this.fontFamily())}_addTextLine(t){this.align()===lv&&(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 wC().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!==D0&&o!==void 0,l=a!==D0&&a!==void 0,u=this.padding(),f=o-u*2,p=a-u*2,m=0,v=this.wrap(),b=v!==UI,x=v!==k7e&&b,E=this.ellipsis();this.textArr=[],wC().font=this._getContextFont();for(var k=E?this._getTextWidth(xC):0,_=0,T=t.length;_f)for(;A.length>0;){for(var I=0,D=A.length,B="",z=0;I>>1,Y=A.slice(0,j+1),te=this._getTextWidth(Y)+k;te<=f?(I=j+1,B=Y,z=te):D=j}if(B){if(x){var G,$=A[B.length],V=$===Rb||$===HI;V&&z<=f?G=B.length:G=Math.max(B.lastIndexOf(Rb),B.lastIndexOf(HI))+1,G>0&&(I=G,B=B.slice(0,I),z=this._getTextWidth(B))}B=B.trimRight(),this._addTextLine(B),r=Math.max(r,z),m+=i;var J=this._shouldHandleEllipsis(m);if(J){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(I),A=A.trimLeft(),A.length>0&&(R=this._getTextWidth(A),R<=f)){this._addTextLine(A),m+=i,r=Math.max(r,R);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,R),this._shouldHandleEllipsis(m)&&_p)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!==D0&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==UI;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==D0&&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+xC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var f=lG(this.text()),p=this.text().split(" ").length-1,m,v,b,x=-1,E=0,k=function(){E=0;for(var te=t.dataArray,G=x+1;G0)return x=G,te[G];te[G].command==="M"&&(m={x:te[G].points[0],y:te[G].points[1]})}return{}},_=function(te){var G=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(G+=(s-a)/p);var $=0,V=0;for(v=void 0;Math.abs(G-$)/G>.01&&V<20;){V++;for(var J=$;b===void 0;)b=k(),b&&J+b.pathLengthG?v=zn.getPointOnLine(G,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var U=b.points[4],X=b.points[5],le=b.points[4]+X;E===0?E=U+1e-8:G>$?E+=Math.PI/180*X/Math.abs(X):E-=Math.PI/360*X/Math.abs(X),(X<0&&E=0&&E>le)&&(E=le,Z=!0),v=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case"C":E===0?G>b.pathLength?E=1e-8:E=G/b.pathLength:G>$?E+=(G-$)/b.pathLength/2:E=Math.max(E-($-G)/b.pathLength/2,0),E>1&&(E=1,Z=!0),v=zn.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":E===0?E=G/b.pathLength:G>$?E+=(G-$)/b.pathLength:E-=($-G)/b.pathLength,E>1&&(E=1,Z=!0),v=zn.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}v!==void 0&&($=zn.getLineLength(m.x,m.y,v.x,v.y)),Z&&(Z=!1,b=void 0)}},T="C",A=t._getTextSize(T).width+r,R=u/A-1,I=0;Ie+`.${gG}`).join(" "),WI="nodesRect",R7e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],I7e={"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 D7e="ontouchstart"in gt._global;function N7e(e,t){if(e==="rotater")return"crosshair";t+=he.degToRad(I7e[e]||0);var n=(he.radToDeg(t)%360+360)%360;return he._inRange(n,315+22.5,360)||he._inRange(n,0,22.5)?"ns-resize":he._inRange(n,45-22.5,45+22.5)?"nesw-resize":he._inRange(n,90-22.5,90+22.5)?"ew-resize":he._inRange(n,135-22.5,135+22.5)?"nwse-resize":he._inRange(n,180-22.5,180+22.5)?"ns-resize":he._inRange(n,225-22.5,225+22.5)?"nesw-resize":he._inRange(n,270-22.5,270+22.5)?"ew-resize":he._inRange(n,315-22.5,315+22.5)?"nwse-resize":(he.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var G5=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],GI=1e8;function B7e(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 mG(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 $7e(e,t){const n=B7e(e);return mG(e,t,n)}function F7e(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(R7e.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(WI),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(WI,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(gt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),f={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return mG(f,-gt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-GI,y:-GI,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const f=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var p=[{x:f.x,y:f.y},{x:f.x+f.width,y:f.y},{x:f.x+f.width,y:f.y+f.height},{x:f.x,y:f.y+f.height}],m=u.getAbsoluteTransform();p.forEach(function(v){var b=m.point(v);n.push(b)})});const r=new Ea;r.rotate(-gt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var f=r.point(u);i===void 0&&(i=a=f.x,o=s=f.y),i=Math.min(i,f.x),o=Math.min(o,f.y),a=Math.max(a,f.x),s=Math.max(s,f.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:gt.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(),G5.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new My({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:D7e?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=gt.getAngle(this.rotation()),o=N7e(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 $e({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()*he._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(!!this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const f=o.getAbsolutePosition();if(!(u.x===f.x&&u.y===f.y)){if(this._movingAnchorName==="rotater"){var p=this._getNodeRect();n=o.x()-p.width/2,r=-o.y()+p.height/2;let te=Math.atan2(-r,n)+Math.PI/2;p.height<0&&(te-=Math.PI);var m=gt.getAngle(this.rotation());const G=m+te,$=gt.getAngle(this.rotationSnapTolerance()),J=F7e(this.rotationSnaps(),G,$)-p.rotation,Z=$7e(p,J);this._fitNodesInto(Z,t);return}var v=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(v){var b=_?{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(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-left").x()>b.x?-1:1,E=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*x,r=i*this.sin*E,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(v){var b=_?{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()-b.x,2)+Math.pow(b.y-o.y(),2));var x=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*x,r=i*this.sin*E,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var k=o.position();this.findOne(".top-left").y(k.y),this.findOne(".bottom-right").x(k.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(v){var b=_?{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(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var x=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(he._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(he._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Ea;if(a.rotate(gt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const p=a.point({x:-this.padding()*2,y:0});if(t.x+=p.x,t.y+=p.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const p=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const p=a.point({x:0,y:-this.padding()*2});if(t.x+=p.x,t.y+=p.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const p=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const p=this.boundBoxFunc()(r,t);p?t=p:he.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Ea;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Ea;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const f=u.multiply(l.invert());this._nodes.forEach(p=>{var m;const v=p.getParent().getAbsoluteTransform(),b=p.getTransform().copy();b.translate(p.offsetX(),p.offsetY());const x=new Ea;x.multiply(v.copy().invert()).multiply(f).multiply(v).multiply(b);const E=x.decompose();p.setAttrs(E),this._fire("transform",{evt:n,target:p}),p._fire("transform",{evt:n,target:p}),(m=p.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(he._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(he._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(u=>{u.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()*he._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=""),n1.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return qe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}function z7e(e){return e instanceof Array||he.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){G5.indexOf(t)===-1&&he.warn("Unknown anchor name: "+t+". Available names are: "+G5.join(", "))}),e||[]}On.prototype.className="Transformer";Cr(On);ee.addGetterSetter(On,"enabledAnchors",G5,z7e);ee.addGetterSetter(On,"flipEnabled",!0,il());ee.addGetterSetter(On,"resizeEnabled",!0);ee.addGetterSetter(On,"anchorSize",10,Ge());ee.addGetterSetter(On,"rotateEnabled",!0);ee.addGetterSetter(On,"rotationSnaps",[]);ee.addGetterSetter(On,"rotateAnchorOffset",50,Ge());ee.addGetterSetter(On,"rotationSnapTolerance",5,Ge());ee.addGetterSetter(On,"borderEnabled",!0);ee.addGetterSetter(On,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(On,"anchorStrokeWidth",1,Ge());ee.addGetterSetter(On,"anchorFill","white");ee.addGetterSetter(On,"anchorCornerRadius",0,Ge());ee.addGetterSetter(On,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(On,"borderStrokeWidth",1,Ge());ee.addGetterSetter(On,"borderDash");ee.addGetterSetter(On,"keepRatio",!0);ee.addGetterSetter(On,"centeredScaling",!1);ee.addGetterSetter(On,"ignoreStroke",!1);ee.addGetterSetter(On,"padding",0,Ge());ee.addGetterSetter(On,"node");ee.addGetterSetter(On,"nodes");ee.addGetterSetter(On,"boundBoxFunc");ee.addGetterSetter(On,"anchorDragBoundFunc");ee.addGetterSetter(On,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(On,"useSingleNodeRotation",!0);ee.backCompat(On,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class vc extends $e{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,gt.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)}}vc.prototype.className="Wedge";vc.prototype._centroid=!0;vc.prototype._attrsAffectingSize=["radius"];Cr(vc);ee.addGetterSetter(vc,"radius",0,Ge());ee.addGetterSetter(vc,"angle",0,Ge());ee.addGetterSetter(vc,"clockwise",!1);ee.backCompat(vc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function qI(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var j7e=[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],H7e=[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 V7e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,f,p,m,v,b,x,E,k,_,T,A,R,I,D,B,z,j,Y,te,G=t+t+1,$=r-1,V=i-1,J=t+1,Z=J*(J+1)/2,U=new qI,X=null,le=U,fe=null,Se=null,Ae=j7e[t],be=H7e[t];for(s=1;s>be,Y!==0?(Y=255/Y,n[f]=(m*Ae>>be)*Y,n[f+1]=(v*Ae>>be)*Y,n[f+2]=(b*Ae>>be)*Y):n[f]=n[f+1]=n[f+2]=0,m-=E,v-=k,b-=_,x-=T,E-=fe.r,k-=fe.g,_-=fe.b,T-=fe.a,l=p+((l=o+t+1)<$?l:$)<<2,A+=fe.r=n[l],R+=fe.g=n[l+1],I+=fe.b=n[l+2],D+=fe.a=n[l+3],m+=A,v+=R,b+=I,x+=D,fe=fe.next,E+=B=Se.r,k+=z=Se.g,_+=j=Se.b,T+=Y=Se.a,A-=B,R-=z,I-=j,D-=Y,Se=Se.next,f+=4;p+=r}for(o=0;o>be,Y>0?(Y=255/Y,n[l]=(m*Ae>>be)*Y,n[l+1]=(v*Ae>>be)*Y,n[l+2]=(b*Ae>>be)*Y):n[l]=n[l+1]=n[l+2]=0,m-=E,v-=k,b-=_,x-=T,E-=fe.r,k-=fe.g,_-=fe.b,T-=fe.a,l=o+((l=a+J)0&&V7e(t,n)};ee.addGetterSetter(qe,"blurRadius",0,Ge(),ee.afterSetFilter);const W7e=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};ee.addGetterSetter(qe,"contrast",0,Ge(),ee.afterSetFilter);const q7e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,f=l*4,p=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:he.error("Unknown emboss direction: "+r)}do{var m=(p-1)*f,v=o;p+v<1&&(v=0),p+v>u&&(v=0);var b=(p-1+v)*l*4,x=l;do{var E=m+(x-1)*4,k=a;x+k<1&&(k=0),x+k>l&&(k=0);var _=b+(x-1+k)*4,T=s[E]-s[_],A=s[E+1]-s[_+1],R=s[E+2]-s[_+2],I=T,D=I>0?I:-I,B=A>0?A:-A,z=R>0?R:-R;if(B>D&&(I=A),z>D&&(I=R),I*=t,i){var j=s[E]+I,Y=s[E+1]+I,te=s[E+2]+I;s[E]=j>255?255:j<0?0:j,s[E+1]=Y>255?255:Y<0?0:Y,s[E+2]=te>255?255:te<0?0:te}else{var G=n-I;G<0?G=0:G>255&&(G=255),s[E]=s[E+1]=s[E+2]=G}}while(--x)}while(--p)};ee.addGetterSetter(qe,"embossStrength",.5,Ge(),ee.afterSetFilter);ee.addGetterSetter(qe,"embossWhiteLevel",.5,Ge(),ee.afterSetFilter);ee.addGetterSetter(qe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(qe,"embossBlend",!1,null,ee.afterSetFilter);function CC(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 Y7e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],f=u,p,m,v=this.enhance();if(v!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),p=t[m+2],pf&&(f=p);i===r&&(i=255,r=0),s===a&&(s=255,a=0),f===u&&(f=255,u=0);var b,x,E,k,_,T,A,R,I;for(v>0?(x=i+v*(255-i),E=r-v*(r-0),_=s+v*(255-s),T=a-v*(a-0),R=f+v*(255-f),I=u-v*(u-0)):(b=(i+r)*.5,x=i+v*(i-b),E=r+v*(r-b),k=(s+a)*.5,_=s+v*(s-k),T=a+v*(a-k),A=(f+u)*.5,R=f+v*(f-A),I=u+v*(u-A)),m=0;mk?E:k;var _=a,T=o,A,R,I=360/T*Math.PI/180,D,B;for(R=0;RT?_:T;var A=a,R=o,I,D,B=n.polarRotation||0,z,j;for(f=0;ft&&(A=T,R=0,I=-1),i=0;i=0&&v=0&&b=0&&v=0&&b=255*4?255:0}return a}function s9e(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&&v=0&&b=n))for(o=x;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],f+=A[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,f=f/T,i=v;i=n))for(o=x;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=f)}};ee.addGetterSetter(qe,"pixelSize",8,Ge(),ee.afterSetFilter);const d9e=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)});ee.addGetterSetter(qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(qe,"blue",0,FW,ee.afterSetFilter);const h9e=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)});ee.addGetterSetter(qe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(qe,"blue",0,FW,ee.afterSetFilter);ee.addGetterSetter(qe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const p9e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),f>127&&(f=255-f),p>127&&(p=255-p),t[l]=u,t[l+1]=f,t[l+2]=p}while(--s)}while(--o)},m9e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new F0.Stage({container:i,width:n,height:r}),a=new F0.Layer,s=new F0.Layer;a.add(new F0.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new F0.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l},y9e=e=>{const t=window.open("");!t||e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})};let vG=null,yG=null;const b9e=e=>{vG=e},tl=()=>vG,S9e=e=>{yG=e},bG=()=>yG,x9e=e=>{const t=tl(),{generationMode:n,optionsState:r,canvasState:i,systemState:o}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:u,height:f,hiresFix:p,img2imgStrength:m,infillMethod:v,initialImage:b,iterations:x,perlin:E,prompt:k,sampler:_,seamBlur:T,seamless:A,seamSize:R,seamSteps:I,seamStrength:D,seed:B,seedWeights:z,shouldFitToWidthHeight:j,shouldGenerateVariations:Y,shouldRandomizeSeed:te,shouldRunESRGAN:G,shouldRunFacetool:$,steps:V,threshold:J,tileSize:Z,upscalingLevel:U,upscalingStrength:X,variationAmount:le,width:fe}=r,{shouldDisplayInProgressType:Se,saveIntermediatesInterval:Ae,enableImageDebugging:be}=o,ke={prompt:k,iterations:x,steps:V,cfg_scale:a,threshold:J,perlin:E,height:f,width:fe,sampler_name:_,seed:B,progress_images:Se==="full-res",progress_latents:Se==="latents",save_intermediates:Ae,generation_mode:n,init_mask:""};let De=!1,Je=!1;if(ke.seed=te?$W(ZE,QE):B,["txt2img","img2img"].includes(n)&&(ke.seamless=A,ke.hires_fix=p,G&&(De={level:U,strength:X}),$&&(Je={type:u,strength:l},u==="codeformer"&&(Je.codeformer_fidelity=s))),n==="img2img"&&b&&(ke.init_img=typeof b=="string"?b:b.url,ke.strength=m,ke.fit=j),n==="unifiedCanvas"&&t){const{layerState:{objects:Ye},boundingBoxCoordinates:mt,boundingBoxDimensions:_t,inpaintReplace:dt,shouldUseInpaintReplace:vt,stageScale:xt,isMaskEnabled:Le,shouldPreserveMaskedArea:ut,boundingBoxScaleMethod:Rt,scaledBoundingBoxDimensions:ot}=i,Ct={...mt,..._t},ln=v9e(Le?Ye.filter(WE):[],Ct);ke.init_mask=ln,ke.fit=!1,ke.strength=m,ke.invert_mask=ut,vt&&(ke.inpaint_replace=dt),ke.bounding_box=Ct;const ue=t.scale();t.scale({x:1/xt,y:1/xt});const Ie=t.getAbsolutePosition(),We=t.toDataURL({x:Ct.x+Ie.x,y:Ct.y+Ie.y,width:Ct.width,height:Ct.height});be&&y9e([{base64:ln,caption:"mask sent as init_mask"},{base64:We,caption:"image sent as init_img"}]),t.scale(ue),ke.init_img=We,ke.progress_images=!1,Rt!=="none"&&(ke.inpaint_width=ot.width,ke.inpaint_height=ot.height),ke.seam_size=R,ke.seam_blur=T,ke.seam_strength=D,ke.seam_steps=I,ke.tile_size=Z,ke.infill_method=v,ke.force_outpaint=!1}return Y?(ke.variation_amount=le,z&&(ke.with_variations=q5e(z))):ke.variation_amount=0,be&&(ke.enable_image_debugging=be),{generationParameters:ke,esrganParameters:De,facetoolParameters:Je}},w9e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Ws(!0));const o=r(),{options:a,system:s,canvas:l}=o,u={generationMode:i,optionsState:a,canvasState:l,systemState:s};n(hwe());const{generationParameters:f,esrganParameters:p,facetoolParameters:m}=x9e(u);t.emit("generateImage",f,p,m),f.init_mask&&(f.init_mask=f.init_mask.substr(0,64).concat("...")),f.init_img&&(f.init_img=f.init_img.substr(0,64).concat("...")),n(eo({timestamp:to(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...f,...p,...m})}`}))},emitRunESRGAN:i=>{n(Ws(!0));const o=r().options,{upscalingLevel:a,upscalingStrength:s}=o,l={upscale:[a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(eo({timestamp:to(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(Ws(!0));const o=r().options,{facetoolType:a,facetoolStrength:s,codeformerFidelity:l}=o,u={facetool_strength:s};a==="codeformer"&&(u.codeformer_fidelity=l),t.emit("runPostprocessing",i,{type:a,...u}),n(eo({timestamp:to(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...u})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(BU(i)),t.emit("deleteImage",o,l,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")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitRequestModelChange:i=>{n(cwe()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}},C9e=()=>{const{origin:e}=new URL(window.location.href),t=P4(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:f,onGenerationResult:p,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:x,onImageDeleted:E,onSystemConfig:k,onModelChanged:_,onFoundModels:T,onNewModelAdded:A,onModelDeleted:R,onModelChangeFailed:I,onTempFolderEmptied:D}=eCe(i),{emitGenerateImage:B,emitRunESRGAN:z,emitRunFacetool:j,emitDeleteImage:Y,emitRequestImages:te,emitRequestNewImages:G,emitCancelProcessing:$,emitRequestSystemConfig:V,emitSearchForModels:J,emitAddNewModel:Z,emitDeleteModel:U,emitRequestModelChange:X,emitSaveStagingAreaImageToGallery:le,emitRequestEmptyTempFolder:fe}=w9e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",Se=>u(Se)),t.on("generationResult",Se=>p(Se)),t.on("postprocessingResult",Se=>f(Se)),t.on("intermediateResult",Se=>m(Se)),t.on("progressUpdate",Se=>v(Se)),t.on("galleryImages",Se=>b(Se)),t.on("processingCanceled",()=>{x()}),t.on("imageDeleted",Se=>{E(Se)}),t.on("systemConfig",Se=>{k(Se)}),t.on("foundModels",Se=>{T(Se)}),t.on("newModelAdded",Se=>{A(Se)}),t.on("modelDeleted",Se=>{R(Se)}),t.on("modelChanged",Se=>{_(Se)}),t.on("modelChangeFailed",Se=>{I(Se)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{B(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{j(a.payload);break}case"socketio/deleteImage":{Y(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{G(a.payload);break}case"socketio/cancelProcessing":{$();break}case"socketio/requestSystemConfig":{V();break}case"socketio/searchForModels":{J(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{U(a.payload);break}case"socketio/requestModelChange":{X(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{le(a.payload);break}case"socketio/requestEmptyTempFolder":{fe();break}}o(a)}},_9e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),k9e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),E9e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),SG=aU({options:fSe,gallery:wSe,system:mwe,canvas:Ywe}),P9e=vU.getPersistConfig({key:"root",storage:mU,rootReducer:SG,blacklist:[..._9e,...k9e,...E9e],debounce:300}),T9e=A5e(P9e,SG),xG=a5e({reducer:T9e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(C9e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var wG={exports:{}},CG={};/** * @license React * use-sync-external-store-shim.production.min.js @@ -476,7 +476,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iP=Symbol.for("react.element"),oP=Symbol.for("react.portal"),Ex=Symbol.for("react.fragment"),Px=Symbol.for("react.strict_mode"),Tx=Symbol.for("react.profiler"),Lx=Symbol.for("react.provider"),Ax=Symbol.for("react.context"),t8e=Symbol.for("react.server_context"),Ox=Symbol.for("react.forward_ref"),Mx=Symbol.for("react.suspense"),Rx=Symbol.for("react.suspense_list"),Ix=Symbol.for("react.memo"),Dx=Symbol.for("react.lazy"),n8e=Symbol.for("react.offscreen"),LG;LG=Symbol.for("react.module.reference");function vs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iP:switch(e=e.type,e){case Ex:case Tx:case Px:case Mx:case Rx:return e;default:switch(e=e&&e.$$typeof,e){case t8e:case Ax:case Ox:case Dx:case Ix:case Lx:return e;default:return t}}case oP:return t}}}Bn.ContextConsumer=Ax;Bn.ContextProvider=Lx;Bn.Element=iP;Bn.ForwardRef=Ox;Bn.Fragment=Ex;Bn.Lazy=Dx;Bn.Memo=Ix;Bn.Portal=oP;Bn.Profiler=Tx;Bn.StrictMode=Px;Bn.Suspense=Mx;Bn.SuspenseList=Rx;Bn.isAsyncMode=function(){return!1};Bn.isConcurrentMode=function(){return!1};Bn.isContextConsumer=function(e){return vs(e)===Ax};Bn.isContextProvider=function(e){return vs(e)===Lx};Bn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iP};Bn.isForwardRef=function(e){return vs(e)===Ox};Bn.isFragment=function(e){return vs(e)===Ex};Bn.isLazy=function(e){return vs(e)===Dx};Bn.isMemo=function(e){return vs(e)===Ix};Bn.isPortal=function(e){return vs(e)===oP};Bn.isProfiler=function(e){return vs(e)===Tx};Bn.isStrictMode=function(e){return vs(e)===Px};Bn.isSuspense=function(e){return vs(e)===Mx};Bn.isSuspenseList=function(e){return vs(e)===Rx};Bn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ex||e===Tx||e===Px||e===Mx||e===Rx||e===n8e||typeof e=="object"&&e!==null&&(e.$$typeof===Dx||e.$$typeof===Ix||e.$$typeof===Lx||e.$$typeof===Ax||e.$$typeof===Ox||e.$$typeof===LG||e.getModuleId!==void 0)};Bn.typeOf=vs;(function(e){e.exports=Bn})(e8e);function r8e(){const e=Y9e();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 YI={notify(){},get:()=>[]};function i8e(e,t){let n,r=YI;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=r8e())}function u(){n&&(n(),n=void 0,r.clear(),r=YI)}const f={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return f}const o8e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a8e=o8e?C.exports.useLayoutEffect:C.exports.useEffect;function s8e({store:e,context:t,children:n,serverState:r}){const i=C.exports.useMemo(()=>{const s=i8e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=C.exports.useMemo(()=>e.getState(),[e]);return a8e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),y((t||nf).Provider,{value:i,children:n})}function AG(e=nf){const t=e===nf?PG:()=>C.exports.useContext(e);return function(){const{store:r}=t();return r}}const l8e=AG();function u8e(e=nf){const t=e===nf?l8e:AG(e);return function(){return t().dispatch}}const c8e=u8e();X9e(_G.exports.useSyncExternalStoreWithSelector);q9e(pu.exports.unstable_batchedUpdates);function O4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O4=function(n){return typeof n}:O4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},O4(e)}function d8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;ny(at,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y(by,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),Be=c8e,ve=J9e,g8e=lt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),m8e=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ve(g8e),i=t?Math.round(t*100/n):0;return y(LV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};var RG={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ZI=oe.createContext&&oe.createContext(RG),Wd=globalThis&&globalThis.__assign||function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y(so,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y(fs,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function q8e(e){const{title:t,hotkey:n,description:r}=e;return K("div",{className:"hotkey-modal-item",children:[K("div",{className:"hotkey-info",children:[y("p",{className:"hotkey-title",children:t}),r&&y("p",{className:"hotkey-description",children:r})]}),y("div",{className:"hotkey-key",children:n})]})}function Y8e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=f=>{const p=[];return f.forEach((m,v)=>{p.push(y(q8e,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y("div",{className:"hotkey-modal-category",children:p})};return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,children:[y(Jd,{}),K(ep,{className:" modal hotkeys-modal",children:[y(Cy,{className:"modal-close-btn"}),y("h1",{children:"Keyboard Shorcuts"}),y("div",{className:"hotkeys-modal-items",children:K(Nk,{allowMultiple:!0,children:[K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:appHotkeys")}),y(ng,{})]}),y(ig,{children:u(o)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:generalHotkeys")}),y(ng,{})]}),y(ig,{children:u(a)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:galleryHotkeys")}),y(ng,{})]}),y(ig,{children:u(s)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y(ng,{})]}),y(ig,{children:u(l)})]})]})})]})]})]})}const os=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return K(Ir,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y(ti,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y(kE,{className:"invokeai__switch-root",...s})]})},nl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return K(Ir,{isDisabled:n,className:`invokeai__select ${l}`,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},children:[t&&y(ti,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y(so,{label:i,...o,children:y(OV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(f=>typeof f=="string"||typeof f=="number"?y("option",{value:f,className:"invokeai__select-option",children:f},f):y("option",{value:f.value,className:"invokeai__select-option",children:f.key},f.value))})})]})},JI=/^-?(0\.)?\.?$/,Eo=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:f,min:p,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:E,numberInputStepperProps:k,tooltipProps:_,...T}=e,[A,R]=C.exports.useState(String(u));C.exports.useEffect(()=>{!A.match(JI)&&u!==Number(A)&&R(String(u))},[u,A]);const I=B=>{R(B),B.match(JI)||f(v?Math.floor(Number(B)):Number(B))},D=B=>{const z=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),p,m);R(String(z)),f(z)};return y(so,{..._,children:K(Ir,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y(ti,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),K(gE,{className:"invokeai__number-input-root",value:A,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[y(mE,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&K("div",{className:"invokeai__number-input-stepper",children:[y(yE,{...k,className:"invokeai__number-input-stepper-button"}),y(vE,{...k,className:"invokeai__number-input-stepper-button"})]})]})]})})},al=e=>e.system,K8e=e=>e.system.toastQueue,_r=lt(e=>e.options,e=>zE[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});lt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const dP=e=>e.options,X8e=lt([al,dP],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,f)=>f),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Z8e=({children:e})=>{const t=Be(),{t:n}=Ke(),r=ve(_=>_.options.steps),{isOpen:i,onOpen:o,onClose:a}=Qh(),{isOpen:s,onOpen:l,onClose:u}=Qh(),{shouldDisplayInProgressType:f,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=ve(X8e),E=()=>{MG.purge().then(()=>{a(),l()})},k=_=>{_>r&&(_=r),_<1&&(_=1),t(dwe(_))};return K(fn,{children:[C.exports.cloneElement(e,{onClick:o}),K(Qd,{isOpen:i,onClose:a,size:"lg",children:[y(Jd,{}),K(ep,{className:"modal settings-modal",children:[y(S1,{className:"settings-modal-header",children:n("common:settingsLabel")}),y(Cy,{className:"modal-close-btn"}),K(t1,{className:"settings-modal-content",children:[K("div",{className:"settings-modal-items",children:[K("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y(nl,{label:n("settings:displayInProgress"),validValues:aCe,value:f,onChange:_=>t(iwe(_.target.value))}),f==="full-res"&&y(Eo,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:k,value:v,width:"auto",textAlign:"center"})]}),y(os,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:p,onChange:_=>t(eW(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(lwe(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(cSe(_.target.checked))})]}),K("div",{className:"settings-modal-items",children:[y("h2",{style:{fontWeight:"bold"},children:"Developer"}),y(os,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(fwe(_.target.checked))})]}),K("div",{className:"settings-modal-reset",children:[y(Hh,{size:"md",children:n("settings:resetWebUI")}),y(ds,{colorScheme:"red",onClick:E,children:n("settings:resetWebUI")}),y(yr,{children:n("settings:resetWebUIDesc1")}),y(yr,{children:n("settings:resetWebUIDesc2")})]})]}),y(cx,{children:y(ds,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),K(Qd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y(Jd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y(ep,{children:y(t1,{pb:6,pt:6,children:y(at,{justifyContent:"center",children:y(yr,{fontSize:"lg",children:y(yr,{children:n("settings:resetComplete")})})})})})]})]})},Q8e=lt(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:gi.exports.isEqual}}),J8e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ve(Q8e),s=Be(),{t:l}=Ke();let u;e&&!o?u="status-good":u="status-bad";let f=i;return[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(f)&&(u="status-working"),f&&t&&r>1&&(f+=` (${n}/${r})`),y(so,{label:o&&!a?"Click to clear, check logs for details":void 0,children:y(yr,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(tW())},className:`status ${u}`,children:l(f)})})},Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return K(bE,{...o,children:[y(wE,{children:t}),K(xE,{className:`invokeai__popover-content ${r}`,children:[i&&y(SE,{className:"invokeai__popover-arrow"}),n]})]})},qr=Oe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y(so,{label:r,...i,children:y(ds,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function e_e(){const{t:e}=Ke(),{setColorMode:t,colorMode:n}=uy(),r=Be(),i=ve(l=>l.options.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};C.exports.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(Q5e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y(qr,{style:{width:"6rem"},leftIcon:i===u?y(aP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(B8e,{})}),children:y(pi,{align:"stretch",children:s()})})}const t_e=lt([al],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),n_e=()=>{const e=Be(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ve(t_e);return y(at,{style:{paddingLeft:"0.3rem"},children:y(nl,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e(BW(a.target.value))}})})};function rs(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return K(Ir,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y(ti,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y(Uk,{...l,className:"input-entry",size:a,width:o})]})}var eD=Array.isArray,tD=Object.keys,r_e=Object.prototype.hasOwnProperty,i_e=typeof Element<"u";function w8(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=eD(e),r=eD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!w8(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var p=tD(e);if(o=p.length,o!==tD(t).length)return!1;for(i=o;i--!==0;)if(!r_e.call(t,p[i]))return!1;if(i_e&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!w8(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Sd=function(t,n){try{return w8(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},o_e=function(t){return a_e(t)&&!s_e(t)};function a_e(e){return!!e&&typeof e=="object"}function s_e(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||c_e(e)}var l_e=typeof Symbol=="function"&&Symbol.for,u_e=l_e?Symbol.for("react.element"):60103;function c_e(e){return e.$$typeof===u_e}function d_e(e){return Array.isArray(e)?[]:{}}function q5(e,t){return t.clone!==!1&&t.isMergeableObject(e)?J2(d_e(e),e,t):e}function f_e(e,t,n){return e.concat(t).map(function(r){return q5(r,n)})}function h_e(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=q5(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=q5(t[i],n):r[i]=J2(e[i],t[i],n)}),r}function J2(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||f_e,n.isMergeableObject=n.isMergeableObject||o_e;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):h_e(e,t,n):q5(t,n)}J2.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return J2(r,i,n)},{})};var C8=J2,p_e=typeof global=="object"&&global&&global.Object===Object&&global;const GG=p_e;var g_e=typeof self=="object"&&self&&self.Object===Object&&self,m_e=GG||g_e||Function("return this")();const Su=m_e;var v_e=Su.Symbol;const rf=v_e;var qG=Object.prototype,y_e=qG.hasOwnProperty,b_e=qG.toString,cv=rf?rf.toStringTag:void 0;function S_e(e){var t=y_e.call(e,cv),n=e[cv];try{e[cv]=void 0;var r=!0}catch(o){}var i=b_e.call(e);return r&&(t?e[cv]=n:delete e[cv]),i}var x_e=Object.prototype,w_e=x_e.toString;function C_e(e){return w_e.call(e)}var __e="[object Null]",k_e="[object Undefined]",nD=rf?rf.toStringTag:void 0;function bp(e){return e==null?e===void 0?k_e:__e:nD&&nD in Object(e)?S_e(e):C_e(e)}function YG(e,t){return function(n){return e(t(n))}}var E_e=YG(Object.getPrototypeOf,Object);const fP=E_e;function Sp(e){return e!=null&&typeof e=="object"}var P_e="[object Object]",T_e=Function.prototype,L_e=Object.prototype,KG=T_e.toString,A_e=L_e.hasOwnProperty,O_e=KG.call(Object);function rD(e){if(!Sp(e)||bp(e)!=P_e)return!1;var t=fP(e);if(t===null)return!0;var n=A_e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&KG.call(n)==O_e}function M_e(){this.__data__=[],this.size=0}function XG(e,t){return e===t||e!==e&&t!==t}function Bx(e,t){for(var n=e.length;n--;)if(XG(e[n][0],t))return n;return-1}var R_e=Array.prototype,I_e=R_e.splice;function D_e(e){var t=this.__data__,n=Bx(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():I_e.call(t,n,1),--this.size,!0}function N_e(e){var t=this.__data__,n=Bx(t,e);return n<0?void 0:t[n][1]}function B_e(e){return Bx(this.__data__,e)>-1}function $_e(e,t){var n=this.__data__,r=Bx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Wke}var Gke="[object Arguments]",qke="[object Array]",Yke="[object Boolean]",Kke="[object Date]",Xke="[object Error]",Zke="[object Function]",Qke="[object Map]",Jke="[object Number]",eEe="[object Object]",tEe="[object RegExp]",nEe="[object Set]",rEe="[object String]",iEe="[object WeakMap]",oEe="[object ArrayBuffer]",aEe="[object DataView]",sEe="[object Float32Array]",lEe="[object Float64Array]",uEe="[object Int8Array]",cEe="[object Int16Array]",dEe="[object Int32Array]",fEe="[object Uint8Array]",hEe="[object Uint8ClampedArray]",pEe="[object Uint16Array]",gEe="[object Uint32Array]",ir={};ir[sEe]=ir[lEe]=ir[uEe]=ir[cEe]=ir[dEe]=ir[fEe]=ir[hEe]=ir[pEe]=ir[gEe]=!0;ir[Gke]=ir[qke]=ir[oEe]=ir[Yke]=ir[aEe]=ir[Kke]=ir[Xke]=ir[Zke]=ir[Qke]=ir[Jke]=ir[eEe]=ir[tEe]=ir[nEe]=ir[rEe]=ir[iEe]=!1;function mEe(e){return Sp(e)&&rq(e.length)&&!!ir[bp(e)]}function hP(e){return function(t){return e(t)}}var iq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,o2=iq&&typeof module=="object"&&module&&!module.nodeType&&module,vEe=o2&&o2.exports===iq,EC=vEe&&GG.process,yEe=function(){try{var e=o2&&o2.require&&o2.require("util").types;return e||EC&&EC.binding&&EC.binding("util")}catch(t){}}();const i1=yEe;var uD=i1&&i1.isTypedArray,bEe=uD?hP(uD):mEe;const SEe=bEe;var xEe=Object.prototype,wEe=xEe.hasOwnProperty;function oq(e,t){var n=Ny(e),r=!n&&Nke(e),i=!n&&!r&&nq(e),o=!n&&!r&&!i&&SEe(e),a=n||r||i||o,s=a?Oke(e.length,String):[],l=s.length;for(var u in e)(t||wEe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uke(u,l)))&&s.push(u);return s}var CEe=Object.prototype;function pP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CEe;return e===n}var _Ee=YG(Object.keys,Object);const kEe=_Ee;var EEe=Object.prototype,PEe=EEe.hasOwnProperty;function TEe(e){if(!pP(e))return kEe(e);var t=[];for(var n in Object(e))PEe.call(e,n)&&n!="constructor"&&t.push(n);return t}function aq(e){return e!=null&&rq(e.length)&&!ZG(e)}function gP(e){return aq(e)?oq(e):TEe(e)}function LEe(e,t){return e&&Fx(t,gP(t),e)}function AEe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OEe=Object.prototype,MEe=OEe.hasOwnProperty;function REe(e){if(!Dy(e))return AEe(e);var t=pP(e),n=[];for(var r in e)r=="constructor"&&(t||!MEe.call(e,r))||n.push(r);return n}function mP(e){return aq(e)?oq(e,!0):REe(e)}function IEe(e,t){return e&&Fx(t,mP(t),e)}var sq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cD=sq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=cD&&cD.exports===sq,dD=DEe?Su.Buffer:void 0,fD=dD?dD.allocUnsafe:void 0;function NEe(e,t){if(t)return e.slice();var n=e.length,r=fD?fD(n):new e.constructor(n);return e.copy(r),r}function lq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function TD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var LD=function(t){return Array.isArray(t)&&t.length===0},Vo=function(t){return typeof t=="function"},zx=function(t){return t!==null&&typeof t=="object"},ITe=function(t){return String(Math.floor(Number(t)))===t},PC=function(t){return Object.prototype.toString.call(t)==="[object String]"},bq=function(t){return C.exports.Children.count(t)===0},TC=function(t){return zx(t)&&Vo(t.then)};function Hi(e,t,n,r){r===void 0&&(r=0);for(var i=yq(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function Sq(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Xe){return B(Xe,Hi(ue,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(We).then(function(Xe){return Xe.reduce(function(Ce,Ne,kt){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(Ce=au(Ce,Ie[kt],Ne)),Ce},{})})},[B]),j=C.exports.useCallback(function(ue){return Promise.all([z(ue),m.validationSchema?D(ue):{},m.validate?I(ue):{}]).then(function(Ie){var We=Ie[0],Xe=Ie[1],Ce=Ie[2],Ne=C8.all([We,Xe,Ce],{arrayMerge:zTe});return Ne})},[m.validate,m.validationSchema,z,I,D]),Y=Xa(function(ue){return ue===void 0&&(ue=A.values),R({type:"SET_ISVALIDATING",payload:!0}),j(ue).then(function(Ie){return k.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ie})),Ie})});C.exports.useEffect(function(){a&&k.current===!0&&Sd(v.current,m.initialValues)&&Y(v.current)},[a,Y]);var te=C.exports.useCallback(function(ue){var Ie=ue&&ue.values?ue.values:v.current,We=ue&&ue.errors?ue.errors:b.current?b.current:m.initialErrors||{},Xe=ue&&ue.touched?ue.touched:x.current?x.current:m.initialTouched||{},Ce=ue&&ue.status?ue.status:E.current?E.current:m.initialStatus;v.current=Ie,b.current=We,x.current=Xe,E.current=Ce;var Ne=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!ue&&!!ue.isSubmitting,errors:We,touched:Xe,status:Ce,values:Ie,isValidating:!!ue&&!!ue.isValidating,submitCount:!!ue&&!!ue.submitCount&&typeof ue.submitCount=="number"?ue.submitCount:0}})};if(m.onReset){var kt=m.onReset(A.values,dt);TC(kt)?kt.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);C.exports.useEffect(function(){k.current===!0&&!Sd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&Y(v.current))},[u,m.initialValues,te,a,Y]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,R({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(x.current,m.initialTouched)&&(x.current=m.initialTouched||Nb,R({type:"SET_TOUCHED",payload:m.initialTouched||Nb}))},[u,m.initialTouched]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(E.current,m.initialStatus)&&(E.current=m.initialStatus,R({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ue){if(_.current[ue]&&Vo(_.current[ue].validate)){var Ie=Hi(A.values,ue),We=_.current[ue].validate(Ie);return TC(We)?(R({type:"SET_ISVALIDATING",payload:!0}),We.then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:ue,value:We}}),Promise.resolve(We))}else if(m.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ue).then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe[ue]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=C.exports.useCallback(function(ue,Ie){var We=Ie.validate;_.current[ue]={validate:We}},[]),V=C.exports.useCallback(function(ue){delete _.current[ue]},[]),J=Xa(function(ue,Ie){R({type:"SET_TOUCHED",payload:ue});var We=Ie===void 0?i:Ie;return We?Y(A.values):Promise.resolve()}),Z=C.exports.useCallback(function(ue){R({type:"SET_ERRORS",payload:ue})},[]),U=Xa(function(ue,Ie){var We=Vo(ue)?ue(A.values):ue;R({type:"SET_VALUES",payload:We});var Xe=Ie===void 0?n:Ie;return Xe?Y(We):Promise.resolve()}),X=C.exports.useCallback(function(ue,Ie){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Ie}})},[]),le=Xa(function(ue,Ie,We){R({type:"SET_FIELD_VALUE",payload:{field:ue,value:Ie}});var Xe=We===void 0?n:We;return Xe?Y(au(A.values,ue,Ie)):Promise.resolve()}),fe=C.exports.useCallback(function(ue,Ie){var We=Ie,Xe=ue,Ce;if(!PC(ue)){ue.persist&&ue.persist();var Ne=ue.target?ue.target:ue.currentTarget,kt=Ne.type,Nt=Ne.name,Te=Ne.id,Et=Ne.value,Ut=Ne.checked,Ve=Ne.outerHTML,ft=Ne.options,un=Ne.multiple;We=Ie||Nt||Te,Xe=/number|range/.test(kt)?(Ce=parseFloat(Et),isNaN(Ce)?"":Ce):/checkbox/.test(kt)?HTe(Hi(A.values,We),Ut,Et):ft&&un?jTe(ft):Et}We&&le(We,Xe)},[le,A.values]),Se=Xa(function(ue){if(PC(ue))return function(Ie){return fe(Ie,ue)};fe(ue)}),Ae=Xa(function(ue,Ie,We){Ie===void 0&&(Ie=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:ue,value:Ie}});var Xe=We===void 0?i:We;return Xe?Y(A.values):Promise.resolve()}),be=C.exports.useCallback(function(ue,Ie){ue.persist&&ue.persist();var We=ue.target,Xe=We.name,Ce=We.id,Ne=We.outerHTML,kt=Ie||Xe||Ce;Ae(kt,!0)},[Ae]),ke=Xa(function(ue){if(PC(ue))return function(Ie){return be(Ie,ue)};be(ue)}),De=C.exports.useCallback(function(ue){Vo(ue)?R({type:"SET_FORMIK_STATE",payload:ue}):R({type:"SET_FORMIK_STATE",payload:function(){return ue}})},[]),Je=C.exports.useCallback(function(ue){R({type:"SET_STATUS",payload:ue})},[]),Ye=C.exports.useCallback(function(ue){R({type:"SET_ISSUBMITTING",payload:ue})},[]),mt=Xa(function(){return R({type:"SUBMIT_ATTEMPT"}),Y().then(function(ue){var Ie=ue instanceof Error,We=!Ie&&Object.keys(ue).length===0;if(We){var Xe;try{if(Xe=vt(),Xe===void 0)return}catch(Ce){throw Ce}return Promise.resolve(Xe).then(function(Ce){return k.current&&R({type:"SUBMIT_SUCCESS"}),Ce}).catch(function(Ce){if(k.current)throw R({type:"SUBMIT_FAILURE"}),Ce})}else if(k.current&&(R({type:"SUBMIT_FAILURE"}),Ie))throw ue})}),_t=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),mt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),dt={resetForm:te,validateForm:Y,validateField:G,setErrors:Z,setFieldError:X,setFieldTouched:Ae,setFieldValue:le,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,setFormikState:De,submitForm:mt},vt=Xa(function(){return f(A.values,dt)}),xt=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),te()}),Le=C.exports.useCallback(function(ue){return{value:Hi(A.values,ue),error:Hi(A.errors,ue),touched:!!Hi(A.touched,ue),initialValue:Hi(v.current,ue),initialTouched:!!Hi(x.current,ue),initialError:Hi(b.current,ue)}},[A.errors,A.touched,A.values]),ut=C.exports.useCallback(function(ue){return{setValue:function(We,Xe){return le(ue,We,Xe)},setTouched:function(We,Xe){return Ae(ue,We,Xe)},setError:function(We){return X(ue,We)}}},[le,Ae,X]),Rt=C.exports.useCallback(function(ue){var Ie=zx(ue),We=Ie?ue.name:ue,Xe=Hi(A.values,We),Ce={name:We,value:Xe,onChange:Se,onBlur:ke};if(Ie){var Ne=ue.type,kt=ue.value,Nt=ue.as,Te=ue.multiple;Ne==="checkbox"?kt===void 0?Ce.checked=!!Xe:(Ce.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(kt)),Ce.value=kt):Ne==="radio"?(Ce.checked=Xe===kt,Ce.value=kt):Nt==="select"&&Te&&(Ce.value=Ce.value||[],Ce.multiple=!0)}return Ce},[ke,Se,A.values]),ot=C.exports.useMemo(function(){return!Sd(v.current,A.values)},[v.current,A.values]),Ct=C.exports.useMemo(function(){return typeof s<"u"?ot?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Vo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ot,A.errors,m]),ln=Wn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:x.current,initialStatus:E.current,handleBlur:ke,handleChange:Se,handleReset:xt,handleSubmit:_t,resetForm:te,setErrors:Z,setFormikState:De,setFieldTouched:Ae,setFieldValue:le,setFieldError:X,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,submitForm:mt,validateForm:Y,validateField:G,isValid:Ct,dirty:ot,unregisterField:V,registerField:$,getFieldProps:Rt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return ln}function wP(e){var t=BTe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return C.exports.useImperativeHandle(o,function(){return t}),C.exports.createElement(DTe,{value:t},n?C.exports.createElement(n,t):i?i(t):r?Vo(r)?r(t):bq(r)?null:C.exports.Children.only(r):null)}function $Te(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Hi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function FTe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=T8(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function T8(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||rD(i)?T8(i):i!==""?i:void 0}):rD(e[r])?t[r]=T8(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function zTe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?C8(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=C8(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function jTe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function HTe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var VTe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function Xa(e){var t=C.exports.useRef(e);return VTe(function(){t.current=e}),C.exports.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Wn({},t,{length:n+1}))}else return[]},YTe=function(e){RTe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,f=l.formik.setFormikState;f(function(p){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(p.values,u,o(Hi(p.values,u))),x=s?m(Hi(p.errors,u)):void 0,E=a?v(Hi(p.touched,u)):void 0;return LD(x)&&(x=void 0),LD(E)&&(E=void 0),Wn({},p,{values:b,errors:s?au(p.errors,u,x):p.errors,touched:a?au(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(o1(a),[MTe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return GTe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return WTe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return LC(s,o,a)},function(s){return LC(s,o,null)},function(s){return LC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return qTe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(TD(i)),i.pop=i.pop.bind(TD(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Hi(i.formik.values,i.name),Hi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?o1(a):[];return o||(o=s[i]),Vo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,f=o.formik,p=Ih(f,["validate","validationSchema"]),m=Wn({},i,{form:p,name:u});return a?C.exports.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):bq(l)?null:C.exports.Children.only(l):null},t}(C.exports.Component);YTe.defaultProps={validateOnChange:!0};const KTe=lt([al],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),AD=64,OD=2048;function XTe(){const{openModel:e,model_list:t}=ve(KTe),n=ve(l=>l.system.isProcessing),r=Be(),{t:i}=Ke(),[o,a]=C.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});C.exports.useEffect(()=>{var l,u,f,p,m,v,b;if(e){const x=He.pickBy(t,(E,k)=>He.isEqual(k,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(f=x[e])==null?void 0:f.weights,vae:(p=x[e])==null?void 0:p.vae,width:(m=x[e])==null?void 0:m.width,height:(v=x[e])==null?void 0:v.height,default:(b=x[e])==null?void 0:b.default})}},[t,e]);const s=l=>{r(XE(l))};return e?K(at,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y(at,{alignItems:"center",children:y(yr,{fontSize:"lg",fontWeight:"bold",children:e})}),y(at,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y(wP,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:f})=>y("form",{onSubmit:l,children:K(pi,{rowGap:"0.5rem",alignItems:"start",children:[K(Ir,{isInvalid:!!u.description&&f.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"lg"}),!!u.description&&f.description?y(Wo,{children:u.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.config&&f.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"lg"}),!!u.config&&f.config?y(Wo,{children:u.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.weights&&f.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"lg"}),!!u.weights&&f.weights?y(Wo,{children:u.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.vae&&f.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"lg"}),!!u.vae&&f.vae?y(Wo,{children:u.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!u.width&&f.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:p,form:m})=>y(Eo,{id:"width",name:"width",min:AD,max:OD,step:64,value:m.values.width,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.width&&f.width?y(Wo,{children:u.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.height&&f.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:p,form:m})=>y(Eo,{id:"height",name:"height",min:AD,max:OD,step:64,value:m.values.height,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.height&&f.height?y(Wo,{children:u.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y(at,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y(yr,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Qn=e=>{const{label:t,styleClass:n,...r}=e;return y(Vj,{className:`invokeai__checkbox ${n}`,...r,children:t})};function ZTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function QTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function JTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function eLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function wq(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function tLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function nLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function rLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function Hx(e){return yt({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 iLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function oLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function aLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function sLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const Cq=lt([al],e=>{const{model_list:t}=e,n=[];return He.forEach(t,r=>{n.push(r.weights)}),n});function lLe(){const{t:e}=Ke();return y(rl,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function MD({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=ve(Cq),i=o=>{t.includes(o.target.value)?n(He.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return K(rl,{position:"relative",children:[r.includes(e.location)?y(lLe,{}):null,y(Qn,{value:e.name,label:y(fn,{children:K(pi,{alignItems:"start",children:[y("p",{style:{fontWeight:"bold"},children:e.name}),y("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function uLe(){const e=Be(),{t}=Ke(),n=ve(x=>x.system.searchFolder),r=ve(x=>x.system.foundModels),i=ve(Cq),o=ve(x=>x.options.shouldShowExistingModelsInSearch),a=ve(x=>x.system.isProcessing),[s,l]=oe.useState([]),u=()=>{e(nW(null)),e(rW(null)),l([])},f=x=>{e(kI(x.checkpointFolder))},p=()=>{l([]),r&&r.forEach(x=>{i.includes(x.location)||l(E=>[...E,x.name])})},m=()=>{l([])},v=()=>{const x=r==null?void 0:r.filter(E=>s.includes(E.name));x==null||x.forEach(E=>{const k={name:E.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:E.location,vae:"",width:512,height:512,default:!1};e(XE(k))}),l([])},b=()=>{const x=[],E=[];return r&&r.forEach((k,_)=>{i.includes(k.location)?E.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_)):x.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_))}),K(fn,{children:[x,o&&E]})};return K(fn,{children:[n?K(at,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y(Qe,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y(Hx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(kI(n))}),y(Qe,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y(wP,{initialValues:{checkpointFolder:""},onSubmit:x=>{f(x)},children:({handleSubmit:x})=>y("form",{onSubmit:x,children:K(Sy,{columnGap:"0.5rem",children:[y(Ir,{isRequired:!0,width:"max-content",children:y(qo,{as:rs,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y(Qe,{icon:y(ZTe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&K(at,{flexDirection:"column",rowGap:"1rem",children:[K(at,{justifyContent:"space-between",alignItems:"center",children:[K("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),K("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),K(at,{columnGap:"0.5rem",justifyContent:"space-between",children:[K(at,{columnGap:"0.5rem",children:[y(qr,{isDisabled:s.length===r.length,onClick:p,children:t("modelmanager:selectAll")}),y(qr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y(Qn,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(dSe(!o))})]}),y(qr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),K(at,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const RD=64,ID=2048;function cLe(){const{isOpen:e,onOpen:t,onClose:n}=Qh(),r=Be(),{t:i}=Ke(),o=ve(v=>v.system.isProcessing);function a(v){return/\\s/g.test(v)}function s(v){let b;return a(v)&&(b=i("modelmanager:cannotUseSpaces")),b}const l={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},u=v=>{r(XE(v)),n()},f=()=>{n()},[p,m]=oe.useState(!1);return K(fn,{children:[y(qr,{"aria-label":i("modelmanager:addNewModel"),tooltip:i("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:K(at,{columnGap:"0.5rem",alignItems:"center",children:[y(Iy,{}),i("modelmanager:addNew")]})}),K(Qd,{isOpen:e,onClose:f,size:"3xl",closeOnOverlayClick:!1,children:[y(Jd,{}),K(ep,{className:"modal add-model-modal",children:[y(S1,{children:i("modelmanager:addNewModel")}),y(Cy,{}),K(t1,{className:"add-model-modal-body",children:[y(uLe,{}),y(Qn,{label:i("modelmanager:addManually"),isChecked:p,onChange:()=>m(!p)}),p&&y(wP,{initialValues:l,onSubmit:u,children:({handleSubmit:v,errors:b,touched:x})=>y("form",{onSubmit:v,children:K(pi,{rowGap:"0.5rem",children:[y(yr,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:i("modelmanager:manual")}),K(Ir,{isInvalid:!!b.name&&x.name,isRequired:!0,children:[y(ti,{htmlFor:"name",fontSize:"sm",children:i("modelmanager:name")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"name",name:"name",type:"text",validate:s,width:"2xl"}),!!b.name&&x.name?y(Wo,{children:b.name}):y(Uo,{margin:0,children:i("modelmanager:nameValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.description&&x.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"2xl"}),!!b.description&&x.description?y(Wo,{children:b.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.config&&x.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"2xl"}),!!b.config&&x.config?y(Wo,{children:b.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.weights&&x.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"2xl"}),!!b.weights&&x.weights?y(Wo,{children:b.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.vae&&x.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"2xl"}),!!b.vae&&x.vae?y(Wo,{children:b.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!b.width&&x.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:E,form:k})=>y(Eo,{id:"width",name:"width",min:RD,max:ID,step:64,width:"90%",value:k.values.width,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.width&&x.width?y(Wo,{children:b.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.height&&x.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:E,form:k})=>y(Eo,{id:"height",name:"height",min:RD,max:ID,width:"90%",step:64,value:k.values.height,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.height&&x.height?y(Wo,{children:b.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:o,children:i("modelmanager:addModel")})]})})})]})]})]})]})}bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"SunIcon",path:K("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[y("circle",{cx:"12",cy:"12",r:"5"}),y("path",{d:"M12 1v2"}),y("path",{d:"M12 21v2"}),y("path",{d:"M4.22 4.22l1.42 1.42"}),y("path",{d:"M18.36 18.36l1.42 1.42"}),y("path",{d:"M1 12h2"}),y("path",{d:"M21 12h2"}),y("path",{d:"M4.22 19.78l1.42-1.42"}),y("path",{d:"M18.36 5.64l1.42-1.42"})]})});bt({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"});bt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"ViewIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("circle",{cx:"12",cy:"12",r:"2"})]})});bt({displayName:"ViewOffIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});var dLe=bt({displayName:"DeleteIcon",path:y("g",{fill:"currentColor",children:y("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"})})});bt({displayName:"RepeatIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"RepeatClockIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});var fLe=bt({displayName:"EditIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),y("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});bt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});bt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});bt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});bt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});bt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});bt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});bt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});bt({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"});bt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var _q=bt({displayName:"ExternalLinkIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),y("path",{d:"M15 3h6v6"}),y("path",{d:"M10 14L21 3"})]})});bt({displayName:"LinkIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"PlusSquareIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),y("path",{d:"M12 8v8"}),y("path",{d:"M8 12h8"})]})});bt({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"});bt({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"});bt({displayName:"TimeIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowRightIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowLeftIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"EmailIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({displayName:"SpinnerIcon",path:K(fn,{children:[y("defs",{children:K("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[y("stop",{stopColor:"currentColor",offset:"0%"}),y("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),K("g",{transform:"translate(2)",fill:"none",children:[y("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),y("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),y("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});bt({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"});bt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({displayName:"InfoOutlineIcon",path:K("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[y("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),y("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),y("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});bt({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"});bt({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"});bt({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"});bt({displayName:"QuestionOutlineIcon",path:K("g",{stroke:"currentColor",strokeWidth:"1.5",children:[y("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"}),y("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),y("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});bt({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"});bt({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"});bt({viewBox:"0 0 14 14",path:y("g",{fill:"currentColor",children:y("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});bt({displayName:"MinusIcon",path:y("g",{fill:"currentColor",children:y("rect",{height:"4",width:"20",x:"2",y:"10"})})});bt({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"});const CP=Oe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:f,onClose:p}=Qh(),m=C.exports.useRef(null),v=()=>{r(),p()},b=()=>{o&&o(),p()};return K(fn,{children:[C.exports.cloneElement(l,{onClick:f,ref:t}),y(xV,{isOpen:u,leastDestructiveRef:m,onClose:p,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:s}),y(t1,{children:a}),K(cx,{children:[y(ds,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y(ds,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})});function DD(e){const{isProcessing:t,isConnected:n}=ve(v=>v.system),r=ve(v=>v.system.openModel),{t:i}=Ke(),o=Be(),{name:a,status:s,description:l}=e,u=()=>{o(BW(a))},f=()=>{o(lI(a))},p=()=>{o(Z6e(a)),o(lI(null))};return K(at,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y(rl,{onClick:f,cursor:"pointer",children:y(so,{label:l,hasArrow:!0,placement:"bottom",children:y(yr,{fontWeight:"bold",children:a})})}),y(rH,{onClick:f,cursor:"pointer"}),K(at,{gap:2,alignItems:"center",children:[y(yr,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),y(ds,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y(Qe,{icon:y(fLe,{}),size:"sm",onClick:f,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y(CP,{title:i("modelmanager:deleteModel"),acceptCallback:p,acceptButtonText:i("modelmanager:delete"),triggerComponent:y(Qe,{icon:y(dLe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:K(at,{rowGap:"1rem",flexDirection:"column",children:[y("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const hLe=lt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),pLe=()=>{const{models:e}=ve(hLe),[t,n]=C.exports.useState(""),{t:r}=Ke(),i=He.debounce(a=>{n(a.target.value)},400),o=()=>{const a=[],s=[];return e.forEach((l,u)=>{l.name.startsWith(t)&&s.push(y(DD,{name:l.name,status:l.status,description:l.description},u)),a.push(y(DD,{name:l.name,status:l.status,description:l.description},u))}),t!==""?s:a};return K(at,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[K(at,{justifyContent:"space-between",children:[y(yr,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),y(cLe,{})]}),y(rs,{onChange:i,label:r("modelmanager:search")}),y(at,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:o()})]})};function gLe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke();return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,size:"6xl",children:[y(Jd,{}),K(ep,{className:" modal",children:[y(Cy,{className:"modal-close-btn"}),y(S1,{children:i("modelmanager:modelManager")}),K(at,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y(pLe,{}),y(XTe,{})]})]})]})]})}function mLe(){const{t:e,i18n:t}=Ke(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y(qr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y(I8e,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y(pi,{children:r()})})}const vLe=()=>{const{t:e}=Ke();return K("div",{className:"site-header",children:[K("div",{className:"site-header-left-side",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),K("div",{className:"site-header-right-side",children:[y(J8e,{}),y(n_e,{}),y(gLe,{children:y(Qe,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(E8e,{})})}),y(Y8e,{children:y(Qe,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(R8e,{})})}),y(e_e,{}),y(mLe,{}),y(Qe,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y(k8e,{})})}),y(Qe,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y(S8e,{})})}),y(Qe,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y(b8e,{})})}),y(Z8e,{children:y(Qe,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y(JTe,{})})})]})]})};var yLe=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)}}(),Jr=globalThis&&globalThis.__assign||function(){return Jr=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)}},kLe=["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"],zD="__resizable_base__",kq=function(e){xLe(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(zD):o.className+=zD,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||wLe},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(),u=Number(n.state[s].toString().replace("px","")),f=u/l[s]*100;return f+"%"}return AC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?AC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?AC(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&&N0("left",o),s=i&&N0("top",o),l,u;if(this.props.bounds==="parent"){var f=this.parentNode;f&&(l=a?this.resizableRight-this.parentLeft:f.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:f.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=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),u=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,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var E=(m-b)*this.ratio+x,k=(v-b)*this.ratio+x,_=(f-x)/this.ratio+b,T=(p-x)/this.ratio+b,A=Math.max(f,E),R=Math.min(p,k),I=Math.max(m,_),D=Math.min(v,T);n=$b(n,A,R),r=$b(r,I,D)}else n=$b(n,f,p),r=$b(r,m,v);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,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&CLe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Fb(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 u=this.parentNode;if(u){var f=this.window.getComputedStyle(u).flexDirection;this.flexDir=f.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Fl(Fl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Fb(n))try{n.preventDefault(),n.stopPropagation()}catch(V){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Fb(n)?n.touches[0].clientX:n.clientX,f=Fb(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,v=p.original,b=p.width,x=p.height,E=this.getParentSize(),k=_Le(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=k.maxWidth,a=k.maxHeight,s=k.minWidth,l=k.minHeight;var _=this.calculateNewSizeFromDirection(u,f),T=_.newHeight,A=_.newWidth,R=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=FD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=FD(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(A,T,{width:R.maxWidth,height:R.maxHeight},{width:s,height:l});if(A=I.newWidth,T=I.newHeight,this.props.grid){var D=$D(A,this.props.grid[0]),B=$D(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(B-T)<=z?B:T}var j={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var Y=A/E.width*100;A=Y+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var Y=T/E.height*100;T=Y+"%"}else if(x.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(x.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),pu.exports.flushSync(function(){r.setState($)}),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:Fl(Fl({},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,u=r.handleComponent;if(!i)return null;var f=Object.keys(i).map(function(p){return i[p]!==!1?y(SLe,{direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p],children:u&&u[p]?u[p]:null},p):null});return y("div",{className:l,style:s,children:f})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return kLe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Fl(Fl(Fl({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 K(o,{...Fl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&y("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}(C.exports.PureComponent),ELe=Object.create,Eq=Object.defineProperty,PLe=Object.getOwnPropertyDescriptor,TLe=Object.getOwnPropertyNames,LLe=Object.getPrototypeOf,ALe=Object.prototype.hasOwnProperty,Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),OLe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TLe(t))!ALe.call(e,i)&&i!==n&&Eq(e,i,{get:()=>t[i],enumerable:!(r=PLe(t,i))||r.enumerable});return e},Pq=(e,t,n)=>(n=e!=null?ELe(LLe(e)):{},OLe(t||!e||!e.__esModule?Eq(n,"default",{value:e,enumerable:!0}):n,e)),MLe=Ue((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),Tq=Ue((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Vx=Ue((e,t)=>{var n=Tq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),RLe=Ue((e,t)=>{var n=Vx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),ILe=Ue((e,t)=>{var n=Vx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),DLe=Ue((e,t)=>{var n=Vx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),NLe=Ue((e,t)=>{var n=Vx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Ux=Ue((e,t)=>{var n=MLe(),r=RLe(),i=ILe(),o=DLe(),a=NLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux();function r(){this.__data__=new n,this.size=0}t.exports=r}),$Le=Ue((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),FLe=Ue((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),zLe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),Lq=Ue((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),bc=Ue((e,t)=>{var n=Lq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=Ue((e,t)=>{var n=bc(),r=n.Symbol;t.exports=r}),jLe=Ue((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),f=l[a];try{l[a]=void 0;var p=!0}catch(v){}var m=o.call(l);return p&&(u?l[a]=f:delete l[a]),m}t.exports=s}),HLe=Ue((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Wx=Ue((e,t)=>{var n=_P(),r=jLe(),i=HLe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),Aq=Ue((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),Oq=Ue((e,t)=>{var n=Wx(),r=Aq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var f=n(u);return f==o||f==a||f==i||f==s}t.exports=l}),VLe=Ue((e,t)=>{var n=bc(),r=n["__core-js_shared__"];t.exports=r}),ULe=Ue((e,t)=>{var n=VLe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),Mq=Ue((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),WLe=Ue((e,t)=>{var n=Oq(),r=ULe(),i=Aq(),o=Mq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,f=l.toString,p=u.hasOwnProperty,m=RegExp("^"+f.call(p).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=v}),GLe=Ue((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Ue((e,t)=>{var n=WLe(),r=GLe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Map");t.exports=i}),Gx=Ue((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),qLe=Ue((e,t)=>{var n=Gx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),YLe=Ue((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),KLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),XLe=Ue((e,t)=>{var n=Gx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ZLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),QLe=Ue((e,t)=>{var n=qLe(),r=YLe(),i=KLe(),o=XLe(),a=ZLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=QLe(),r=Ux(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),eAe=Ue((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),qx=Ue((e,t)=>{var n=eAe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),tAe=Ue((e,t)=>{var n=qx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),nAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).get(i)}t.exports=r}),rAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).has(i)}t.exports=r}),iAe=Ue((e,t)=>{var n=qx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),Rq=Ue((e,t)=>{var n=JLe(),r=tAe(),i=nAe(),o=rAe(),a=iAe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux(),r=kP(),i=Rq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var f=u.__data__;if(!r||f.length{var n=Ux(),r=BLe(),i=$Le(),o=FLe(),a=zLe(),s=oAe();function l(u){var f=this.__data__=new n(u);this.size=f.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),sAe=Ue((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),lAe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),uAe=Ue((e,t)=>{var n=Rq(),r=sAe(),i=lAe();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),Iq=Ue((e,t)=>{var n=uAe(),r=cAe(),i=dAe(),o=1,a=2;function s(l,u,f,p,m,v){var b=f&o,x=l.length,E=u.length;if(x!=E&&!(b&&E>x))return!1;var k=v.get(l),_=v.get(u);if(k&&_)return k==u&&_==l;var T=-1,A=!0,R=f&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=bc(),r=n.Uint8Array;t.exports=r}),hAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),pAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),gAe=Ue((e,t)=>{var n=_P(),r=fAe(),i=Tq(),o=Iq(),a=hAe(),s=pAe(),l=1,u=2,f="[object Boolean]",p="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",x="[object RegExp]",E="[object Set]",k="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",R=n?n.prototype:void 0,I=R?R.valueOf:void 0;function D(B,z,j,Y,te,G,$){switch(j){case A:if(B.byteLength!=z.byteLength||B.byteOffset!=z.byteOffset)return!1;B=B.buffer,z=z.buffer;case T:return!(B.byteLength!=z.byteLength||!G(new r(B),new r(z)));case f:case p:case b:return i(+B,+z);case m:return B.name==z.name&&B.message==z.message;case x:case k:return B==z+"";case v:var V=a;case E:var J=Y&l;if(V||(V=s),B.size!=z.size&&!J)return!1;var Z=$.get(B);if(Z)return Z==z;Y|=u,$.set(B,z);var U=o(V(B),V(z),Y,te,G,$);return $.delete(B),U;case _:if(I)return I.call(B)==I.call(z)}return!1}t.exports=D}),mAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),vAe=Ue((e,t)=>{var n=mAe(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),yAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),SAe=Ue((e,t)=>{var n=yAe(),r=bAe(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),xAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),wAe=Ue((e,t)=>{var n=Wx(),r=Yx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),CAe=Ue((e,t)=>{var n=wAe(),r=Yx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),_Ae=Ue((e,t)=>{function n(){return!1}t.exports=n}),Dq=Ue((e,t)=>{var n=bc(),r=_Ae(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),kAe=Ue((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),EAe=Ue((e,t)=>{var n=Wx(),r=Nq(),i=Yx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",x="[object Set]",E="[object String]",k="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",Y="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[R]=G[I]=G[D]=G[B]=G[z]=G[j]=G[Y]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[T]=G[l]=G[u]=G[f]=G[p]=G[m]=G[v]=G[b]=G[x]=G[E]=G[k]=!1;function $(V){return i(V)&&r(V.length)&&!!G[n(V)]}t.exports=$}),PAe=Ue((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),TAe=Ue((e,t)=>{var n=Lq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),Bq=Ue((e,t)=>{var n=EAe(),r=PAe(),i=TAe(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),LAe=Ue((e,t)=>{var n=xAe(),r=CAe(),i=EP(),o=Dq(),a=kAe(),s=Bq(),l=Object.prototype,u=l.hasOwnProperty;function f(p,m){var v=i(p),b=!v&&r(p),x=!v&&!b&&o(p),E=!v&&!b&&!x&&s(p),k=v||b||x||E,_=k?n(p.length,String):[],T=_.length;for(var A in p)(m||u.call(p,A))&&!(k&&(A=="length"||x&&(A=="offset"||A=="parent")||E&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=f}),AAe=Ue((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),OAe=Ue((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),MAe=Ue((e,t)=>{var n=OAe(),r=n(Object.keys,Object);t.exports=r}),RAe=Ue((e,t)=>{var n=AAe(),r=MAe(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),IAe=Ue((e,t)=>{var n=Oq(),r=Nq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),DAe=Ue((e,t)=>{var n=LAe(),r=RAe(),i=IAe();function o(a){return i(a)?n(a):r(a)}t.exports=o}),NAe=Ue((e,t)=>{var n=vAe(),r=SAe(),i=DAe();function o(a){return n(a,i,r)}t.exports=o}),BAe=Ue((e,t)=>{var n=NAe(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,f,p,m){var v=u&r,b=n(s),x=b.length,E=n(l),k=E.length;if(x!=k&&!v)return!1;for(var _=x;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),R=m.get(l);if(A&&R)return A==l&&R==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=bc(),i=n(r,"DataView");t.exports=i}),FAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Promise");t.exports=i}),zAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Set");t.exports=i}),jAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"WeakMap");t.exports=i}),HAe=Ue((e,t)=>{var n=$Ae(),r=kP(),i=FAe(),o=zAe(),a=jAe(),s=Wx(),l=Mq(),u="[object Map]",f="[object Object]",p="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",x=l(n),E=l(r),k=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=p||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(R){var I=s(R),D=I==f?R.constructor:void 0,B=D?l(D):"";if(B)switch(B){case x:return b;case E:return u;case k:return p;case _:return m;case T:return v}return I}),t.exports=A}),VAe=Ue((e,t)=>{var n=aAe(),r=Iq(),i=gAe(),o=BAe(),a=HAe(),s=EP(),l=Dq(),u=Bq(),f=1,p="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function E(k,_,T,A,R,I){var D=s(k),B=s(_),z=D?m:a(k),j=B?m:a(_);z=z==p?v:z,j=j==p?v:j;var Y=z==v,te=j==v,G=z==j;if(G&&l(k)){if(!l(_))return!1;D=!0,Y=!1}if(G&&!Y)return I||(I=new n),D||u(k)?r(k,_,T,A,R,I):i(k,_,z,T,A,R,I);if(!(T&f)){var $=Y&&x.call(k,"__wrapped__"),V=te&&x.call(_,"__wrapped__");if($||V){var J=$?k.value():k,Z=V?_.value():_;return I||(I=new n),R(J,Z,T,A,I)}}return G?(I||(I=new n),o(k,_,T,A,R,I)):!1}t.exports=E}),UAe=Ue((e,t)=>{var n=VAe(),r=Yx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),$q=Ue((e,t)=>{var n=UAe();function r(i,o){return n(i,o)}t.exports=r}),WAe=["ctrl","shift","alt","meta","mod"],GAe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function OC(e,t=","){return typeof e=="string"?e.split(t):e}function s2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>GAe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!WAe.includes(o));return{...r,keys:i}}function qAe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function YAe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function KAe(e){return Fq(e,["input","textarea","select"])}function Fq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function XAe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var ZAe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:f,metaKey:p,shiftKey:m,key:v,code:b}=e,x=b.toLowerCase().replace("key",""),E=v.toLowerCase();if(u!==r&&E!=="alt"||m!==s&&E!=="shift")return!1;if(a){if(!p&&!f)return!1}else if(p!==o&&x!=="meta"||f!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(E)||l.includes(x))?!0:l?l.every(k=>n.has(k)):!l},QAe=C.exports.createContext(void 0),JAe=()=>C.exports.useContext(QAe),eOe=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),tOe=()=>C.exports.useContext(eOe),nOe=Pq($q());function rOe(e){let t=C.exports.useRef(void 0);return(0,nOe.default)(t.current,e)||(t.current=e),t.current}var jD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ze(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=rOe(a),{enabledScopes:f}=tOe(),p=JAe();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!XAe(f,u==null?void 0:u.scopes))return;let m=x=>{var E;if(!(KAe(x)&&!Fq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){jD(x);return}((E=x.target)==null?void 0:E.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||OC(e,u==null?void 0:u.splitKey).forEach(k=>{var T;let _=s2(k,u==null?void 0:u.combinationKey);if(ZAe(x,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(qAe(x,_,u==null?void 0:u.preventDefault),!YAe(x,_,u==null?void 0:u.enabled)){jD(x);return}l(x,_)}})}},v=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.addHotkey(s2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.removeHotkey(s2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,f]),i}Pq($q());var L8=new Set;function iOe(e){(Array.isArray(e)?e:[e]).forEach(t=>L8.add(s2(t)))}function oOe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=s2(t);for(let i of L8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&L8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{iOe(e.key)}),document.addEventListener("keyup",e=>{oOe(e.key)})});const aOe=lt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),sOe=lt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),lOe=()=>{const e=Be(),t=ve(aOe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ve(sOe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(tW()),e(dC(!n))};return Ze("`",()=>{e(dC(!n))},[n]),Ze("esc",()=>{e(dC(!1))}),K(fn,{children:[n&&y(kq,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:y("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=f;return K("div",{className:`console-entry console-${b}-color`,children:[K("p",{className:"console-timestamp",children:[m,":"]}),y("p",{className:"console-message",children:v})]},p)})})}),n&&y(so,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y(fs,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y(x8e,{}),onClick:()=>a(!o)})}),y(so,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y(fs,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y(N8e,{}):y($G,{}),onClick:l})})]})};function uOe(){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)})}function cOe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:nodes")}),y("p",{children:e("common:nodesDesc")})]})}const dOe=()=>{const{t:e}=Ke();return K("div",{className:"work-in-progress post-processing-work-in-progress",children:[y("h1",{children:e("common:postProcessing")}),y("p",{children:e("common:postProcessDesc1")}),y("p",{children:e("common:postProcessDesc2")}),y("p",{children:e("common:postProcessDesc3")})]})},fOe=bt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y("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"})})}),hOe=bt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y("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"})}),pOe=bt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y("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"})}),gOe=bt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y("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 oo=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const mOe={[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:"Image to Image 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"},[8]:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},vOe=lt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),yOe=lt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),PP=()=>{const e=Be(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ve(vOe),{isGFPGANAvailable:i}=ve(yOe),o=u=>e(w4(u)),a=u=>e(CU(u)),s=u=>e(C4(u.target.value)),{t:l}=Ke();return K(at,{direction:"column",gap:2,children:[y(nl,{label:l("options:type"),validValues:oCe.concat(),value:n,onChange:s}),y(Eo,{isDisabled:!i,label:l("options:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y(Eo,{isDisabled:!i,label:l("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function zq(){const e=ve(i=>i.system.isGFPGANAvailable),t=ve(i=>i.options.shouldRunFacetool),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(sSe(i.target.checked))})}function bOe(){const e=Be(),t=ve(i=>i.options.shouldFitToWidthHeight),n=i=>e(OU(i.target.checked)),{t:r}=Ke();return y(os,{label:r("options:imageFit"),isChecked:t,onChange:n})}function Zo(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:f="",withSliderMarks:p=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:x=!1,inputWidth:E="5rem",inputReadOnly:k=!0,withReset:_=!1,hideTooltip:T=!1,isCompact:A=!1,handleReset:R,isResetDisabled:I,isSliderDisabled:D,isInputDisabled:B,styleClass:z,sliderFormControlProps:j,sliderFormLabelProps:Y,sliderMarkProps:te,sliderTrackProps:G,sliderThumbProps:$,sliderNumberInputProps:V,sliderNumberInputFieldProps:J,sliderNumberInputStepperProps:Z,sliderTooltipProps:U,sliderIAIIconButtonProps:X,...le}=e,[fe,Se]=C.exports.useState(String(i)),Ae=C.exports.useMemo(()=>V!=null&&V.max?V.max:a,[a,V==null?void 0:V.max]);C.exports.useEffect(()=>{String(i)!==fe&&fe!==""&&Se(String(i))},[i,fe,Se]);const be=Je=>{const Ye=He.clamp(x?Math.floor(Number(Je.target.value)):Number(Je.target.value),o,Ae);Se(String(Ye)),l(Ye)},ke=Je=>{Se(String(Je)),l(Number(Je))},De=()=>{!R||R()};return K(Ir,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":p,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...j,children:[y(ti,{className:"invokeai__slider-component-label",...Y,children:r}),K(Sy,{w:"100%",gap:2,alignItems:"center",children:[K(_E,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ke,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...le,children:[p&&K(fn,{children:[y($9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y($9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y(HV,{className:"invokeai__slider_track",...G,children:y(VV,{className:"invokeai__slider_track-filled"})}),y(so,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${f}`,hidden:T,...U,children:y(jV,{className:"invokeai__slider-thumb",...$})})]}),b&&K(gE,{min:o,max:Ae,step:s,value:fe,onChange:ke,onBlur:be,className:"invokeai__slider-number-field",isDisabled:B,...V,children:[y(mE,{className:"invokeai__slider-number-input",width:E,readOnly:k,...J}),K(_V,{...Z,children:[y(yE,{className:"invokeai__slider-number-stepper"}),y(vE,{className:"invokeai__slider-number-stepper"})]})]}),_&&y(Qe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y(Hx,{}),onClick:De,isDisabled:I,...X})]})]})}function jq(e){const{t}=Ke(),{label:n=`${t("options:strength")}`,styleClass:r}=e,i=ve(l=>l.options.img2imgStrength),o=Be();return y(Zo,{label:n,step:.01,min:.01,max:.99,onChange:l=>o(Y9(l)),value:i,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Y9(.75))}})}const Hq=()=>{const e=Be(),t=ve(i=>i.options.seamless),n=i=>e(LU(i.target.checked)),{t:r}=Ke();return y(at,{gap:2,direction:"column",children:y(os,{label:r("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},SOe=()=>y(at,{gap:2,direction:"column",children:y(Hq,{})});function xOe(){const e=Be(),{t}=Ke(),n=ve(i=>i.options.shouldRandomizeSeed),r=i=>e(oSe(i.target.checked));return y(os,{label:t("options:randomizeSeed"),isChecked:n,onChange:r})}function wOe(){const e=ve(a=>a.options.seed),t=ve(a=>a.options.shouldRandomizeSeed),n=ve(a=>a.options.shouldGenerateVariations),{t:r}=Ke(),i=Be(),o=a=>i(Ly(a));return y(Eo,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:ZE,max:QE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"10rem"})}function COe(){const e=Be(),t=ve(i=>i.options.shouldRandomizeSeed),{t:n}=Ke();return y(ds,{size:"sm",isDisabled:t,onClick:()=>e(Ly($W(ZE,QE))),children:y("p",{children:n("options:shuffle")})})}function _Oe(){const e=Be(),t=ve(i=>i.options.threshold),{t:n}=Ke(),r=i=>e(IU(i));return y(Eo,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}function kOe(){const e=Be(),t=ve(i=>i.options.perlin),{t:n}=Ke(),r=i=>e(PU(i));return y(Eo,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}const TP=()=>K(at,{gap:2,direction:"column",children:[y(xOe,{}),K(at,{gap:2,children:[y(wOe,{}),y(COe,{})]}),y(at,{gap:2,children:y(_Oe,{})}),y(at,{gap:2,children:y(kOe,{})})]}),EOe=lt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),POe=lt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),LP=()=>{const e=Be(),{upscalingLevel:t,upscalingStrength:n}=ve(EOe),{isESRGANAvailable:r}=ve(POe),{t:i}=Ke(),o=s=>e(K9(Number(s.target.value))),a=s=>e(X9(s));return K("div",{className:"upscale-options",children:[y(nl,{isDisabled:!r,label:i("options:scale"),value:t,onChange:o,validValues:iCe}),y(Eo,{isDisabled:!r,label:i("options:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};function Vq(){const e=ve(i=>i.system.isESRGANAvailable),t=ve(i=>i.options.shouldRunESRGAN),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(aSe(i.target.checked))})}function AP(){const e=ve(r=>r.options.shouldGenerateVariations),t=Be();return y(os,{isChecked:e,width:"auto",onChange:r=>t(tSe(r.target.checked))})}function TOe(){const e=ve(o=>o.options.seedWeights),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(AU(o.target.value));return y(rs,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(FE(e)||e===""),isDisabled:!t,onChange:i})}function LOe(){const e=ve(o=>o.options.variationAmount),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(uSe(o));return y(Eo,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const OP=()=>K(at,{gap:2,direction:"column",children:[y(LOe,{}),y(TOe,{})]});function AOe(){const e=Be(),t=ve(i=>i.options.cfgScale),{t:n}=Ke(),r=i=>e(wU(i));return y(Eo,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function OOe(){const e=ve(o=>o.options.height),t=ve(_r),n=Be(),{t:r}=Ke(),i=o=>n(_U(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:r("options:height"),value:e,flexGrow:1,onChange:i,validValues:rCe,styleClass:"main-option-block"})}const MOe=lt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function ROe(){const e=Be(),{iterations:t}=ve(MOe),{t:n}=Ke(),r=i=>e(J5e(i));return y(Eo,{label:n("options:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function IOe(){const e=ve(i=>i.options.sampler),t=Be(),{t:n}=Ke(),r=i=>t(TU(i.target.value));return y(nl,{label:n("options:sampler"),value:e,onChange:r,validValues:tCe,styleClass:"main-option-block"})}function DOe(){const e=Be(),t=ve(i=>i.options.steps),{t:n}=Ke(),r=i=>e(RU(i));return y(Eo,{label:n("options:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function NOe(){const e=ve(o=>o.options.width),t=ve(_r),{t:n}=Ke(),r=Be(),i=o=>r(DU(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:n("options:width"),value:e,flexGrow:1,onChange:i,validValues:nCe,styleClass:"main-option-block"})}function MP(){return y("div",{className:"main-options",children:K("div",{className:"main-options-list",children:[K("div",{className:"main-options-row",children:[y(ROe,{}),y(DOe,{}),y(AOe,{})]}),K("div",{className:"main-options-row",children:[y(NOe,{}),y(OOe,{}),y(IOe,{})]})]})})}const BOe=lt(e=>e.system,e=>e.shouldDisplayGuides),$Oe=({children:e,feature:t})=>{const n=ve(BOe),{text:r}=mOe[t];return n?K(bE,{trigger:"hover",children:[y(wE,{children:y(rl,{children:e})}),K(xE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y(SE,{className:"guide-popover-arrow"}),y("div",{className:"guide-popover-guide-content",children:r})]})]}):null},FOe=Oe(({feature:e,icon:t=QTe},n)=>y($Oe,{feature:e,children:y(rl,{ref:n,children:y($a,{marginBottom:"-.15rem",as:t})})}));function zOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return K(rg,{className:"advanced-settings-item",children:[y(tg,{className:"advanced-settings-header",children:K(at,{width:"100%",gap:"0.5rem",align:"center",children:[y(rl,{flexGrow:1,textAlign:"left",children:t}),i,n&&y(FOe,{feature:n}),y(ng,{})]})}),y(ig,{className:"advanced-settings-panel",children:r})]})}const RP=e=>{const{accordionInfo:t}=e,n=ve(a=>a.system.openAccordions),r=Be();return y(Nk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(owe(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:f,additionalHeaderComponents:p}=t[s];a.push(y(zOe,{header:l,feature:u,content:f,additionalHeaderComponents:p},s))}),a})()})},rn=e=>e.canvas,kr=lt([rn,_r,al],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Uq=e=>e.canvas.layerState.objects.find(H5),Wq=lt([e=>e.options,e=>e.system,Uq,_r],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:f}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),f||(p=!1,m.push("System Disconnected")),o&&(!(FE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}});function IP(e){const{iconButton:t=!1,...n}=e,r=Be(),{isReady:i}=ve(Wq),o=ve(_r),a=()=>{r(u8(o))},{t:s}=Ke();return Ze(["ctrl+enter","meta+enter"],()=>{r(u8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y("div",{style:{flexGrow:4},children:t?y(Qe,{"aria-label":s("options:invoke"),type:"submit",icon:y($8e,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):y(qr,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const jOe=lt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function DP(e){const{...t}=e,n=Be(),{isProcessing:r,isConnected:i,isCancelable:o}=ve(jOe),a=()=>n(K6e()),{t:s}=Ke();return Ze("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y(Qe,{icon:y(nLe,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const HOe=lt(e=>e.options,e=>e.shouldLoopback),VOe=()=>{const e=Be(),t=ve(HOe),{t:n}=Ke();return y(Qe,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y(z8e,{}),onClick:()=>{e(rSe(!t))}})},NP=()=>{const e=ve(_r);return K("div",{className:"process-buttons",children:[y(IP,{}),e==="img2img"&&y(VOe,{}),y(DP,{})]})},UOe=lt([e=>e.options,_r],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BP=()=>{const e=Be(),{prompt:t,activeTabName:n}=ve(UOe),{isReady:r}=ve(Wq),i=C.exports.useRef(null),{t:o}=Ke(),a=l=>{e(mx(l.target.value))};Ze("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(u8(n)))};return y("div",{className:"prompt-bar",children:y(Ir,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y(ZV,{id:"prompt",name:"prompt",placeholder:o("options:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function Gq(e){return yt({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 qq(e){return yt({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function WOe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function GOe(e,t){e.classList?e.classList.add(t):WOe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function HD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function qOe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=HD(e.className,t):e.setAttribute("class",HD(e.className&&e.className.baseVal||"",t))}const VD={disabled:!1},Yq=oe.createContext(null);var Kq=function(t){return t.scrollTop},Av="unmounted",Sh="exited",xh="entering",z0="entered",A8="exiting",Sc=function(e){oE(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=Sh,o.appearStatus=xh):l=z0:r.unmountOnExit||r.mountOnEnter?l=Av:l=Sh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Av?{status:Sh}: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!==xh&&a!==z0&&(o=xh):(a===xh||a===z0)&&(o=A8)}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===xh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:W3.findDOMNode(this);a&&Kq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Sh&&this.setState({status:Av})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[W3.findDOMNode(this),s],u=l[0],f=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||VD.disabled){this.safeSetState({status:z0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:xh},function(){o.props.onEntering(u,f),o.onTransitionEnd(m,function(){o.safeSetState({status:z0},function(){o.props.onEntered(u,f)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:W3.findDOMNode(this);if(!o||VD.disabled){this.safeSetState({status:Sh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:A8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Sh},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:W3.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],u=l[0],f=l[1];this.props.addEndListener(u,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Av)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=nE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return y(Yq.Provider,{value:null,children:typeof a=="function"?a(i,s):oe.cloneElement(oe.Children.only(a),s)})},t}(oe.Component);Sc.contextType=Yq;Sc.propTypes={};function B0(){}Sc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:B0,onEntering:B0,onEntered:B0,onExit:B0,onExiting:B0,onExited:B0};Sc.UNMOUNTED=Av;Sc.EXITED=Sh;Sc.ENTERING=xh;Sc.ENTERED=z0;Sc.EXITING=A8;const YOe=Sc;var KOe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return GOe(t,r)})},MC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return qOe(t,r)})},$P=function(e){oE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ae.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),FP=e=>{const t=Be(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ve(XOe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ze("o",()=>{t(Ju(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Ze("esc",()=>{t(Ju(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ze("shift+o",()=>{m(),t(vi(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(eSe(a.current?a.current.scrollTop:0)),t(Ju(!1)),t(nSe(!1)))},[t,i]),f=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(iSe(!i)),t(vi(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y(Xq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:y("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y("div",{className:"options-panel-margin",children:K("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?p():!i&&f()},children:[y(so,{label:"Pin Options Panel",children:y("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?y(Gq,{}):y(qq,{})})}),!i&&K("div",{className:"invoke-ai-logo-wrapper",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),l]})})})})};function ZOe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(SOe,{})}},n=Be(),r=ve(_r);return C.exports.useEffect(()=>{r==="img2img"&&n(jE(!1))},[r,n]),K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(bOe,{}),y(RP,{accordionInfo:t})]})}const zP=C.exports.createContext(null),QOe=e=>{const{styleClass:t}=e,n=C.exports.useContext(zP),r=()=>{n&&n()};return y("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:K("div",{className:"image-upload-button",children:[y(Nx,{}),y(Hh,{size:"lg",children:"Click or Drag and Drop"})]})})},JOe=lt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),O8=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Qh(),a=Be(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ve(JOe),f=C.exports.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Y6e(e)),o()};Ze("delete",()=>{s?i():m()},[e,s]);const v=b=>a(eW(!b.target.checked));return K(fn,{children:[C.exports.cloneElement(t,{onClick:e?p:void 0,ref:n}),y(xV,{isOpen:r,leastDestructiveRef:f,onClose:o,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y(t1,{children:K(at,{direction:"column",gap:5,children:[y(yr,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y(Ir,{children:K(at,{alignItems:"center",children:[y(ti,{mb:0,children:"Don't ask me again"}),y(kE,{checked:!s,onChange:v})]})})]})}),K(cx,{children:[y(ds,{ref:f,onClick:o,className:"modal-close-btn",children:"Cancel"}),y(ds,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),eMe=lt([e=>e.system,e=>e.options,e=>e.gallery,_r],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:f,isLightBoxOpen:p}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:f,activeTabName:r,isLightBoxOpen:p}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Zq=()=>{var B,z,j,Y,te,G;const e=Be(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:f,activeTabName:p}=ve(eMe),m=Ty(),{t:v}=Ke(),b=()=>{!u||(f&&e(Qu(!1)),e(C1(u)),e(Go("img2img")))},x=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Ze("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var $,V;!u||(u.metadata&&e(X5e(u.metadata)),(($=u.metadata)==null?void 0:$.image.type)==="img2img"?e(Go("img2img")):((V=u.metadata)==null?void 0:V.image.type)==="txt2img"&&e(Go("txt2img")))};Ze("a",()=>{var $,V;["txt2img","img2img"].includes((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Ly(u.metadata.image.seed))};Ze("s",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var $,V;return((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.prompt)&&e(mx(u.metadata.image.prompt))};Ze("p",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.prompt?(_(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{u&&e(G6e(u))};Ze("Shift+U",()=>{i&&!s&&n&&!t&&o?T():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const A=()=>{u&&e(q6e(u))};Ze("Shift+R",()=>{r&&!s&&n&&!t&&a?A():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(MU(!l)),I=()=>{!u||(f&&e(Qu(!1)),e(Sx(u)),e(vi(!0)),p!=="unifiedCanvas"&&e(Go("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Ze("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const D=()=>{e(Qu(!f))};return K("div",{className:"current-image-options",children:[K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":`${v("options:sendTo")}...`,icon:y(V8e,{})}),children:K("div",{className:"current-image-send-to-popover",children:[y(qr,{size:"sm",onClick:b,leftIcon:y(QI,{}),children:v("options:sendToImg2Img")}),y(qr,{size:"sm",onClick:I,leftIcon:y(QI,{}),children:v("options:sendToUnifiedCanvas")}),y(qr,{size:"sm",onClick:x,leftIcon:y(Ry,{}),children:v("options:copyImageToLink")}),y(qr,{leftIcon:y(sP,{}),size:"sm",children:y(Vh,{download:!0,href:u==null?void 0:u.url,children:v("options:downloadImage")})})]})}),y(Qe,{icon:y(T8e,{}),tooltip:f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"aria-label":f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"data-selected":f,onClick:D})]}),K(io,{isAttached:!0,children:[y(Qe,{icon:y(F8e,{}),tooltip:`${v("options:usePrompt")} (P)`,"aria-label":`${v("options:usePrompt")} (P)`,isDisabled:!((z=(B=u==null?void 0:u.metadata)==null?void 0:B.image)!=null&&z.prompt),onClick:_}),y(Qe,{icon:y(H8e,{}),tooltip:`${v("options:useSeed")} (S)`,"aria-label":`${v("options:useSeed")} (S)`,isDisabled:!((Y=(j=u==null?void 0:u.metadata)==null?void 0:j.image)!=null&&Y.seed),onClick:k}),y(Qe,{icon:y(_8e,{}),tooltip:`${v("options:useAll")} (A)`,"aria-label":`${v("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((G=(te=u==null?void 0:u.metadata)==null?void 0:te.image)==null?void 0:G.type),onClick:E})]}),K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(O8e,{}),"aria-label":v("options:restoreFaces")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(PP,{}),y(qr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:A,children:v("options:restoreFaces")})]})}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(P8e,{}),"aria-label":v("options:upscale")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(LP,{}),y(qr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:T,children:v("options:upscaleImage")})]})})]}),y(io,{isAttached:!0,children:y(Qe,{icon:y($G,{}),tooltip:`${v("options:info")} (I)`,"aria-label":`${v("options:info")} (I)`,"data-selected":l,onClick:R})}),y(O8,{image:u,children:y(Qe,{icon:y(yp,{}),tooltip:`${v("options:deleteImage")} (Del)`,"aria-label":`${v("options:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function tMe(e){return yt({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 $n=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>K(at,{gap:2,children:[n&&y(so,{label:`Recall ${e}`,children:y(fs,{"aria-label":"Use this parameter",icon:y(tMe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y(so,{label:`Copy ${e}`,children:y(fs,{"aria-label":`Copy ${e}`,icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),K(at,{direction:i?"column":"row",children:[K(yr,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?K(Vh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y(_q,{mx:"2px"})]}):y(yr,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),nMe=(e,t)=>e.image.uuid===t.image.uuid,Qq=C.exports.memo(({image:e,styleClass:t})=>{var j,Y;const n=Be();Ze("esc",()=>{n(MU(!1))});const r=((j=e==null?void 0:e.metadata)==null?void 0:j.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:f,orig_path:p,perlin:m,postprocessing:v,prompt:b,sampler:x,scale:E,seamless:k,seed:_,steps:T,strength:A,threshold:R,type:I,variations:D,width:B}=r,z=JSON.stringify(e.metadata,null,2);return y("div",{className:`image-metadata-viewer ${t}`,children:K(at,{gap:1,direction:"column",width:"100%",children:[K(at,{gap:2,children:[y(yr,{fontWeight:"semibold",children:"File:"}),K(Vh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y(_q,{mx:"2px"})]})]}),Object.keys(r).length>0?K(fn,{children:[I&&y($n,{label:"Generation type",value:I}),((Y=e.metadata)==null?void 0:Y.model_weights)&&y($n,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&y($n,{label:"Original image",value:p}),I==="gfpgan"&&A!==void 0&&y($n,{label:"Fix faces strength",value:A,onClick:()=>n(w4(A))}),I==="esrgan"&&E!==void 0&&y($n,{label:"Upscaling scale",value:E,onClick:()=>n(K9(E))}),I==="esrgan"&&A!==void 0&&y($n,{label:"Upscaling strength",value:A,onClick:()=>n(X9(A))}),b&&y($n,{label:"Prompt",labelPosition:"top",value:x4(b),onClick:()=>n(mx(b))}),_!==void 0&&y($n,{label:"Seed",value:_,onClick:()=>n(Ly(_))}),R!==void 0&&y($n,{label:"Noise Threshold",value:R,onClick:()=>n(IU(R))}),m!==void 0&&y($n,{label:"Perlin Noise",value:m,onClick:()=>n(PU(m))}),x&&y($n,{label:"Sampler",value:x,onClick:()=>n(TU(x))}),T&&y($n,{label:"Steps",value:T,onClick:()=>n(RU(T))}),o!==void 0&&y($n,{label:"CFG scale",value:o,onClick:()=>n(wU(o))}),D&&D.length>0&&y($n,{label:"Seed-weight pairs",value:N5(D),onClick:()=>n(AU(N5(D)))}),k&&y($n,{label:"Seamless",value:k,onClick:()=>n(LU(k))}),l&&y($n,{label:"High Resolution Optimization",value:l,onClick:()=>n(jE(l))}),B&&y($n,{label:"Width",value:B,onClick:()=>n(DU(B))}),s&&y($n,{label:"Height",value:s,onClick:()=>n(_U(s))}),u&&y($n,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(C1(u))}),f&&y($n,{label:"Mask image",value:f,isLink:!0,onClick:()=>n(EU(f))}),I==="img2img"&&A&&y($n,{label:"Image to image strength",value:A,onClick:()=>n(Y9(A))}),a&&y($n,{label:"Image to image fit",value:a,onClick:()=>n(OU(a))}),v&&v.length>0&&K(fn,{children:[y(Hh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y($n,{label:"Scale",value:$,onClick:()=>n(K9($))}),y($n,{label:"Strength",value:V,onClick:()=>n(X9(V))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("codeformer"))}}),V&&y($n,{label:"Fidelity",value:V,onClick:()=>{n(CU(V)),n(C4("codeformer"))}})]},G)}})]}),i&&y($n,{withCopy:!0,label:"Dream Prompt",value:i}),K(at,{gap:2,direction:"column",children:[K(at,{gap:2,children:[y(so,{label:"Copy metadata JSON",children:y(fs,{"aria-label":"Copy metadata JSON",icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y(yr,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y("div",{className:"image-json-viewer",children:y("pre",{children:z})})]})]}):y(eH,{width:"100%",pt:10,children:y(yr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},nMe),Jq=lt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var f;return u.uuid===((f=e==null?void 0:e.currentImage)==null?void 0:f.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function rMe(){const e=Be(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return K("div",{className:"current-image-preview",children:[i&&y(nx,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&y(Qq,{image:i,styleClass:"current-image-metadata"})]})}const iMe=lt([e=>e.gallery,e=>e.options,_r],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ve(iMe);return y("div",{className:"current-image-area","data-tab-name":t,children:e?K(fn,{children:[y(Zq,{}),y(rMe,{})]}):y("div",{className:"current-image-display-placeholder",children:y(tLe,{})})})},oMe=()=>{const e=C.exports.useContext(zP);return y(Qe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y(Nx,{}),onClick:e||void 0})};function aMe(){const e=ve(o=>o.options.initialImage),{t}=Ke(),n=Be(),r=Ty(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(xU())};return K(fn,{children:[K("div",{className:"init-image-preview-header",children:[y("h2",{children:t("options:initialImage")}),y(oMe,{})]}),e&&y("div",{className:"init-image-preview",children:y(nx,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const sMe=()=>{const e=ve(r=>r.options.initialImage),{currentImage:t}=ve(r=>r.gallery);return K("div",{className:"workarea-split-view",children:[y("div",{className:"workarea-split-view-left",children:e?y("div",{className:"image-to-image-area",children:y(aMe,{})}):y(QOe,{})}),t&&y("div",{className:"workarea-split-view-right",children:y(eY,{})})]})};function lMe(e){return yt({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 tr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function By(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(p){const{scope:m,children:v,...b}=p,x=(m==null?void 0:m[e][l])||s,E=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(x.Provider,{value:E},v)}function f(p,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,f]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,uMe(i,...t)]}function uMe(...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:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function cMe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tY(...e){return t=>e.forEach(n=>cMe(n,t))}function gs(...e){return C.exports.useCallback(tY(...e),e)}const ny=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(fMe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(M8,Dn({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(M8,Dn({},r,{ref:t}),n)});ny.displayName="Slot";const M8=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...hMe(r,n.props),ref:tY(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});M8.displayName="SlotClone";const dMe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function fMe(e){return C.exports.isValidElement(e)&&e.type===dMe}function hMe(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 pMe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],uc=pMe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ny:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,Dn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nY(e,t){e&&pu.exports.flushSync(()=>e.dispatchEvent(t))}function rY(e){const t=e+"CollectionProvider",[n,r]=By(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:x}=v,E=oe.useRef(null),k=oe.useRef(new Map).current;return oe.createElement(i,{scope:b,itemMap:k,collectionRef:E},x)},s=e+"CollectionSlot",l=oe.forwardRef((v,b)=>{const{scope:x,children:E}=v,k=o(s,x),_=gs(b,k.collectionRef);return oe.createElement(ny,{ref:_},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",p=oe.forwardRef((v,b)=>{const{scope:x,children:E,...k}=v,_=oe.useRef(null),T=gs(b,_),A=o(u,x);return oe.useEffect(()=>(A.itemMap.set(_,{ref:_,...k}),()=>void A.itemMap.delete(_))),oe.createElement(ny,{[f]:"",ref:T},E)});function m(v){const b=o(e+"CollectionConsumer",v);return oe.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>k.indexOf(A.ref.current)-k.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const gMe=C.exports.createContext(void 0);function iY(e){const t=C.exports.useContext(gMe);return e||t||"ltr"}function fu(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function mMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const R8="dismissableLayer.update",vMe="dismissableLayer.pointerDownOutside",yMe="dismissableLayer.focusOutside";let UD;const bMe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),SMe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,f=C.exports.useContext(bMe),[p,m]=C.exports.useState(null),v=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),x=gs(t,B=>m(B)),E=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),T=p?E.indexOf(p):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,R=T>=_,I=xMe(B=>{const z=B.target,j=[...f.branches].some(Y=>Y.contains(z));!R||j||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=wMe(B=>{const z=B.target;[...f.branches].some(Y=>Y.contains(z))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return mMe(B=>{T===f.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!p)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),WD(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=UD)}},[p,v,r,f]),C.exports.useEffect(()=>()=>{!p||(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),WD())},[p,f]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(R8,B),()=>document.removeEventListener(R8,B)},[]),C.exports.createElement(uc.div,Dn({},u,{ref:x,style:{pointerEvents:A?R?"auto":"none":void 0,...e.style},onFocusCapture:tr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:tr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:tr(e.onPointerDownCapture,I.onPointerDownCapture)}))});function xMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){oY(vMe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 wMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&oY(yMe,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 WD(){const e=new CustomEvent(R8);document.dispatchEvent(e)}function oY(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?nY(i,o):i.dispatchEvent(o)}let RC=0;function CMe(){C.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:GD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GD()),RC++,()=>{RC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),RC--}},[])}function GD(){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 IC="focusScope.autoFocusOnMount",DC="focusScope.autoFocusOnUnmount",qD={bubbles:!1,cancelable:!0},_Me=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=fu(i),f=fu(o),p=C.exports.useRef(null),m=gs(t,x=>l(x)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let x=function(k){if(v.paused||!s)return;const _=k.target;s.contains(_)?p.current=_:wh(p.current,{select:!0})},E=function(k){v.paused||!s||s.contains(k.relatedTarget)||wh(p.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){KD.add(v);const x=document.activeElement;if(!s.contains(x)){const k=new CustomEvent(IC,qD);s.addEventListener(IC,u),s.dispatchEvent(k),k.defaultPrevented||(kMe(AMe(aY(s)),{select:!0}),document.activeElement===x&&wh(s))}return()=>{s.removeEventListener(IC,u),setTimeout(()=>{const k=new CustomEvent(DC,qD);s.addEventListener(DC,f),s.dispatchEvent(k),k.defaultPrevented||wh(x!=null?x:document.body,{select:!0}),s.removeEventListener(DC,f),KD.remove(v)},0)}}},[s,u,f,v]);const b=C.exports.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(E&&k){const _=x.currentTarget,[T,A]=EMe(_);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),n&&wh(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),n&&wh(A,{select:!0})):k===_&&x.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(uc.div,Dn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function kMe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wh(r,{select:t}),document.activeElement!==n)return}function EMe(e){const t=aY(e),n=YD(t,e),r=YD(t.reverse(),e);return[n,r]}function aY(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 YD(e,t){for(const n of e)if(!PMe(n,{upTo:t}))return n}function PMe(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 TMe(e){return e instanceof HTMLInputElement&&"select"in e}function wh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TMe(e)&&t&&e.select()}}const KD=LMe();function LMe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XD(e,t),e.unshift(t)},remove(t){var n;e=XD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function XD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function AMe(e){return e.filter(t=>t.tagName!=="A")}const a1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},OMe=jC["useId".toString()]||(()=>{});let MMe=0;function RMe(e){const[t,n]=C.exports.useState(OMe());return a1(()=>{e||n(r=>r!=null?r:String(MMe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function Kx(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function jP(e){return e==="y"?"height":"width"}function ZD(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=A1(t),l=jP(s),u=r[l]/2-i[l]/2,f=L1(t),p=s==="x";let m;switch(f){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(Kx(t)){case"start":m[s]-=u*(n&&p?-1:1);break;case"end":m[s]+=u*(n&&p?-1:1);break}return m}const IMe=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:u,y:f}=ZD(l,r,s),p=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=sY(r),f={x:i,y:o},p=A1(a),m=Kx(a),v=jP(p),b=await l.getDimensions(n),x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",k=s.reference[v]+s.reference[p]-f[p]-s.floating[v],_=f[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const R=k/2-_/2,I=u[x],D=A-b[v]-u[E],B=A/2-b[v]/2+R,z=I8(I,B,D),te=(m==="start"?u[x]:u[E])>0&&B!==z&&s.reference[v]<=s.floating[v]?B$Me[t])}function FMe(e,t,n){n===void 0&&(n=!1);const r=Kx(e),i=A1(e),o=jP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=X5(a)),{main:a,cross:X5(a)}}const zMe={start:"end",end:"start"};function JD(e){return e.replace(/start|end/g,t=>zMe[t])}const jMe=["top","right","bottom","left"];function HMe(e){const t=X5(e);return[JD(e),t,JD(t)]}const VMe=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:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,x=L1(r),k=p||(x===a||!v?[X5(a)]:HMe(a)),_=[a,...k],T=await K5(t,b),A=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&A.push(T[x]),f){const{main:z,cross:j}=FMe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));A.push(T[z],T[j])}if(R=[...R,{placement:r,overflows:A}],!A.every(z=>z<=0)){var I,D;const z=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,j=_[z];if(j)return{data:{index:z,overflows:R},reset:{placement:j}};let Y="bottom";switch(m){case"bestFit":{var B;const te=(B=R.map(G=>[G,G.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((G,$)=>G[1]-$[1])[0])==null?void 0:B[0].placement;te&&(Y=te);break}case"initialPlacement":Y=a;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function eN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tN(e){return jMe.some(t=>e[t]>=0)}const UMe=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 K5(r,{...n,elementContext:"reference"}),a=eN(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tN(a)}}}case"escaped":{const o=await K5(r,{...n,altBoundary:!0}),a=eN(o,i.floating);return{data:{escapedOffsets:a,escaped:tN(a)}}}default:return{}}}}};async function WMe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=Kx(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,f=o&&l?-1:1,p=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const GMe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await WMe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function lY(e){return e==="x"?"y":"x"}const qMe=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:k,y:_}=E;return{x:k,y:_}}},...l}=e,u={x:n,y:r},f=await K5(t,l),p=A1(L1(i)),m=lY(p);let v=u[p],b=u[m];if(o){const E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",_=v+f[E],T=v-f[k];v=I8(_,v,T)}if(a){const E=m==="y"?"top":"left",k=m==="y"?"bottom":"right",_=b+f[E],T=b-f[k];b=I8(_,b,T)}const x=s.fn({...t,[p]:v,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},YMe=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:u=!0}=e,f={x:n,y:r},p=A1(i),m=lY(p);let v=f[p],b=f[m];const x=typeof s=="function"?s({...o,placement:i}):s,E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const R=p==="y"?"height":"width",I=o.reference[p]-o.floating[R]+E.mainAxis,D=o.reference[p]+o.reference[R]-E.mainAxis;vD&&(v=D)}if(u){var k,_,T,A;const R=p==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[R]+(I&&(k=(_=a.offset)==null?void 0:_[m])!=null?k:0)+(I?0:E.crossAxis),B=o.reference[m]+o.reference[R]+(I?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(I?E.crossAxis:0);bB&&(b=B)}return{[p]:v,[m]:b}}}};function uY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function xc(e){if(e==null)return window;if(!uY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function $y(e){return xc(e).getComputedStyle(e)}function cc(e){return uY(e)?"":e?(e.nodeName||"").toLowerCase():""}function cY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function hu(e){return e instanceof xc(e).HTMLElement}function of(e){return e instanceof xc(e).Element}function KMe(e){return e instanceof xc(e).Node}function HP(e){if(typeof ShadowRoot>"u")return!1;const t=xc(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xx(e){const{overflow:t,overflowX:n,overflowY:r}=$y(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function XMe(e){return["table","td","th"].includes(cc(e))}function dY(e){const t=/firefox/i.test(cY()),n=$y(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 fY(){return!/^((?!chrome|android).)*safari/i.test(cY())}const nN=Math.min,l2=Math.max,Z5=Math.round;function dc(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,u=1;t&&hu(e)&&(l=e.offsetWidth>0&&Z5(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Z5(s.height)/e.offsetHeight||1);const f=of(e)?xc(e):window,p=!fY()&&n,m=(s.left+(p&&(r=(i=f.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(p&&(o=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:v,right:m+b,bottom:v+x,left:m,x:m,y:v}}function bf(e){return((KMe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zx(e){return of(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hY(e){return dc(bf(e)).left+Zx(e).scrollLeft}function ZMe(e){const t=dc(e);return Z5(t.width)!==e.offsetWidth||Z5(t.height)!==e.offsetHeight}function QMe(e,t,n){const r=hu(t),i=bf(t),o=dc(e,r&&ZMe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((cc(t)!=="body"||Xx(i))&&(a=Zx(t)),hu(t)){const l=dc(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=hY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function pY(e){return cc(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||bf(e)}function rN(e){return!hu(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function JMe(e){let t=pY(e);for(HP(t)&&(t=t.host);hu(t)&&!["html","body"].includes(cc(t));){if(dY(t))return t;t=t.parentNode}return null}function D8(e){const t=xc(e);let n=rN(e);for(;n&&XMe(n)&&getComputedStyle(n).position==="static";)n=rN(n);return n&&(cc(n)==="html"||cc(n)==="body"&&getComputedStyle(n).position==="static"&&!dY(n))?t:n||JMe(e)||t}function iN(e){if(hu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=dc(e);return{width:t.width,height:t.height}}function eRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=hu(n),o=bf(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((cc(n)!=="body"||Xx(o))&&(a=Zx(n)),hu(n))){const l=dc(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 tRe(e,t){const n=xc(e),r=bf(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=fY();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function nRe(e){var t;const n=bf(e),r=Zx(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=l2(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=l2(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+hY(e);const l=-r.scrollTop;return $y(i||n).direction==="rtl"&&(s+=l2(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function gY(e){const t=pY(e);return["html","body","#document"].includes(cc(t))?e.ownerDocument.body:hu(t)&&Xx(t)?t:gY(t)}function Q5(e,t){var n;t===void 0&&(t=[]);const r=gY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xc(r),a=i?[o].concat(o.visualViewport||[],Xx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Q5(a))}function rRe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&HP(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function iRe(e,t){const n=dc(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 oN(e,t,n){return t==="viewport"?Y5(tRe(e,n)):of(t)?iRe(t,n):Y5(nRe(bf(e)))}function oRe(e){const t=Q5(e),r=["absolute","fixed"].includes($y(e).position)&&hu(e)?D8(e):e;return of(r)?t.filter(i=>of(i)&&rRe(i,r)&&cc(i)!=="body"):[]}function aRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?oRe(t):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const p=oN(t,f,i);return u.top=l2(p.top,u.top),u.right=nN(p.right,u.right),u.bottom=nN(p.bottom,u.bottom),u.left=l2(p.left,u.left),u},oN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const sRe={getClippingRect:aRe,convertOffsetParentRelativeRectToViewportRelativeRect:eRe,isElement:of,getDimensions:iN,getOffsetParent:D8,getDocumentElement:bf,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:QMe(t,D8(n),r),floating:{...iN(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>$y(e).direction==="rtl"};function lRe(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,u=o&&!s,f=l||u?[...of(e)?Q5(e):[],...Q5(t)]:[];f.forEach(x=>{l&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});let p=null;if(a){let x=!0;p=new ResizeObserver(()=>{x||n(),x=!1}),of(e)&&!s&&p.observe(e),p.observe(t)}let m,v=s?dc(e):null;s&&b();function b(){const x=dc(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,m=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(E=>{l&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),(x=p)==null||x.disconnect(),p=null,s&&cancelAnimationFrame(m)}}const uRe=(e,t,n)=>IMe(e,t,{platform:sRe,...n});var N8=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function B8(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(!B8(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)&&!B8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function cRe(e){const t=C.exports.useRef(e);return N8(()=>{t.current=e}),t}function dRe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=cRe(i),l=C.exports.useRef(null),[u,f]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=C.exports.useState(t);B8(p==null?void 0:p.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||uRe(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&pu.exports.flushSync(()=>{f(T)})})},[p,n,r]);N8(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);N8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=C.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,v);l.current=T}else v()},[v,s]),E=C.exports.useCallback(T=>{o.current=T,x()},[x]),k=C.exports.useCallback(T=>{a.current=T,x()},[x]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:E,floating:k}),[u,v,_,E,k])}const fRe=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?QD({element:t.current,padding:n}).fn(i):{}:t?QD({element:t,padding:n}).fn(i):{}}}};function hRe(e){const[t,n]=C.exports.useState(void 0);return a1(()=>{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,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.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 mY="Popper",[VP,vY]=By(mY),[pRe,yY]=VP(mY),gRe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(pRe,{scope:t,anchor:r,onAnchorChange:i},n)},mRe="PopperAnchor",vRe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=yY(mRe,n),a=C.exports.useRef(null),s=gs(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(uc.div,Dn({},i,{ref:s}))}),J5="PopperContent",[yRe,jze]=VP(J5),[bRe,SRe]=VP(J5,{hasParent:!1,positionUpdateFns:new Set}),xRe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:E=[],collisionPadding:k=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...R}=e,I=yY(J5,f),[D,B]=C.exports.useState(null),z=gs(t,ue=>B(ue)),[j,Y]=C.exports.useState(null),te=hRe(j),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,V=p+(v!=="center"?"-"+v:""),J=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},Z=Array.isArray(E)?E:[E],U=Z.length>0,X={padding:J,boundary:Z.filter(CRe),altBoundary:U},{reference:le,floating:fe,strategy:Se,x:Ae,y:be,placement:ke,middlewareData:De,update:Je}=dRe({strategy:"fixed",placement:V,whileElementsMounted:lRe,middleware:[GMe({mainAxis:m+$,alignmentAxis:b}),A?qMe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?YMe():void 0,...X}):void 0,j?fRe({element:j,padding:x}):void 0,A?VMe({...X}):void 0,_Re({arrowWidth:G,arrowHeight:$}),T?UMe({strategy:"referenceHidden"}):void 0].filter(wRe)});a1(()=>{le(I.anchor)},[le,I.anchor]);const Ye=Ae!==null&&be!==null,[mt,_t]=bY(ke),dt=(i=De.arrow)===null||i===void 0?void 0:i.x,vt=(o=De.arrow)===null||o===void 0?void 0:o.y,xt=((a=De.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=C.exports.useState();a1(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Rt,positionUpdateFns:ot}=SRe(J5,f),Ct=!Rt;C.exports.useLayoutEffect(()=>{if(!Ct)return ot.add(Je),()=>{ot.delete(Je)}},[Ct,ot,Je]),C.exports.useLayoutEffect(()=>{Ct&&Ye&&Array.from(ot).reverse().forEach(ue=>requestAnimationFrame(ue))},[Ct,Ye,ot]);const ln={"data-side":mt,"data-align":_t,...R,ref:z,style:{...R.style,animation:Ye?void 0:"none",opacity:(s=De.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:Ye?`translate3d(${Math.round(Ae)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=De.transformOrigin)===null||l===void 0?void 0:l.x,(u=De.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(yRe,{scope:f,placedSide:mt,onArrowChange:Y,arrowX:dt,arrowY:vt,shouldHideArrow:xt},Ct?C.exports.createElement(bRe,{scope:f,hasParent:!0,positionUpdateFns:ot},C.exports.createElement(uc.div,ln)):C.exports.createElement(uc.div,ln)))});function wRe(e){return e!==void 0}function CRe(e){return e!==null}const _Re=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,v=p?0:e.arrowHeight,[b,x]=bY(s),E={start:"0%",center:"50%",end:"100%"}[x],k=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=p?E:`${k}px`,A=`${-v}px`):b==="top"?(T=p?E:`${k}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=p?E:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=p?E:`${_}px`),{data:{x:T,y:A}}}});function bY(e){const[t,n="center"]=e.split("-");return[t,n]}const kRe=gRe,ERe=vRe,PRe=xRe;function TRe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const SY=e=>{const{present:t,children:n}=e,r=LRe(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=gs(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};SY.displayName="Presence";function LRe(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=TRe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=jb(r.current);o.current=s==="mounted"?u:"none"},[s]),a1(()=>{const u=r.current,f=i.current;if(f!==e){const m=o.current,v=jb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a1(()=>{if(t){const u=p=>{const v=jb(r.current).includes(p.animationName);p.target===t&&v&&pu.exports.flushSync(()=>l("ANIMATION_END"))},f=p=>{p.target===t&&(o.current=jb(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function jb(e){return(e==null?void 0:e.animationName)||"none"}function ARe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=ORe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=fu(n),l=C.exports.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function ORe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=fu(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const NC="rovingFocusGroup.onEntryFocus",MRe={bubbles:!1,cancelable:!0},UP="RovingFocusGroup",[$8,xY,RRe]=rY(UP),[IRe,wY]=By(UP,[RRe]),[DRe,NRe]=IRe(UP),BRe=C.exports.forwardRef((e,t)=>C.exports.createElement($8.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement($8.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement($Re,Dn({},e,{ref:t}))))),$Re=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=e,p=C.exports.useRef(null),m=gs(t,p),v=iY(o),[b=null,x]=ARe({prop:a,defaultProp:s,onChange:l}),[E,k]=C.exports.useState(!1),_=fu(u),T=xY(n),A=C.exports.useRef(!1),[R,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=p.current;if(D)return D.addEventListener(NC,_),()=>D.removeEventListener(NC,_)},[_]),C.exports.createElement(DRe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>x(D),[x]),onItemShiftTab:C.exports.useCallback(()=>k(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(uc.div,Dn({tabIndex:E||R===0?-1:0,"data-orientation":r},f,{ref:m,style:{outline:"none",...e.style},onMouseDown:tr(e.onMouseDown,()=>{A.current=!0}),onFocus:tr(e.onFocus,D=>{const B=!A.current;if(D.target===D.currentTarget&&B&&!E){const z=new CustomEvent(NC,MRe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const j=T().filter(V=>V.focusable),Y=j.find(V=>V.active),te=j.find(V=>V.id===b),$=[Y,te,...j].filter(Boolean).map(V=>V.ref.current);CY($)}}A.current=!1}),onBlur:tr(e.onBlur,()=>k(!1))})))}),FRe="RovingFocusGroupItem",zRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=RMe(),s=NRe(FRe,n),l=s.currentTabStopId===a,u=xY(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=s;return C.exports.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.exports.createElement($8.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(uc.span,Dn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:tr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:tr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:tr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=VRe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let x=u().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=s.loop?URe(x,E+1):x.slice(E+1)}setTimeout(()=>CY(x))}})})))}),jRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VRe(e,t,n){const r=HRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jRe[r]}function CY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function URe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const WRe=BRe,GRe=zRe,qRe=["Enter"," "],YRe=["ArrowDown","PageUp","Home"],_Y=["ArrowUp","PageDown","End"],KRe=[...YRe,..._Y],Qx="Menu",[F8,XRe,ZRe]=rY(Qx),[Cp,kY]=By(Qx,[ZRe,vY,wY]),WP=vY(),EY=wY(),[QRe,Jx]=Cp(Qx),[JRe,GP]=Cp(Qx),eIe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=C.exports.useState(null),f=C.exports.useRef(!1),p=fu(o),m=iY(i);return C.exports.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(kRe,s,C.exports.createElement(QRe,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},C.exports.createElement(JRe,{scope:t,onClose:C.exports.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:a},r)))},tIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return C.exports.createElement(ERe,Dn({},i,r,{ref:t}))}),nIe="MenuPortal",[Hze,rIe]=Cp(nIe,{forceMount:void 0}),Gd="MenuContent",[iIe,PY]=Cp(Gd),oIe=C.exports.forwardRef((e,t)=>{const n=rIe(Gd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Jx(Gd,e.__scopeMenu),a=GP(Gd,e.__scopeMenu);return C.exports.createElement(F8.Provider,{scope:e.__scopeMenu},C.exports.createElement(SY,{present:r||o.open},C.exports.createElement(F8.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(aIe,Dn({},i,{ref:t})):C.exports.createElement(sIe,Dn({},i,{ref:t})))))}),aIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu),r=C.exports.useRef(null),i=gs(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return MH(o)},[]),C.exports.createElement(TY,Dn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),sIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu);return C.exports.createElement(TY,Dn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),TY=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...b}=e,x=Jx(Gd,n),E=GP(Gd,n),k=WP(n),_=EY(n),T=XRe(n),[A,R]=C.exports.useState(null),I=C.exports.useRef(null),D=gs(t,I,x.onContentChange),B=C.exports.useRef(0),z=C.exports.useRef(""),j=C.exports.useRef(0),Y=C.exports.useRef(null),te=C.exports.useRef("right"),G=C.exports.useRef(0),$=v?yV:C.exports.Fragment,V=v?{as:ny,allowPinchZoom:!0}:void 0,J=U=>{var X,le;const fe=z.current+U,Se=T().filter(Ye=>!Ye.disabled),Ae=document.activeElement,be=(X=Se.find(Ye=>Ye.ref.current===Ae))===null||X===void 0?void 0:X.textValue,ke=Se.map(Ye=>Ye.textValue),De=mIe(ke,fe,be),Je=(le=Se.find(Ye=>Ye.textValue===De))===null||le===void 0?void 0:le.ref.current;(function Ye(mt){z.current=mt,window.clearTimeout(B.current),mt!==""&&(B.current=window.setTimeout(()=>Ye(""),1e3))})(fe),Je&&setTimeout(()=>Je.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),CMe();const Z=C.exports.useCallback(U=>{var X,le;return te.current===((X=Y.current)===null||X===void 0?void 0:X.side)&&yIe(U,(le=Y.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(iIe,{scope:n,searchRef:z,onItemEnter:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(U=>{var X;Z(U)||((X=I.current)===null||X===void 0||X.focus(),R(null))},[Z]),onTriggerLeave:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:j,onPointerGraceIntentChange:C.exports.useCallback(U=>{Y.current=U},[])},C.exports.createElement($,V,C.exports.createElement(_Me,{asChild:!0,trapped:i,onMountAutoFocus:tr(o,U=>{var X;U.preventDefault(),(X=I.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:a},C.exports.createElement(SMe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m},C.exports.createElement(WRe,Dn({asChild:!0},_,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:R,onEntryFocus:U=>{E.isUsingKeyboardRef.current||U.preventDefault()}}),C.exports.createElement(PRe,Dn({role:"menu","aria-orientation":"vertical","data-state":hIe(x.open),"data-radix-menu-content":"",dir:E.dir},k,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:tr(b.onKeyDown,U=>{const le=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Se=U.key.length===1;le&&(U.key==="Tab"&&U.preventDefault(),!fe&&Se&&J(U.key));const Ae=I.current;if(U.target!==Ae||!KRe.includes(U.key))return;U.preventDefault();const ke=T().filter(De=>!De.disabled).map(De=>De.ref.current);_Y.includes(U.key)&&ke.reverse(),pIe(ke)}),onBlur:tr(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(B.current),z.current="")}),onPointerMove:tr(e.onPointerMove,j8(U=>{const X=U.target,le=G.current!==U.clientX;if(U.currentTarget.contains(X)&&le){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),z8="MenuItem",aN="menu.itemSelect",lIe=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=GP(z8,e.__scopeMenu),s=PY(z8,e.__scopeMenu),l=gs(t,o),u=C.exports.useRef(!1),f=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(aN,{bubbles:!0,cancelable:!0});p.addEventListener(aN,v=>r==null?void 0:r(v),{once:!0}),nY(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(uIe,Dn({},i,{ref:l,disabled:n,onClick:tr(e.onClick,f),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:tr(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:tr(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||qRe.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),uIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=PY(z8,n),s=EY(n),l=C.exports.useRef(null),u=gs(t,l),[f,p]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var x;v(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),C.exports.createElement(F8.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(GRe,Dn({asChild:!0},s,{focusable:!r}),C.exports.createElement(uc.div,Dn({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:tr(e.onPointerMove,j8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:tr(e.onPointerLeave,j8(b=>a.onItemLeave(b))),onFocus:tr(e.onFocus,()=>p(!0)),onBlur:tr(e.onBlur,()=>p(!1))}))))}),cIe="MenuRadioGroup";Cp(cIe,{value:void 0,onValueChange:()=>{}});const dIe="MenuItemIndicator";Cp(dIe,{checked:!1});const fIe="MenuSub";Cp(fIe);function hIe(e){return e?"open":"closed"}function pIe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function mIe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=gIe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function vIe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=f>r&&n<(u-s)*(r-l)/(f-l)+s&&(i=!i)}return i}function yIe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return vIe(n,t)}function j8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const bIe=eIe,SIe=tIe,xIe=oIe,wIe=lIe,LY="ContextMenu",[CIe,Vze]=By(LY,[kY]),ew=kY(),[_Ie,AY]=CIe(LY),kIe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=ew(t),u=fu(r),f=C.exports.useCallback(p=>{s(p),u(p)},[u]);return C.exports.createElement(_Ie,{scope:t,open:a,onOpenChange:f,modal:o},C.exports.createElement(bIe,Dn({},l,{dir:i,open:a,onOpenChange:f,modal:o}),n))},EIe="ContextMenuTrigger",PIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(EIe,n),o=ew(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),f=p=>{a.current={x:p.clientX,y:p.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(SIe,Dn({},o,{virtualRef:s})),C.exports.createElement(uc.span,Dn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:tr(e.onContextMenu,p=>{u(),f(p),p.preventDefault()}),onPointerDown:tr(e.onPointerDown,Hb(p=>{u(),l.current=window.setTimeout(()=>f(p),700)})),onPointerMove:tr(e.onPointerMove,Hb(u)),onPointerCancel:tr(e.onPointerCancel,Hb(u)),onPointerUp:tr(e.onPointerUp,Hb(u))})))}),TIe="ContextMenuContent",LIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(TIe,n),o=ew(n),a=C.exports.useRef(!1);return C.exports.createElement(xIe,Dn({},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)"}}))}),AIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=ew(n);return C.exports.createElement(wIe,Dn({},i,r,{ref:t}))});function Hb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const OIe=kIe,MIe=PIe,RIe=LIe,hd=AIe,IIe=lt([e=>e.gallery,e=>e.options,kr,_r],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightBoxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${f}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),DIe=lt([e=>e.options,e=>e.gallery,e=>e.system,_r],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),NIe=e=>e.gallery,BIe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,$Ie=C.exports.memo(e=>{var G,$,V,J,Z,U,X,le;const t=Be(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ve(DIe),{image:l,isSelected:u}=e,{url:f,thumbnail:p,uuid:m,metadata:v}=l,[b,x]=C.exports.useState(!1),E=Ty(),{t:k}=Ke(),_=()=>x(!0),T=()=>x(!1),A=()=>{l.metadata&&t(mx(l.metadata.image.prompt)),E({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},R=()=>{l.metadata&&t(Ly(l.metadata.image.seed)),E({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(Qu(!1)),t(C1(l)),n!=="img2img"&&t(Go("img2img")),E({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{a&&t(Qu(!1)),t(Sx(l)),t(bx()),n!=="unifiedCanvas"&&t(Go("unifiedCanvas")),E({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},B=()=>{v&&t(Z5e(v)),E({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},z=async()=>{var fe;if((fe=v==null?void 0:v.image)!=null&&fe.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Go("img2img")),t(K5e(v)),E({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}E({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},j=()=>t(wR(l)),Y=fe=>{fe.dataTransfer.setData("invokeai/imageUuid",m),fe.dataTransfer.effectAllowed="move"},te=()=>{t(Qu(!0)),t(wR(l))};return K(OIe,{onOpenChange:fe=>{t($U(fe))},children:[y(MIe,{children:K(rl,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:T,userSelect:"none",draggable:!0,onDragStart:Y,children:[y(nx,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:p||f,loading:"lazy"}),y("div",{className:"hoverable-image-content",onClick:j,children:u&&y($a,{width:"50%",height:"50%",as:aP,className:"hoverable-image-check"})}),b&&i>=64&&y("div",{className:"hoverable-image-delete-button",children:y(O8,{image:l,children:y(fs,{"aria-label":k("options:deleteImage"),icon:y(U8e,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},m)}),K(RIe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:fe=>{fe.detail.originalEvent.preventDefault()},children:[y(hd,{onClickCapture:te,children:k("options:openInViewer")}),y(hd,{onClickCapture:A,disabled:(($=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:$.prompt)===void 0,children:k("options:usePrompt")}),y(hd,{onClickCapture:R,disabled:((J=(V=l==null?void 0:l.metadata)==null?void 0:V.image)==null?void 0:J.seed)===void 0,children:k("options:useSeed")}),y(hd,{onClickCapture:B,disabled:!["txt2img","img2img"].includes((U=(Z=l==null?void 0:l.metadata)==null?void 0:Z.image)==null?void 0:U.type),children:k("options:useAll")}),y(hd,{onClickCapture:z,disabled:((le=(X=l==null?void 0:l.metadata)==null?void 0:X.image)==null?void 0:le.type)!=="img2img",children:k("options:useInitImg")}),y(hd,{onClickCapture:I,children:k("options:sendToImg2Img")}),y(hd,{onClickCapture:D,children:k("options:sendToUnifiedCanvas")}),y(hd,{"data-warning":!0,children:y(O8,{image:l,children:y("p",{children:k("options:deleteImage")})})})]})]})},BIe),Vb=320,sN=40,FIe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},lN=400;function OY(){const e=Be(),{t}=Ke(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:x,isLightBoxOpen:E,isStaging:k,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=ve(IIe),{galleryMinWidth:A,galleryMaxWidth:R}=E?{galleryMinWidth:lN,galleryMaxWidth:lN}:FIe[f],[I,D]=C.exports.useState(x>=Vb),[B,z]=C.exports.useState(!1),[j,Y]=C.exports.useState(0),te=C.exports.useRef(null),G=C.exports.useRef(null),$=C.exports.useRef(null);C.exports.useEffect(()=>{x>=Vb&&D(!1)},[x]);const V=()=>{e(mSe(!o)),e(vi(!0))},J=()=>{a?U():Z()},Z=()=>{e(Vd(!0)),o&&e(vi(!0))},U=C.exports.useCallback(()=>{e(Vd(!1)),e($U(!1)),e(vSe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),X=()=>{e(c8(r))},le=be=>{e(ev(be))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Se=()=>{$.current&&window.clearTimeout($.current)};Ze("g",()=>{J()},[a,o]),Ze("left",()=>{e(VE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("right",()=>{e(HE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("shift+g",()=>{V()},[o]),Ze("esc",()=>{e(Vd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Ae=32;return Ze("shift+up",()=>{if(l<256){const be=He.clamp(l+Ae,32,256);e(ev(be))}},[l]),Ze("shift+down",()=>{if(l>32){const be=He.clamp(l-Ae,32,256);e(ev(be))}},[l]),C.exports.useEffect(()=>{!G.current||(G.current.scrollTop=s)},[s,a]),C.exports.useEffect(()=>{function be(ke){!o&&te.current&&!te.current.contains(ke.target)&&U()}return document.addEventListener("mousedown",be),()=>{document.removeEventListener("mousedown",be)}},[U,o]),y(Xq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:K("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[K(kq,{minWidth:A,maxWidth:o?R:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(be,ke,De)=>{Y(De.clientHeight),De.style.height=`${De.clientHeight}px`,o&&(De.style.position="fixed",De.style.right="1rem",z(!0))},onResizeStop:(be,ke,De,Je)=>{const Ye=o?He.clamp(Number(x)+Je.width,A,Number(R)):Number(x)+Je.width;e(SSe(Ye)),De.removeAttribute("data-resize-alert"),o&&(De.style.position="relative",De.style.removeProperty("right"),De.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(be,ke,De,Je)=>{const Ye=He.clamp(Number(x)+Je.width,A,Number(o?R:.95*window.innerWidth));Ye>=Vb&&!I?D(!0):YeYe-sN&&e(ev(Ye-sN)),o&&(Ye>=R?De.setAttribute("data-resize-alert","true"):De.removeAttribute("data-resize-alert")),De.style.height=`${j}px`},children:[K("div",{className:"image-gallery-header",children:[y(io,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:I?K(fn,{children:[y(qr,{size:"sm","data-selected":r==="result",onClick:()=>e(gb("result")),children:t("gallery:generations")}),y(qr,{size:"sm","data-selected":r==="user",onClick:()=>e(gb("user")),children:t("gallery:uploads")})]}):K(fn,{children:[y(Qe,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y(M8e,{}),onClick:()=>e(gb("result"))}),y(Qe,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y(G8e,{}),onClick:()=>e(gb("user"))})]})}),K("div",{className:"image-gallery-header-right-icons",children:[y(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y(Qe,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y(cP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:K("div",{className:"image-gallery-settings-popover",children:[K("div",{children:[y(Zo,{value:l,onChange:le,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y(Qe,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ev(64)),icon:y(Hx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y("div",{children:y(Qn,{label:t("gallery:maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(ySe(p==="contain"?"cover":"contain"))})}),y("div",{children:y(Qn,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:be=>e(bSe(be.target.checked))})}),y("div",{children:y(Qn,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:be=>e(xSe(be.target.checked))})})]})}),y(Qe,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:V,icon:o?y(Gq,{}):y(qq,{})})]})]}),y("div",{className:"image-gallery-container",ref:G,children:n.length||b?K(fn,{children:[y("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(be=>{const{uuid:ke}=be;return y($Ie,{image:be,isSelected:i===ke},ke)})}),y(ds,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):K("div",{className:"image-gallery-container-placeholder",children:[y(wq,{}),y("p",{children:t("gallery:noImagesInGallery")})]})})]}),B&&y("div",{style:{width:x+"px",height:"100%"}})]})})}const zIe=lt(NIe,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),jIe=()=>{const{resultImages:e,userImages:t}=ve(zIe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},HIe=lt([e=>e.options,_r],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qP=e=>{const t=Be(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ve(HIe),u=jIe(),f=()=>{t(lSe(!a)),t(vi(!0))},p=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(C1(b)):o==="unifiedCanvas"&&t(Sx(b)))};return y("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:K("div",{className:"workarea-main",children:[n,K("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&y(so,{label:"Toggle Split View",children:y("div",{className:"workarea-split-button","data-selected":a,onClick:f,children:y(lMe,{})})})]}),!s&&y(OY,{})]})})};function VIe(){return y(qP,{optionsPanel:y(ZOe,{}),children:y(sMe,{})})}const UIe=()=>{const e=Be(),t=ve(i=>i.options.hiresFix),{t:n}=Ke(),r=i=>e(jE(i.target.checked));return y(at,{gap:2,direction:"column",children:y(os,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:r})})},WIe=()=>K(at,{gap:2,direction:"column",children:[y(Hq,{}),y(UIe,{})]});function GIe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(WIe,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(RP,{accordionInfo:t})]})}const qIe=()=>y("div",{className:"workarea-single-view",children:y("div",{className:"text-to-image-area",children:y(eY,{})})});function YIe(){return y(qP,{optionsPanel:y(GIe,{}),children:y(qIe,{})})}var H8=function(e,t){return H8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},H8(e,t)};function KIe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var su=function(){return su=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Sf(e,t,n,r){var i=dDe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):IY(e,r,n,function(v){var b=s+f*v,x=l+p*v,E=u+m*v;o(b,x,E)})}}function dDe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function fDe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,f=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:f}}var hDe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,f=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:f,minPositionY:p,maxPositionY:m}},YP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=fDe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,f=o.newContentHeight,p=o.newDiffHeight,m=hDe(a,l,u,s,f,p,Boolean(i));return m},s1=function(e,t){var n=YP(e,t);return e.bounds=n,n};function tw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,f=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var v=V8(e,s-p,u+p,r),b=V8(t,l-m,f+m,r);return{x:v,y:b}}var V8=function(e,t,n,r){return r?en?as(n,2):as(e,2):as(e,2)};function nw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*f,m=u-n*f,v=tw(p,m,i,o,0,0,null);return v}function Fy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var cN=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=rw(o,n);return!l},dN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},pDe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},gDe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function mDe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var f=e.bounds,p=f.maxPositionX,m=f.minPositionX,v=f.maxPositionY,b=f.minPositionY,x=n>p||nv||rp?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=nw(e,k,_,i,e.bounds,s||l),A=T.x,R=T.y;return{scale:i,positionX:x?A:n,positionY:E?R:r}}}function vDe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,f=l.positionX,p=l.positionY,m=t!==f,v=n!==p,b=!m||!v;if(!(!a||b||!s)){var x=tw(t,n,s,o,r,i,a),E=x.x,k=x.y;e.setTransformState(u,E,k)}}var yDe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var f=t-r.x,p=n-r.y,m=a?l:f,v=s?u:p;return{x:m,y:v}},eS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},bDe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},SDe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function xDe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function fN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var f=a+(e-a)*u;return f>l?l:fo?o:f}}return r?t:V8(e,o,a,i)}function wDe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function CDe(e,t){var n=bDe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=wDe(a,s),f=t.x-r.x,p=t.y-r.y,m=f/u,v=p/u,b=l-i,x=f*f+p*p,E=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:v,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function _De(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=SDe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,f=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,E=r.panning,k=E.lockAxisY,_=E.lockAxisX,T=x.animationType,A=b.sizeX,R=b.sizeY,I=b.velocityAlignmentTime,D=I,B=xDe(e,l),z=Math.max(B,D),j=eS(e,A),Y=eS(e,R),te=j*i.offsetWidth/100,G=Y*i.offsetHeight/100,$=u+te,V=f-te,J=p+G,Z=m-G,U=e.transformState,X=new Date().getTime();IY(e,T,z,function(le){var fe=e.transformState,Se=fe.scale,Ae=fe.positionX,be=fe.positionY,ke=new Date().getTime()-X,De=ke/D,Je=MY[b.animationType],Ye=1-Je(Math.min(1,De)),mt=1-le,_t=Ae+a*mt,dt=be+s*mt,vt=fN(_t,U.positionX,Ae,_,v,f,u,V,$,Ye),xt=fN(dt,U.positionY,be,k,v,m,p,Z,J,Ye);(Ae!==_t||be!==dt)&&e.setTransformState(Se,vt,xt)})}}function hN(e,t){var n=e.transformState.scale;Gl(e),s1(e,n),t.touches?gDe(e,t):pDe(e,t)}function pN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=yDe(e,t,n),u=l.x,f=l.y,p=eS(e,a),m=eS(e,s);CDe(e,{x:u,y:f}),vDe(e,u,f,p,m)}}function kDe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,f=(a==null?void 0:a.height)||0,p=s.1&&p;m?_De(e):DY(e)}}function DY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,f=o||t=a;if((r>=1||s)&&DY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=KP(e,a,v,b);x&&Sf(e,x,f,p)}}function KP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Fy(as(t,2),o,a,0,!1),u=s1(e,l),f=nw(e,n,r,l,u,s),p=f.x,m=f.y;return{scale:l,positionX:p,positionY:m}}var cg={previousScale:1,scale:1,positionX:0,positionY:0},EDe=su(su({},cg),{setComponents:function(){},contextInstance:null}),dv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},BY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:cg.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:cg.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:cg.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:cg.positionY}},gN=function(e){var t=su({},dv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof dv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(dv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=su(su({},dv[n]),e[n]):s?t[n]=uN(uN([],dv[n]),e[n]):t[n]=e[n]}}),t},$Y=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var f=r*Math.exp(t*n),p=Fy(as(f,3),s,a,u,!1);return p};function FY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var f=o.offsetWidth,p=o.offsetHeight,m=(f/2-l)/s,v=(p/2-u)/s,b=$Y(e,t,n),x=KP(e,b,m,v);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,x,r,i)}function zY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=BY(e.props),s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!!i){var p=YP(e,a.scale),m=tw(a.positionX,a.positionY,p,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&f===a.positionY||Sf(e,v,t,n)}}function PDe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return cg;var l=r.getBoundingClientRect(),u=TDe(t),f=u.x,p=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/v,E=Fy(n||Math.min(b,x),a,s,0,!1),k=(l.width-m*E)/2,_=(l.height-v*E)/2,T=(l.left-f)*E+k,A=(l.top-p)*E+_,R=YP(e,E),I=tw(T,A,R,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:E}}function TDe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function LDe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var ADe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,1,t,n,r)}},ODe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,-1,t,n,r)}},MDe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,f=e.wrapperComponent,p=e.contentComponent,m=e.setup.disabled;if(!(m||!f||!p)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Sf(e,v,i,o)}}},RDe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),zY(e,t,n)}},IDe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=jY(t||i.scale,o,a);Sf(e,s,n,r)}}},DDe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Gl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&LDe(a)&&a&&o.contains(a)){var s=PDe(e,a,n);Sf(e,s,r,i)}}},ei=function(e){return{instance:e,state:e.transformState,zoomIn:ADe(e),zoomOut:ODe(e),setTransform:MDe(e),resetTransform:RDe(e),centerView:IDe(e),zoomToElement:DDe(e)}},BC=!1;function $C(){try{var e={get passive(){return BC=!0,!1}};return e}catch(t){return BC=!1,BC}}var rw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},mN=function(e){e&&clearTimeout(e)},NDe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},jY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},BDe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,f=s&&!l&&!r&&u;if(!f||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var p=rw(u,a);return!p};function $De(e,t){var n=e?e.deltaY<0?1:-1:0,r=XIe(t,n);return r}function HY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var FDe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size,m=f.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,x=Fy(as(v,3),u,l,p,b);return x},zDe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},jDe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=rw(a,i);return!l},HDe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},VDe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=as(i[0].clientX-r.left,5),a=as(i[0].clientY-r.top,5),s=as(i[1].clientX-r.left,5),l=as(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},VY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},UDe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var f=t/r,p=f*n;return Fy(as(p,2),a,o,l,!u)},WDe=160,GDe=100,qDe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Gl(e),Pi(ei(e),t,r),Pi(ei(e),t,i))},YDe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,f=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,v=p.size,b=p.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var E=$De(t,null),k=FDe(e,E,x,!t.ctrlKey);if(l!==k){var _=s1(e,k),T=HY(t,o,l),A=b||v===0||f,R=u&&A,I=nw(e,T.x,T.y,k,_,R),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(k,D,B),Pi(ei(e),t,r),Pi(ei(e),t,i)}},KDe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;mN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(NY(e,t.x,t.y),e.wheelAnimationTimer=null)},GDe);var o=zDe(e,t);o&&(mN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,Pi(ei(e),t,r),Pi(ei(e),t,i))},WDe))},XDe=function(e,t){var n=VY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Gl(e)},ZDe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,f=l.size;if(!(r===null||!n)){var p=VDe(t,i,n);if(!(!isFinite(p.x)||!isFinite(p.y))){var m=VY(t),v=UDe(e,m);if(v!==i){var b=s1(e,v),x=u||f===0||s,E=a&&x,k=nw(e,p.x,p.y,v,b,E),_=k.x,T=k.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(v,_,T)}}}},QDe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,NY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function JDe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return zY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var f=i==="zoomOut"?-1:1,p=$Y(e,f,o),m=HY(t,u,l),v=KP(e,p,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,v,a,s)}}var eNe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),f=n&&l&&u&&!a;if(!f)return!1;var p=rw(l,s);return!(p||!f)},UY=oe.createContext(EDe),tNe=function(e){KIe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=BY(n.props),n.setup=gN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=$C();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=BDe(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||(qDe(n,r),YDe(n,r),KDe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),Gl(n),hN(n,r),Pi(ei(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=dN(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),pN(n,r.clientX,r.clientY),Pi(ei(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(kDe(n),Pi(ei(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=jDe(n,r);!l||(XDe(n,r),Gl(n),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=HDe(n);!l||(r.preventDefault(),r.stopPropagation(),ZDe(n,r),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(QDe(n),Pi(ei(n),r,o),Pi(ei(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Gl(n);var l=r.touches,u=l.length===1,f=l.length===2;u&&(Gl(n),hN(n,r),Pi(ei(n),r,o)),f&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=dN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];pN(n,s.clientX,s.clientY),Pi(ei(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=eNe(n,r);!o||JDe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ei(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=jY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=NDe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ei(n))},n}return t.prototype.componentDidMount=function(){var n=$C();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=$C();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Gl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s1(this,this.transformState.scale),this.setup=gN(this.props))},t.prototype.render=function(){var n=ei(this),r=this.props.children,i=typeof r=="function"?r(n):r;return y(UY.Provider,{value:su(su({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),nNe=oe.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),y(tNe,{...su({},e,{setRef:i})})});function rNe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var iNe=`.transform-component-module_wrapper__1_Fgj { + */var iP=Symbol.for("react.element"),oP=Symbol.for("react.portal"),Ex=Symbol.for("react.fragment"),Px=Symbol.for("react.strict_mode"),Tx=Symbol.for("react.profiler"),Lx=Symbol.for("react.provider"),Ax=Symbol.for("react.context"),t8e=Symbol.for("react.server_context"),Ox=Symbol.for("react.forward_ref"),Mx=Symbol.for("react.suspense"),Rx=Symbol.for("react.suspense_list"),Ix=Symbol.for("react.memo"),Dx=Symbol.for("react.lazy"),n8e=Symbol.for("react.offscreen"),LG;LG=Symbol.for("react.module.reference");function vs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iP:switch(e=e.type,e){case Ex:case Tx:case Px:case Mx:case Rx:return e;default:switch(e=e&&e.$$typeof,e){case t8e:case Ax:case Ox:case Dx:case Ix:case Lx:return e;default:return t}}case oP:return t}}}Bn.ContextConsumer=Ax;Bn.ContextProvider=Lx;Bn.Element=iP;Bn.ForwardRef=Ox;Bn.Fragment=Ex;Bn.Lazy=Dx;Bn.Memo=Ix;Bn.Portal=oP;Bn.Profiler=Tx;Bn.StrictMode=Px;Bn.Suspense=Mx;Bn.SuspenseList=Rx;Bn.isAsyncMode=function(){return!1};Bn.isConcurrentMode=function(){return!1};Bn.isContextConsumer=function(e){return vs(e)===Ax};Bn.isContextProvider=function(e){return vs(e)===Lx};Bn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iP};Bn.isForwardRef=function(e){return vs(e)===Ox};Bn.isFragment=function(e){return vs(e)===Ex};Bn.isLazy=function(e){return vs(e)===Dx};Bn.isMemo=function(e){return vs(e)===Ix};Bn.isPortal=function(e){return vs(e)===oP};Bn.isProfiler=function(e){return vs(e)===Tx};Bn.isStrictMode=function(e){return vs(e)===Px};Bn.isSuspense=function(e){return vs(e)===Mx};Bn.isSuspenseList=function(e){return vs(e)===Rx};Bn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ex||e===Tx||e===Px||e===Mx||e===Rx||e===n8e||typeof e=="object"&&e!==null&&(e.$$typeof===Dx||e.$$typeof===Ix||e.$$typeof===Lx||e.$$typeof===Ax||e.$$typeof===Ox||e.$$typeof===LG||e.getModuleId!==void 0)};Bn.typeOf=vs;(function(e){e.exports=Bn})(e8e);function r8e(){const e=Y9e();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 YI={notify(){},get:()=>[]};function i8e(e,t){let n,r=YI;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=r8e())}function u(){n&&(n(),n=void 0,r.clear(),r=YI)}const f={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return f}const o8e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a8e=o8e?C.exports.useLayoutEffect:C.exports.useEffect;function s8e({store:e,context:t,children:n,serverState:r}){const i=C.exports.useMemo(()=>{const s=i8e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=C.exports.useMemo(()=>e.getState(),[e]);return a8e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),y((t||nf).Provider,{value:i,children:n})}function AG(e=nf){const t=e===nf?PG:()=>C.exports.useContext(e);return function(){const{store:r}=t();return r}}const l8e=AG();function u8e(e=nf){const t=e===nf?l8e:AG(e);return function(){return t().dispatch}}const c8e=u8e();X9e(_G.exports.useSyncExternalStoreWithSelector);q9e(pu.exports.unstable_batchedUpdates);function O4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O4=function(n){return typeof n}:O4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},O4(e)}function d8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;ny(at,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y(by,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),Be=c8e,ve=J9e,g8e=lt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),m8e=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ve(g8e),i=t?Math.round(t*100/n):0;return y(LV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};var RG={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ZI=oe.createContext&&oe.createContext(RG),Wd=globalThis&&globalThis.__assign||function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y(so,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y(fs,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function q8e(e){const{title:t,hotkey:n,description:r}=e;return K("div",{className:"hotkey-modal-item",children:[K("div",{className:"hotkey-info",children:[y("p",{className:"hotkey-title",children:t}),r&&y("p",{className:"hotkey-description",children:r})]}),y("div",{className:"hotkey-key",children:n})]})}function Y8e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=f=>{const p=[];return f.forEach((m,v)=>{p.push(y(q8e,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y("div",{className:"hotkey-modal-category",children:p})};return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,children:[y(Jd,{}),K(ep,{className:" modal hotkeys-modal",children:[y(Cy,{className:"modal-close-btn"}),y("h1",{children:"Keyboard Shorcuts"}),y("div",{className:"hotkeys-modal-items",children:K(Nk,{allowMultiple:!0,children:[K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:appHotkeys")}),y(ng,{})]}),y(ig,{children:u(o)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:generalHotkeys")}),y(ng,{})]}),y(ig,{children:u(a)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:galleryHotkeys")}),y(ng,{})]}),y(ig,{children:u(s)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y(ng,{})]}),y(ig,{children:u(l)})]})]})})]})]})]})}const os=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return K(Ir,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y(ti,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y(kE,{className:"invokeai__switch-root",...s})]})},nl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return K(Ir,{isDisabled:n,className:`invokeai__select ${l}`,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},children:[t&&y(ti,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y(so,{label:i,...o,children:y(OV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(f=>typeof f=="string"||typeof f=="number"?y("option",{value:f,className:"invokeai__select-option",children:f},f):y("option",{value:f.value,className:"invokeai__select-option",children:f.key},f.value))})})]})},JI=/^-?(0\.)?\.?$/,Eo=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:f,min:p,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:E,numberInputStepperProps:k,tooltipProps:_,...T}=e,[A,R]=C.exports.useState(String(u));C.exports.useEffect(()=>{!A.match(JI)&&u!==Number(A)&&R(String(u))},[u,A]);const I=B=>{R(B),B.match(JI)||f(v?Math.floor(Number(B)):Number(B))},D=B=>{const z=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),p,m);R(String(z)),f(z)};return y(so,{..._,children:K(Ir,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y(ti,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),K(gE,{className:"invokeai__number-input-root",value:A,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[y(mE,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&K("div",{className:"invokeai__number-input-stepper",children:[y(yE,{...k,className:"invokeai__number-input-stepper-button"}),y(vE,{...k,className:"invokeai__number-input-stepper-button"})]})]})]})})},al=e=>e.system,K8e=e=>e.system.toastQueue,_r=lt(e=>e.options,e=>zE[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});lt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const dP=e=>e.options,X8e=lt([al,dP],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,f)=>f),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Z8e=({children:e})=>{const t=Be(),{t:n}=Ke(),r=ve(_=>_.options.steps),{isOpen:i,onOpen:o,onClose:a}=Qh(),{isOpen:s,onOpen:l,onClose:u}=Qh(),{shouldDisplayInProgressType:f,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=ve(X8e),E=()=>{MG.purge().then(()=>{a(),l()})},k=_=>{_>r&&(_=r),_<1&&(_=1),t(dwe(_))};return K(fn,{children:[C.exports.cloneElement(e,{onClick:o}),K(Qd,{isOpen:i,onClose:a,size:"lg",children:[y(Jd,{}),K(ep,{className:"modal settings-modal",children:[y(S1,{className:"settings-modal-header",children:n("common:settingsLabel")}),y(Cy,{className:"modal-close-btn"}),K(t1,{className:"settings-modal-content",children:[K("div",{className:"settings-modal-items",children:[K("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y(nl,{label:n("settings:displayInProgress"),validValues:aCe,value:f,onChange:_=>t(iwe(_.target.value))}),f==="full-res"&&y(Eo,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:k,value:v,width:"auto",textAlign:"center"})]}),y(os,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:p,onChange:_=>t(eW(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(lwe(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(cSe(_.target.checked))})]}),K("div",{className:"settings-modal-items",children:[y("h2",{style:{fontWeight:"bold"},children:"Developer"}),y(os,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(fwe(_.target.checked))})]}),K("div",{className:"settings-modal-reset",children:[y(Hh,{size:"md",children:n("settings:resetWebUI")}),y(ds,{colorScheme:"red",onClick:E,children:n("settings:resetWebUI")}),y(yr,{children:n("settings:resetWebUIDesc1")}),y(yr,{children:n("settings:resetWebUIDesc2")})]})]}),y(cx,{children:y(ds,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),K(Qd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y(Jd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y(ep,{children:y(t1,{pb:6,pt:6,children:y(at,{justifyContent:"center",children:y(yr,{fontSize:"lg",children:y(yr,{children:n("settings:resetComplete")})})})})})]})]})},Q8e=lt(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:gi.exports.isEqual}}),J8e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ve(Q8e),s=Be(),{t:l}=Ke();let u;e&&!o?u="status-good":u="status-bad";let f=i;return[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(f)&&(u="status-working"),f&&t&&r>1&&(f+=` (${n}/${r})`),y(so,{label:o&&!a?"Click to clear, check logs for details":void 0,children:y(yr,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(tW())},className:`status ${u}`,children:l(f)})})},Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return K(bE,{...o,children:[y(wE,{children:t}),K(xE,{className:`invokeai__popover-content ${r}`,children:[i&&y(SE,{className:"invokeai__popover-arrow"}),n]})]})},qr=Oe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y(so,{label:r,...i,children:y(ds,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function e_e(){const{t:e}=Ke(),{setColorMode:t,colorMode:n}=uy(),r=Be(),i=ve(l=>l.options.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};C.exports.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(Q5e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y(qr,{style:{width:"6rem"},leftIcon:i===u?y(aP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(B8e,{})}),children:y(pi,{align:"stretch",children:s()})})}const t_e=lt([al],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),n_e=()=>{const e=Be(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ve(t_e);return y(at,{style:{paddingLeft:"0.3rem"},children:y(nl,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e(BW(a.target.value))}})})};function rs(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return K(Ir,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y(ti,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y(Uk,{...l,className:"input-entry",size:a,width:o})]})}var eD=Array.isArray,tD=Object.keys,r_e=Object.prototype.hasOwnProperty,i_e=typeof Element<"u";function w8(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=eD(e),r=eD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!w8(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var p=tD(e);if(o=p.length,o!==tD(t).length)return!1;for(i=o;i--!==0;)if(!r_e.call(t,p[i]))return!1;if(i_e&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!w8(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Sd=function(t,n){try{return w8(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},o_e=function(t){return a_e(t)&&!s_e(t)};function a_e(e){return!!e&&typeof e=="object"}function s_e(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||c_e(e)}var l_e=typeof Symbol=="function"&&Symbol.for,u_e=l_e?Symbol.for("react.element"):60103;function c_e(e){return e.$$typeof===u_e}function d_e(e){return Array.isArray(e)?[]:{}}function q5(e,t){return t.clone!==!1&&t.isMergeableObject(e)?J2(d_e(e),e,t):e}function f_e(e,t,n){return e.concat(t).map(function(r){return q5(r,n)})}function h_e(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=q5(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=q5(t[i],n):r[i]=J2(e[i],t[i],n)}),r}function J2(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||f_e,n.isMergeableObject=n.isMergeableObject||o_e;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):h_e(e,t,n):q5(t,n)}J2.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return J2(r,i,n)},{})};var C8=J2,p_e=typeof global=="object"&&global&&global.Object===Object&&global;const GG=p_e;var g_e=typeof self=="object"&&self&&self.Object===Object&&self,m_e=GG||g_e||Function("return this")();const Su=m_e;var v_e=Su.Symbol;const rf=v_e;var qG=Object.prototype,y_e=qG.hasOwnProperty,b_e=qG.toString,cv=rf?rf.toStringTag:void 0;function S_e(e){var t=y_e.call(e,cv),n=e[cv];try{e[cv]=void 0;var r=!0}catch(o){}var i=b_e.call(e);return r&&(t?e[cv]=n:delete e[cv]),i}var x_e=Object.prototype,w_e=x_e.toString;function C_e(e){return w_e.call(e)}var __e="[object Null]",k_e="[object Undefined]",nD=rf?rf.toStringTag:void 0;function bp(e){return e==null?e===void 0?k_e:__e:nD&&nD in Object(e)?S_e(e):C_e(e)}function YG(e,t){return function(n){return e(t(n))}}var E_e=YG(Object.getPrototypeOf,Object);const fP=E_e;function Sp(e){return e!=null&&typeof e=="object"}var P_e="[object Object]",T_e=Function.prototype,L_e=Object.prototype,KG=T_e.toString,A_e=L_e.hasOwnProperty,O_e=KG.call(Object);function rD(e){if(!Sp(e)||bp(e)!=P_e)return!1;var t=fP(e);if(t===null)return!0;var n=A_e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&KG.call(n)==O_e}function M_e(){this.__data__=[],this.size=0}function XG(e,t){return e===t||e!==e&&t!==t}function Bx(e,t){for(var n=e.length;n--;)if(XG(e[n][0],t))return n;return-1}var R_e=Array.prototype,I_e=R_e.splice;function D_e(e){var t=this.__data__,n=Bx(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():I_e.call(t,n,1),--this.size,!0}function N_e(e){var t=this.__data__,n=Bx(t,e);return n<0?void 0:t[n][1]}function B_e(e){return Bx(this.__data__,e)>-1}function $_e(e,t){var n=this.__data__,r=Bx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Wke}var Gke="[object Arguments]",qke="[object Array]",Yke="[object Boolean]",Kke="[object Date]",Xke="[object Error]",Zke="[object Function]",Qke="[object Map]",Jke="[object Number]",eEe="[object Object]",tEe="[object RegExp]",nEe="[object Set]",rEe="[object String]",iEe="[object WeakMap]",oEe="[object ArrayBuffer]",aEe="[object DataView]",sEe="[object Float32Array]",lEe="[object Float64Array]",uEe="[object Int8Array]",cEe="[object Int16Array]",dEe="[object Int32Array]",fEe="[object Uint8Array]",hEe="[object Uint8ClampedArray]",pEe="[object Uint16Array]",gEe="[object Uint32Array]",ir={};ir[sEe]=ir[lEe]=ir[uEe]=ir[cEe]=ir[dEe]=ir[fEe]=ir[hEe]=ir[pEe]=ir[gEe]=!0;ir[Gke]=ir[qke]=ir[oEe]=ir[Yke]=ir[aEe]=ir[Kke]=ir[Xke]=ir[Zke]=ir[Qke]=ir[Jke]=ir[eEe]=ir[tEe]=ir[nEe]=ir[rEe]=ir[iEe]=!1;function mEe(e){return Sp(e)&&rq(e.length)&&!!ir[bp(e)]}function hP(e){return function(t){return e(t)}}var iq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,o2=iq&&typeof module=="object"&&module&&!module.nodeType&&module,vEe=o2&&o2.exports===iq,EC=vEe&&GG.process,yEe=function(){try{var e=o2&&o2.require&&o2.require("util").types;return e||EC&&EC.binding&&EC.binding("util")}catch(t){}}();const i1=yEe;var uD=i1&&i1.isTypedArray,bEe=uD?hP(uD):mEe;const SEe=bEe;var xEe=Object.prototype,wEe=xEe.hasOwnProperty;function oq(e,t){var n=Ny(e),r=!n&&Nke(e),i=!n&&!r&&nq(e),o=!n&&!r&&!i&&SEe(e),a=n||r||i||o,s=a?Oke(e.length,String):[],l=s.length;for(var u in e)(t||wEe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uke(u,l)))&&s.push(u);return s}var CEe=Object.prototype;function pP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CEe;return e===n}var _Ee=YG(Object.keys,Object);const kEe=_Ee;var EEe=Object.prototype,PEe=EEe.hasOwnProperty;function TEe(e){if(!pP(e))return kEe(e);var t=[];for(var n in Object(e))PEe.call(e,n)&&n!="constructor"&&t.push(n);return t}function aq(e){return e!=null&&rq(e.length)&&!ZG(e)}function gP(e){return aq(e)?oq(e):TEe(e)}function LEe(e,t){return e&&Fx(t,gP(t),e)}function AEe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OEe=Object.prototype,MEe=OEe.hasOwnProperty;function REe(e){if(!Dy(e))return AEe(e);var t=pP(e),n=[];for(var r in e)r=="constructor"&&(t||!MEe.call(e,r))||n.push(r);return n}function mP(e){return aq(e)?oq(e,!0):REe(e)}function IEe(e,t){return e&&Fx(t,mP(t),e)}var sq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cD=sq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=cD&&cD.exports===sq,dD=DEe?Su.Buffer:void 0,fD=dD?dD.allocUnsafe:void 0;function NEe(e,t){if(t)return e.slice();var n=e.length,r=fD?fD(n):new e.constructor(n);return e.copy(r),r}function lq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function TD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var LD=function(t){return Array.isArray(t)&&t.length===0},Vo=function(t){return typeof t=="function"},zx=function(t){return t!==null&&typeof t=="object"},ITe=function(t){return String(Math.floor(Number(t)))===t},PC=function(t){return Object.prototype.toString.call(t)==="[object String]"},bq=function(t){return C.exports.Children.count(t)===0},TC=function(t){return zx(t)&&Vo(t.then)};function Hi(e,t,n,r){r===void 0&&(r=0);for(var i=yq(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function Sq(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Xe){return B(Xe,Hi(ue,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(We).then(function(Xe){return Xe.reduce(function(Ce,Ne,kt){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(Ce=au(Ce,Ie[kt],Ne)),Ce},{})})},[B]),j=C.exports.useCallback(function(ue){return Promise.all([z(ue),m.validationSchema?D(ue):{},m.validate?I(ue):{}]).then(function(Ie){var We=Ie[0],Xe=Ie[1],Ce=Ie[2],Ne=C8.all([We,Xe,Ce],{arrayMerge:zTe});return Ne})},[m.validate,m.validationSchema,z,I,D]),Y=Xa(function(ue){return ue===void 0&&(ue=A.values),R({type:"SET_ISVALIDATING",payload:!0}),j(ue).then(function(Ie){return k.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ie})),Ie})});C.exports.useEffect(function(){a&&k.current===!0&&Sd(v.current,m.initialValues)&&Y(v.current)},[a,Y]);var te=C.exports.useCallback(function(ue){var Ie=ue&&ue.values?ue.values:v.current,We=ue&&ue.errors?ue.errors:b.current?b.current:m.initialErrors||{},Xe=ue&&ue.touched?ue.touched:x.current?x.current:m.initialTouched||{},Ce=ue&&ue.status?ue.status:E.current?E.current:m.initialStatus;v.current=Ie,b.current=We,x.current=Xe,E.current=Ce;var Ne=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!ue&&!!ue.isSubmitting,errors:We,touched:Xe,status:Ce,values:Ie,isValidating:!!ue&&!!ue.isValidating,submitCount:!!ue&&!!ue.submitCount&&typeof ue.submitCount=="number"?ue.submitCount:0}})};if(m.onReset){var kt=m.onReset(A.values,dt);TC(kt)?kt.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);C.exports.useEffect(function(){k.current===!0&&!Sd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&Y(v.current))},[u,m.initialValues,te,a,Y]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,R({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(x.current,m.initialTouched)&&(x.current=m.initialTouched||Nb,R({type:"SET_TOUCHED",payload:m.initialTouched||Nb}))},[u,m.initialTouched]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(E.current,m.initialStatus)&&(E.current=m.initialStatus,R({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ue){if(_.current[ue]&&Vo(_.current[ue].validate)){var Ie=Hi(A.values,ue),We=_.current[ue].validate(Ie);return TC(We)?(R({type:"SET_ISVALIDATING",payload:!0}),We.then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:ue,value:We}}),Promise.resolve(We))}else if(m.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ue).then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe[ue]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=C.exports.useCallback(function(ue,Ie){var We=Ie.validate;_.current[ue]={validate:We}},[]),V=C.exports.useCallback(function(ue){delete _.current[ue]},[]),J=Xa(function(ue,Ie){R({type:"SET_TOUCHED",payload:ue});var We=Ie===void 0?i:Ie;return We?Y(A.values):Promise.resolve()}),Z=C.exports.useCallback(function(ue){R({type:"SET_ERRORS",payload:ue})},[]),U=Xa(function(ue,Ie){var We=Vo(ue)?ue(A.values):ue;R({type:"SET_VALUES",payload:We});var Xe=Ie===void 0?n:Ie;return Xe?Y(We):Promise.resolve()}),X=C.exports.useCallback(function(ue,Ie){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Ie}})},[]),le=Xa(function(ue,Ie,We){R({type:"SET_FIELD_VALUE",payload:{field:ue,value:Ie}});var Xe=We===void 0?n:We;return Xe?Y(au(A.values,ue,Ie)):Promise.resolve()}),fe=C.exports.useCallback(function(ue,Ie){var We=Ie,Xe=ue,Ce;if(!PC(ue)){ue.persist&&ue.persist();var Ne=ue.target?ue.target:ue.currentTarget,kt=Ne.type,Nt=Ne.name,Te=Ne.id,Et=Ne.value,Ut=Ne.checked,Ve=Ne.outerHTML,ft=Ne.options,un=Ne.multiple;We=Ie||Nt||Te,Xe=/number|range/.test(kt)?(Ce=parseFloat(Et),isNaN(Ce)?"":Ce):/checkbox/.test(kt)?HTe(Hi(A.values,We),Ut,Et):ft&&un?jTe(ft):Et}We&&le(We,Xe)},[le,A.values]),Se=Xa(function(ue){if(PC(ue))return function(Ie){return fe(Ie,ue)};fe(ue)}),Ae=Xa(function(ue,Ie,We){Ie===void 0&&(Ie=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:ue,value:Ie}});var Xe=We===void 0?i:We;return Xe?Y(A.values):Promise.resolve()}),be=C.exports.useCallback(function(ue,Ie){ue.persist&&ue.persist();var We=ue.target,Xe=We.name,Ce=We.id,Ne=We.outerHTML,kt=Ie||Xe||Ce;Ae(kt,!0)},[Ae]),ke=Xa(function(ue){if(PC(ue))return function(Ie){return be(Ie,ue)};be(ue)}),De=C.exports.useCallback(function(ue){Vo(ue)?R({type:"SET_FORMIK_STATE",payload:ue}):R({type:"SET_FORMIK_STATE",payload:function(){return ue}})},[]),Je=C.exports.useCallback(function(ue){R({type:"SET_STATUS",payload:ue})},[]),Ye=C.exports.useCallback(function(ue){R({type:"SET_ISSUBMITTING",payload:ue})},[]),mt=Xa(function(){return R({type:"SUBMIT_ATTEMPT"}),Y().then(function(ue){var Ie=ue instanceof Error,We=!Ie&&Object.keys(ue).length===0;if(We){var Xe;try{if(Xe=vt(),Xe===void 0)return}catch(Ce){throw Ce}return Promise.resolve(Xe).then(function(Ce){return k.current&&R({type:"SUBMIT_SUCCESS"}),Ce}).catch(function(Ce){if(k.current)throw R({type:"SUBMIT_FAILURE"}),Ce})}else if(k.current&&(R({type:"SUBMIT_FAILURE"}),Ie))throw ue})}),_t=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),mt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),dt={resetForm:te,validateForm:Y,validateField:G,setErrors:Z,setFieldError:X,setFieldTouched:Ae,setFieldValue:le,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,setFormikState:De,submitForm:mt},vt=Xa(function(){return f(A.values,dt)}),xt=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),te()}),Le=C.exports.useCallback(function(ue){return{value:Hi(A.values,ue),error:Hi(A.errors,ue),touched:!!Hi(A.touched,ue),initialValue:Hi(v.current,ue),initialTouched:!!Hi(x.current,ue),initialError:Hi(b.current,ue)}},[A.errors,A.touched,A.values]),ut=C.exports.useCallback(function(ue){return{setValue:function(We,Xe){return le(ue,We,Xe)},setTouched:function(We,Xe){return Ae(ue,We,Xe)},setError:function(We){return X(ue,We)}}},[le,Ae,X]),Rt=C.exports.useCallback(function(ue){var Ie=zx(ue),We=Ie?ue.name:ue,Xe=Hi(A.values,We),Ce={name:We,value:Xe,onChange:Se,onBlur:ke};if(Ie){var Ne=ue.type,kt=ue.value,Nt=ue.as,Te=ue.multiple;Ne==="checkbox"?kt===void 0?Ce.checked=!!Xe:(Ce.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(kt)),Ce.value=kt):Ne==="radio"?(Ce.checked=Xe===kt,Ce.value=kt):Nt==="select"&&Te&&(Ce.value=Ce.value||[],Ce.multiple=!0)}return Ce},[ke,Se,A.values]),ot=C.exports.useMemo(function(){return!Sd(v.current,A.values)},[v.current,A.values]),Ct=C.exports.useMemo(function(){return typeof s<"u"?ot?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Vo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ot,A.errors,m]),ln=Wn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:x.current,initialStatus:E.current,handleBlur:ke,handleChange:Se,handleReset:xt,handleSubmit:_t,resetForm:te,setErrors:Z,setFormikState:De,setFieldTouched:Ae,setFieldValue:le,setFieldError:X,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,submitForm:mt,validateForm:Y,validateField:G,isValid:Ct,dirty:ot,unregisterField:V,registerField:$,getFieldProps:Rt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return ln}function wP(e){var t=BTe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return C.exports.useImperativeHandle(o,function(){return t}),C.exports.createElement(DTe,{value:t},n?C.exports.createElement(n,t):i?i(t):r?Vo(r)?r(t):bq(r)?null:C.exports.Children.only(r):null)}function $Te(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Hi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function FTe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=T8(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function T8(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||rD(i)?T8(i):i!==""?i:void 0}):rD(e[r])?t[r]=T8(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function zTe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?C8(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=C8(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function jTe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function HTe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var VTe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function Xa(e){var t=C.exports.useRef(e);return VTe(function(){t.current=e}),C.exports.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Wn({},t,{length:n+1}))}else return[]},YTe=function(e){RTe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,f=l.formik.setFormikState;f(function(p){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(p.values,u,o(Hi(p.values,u))),x=s?m(Hi(p.errors,u)):void 0,E=a?v(Hi(p.touched,u)):void 0;return LD(x)&&(x=void 0),LD(E)&&(E=void 0),Wn({},p,{values:b,errors:s?au(p.errors,u,x):p.errors,touched:a?au(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(o1(a),[MTe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return GTe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return WTe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return LC(s,o,a)},function(s){return LC(s,o,null)},function(s){return LC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return qTe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(TD(i)),i.pop=i.pop.bind(TD(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Hi(i.formik.values,i.name),Hi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?o1(a):[];return o||(o=s[i]),Vo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,f=o.formik,p=Ih(f,["validate","validationSchema"]),m=Wn({},i,{form:p,name:u});return a?C.exports.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):bq(l)?null:C.exports.Children.only(l):null},t}(C.exports.Component);YTe.defaultProps={validateOnChange:!0};const KTe=lt([al],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),AD=64,OD=2048;function XTe(){const{openModel:e,model_list:t}=ve(KTe),n=ve(l=>l.system.isProcessing),r=Be(),{t:i}=Ke(),[o,a]=C.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});C.exports.useEffect(()=>{var l,u,f,p,m,v,b;if(e){const x=He.pickBy(t,(E,k)=>He.isEqual(k,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(f=x[e])==null?void 0:f.weights,vae:(p=x[e])==null?void 0:p.vae,width:(m=x[e])==null?void 0:m.width,height:(v=x[e])==null?void 0:v.height,default:(b=x[e])==null?void 0:b.default})}},[t,e]);const s=l=>{r(XE(l))};return e?K(at,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y(at,{alignItems:"center",children:y(yr,{fontSize:"lg",fontWeight:"bold",children:e})}),y(at,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y(wP,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:f})=>y("form",{onSubmit:l,children:K(pi,{rowGap:"0.5rem",alignItems:"start",children:[K(Ir,{isInvalid:!!u.description&&f.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"lg"}),!!u.description&&f.description?y(Wo,{children:u.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.config&&f.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"lg"}),!!u.config&&f.config?y(Wo,{children:u.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.weights&&f.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"lg"}),!!u.weights&&f.weights?y(Wo,{children:u.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.vae&&f.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"lg"}),!!u.vae&&f.vae?y(Wo,{children:u.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!u.width&&f.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:p,form:m})=>y(Eo,{id:"width",name:"width",min:AD,max:OD,step:64,value:m.values.width,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.width&&f.width?y(Wo,{children:u.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.height&&f.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:p,form:m})=>y(Eo,{id:"height",name:"height",min:AD,max:OD,step:64,value:m.values.height,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.height&&f.height?y(Wo,{children:u.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y(at,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y(yr,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Qn=e=>{const{label:t,styleClass:n,...r}=e;return y(Vj,{className:`invokeai__checkbox ${n}`,...r,children:t})};function ZTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function QTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function JTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function eLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function wq(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function tLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function nLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function rLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function Hx(e){return yt({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 iLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function oLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function aLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function sLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const Cq=lt([al],e=>{const{model_list:t}=e,n=[];return He.forEach(t,r=>{n.push(r.weights)}),n});function lLe(){const{t:e}=Ke();return y(rl,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function MD({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=ve(Cq),i=o=>{t.includes(o.target.value)?n(He.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return K(rl,{position:"relative",children:[r.includes(e.location)?y(lLe,{}):null,y(Qn,{value:e.name,label:y(fn,{children:K(pi,{alignItems:"start",children:[y("p",{style:{fontWeight:"bold"},children:e.name}),y("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function uLe(){const e=Be(),{t}=Ke(),n=ve(x=>x.system.searchFolder),r=ve(x=>x.system.foundModels),i=ve(Cq),o=ve(x=>x.options.shouldShowExistingModelsInSearch),a=ve(x=>x.system.isProcessing),[s,l]=oe.useState([]),u=()=>{e(nW(null)),e(rW(null)),l([])},f=x=>{e(kI(x.checkpointFolder))},p=()=>{l([]),r&&r.forEach(x=>{i.includes(x.location)||l(E=>[...E,x.name])})},m=()=>{l([])},v=()=>{const x=r==null?void 0:r.filter(E=>s.includes(E.name));x==null||x.forEach(E=>{const k={name:E.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:E.location,vae:"",width:512,height:512,default:!1};e(XE(k))}),l([])},b=()=>{const x=[],E=[];return r&&r.forEach((k,_)=>{i.includes(k.location)?E.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_)):x.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_))}),K(fn,{children:[x,o&&E]})};return K(fn,{children:[n?K(at,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y(Qe,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y(Hx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(kI(n))}),y(Qe,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y(wP,{initialValues:{checkpointFolder:""},onSubmit:x=>{f(x)},children:({handleSubmit:x})=>y("form",{onSubmit:x,children:K(Sy,{columnGap:"0.5rem",children:[y(Ir,{isRequired:!0,width:"max-content",children:y(qo,{as:rs,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y(Qe,{icon:y(ZTe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&K(at,{flexDirection:"column",rowGap:"1rem",children:[K(at,{justifyContent:"space-between",alignItems:"center",children:[K("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),K("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),K(at,{columnGap:"0.5rem",justifyContent:"space-between",children:[K(at,{columnGap:"0.5rem",children:[y(qr,{isDisabled:s.length===r.length,onClick:p,children:t("modelmanager:selectAll")}),y(qr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y(Qn,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(dSe(!o))})]}),y(qr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),K(at,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const RD=64,ID=2048;function cLe(){const{isOpen:e,onOpen:t,onClose:n}=Qh(),r=Be(),{t:i}=Ke(),o=ve(v=>v.system.isProcessing);function a(v){return/\\s/g.test(v)}function s(v){let b;return a(v)&&(b=i("modelmanager:cannotUseSpaces")),b}const l={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},u=v=>{r(XE(v)),n()},f=()=>{n()},[p,m]=oe.useState(!1);return K(fn,{children:[y(qr,{"aria-label":i("modelmanager:addNewModel"),tooltip:i("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:K(at,{columnGap:"0.5rem",alignItems:"center",children:[y(Iy,{}),i("modelmanager:addNew")]})}),K(Qd,{isOpen:e,onClose:f,size:"3xl",closeOnOverlayClick:!1,children:[y(Jd,{}),K(ep,{className:"modal add-model-modal",children:[y(S1,{children:i("modelmanager:addNewModel")}),y(Cy,{}),K(t1,{className:"add-model-modal-body",children:[y(uLe,{}),y(Qn,{label:i("modelmanager:addManually"),isChecked:p,onChange:()=>m(!p)}),p&&y(wP,{initialValues:l,onSubmit:u,children:({handleSubmit:v,errors:b,touched:x})=>y("form",{onSubmit:v,children:K(pi,{rowGap:"0.5rem",children:[y(yr,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:i("modelmanager:manual")}),K(Ir,{isInvalid:!!b.name&&x.name,isRequired:!0,children:[y(ti,{htmlFor:"name",fontSize:"sm",children:i("modelmanager:name")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"name",name:"name",type:"text",validate:s,width:"2xl"}),!!b.name&&x.name?y(Wo,{children:b.name}):y(Uo,{margin:0,children:i("modelmanager:nameValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.description&&x.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"2xl"}),!!b.description&&x.description?y(Wo,{children:b.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.config&&x.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"2xl"}),!!b.config&&x.config?y(Wo,{children:b.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.weights&&x.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"2xl"}),!!b.weights&&x.weights?y(Wo,{children:b.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.vae&&x.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"2xl"}),!!b.vae&&x.vae?y(Wo,{children:b.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!b.width&&x.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:E,form:k})=>y(Eo,{id:"width",name:"width",min:RD,max:ID,step:64,width:"90%",value:k.values.width,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.width&&x.width?y(Wo,{children:b.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.height&&x.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:E,form:k})=>y(Eo,{id:"height",name:"height",min:RD,max:ID,width:"90%",step:64,value:k.values.height,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.height&&x.height?y(Wo,{children:b.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:o,children:i("modelmanager:addModel")})]})})})]})]})]})]})}bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"SunIcon",path:K("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[y("circle",{cx:"12",cy:"12",r:"5"}),y("path",{d:"M12 1v2"}),y("path",{d:"M12 21v2"}),y("path",{d:"M4.22 4.22l1.42 1.42"}),y("path",{d:"M18.36 18.36l1.42 1.42"}),y("path",{d:"M1 12h2"}),y("path",{d:"M21 12h2"}),y("path",{d:"M4.22 19.78l1.42-1.42"}),y("path",{d:"M18.36 5.64l1.42-1.42"})]})});bt({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"});bt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"ViewIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("circle",{cx:"12",cy:"12",r:"2"})]})});bt({displayName:"ViewOffIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});var dLe=bt({displayName:"DeleteIcon",path:y("g",{fill:"currentColor",children:y("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"})})});bt({displayName:"RepeatIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"RepeatClockIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});var fLe=bt({displayName:"EditIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),y("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});bt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});bt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});bt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});bt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});bt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});bt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});bt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});bt({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"});bt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var _q=bt({displayName:"ExternalLinkIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),y("path",{d:"M15 3h6v6"}),y("path",{d:"M10 14L21 3"})]})});bt({displayName:"LinkIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"PlusSquareIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),y("path",{d:"M12 8v8"}),y("path",{d:"M8 12h8"})]})});bt({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"});bt({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"});bt({displayName:"TimeIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowRightIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowLeftIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"EmailIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({displayName:"SpinnerIcon",path:K(fn,{children:[y("defs",{children:K("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[y("stop",{stopColor:"currentColor",offset:"0%"}),y("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),K("g",{transform:"translate(2)",fill:"none",children:[y("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),y("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),y("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});bt({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"});bt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({displayName:"InfoOutlineIcon",path:K("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[y("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),y("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),y("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});bt({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"});bt({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"});bt({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"});bt({displayName:"QuestionOutlineIcon",path:K("g",{stroke:"currentColor",strokeWidth:"1.5",children:[y("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"}),y("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),y("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});bt({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"});bt({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"});bt({viewBox:"0 0 14 14",path:y("g",{fill:"currentColor",children:y("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});bt({displayName:"MinusIcon",path:y("g",{fill:"currentColor",children:y("rect",{height:"4",width:"20",x:"2",y:"10"})})});bt({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"});const CP=Oe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:f,onClose:p}=Qh(),m=C.exports.useRef(null),v=()=>{r(),p()},b=()=>{o&&o(),p()};return K(fn,{children:[C.exports.cloneElement(l,{onClick:f,ref:t}),y(xV,{isOpen:u,leastDestructiveRef:m,onClose:p,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:s}),y(t1,{children:a}),K(cx,{children:[y(ds,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y(ds,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})});function DD(e){const{isProcessing:t,isConnected:n}=ve(v=>v.system),r=ve(v=>v.system.openModel),{t:i}=Ke(),o=Be(),{name:a,status:s,description:l}=e,u=()=>{o(BW(a))},f=()=>{o(lI(a))},p=()=>{o(Z6e(a)),o(lI(null))};return K(at,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y(rl,{onClick:f,cursor:"pointer",children:y(so,{label:l,hasArrow:!0,placement:"bottom",children:y(yr,{fontWeight:"bold",children:a})})}),y(rH,{onClick:f,cursor:"pointer"}),K(at,{gap:2,alignItems:"center",children:[y(yr,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),y(ds,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y(Qe,{icon:y(fLe,{}),size:"sm",onClick:f,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y(CP,{title:i("modelmanager:deleteModel"),acceptCallback:p,acceptButtonText:i("modelmanager:delete"),triggerComponent:y(Qe,{icon:y(dLe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:K(at,{rowGap:"1rem",flexDirection:"column",children:[y("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const hLe=lt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),pLe=()=>{const{models:e}=ve(hLe),[t,n]=C.exports.useState(""),{t:r}=Ke(),i=He.debounce(a=>{n(a.target.value)},400),o=()=>{const a=[],s=[];return e.forEach((l,u)=>{l.name.startsWith(t)&&s.push(y(DD,{name:l.name,status:l.status,description:l.description},u)),a.push(y(DD,{name:l.name,status:l.status,description:l.description},u))}),t!==""?s:a};return K(at,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[K(at,{justifyContent:"space-between",children:[y(yr,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),y(cLe,{})]}),y(rs,{onChange:i,label:r("modelmanager:search")}),y(at,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:o()})]})};function gLe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke();return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,size:"6xl",children:[y(Jd,{}),K(ep,{className:" modal",children:[y(Cy,{className:"modal-close-btn"}),y(S1,{children:i("modelmanager:modelManager")}),K(at,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y(pLe,{}),y(XTe,{})]})]})]})]})}function mLe(){const{t:e,i18n:t}=Ke(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y(qr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y(I8e,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y(pi,{children:r()})})}const vLe=()=>{const{t:e}=Ke();return K("div",{className:"site-header",children:[K("div",{className:"site-header-left-side",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),K("div",{className:"site-header-right-side",children:[y(J8e,{}),y(n_e,{}),y(gLe,{children:y(Qe,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(E8e,{})})}),y(Y8e,{children:y(Qe,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(R8e,{})})}),y(e_e,{}),y(mLe,{}),y(Qe,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y(k8e,{})})}),y(Qe,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y(S8e,{})})}),y(Qe,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y(b8e,{})})}),y(Z8e,{children:y(Qe,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y(JTe,{})})})]})]})};var yLe=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)}}(),Jr=globalThis&&globalThis.__assign||function(){return Jr=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)}},kLe=["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"],zD="__resizable_base__",kq=function(e){xLe(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(zD):o.className+=zD,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||wLe},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(),u=Number(n.state[s].toString().replace("px","")),f=u/l[s]*100;return f+"%"}return AC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?AC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?AC(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&&N0("left",o),s=i&&N0("top",o),l,u;if(this.props.bounds==="parent"){var f=this.parentNode;f&&(l=a?this.resizableRight-this.parentLeft:f.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:f.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=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),u=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,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var E=(m-b)*this.ratio+x,k=(v-b)*this.ratio+x,_=(f-x)/this.ratio+b,T=(p-x)/this.ratio+b,A=Math.max(f,E),R=Math.min(p,k),I=Math.max(m,_),D=Math.min(v,T);n=$b(n,A,R),r=$b(r,I,D)}else n=$b(n,f,p),r=$b(r,m,v);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,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&CLe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Fb(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 u=this.parentNode;if(u){var f=this.window.getComputedStyle(u).flexDirection;this.flexDir=f.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Fl(Fl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Fb(n))try{n.preventDefault(),n.stopPropagation()}catch(V){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Fb(n)?n.touches[0].clientX:n.clientX,f=Fb(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,v=p.original,b=p.width,x=p.height,E=this.getParentSize(),k=_Le(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=k.maxWidth,a=k.maxHeight,s=k.minWidth,l=k.minHeight;var _=this.calculateNewSizeFromDirection(u,f),T=_.newHeight,A=_.newWidth,R=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=FD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=FD(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(A,T,{width:R.maxWidth,height:R.maxHeight},{width:s,height:l});if(A=I.newWidth,T=I.newHeight,this.props.grid){var D=$D(A,this.props.grid[0]),B=$D(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(B-T)<=z?B:T}var j={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var Y=A/E.width*100;A=Y+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var Y=T/E.height*100;T=Y+"%"}else if(x.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(x.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),pu.exports.flushSync(function(){r.setState($)}),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:Fl(Fl({},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,u=r.handleComponent;if(!i)return null;var f=Object.keys(i).map(function(p){return i[p]!==!1?y(SLe,{direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p],children:u&&u[p]?u[p]:null},p):null});return y("div",{className:l,style:s,children:f})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return kLe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Fl(Fl(Fl({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 K(o,{...Fl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&y("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}(C.exports.PureComponent),ELe=Object.create,Eq=Object.defineProperty,PLe=Object.getOwnPropertyDescriptor,TLe=Object.getOwnPropertyNames,LLe=Object.getPrototypeOf,ALe=Object.prototype.hasOwnProperty,Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),OLe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TLe(t))!ALe.call(e,i)&&i!==n&&Eq(e,i,{get:()=>t[i],enumerable:!(r=PLe(t,i))||r.enumerable});return e},Pq=(e,t,n)=>(n=e!=null?ELe(LLe(e)):{},OLe(t||!e||!e.__esModule?Eq(n,"default",{value:e,enumerable:!0}):n,e)),MLe=Ue((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),Tq=Ue((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Vx=Ue((e,t)=>{var n=Tq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),RLe=Ue((e,t)=>{var n=Vx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),ILe=Ue((e,t)=>{var n=Vx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),DLe=Ue((e,t)=>{var n=Vx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),NLe=Ue((e,t)=>{var n=Vx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Ux=Ue((e,t)=>{var n=MLe(),r=RLe(),i=ILe(),o=DLe(),a=NLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux();function r(){this.__data__=new n,this.size=0}t.exports=r}),$Le=Ue((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),FLe=Ue((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),zLe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),Lq=Ue((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),bc=Ue((e,t)=>{var n=Lq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=Ue((e,t)=>{var n=bc(),r=n.Symbol;t.exports=r}),jLe=Ue((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),f=l[a];try{l[a]=void 0;var p=!0}catch(v){}var m=o.call(l);return p&&(u?l[a]=f:delete l[a]),m}t.exports=s}),HLe=Ue((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Wx=Ue((e,t)=>{var n=_P(),r=jLe(),i=HLe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),Aq=Ue((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),Oq=Ue((e,t)=>{var n=Wx(),r=Aq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var f=n(u);return f==o||f==a||f==i||f==s}t.exports=l}),VLe=Ue((e,t)=>{var n=bc(),r=n["__core-js_shared__"];t.exports=r}),ULe=Ue((e,t)=>{var n=VLe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),Mq=Ue((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),WLe=Ue((e,t)=>{var n=Oq(),r=ULe(),i=Aq(),o=Mq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,f=l.toString,p=u.hasOwnProperty,m=RegExp("^"+f.call(p).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=v}),GLe=Ue((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Ue((e,t)=>{var n=WLe(),r=GLe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Map");t.exports=i}),Gx=Ue((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),qLe=Ue((e,t)=>{var n=Gx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),YLe=Ue((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),KLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),XLe=Ue((e,t)=>{var n=Gx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ZLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),QLe=Ue((e,t)=>{var n=qLe(),r=YLe(),i=KLe(),o=XLe(),a=ZLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=QLe(),r=Ux(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),eAe=Ue((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),qx=Ue((e,t)=>{var n=eAe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),tAe=Ue((e,t)=>{var n=qx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),nAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).get(i)}t.exports=r}),rAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).has(i)}t.exports=r}),iAe=Ue((e,t)=>{var n=qx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),Rq=Ue((e,t)=>{var n=JLe(),r=tAe(),i=nAe(),o=rAe(),a=iAe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux(),r=kP(),i=Rq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var f=u.__data__;if(!r||f.length{var n=Ux(),r=BLe(),i=$Le(),o=FLe(),a=zLe(),s=oAe();function l(u){var f=this.__data__=new n(u);this.size=f.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),sAe=Ue((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),lAe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),uAe=Ue((e,t)=>{var n=Rq(),r=sAe(),i=lAe();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),Iq=Ue((e,t)=>{var n=uAe(),r=cAe(),i=dAe(),o=1,a=2;function s(l,u,f,p,m,v){var b=f&o,x=l.length,E=u.length;if(x!=E&&!(b&&E>x))return!1;var k=v.get(l),_=v.get(u);if(k&&_)return k==u&&_==l;var T=-1,A=!0,R=f&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=bc(),r=n.Uint8Array;t.exports=r}),hAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),pAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),gAe=Ue((e,t)=>{var n=_P(),r=fAe(),i=Tq(),o=Iq(),a=hAe(),s=pAe(),l=1,u=2,f="[object Boolean]",p="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",x="[object RegExp]",E="[object Set]",k="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",R=n?n.prototype:void 0,I=R?R.valueOf:void 0;function D(B,z,j,Y,te,G,$){switch(j){case A:if(B.byteLength!=z.byteLength||B.byteOffset!=z.byteOffset)return!1;B=B.buffer,z=z.buffer;case T:return!(B.byteLength!=z.byteLength||!G(new r(B),new r(z)));case f:case p:case b:return i(+B,+z);case m:return B.name==z.name&&B.message==z.message;case x:case k:return B==z+"";case v:var V=a;case E:var J=Y&l;if(V||(V=s),B.size!=z.size&&!J)return!1;var Z=$.get(B);if(Z)return Z==z;Y|=u,$.set(B,z);var U=o(V(B),V(z),Y,te,G,$);return $.delete(B),U;case _:if(I)return I.call(B)==I.call(z)}return!1}t.exports=D}),mAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),vAe=Ue((e,t)=>{var n=mAe(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),yAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),SAe=Ue((e,t)=>{var n=yAe(),r=bAe(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),xAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),wAe=Ue((e,t)=>{var n=Wx(),r=Yx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),CAe=Ue((e,t)=>{var n=wAe(),r=Yx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),_Ae=Ue((e,t)=>{function n(){return!1}t.exports=n}),Dq=Ue((e,t)=>{var n=bc(),r=_Ae(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),kAe=Ue((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),EAe=Ue((e,t)=>{var n=Wx(),r=Nq(),i=Yx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",x="[object Set]",E="[object String]",k="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",Y="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[R]=G[I]=G[D]=G[B]=G[z]=G[j]=G[Y]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[T]=G[l]=G[u]=G[f]=G[p]=G[m]=G[v]=G[b]=G[x]=G[E]=G[k]=!1;function $(V){return i(V)&&r(V.length)&&!!G[n(V)]}t.exports=$}),PAe=Ue((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),TAe=Ue((e,t)=>{var n=Lq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),Bq=Ue((e,t)=>{var n=EAe(),r=PAe(),i=TAe(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),LAe=Ue((e,t)=>{var n=xAe(),r=CAe(),i=EP(),o=Dq(),a=kAe(),s=Bq(),l=Object.prototype,u=l.hasOwnProperty;function f(p,m){var v=i(p),b=!v&&r(p),x=!v&&!b&&o(p),E=!v&&!b&&!x&&s(p),k=v||b||x||E,_=k?n(p.length,String):[],T=_.length;for(var A in p)(m||u.call(p,A))&&!(k&&(A=="length"||x&&(A=="offset"||A=="parent")||E&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=f}),AAe=Ue((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),OAe=Ue((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),MAe=Ue((e,t)=>{var n=OAe(),r=n(Object.keys,Object);t.exports=r}),RAe=Ue((e,t)=>{var n=AAe(),r=MAe(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),IAe=Ue((e,t)=>{var n=Oq(),r=Nq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),DAe=Ue((e,t)=>{var n=LAe(),r=RAe(),i=IAe();function o(a){return i(a)?n(a):r(a)}t.exports=o}),NAe=Ue((e,t)=>{var n=vAe(),r=SAe(),i=DAe();function o(a){return n(a,i,r)}t.exports=o}),BAe=Ue((e,t)=>{var n=NAe(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,f,p,m){var v=u&r,b=n(s),x=b.length,E=n(l),k=E.length;if(x!=k&&!v)return!1;for(var _=x;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),R=m.get(l);if(A&&R)return A==l&&R==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=bc(),i=n(r,"DataView");t.exports=i}),FAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Promise");t.exports=i}),zAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Set");t.exports=i}),jAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"WeakMap");t.exports=i}),HAe=Ue((e,t)=>{var n=$Ae(),r=kP(),i=FAe(),o=zAe(),a=jAe(),s=Wx(),l=Mq(),u="[object Map]",f="[object Object]",p="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",x=l(n),E=l(r),k=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=p||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(R){var I=s(R),D=I==f?R.constructor:void 0,B=D?l(D):"";if(B)switch(B){case x:return b;case E:return u;case k:return p;case _:return m;case T:return v}return I}),t.exports=A}),VAe=Ue((e,t)=>{var n=aAe(),r=Iq(),i=gAe(),o=BAe(),a=HAe(),s=EP(),l=Dq(),u=Bq(),f=1,p="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function E(k,_,T,A,R,I){var D=s(k),B=s(_),z=D?m:a(k),j=B?m:a(_);z=z==p?v:z,j=j==p?v:j;var Y=z==v,te=j==v,G=z==j;if(G&&l(k)){if(!l(_))return!1;D=!0,Y=!1}if(G&&!Y)return I||(I=new n),D||u(k)?r(k,_,T,A,R,I):i(k,_,z,T,A,R,I);if(!(T&f)){var $=Y&&x.call(k,"__wrapped__"),V=te&&x.call(_,"__wrapped__");if($||V){var J=$?k.value():k,Z=V?_.value():_;return I||(I=new n),R(J,Z,T,A,I)}}return G?(I||(I=new n),o(k,_,T,A,R,I)):!1}t.exports=E}),UAe=Ue((e,t)=>{var n=VAe(),r=Yx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),$q=Ue((e,t)=>{var n=UAe();function r(i,o){return n(i,o)}t.exports=r}),WAe=["ctrl","shift","alt","meta","mod"],GAe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function OC(e,t=","){return typeof e=="string"?e.split(t):e}function s2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>GAe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!WAe.includes(o));return{...r,keys:i}}function qAe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function YAe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function KAe(e){return Fq(e,["input","textarea","select"])}function Fq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function XAe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var ZAe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:f,metaKey:p,shiftKey:m,key:v,code:b}=e,x=b.toLowerCase().replace("key",""),E=v.toLowerCase();if(u!==r&&E!=="alt"||m!==s&&E!=="shift")return!1;if(a){if(!p&&!f)return!1}else if(p!==o&&x!=="meta"||f!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(E)||l.includes(x))?!0:l?l.every(k=>n.has(k)):!l},QAe=C.exports.createContext(void 0),JAe=()=>C.exports.useContext(QAe),eOe=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),tOe=()=>C.exports.useContext(eOe),nOe=Pq($q());function rOe(e){let t=C.exports.useRef(void 0);return(0,nOe.default)(t.current,e)||(t.current=e),t.current}var jD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ze(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=rOe(a),{enabledScopes:f}=tOe(),p=JAe();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!XAe(f,u==null?void 0:u.scopes))return;let m=x=>{var E;if(!(KAe(x)&&!Fq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){jD(x);return}((E=x.target)==null?void 0:E.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||OC(e,u==null?void 0:u.splitKey).forEach(k=>{var T;let _=s2(k,u==null?void 0:u.combinationKey);if(ZAe(x,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(qAe(x,_,u==null?void 0:u.preventDefault),!YAe(x,_,u==null?void 0:u.enabled)){jD(x);return}l(x,_)}})}},v=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.addHotkey(s2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.removeHotkey(s2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,f]),i}Pq($q());var L8=new Set;function iOe(e){(Array.isArray(e)?e:[e]).forEach(t=>L8.add(s2(t)))}function oOe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=s2(t);for(let i of L8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&L8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{iOe(e.key)}),document.addEventListener("keyup",e=>{oOe(e.key)})});const aOe=lt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),sOe=lt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),lOe=()=>{const e=Be(),t=ve(aOe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ve(sOe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(tW()),e(dC(!n))};return Ze("`",()=>{e(dC(!n))},[n]),Ze("esc",()=>{e(dC(!1))}),K(fn,{children:[n&&y(kq,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:y("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=f;return K("div",{className:`console-entry console-${b}-color`,children:[K("p",{className:"console-timestamp",children:[m,":"]}),y("p",{className:"console-message",children:v})]},p)})})}),n&&y(so,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y(fs,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y(x8e,{}),onClick:()=>a(!o)})}),y(so,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y(fs,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y(N8e,{}):y($G,{}),onClick:l})})]})};function uOe(){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)})}function cOe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:nodes")}),y("p",{children:e("common:nodesDesc")})]})}const dOe=()=>{const{t:e}=Ke();return K("div",{className:"work-in-progress post-processing-work-in-progress",children:[y("h1",{children:e("common:postProcessing")}),y("p",{children:e("common:postProcessDesc1")}),y("p",{children:e("common:postProcessDesc2")}),y("p",{children:e("common:postProcessDesc3")})]})},fOe=bt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y("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"})})}),hOe=bt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y("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"})}),pOe=bt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y("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"})}),gOe=bt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y("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 oo=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const mOe=()=>{const{t:e}=Ke();return C.exports.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},vOe=e=>mOe()[e],yOe=lt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),bOe=lt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),PP=()=>{const e=Be(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ve(yOe),{isGFPGANAvailable:i}=ve(bOe),o=u=>e(w4(u)),a=u=>e(CU(u)),s=u=>e(C4(u.target.value)),{t:l}=Ke();return K(at,{direction:"column",gap:2,children:[y(nl,{label:l("options:type"),validValues:oCe.concat(),value:n,onChange:s}),y(Eo,{isDisabled:!i,label:l("options:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y(Eo,{isDisabled:!i,label:l("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function zq(){const e=ve(i=>i.system.isGFPGANAvailable),t=ve(i=>i.options.shouldRunFacetool),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(sSe(i.target.checked))})}function SOe(){const e=Be(),t=ve(i=>i.options.shouldFitToWidthHeight),n=i=>e(OU(i.target.checked)),{t:r}=Ke();return y(os,{label:r("options:imageFit"),isChecked:t,onChange:n})}function Zo(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:f="",withSliderMarks:p=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:x=!1,inputWidth:E="5rem",inputReadOnly:k=!0,withReset:_=!1,hideTooltip:T=!1,isCompact:A=!1,handleReset:R,isResetDisabled:I,isSliderDisabled:D,isInputDisabled:B,styleClass:z,sliderFormControlProps:j,sliderFormLabelProps:Y,sliderMarkProps:te,sliderTrackProps:G,sliderThumbProps:$,sliderNumberInputProps:V,sliderNumberInputFieldProps:J,sliderNumberInputStepperProps:Z,sliderTooltipProps:U,sliderIAIIconButtonProps:X,...le}=e,[fe,Se]=C.exports.useState(String(i)),Ae=C.exports.useMemo(()=>V!=null&&V.max?V.max:a,[a,V==null?void 0:V.max]);C.exports.useEffect(()=>{String(i)!==fe&&fe!==""&&Se(String(i))},[i,fe,Se]);const be=Je=>{const Ye=He.clamp(x?Math.floor(Number(Je.target.value)):Number(Je.target.value),o,Ae);Se(String(Ye)),l(Ye)},ke=Je=>{Se(String(Je)),l(Number(Je))},De=()=>{!R||R()};return K(Ir,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":p,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...j,children:[y(ti,{className:"invokeai__slider-component-label",...Y,children:r}),K(Sy,{w:"100%",gap:2,alignItems:"center",children:[K(_E,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ke,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...le,children:[p&&K(fn,{children:[y($9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y($9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y(HV,{className:"invokeai__slider_track",...G,children:y(VV,{className:"invokeai__slider_track-filled"})}),y(so,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${f}`,hidden:T,...U,children:y(jV,{className:"invokeai__slider-thumb",...$})})]}),b&&K(gE,{min:o,max:Ae,step:s,value:fe,onChange:ke,onBlur:be,className:"invokeai__slider-number-field",isDisabled:B,...V,children:[y(mE,{className:"invokeai__slider-number-input",width:E,readOnly:k,...J}),K(_V,{...Z,children:[y(yE,{className:"invokeai__slider-number-stepper"}),y(vE,{className:"invokeai__slider-number-stepper"})]})]}),_&&y(Qe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y(Hx,{}),onClick:De,isDisabled:I,...X})]})]})}function jq(e){const{t}=Ke(),{label:n=`${t("options:strength")}`,styleClass:r}=e,i=ve(l=>l.options.img2imgStrength),o=Be();return y(Zo,{label:n,step:.01,min:.01,max:.99,onChange:l=>o(Y9(l)),value:i,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Y9(.75))}})}const Hq=()=>{const e=Be(),t=ve(i=>i.options.seamless),n=i=>e(LU(i.target.checked)),{t:r}=Ke();return y(at,{gap:2,direction:"column",children:y(os,{label:r("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},xOe=()=>y(at,{gap:2,direction:"column",children:y(Hq,{})});function wOe(){const e=Be(),{t}=Ke(),n=ve(i=>i.options.shouldRandomizeSeed),r=i=>e(oSe(i.target.checked));return y(os,{label:t("options:randomizeSeed"),isChecked:n,onChange:r})}function COe(){const e=ve(a=>a.options.seed),t=ve(a=>a.options.shouldRandomizeSeed),n=ve(a=>a.options.shouldGenerateVariations),{t:r}=Ke(),i=Be(),o=a=>i(Ly(a));return y(Eo,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:ZE,max:QE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function _Oe(){const e=Be(),t=ve(i=>i.options.shouldRandomizeSeed),{t:n}=Ke();return y(ds,{size:"sm",isDisabled:t,onClick:()=>e(Ly($W(ZE,QE))),padding:"0 1.5rem",children:y("p",{children:n("options:shuffle")})})}function kOe(){const e=Be(),t=ve(i=>i.options.threshold),{t:n}=Ke(),r=i=>e(IU(i));return y(Eo,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}function EOe(){const e=Be(),t=ve(i=>i.options.perlin),{t:n}=Ke(),r=i=>e(PU(i));return y(Eo,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}const TP=()=>K(at,{gap:2,direction:"column",children:[y(wOe,{}),K(at,{gap:2,children:[y(COe,{}),y(_Oe,{})]}),y(at,{gap:2,children:y(kOe,{})}),y(at,{gap:2,children:y(EOe,{})})]}),POe=lt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),TOe=lt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),LP=()=>{const e=Be(),{upscalingLevel:t,upscalingStrength:n}=ve(POe),{isESRGANAvailable:r}=ve(TOe),{t:i}=Ke(),o=s=>e(K9(Number(s.target.value))),a=s=>e(X9(s));return K("div",{className:"upscale-options",children:[y(nl,{isDisabled:!r,label:i("options:scale"),value:t,onChange:o,validValues:iCe}),y(Eo,{isDisabled:!r,label:i("options:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};function Vq(){const e=ve(i=>i.system.isESRGANAvailable),t=ve(i=>i.options.shouldRunESRGAN),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(aSe(i.target.checked))})}function AP(){const e=ve(r=>r.options.shouldGenerateVariations),t=Be();return y(os,{isChecked:e,width:"auto",onChange:r=>t(tSe(r.target.checked))})}function LOe(){const e=ve(o=>o.options.seedWeights),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(AU(o.target.value));return y(rs,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(FE(e)||e===""),isDisabled:!t,onChange:i})}function AOe(){const e=ve(o=>o.options.variationAmount),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(uSe(o));return y(Eo,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const OP=()=>K(at,{gap:2,direction:"column",children:[y(AOe,{}),y(LOe,{})]});function OOe(){const e=Be(),t=ve(i=>i.options.cfgScale),{t:n}=Ke(),r=i=>e(wU(i));return y(Eo,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function MOe(){const e=ve(o=>o.options.height),t=ve(_r),n=Be(),{t:r}=Ke(),i=o=>n(_U(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:r("options:height"),value:e,flexGrow:1,onChange:i,validValues:rCe,styleClass:"main-option-block"})}const ROe=lt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function IOe(){const e=Be(),{iterations:t}=ve(ROe),{t:n}=Ke(),r=i=>e(J5e(i));return y(Eo,{label:n("options:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function DOe(){const e=ve(i=>i.options.sampler),t=Be(),{t:n}=Ke(),r=i=>t(TU(i.target.value));return y(nl,{label:n("options:sampler"),value:e,onChange:r,validValues:tCe,styleClass:"main-option-block"})}function NOe(){const e=Be(),t=ve(i=>i.options.steps),{t:n}=Ke(),r=i=>e(RU(i));return y(Eo,{label:n("options:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function BOe(){const e=ve(o=>o.options.width),t=ve(_r),{t:n}=Ke(),r=Be(),i=o=>r(DU(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:n("options:width"),value:e,flexGrow:1,onChange:i,validValues:nCe,styleClass:"main-option-block"})}function MP(){return y("div",{className:"main-options",children:K("div",{className:"main-options-list",children:[K("div",{className:"main-options-row",children:[y(IOe,{}),y(NOe,{}),y(OOe,{})]}),K("div",{className:"main-options-row",children:[y(BOe,{}),y(MOe,{}),y(DOe,{})]})]})})}const $Oe=lt(e=>e.system,e=>e.shouldDisplayGuides),FOe=({children:e,feature:t})=>{const n=ve($Oe),{text:r}=vOe(t);return n?K(bE,{trigger:"hover",children:[y(wE,{children:y(rl,{children:e})}),K(xE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y(SE,{className:"guide-popover-arrow"}),y("div",{className:"guide-popover-guide-content",children:r})]})]}):null},zOe=Oe(({feature:e,icon:t=QTe},n)=>y(FOe,{feature:e,children:y(rl,{ref:n,children:y($a,{marginBottom:"-.15rem",as:t})})}));function jOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return K(rg,{className:"advanced-settings-item",children:[y(tg,{className:"advanced-settings-header",children:K(at,{width:"100%",gap:"0.5rem",align:"center",children:[y(rl,{flexGrow:1,textAlign:"left",children:t}),i,n&&y(zOe,{feature:n}),y(ng,{})]})}),y(ig,{className:"advanced-settings-panel",children:r})]})}const RP=e=>{const{accordionInfo:t}=e,n=ve(a=>a.system.openAccordions),r=Be();return y(Nk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(owe(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:f,additionalHeaderComponents:p}=t[s];a.push(y(jOe,{header:l,feature:u,content:f,additionalHeaderComponents:p},s))}),a})()})},rn=e=>e.canvas,kr=lt([rn,_r,al],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Uq=e=>e.canvas.layerState.objects.find(H5),Wq=lt([e=>e.options,e=>e.system,Uq,_r],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:f}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),f||(p=!1,m.push("System Disconnected")),o&&(!(FE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}});function IP(e){const{iconButton:t=!1,...n}=e,r=Be(),{isReady:i}=ve(Wq),o=ve(_r),a=()=>{r(u8(o))},{t:s}=Ke();return Ze(["ctrl+enter","meta+enter"],()=>{r(u8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y("div",{style:{flexGrow:4},children:t?y(Qe,{"aria-label":s("options:invoke"),type:"submit",icon:y($8e,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):y(qr,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const HOe=lt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function DP(e){const{...t}=e,n=Be(),{isProcessing:r,isConnected:i,isCancelable:o}=ve(HOe),a=()=>n(K6e()),{t:s}=Ke();return Ze("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y(Qe,{icon:y(nLe,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const VOe=lt(e=>e.options,e=>e.shouldLoopback),UOe=()=>{const e=Be(),t=ve(VOe),{t:n}=Ke();return y(Qe,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y(z8e,{}),onClick:()=>{e(rSe(!t))}})},NP=()=>{const e=ve(_r);return K("div",{className:"process-buttons",children:[y(IP,{}),e==="img2img"&&y(UOe,{}),y(DP,{})]})},WOe=lt([e=>e.options,_r],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BP=()=>{const e=Be(),{prompt:t,activeTabName:n}=ve(WOe),{isReady:r}=ve(Wq),i=C.exports.useRef(null),{t:o}=Ke(),a=l=>{e(mx(l.target.value))};Ze("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(u8(n)))};return y("div",{className:"prompt-bar",children:y(Ir,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y(ZV,{id:"prompt",name:"prompt",placeholder:o("options:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function Gq(e){return yt({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 qq(e){return yt({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function GOe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function qOe(e,t){e.classList?e.classList.add(t):GOe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function HD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function YOe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=HD(e.className,t):e.setAttribute("class",HD(e.className&&e.className.baseVal||"",t))}const VD={disabled:!1},Yq=oe.createContext(null);var Kq=function(t){return t.scrollTop},Av="unmounted",Sh="exited",xh="entering",z0="entered",A8="exiting",Sc=function(e){oE(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=Sh,o.appearStatus=xh):l=z0:r.unmountOnExit||r.mountOnEnter?l=Av:l=Sh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Av?{status:Sh}: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!==xh&&a!==z0&&(o=xh):(a===xh||a===z0)&&(o=A8)}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===xh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:W3.findDOMNode(this);a&&Kq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Sh&&this.setState({status:Av})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[W3.findDOMNode(this),s],u=l[0],f=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||VD.disabled){this.safeSetState({status:z0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:xh},function(){o.props.onEntering(u,f),o.onTransitionEnd(m,function(){o.safeSetState({status:z0},function(){o.props.onEntered(u,f)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:W3.findDOMNode(this);if(!o||VD.disabled){this.safeSetState({status:Sh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:A8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Sh},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:W3.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],u=l[0],f=l[1];this.props.addEndListener(u,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Av)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=nE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return y(Yq.Provider,{value:null,children:typeof a=="function"?a(i,s):oe.cloneElement(oe.Children.only(a),s)})},t}(oe.Component);Sc.contextType=Yq;Sc.propTypes={};function B0(){}Sc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:B0,onEntering:B0,onEntered:B0,onExit:B0,onExiting:B0,onExited:B0};Sc.UNMOUNTED=Av;Sc.EXITED=Sh;Sc.ENTERING=xh;Sc.ENTERED=z0;Sc.EXITING=A8;const KOe=Sc;var XOe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return qOe(t,r)})},MC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return YOe(t,r)})},$P=function(e){oE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ae.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),FP=e=>{const t=Be(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ve(ZOe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ze("o",()=>{t(Ju(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Ze("esc",()=>{t(Ju(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ze("shift+o",()=>{m(),t(vi(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(eSe(a.current?a.current.scrollTop:0)),t(Ju(!1)),t(nSe(!1)))},[t,i]),f=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(iSe(!i)),t(vi(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y(Xq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:y("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y("div",{className:"options-panel-margin",children:K("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?p():!i&&f()},children:[y(so,{label:"Pin Options Panel",children:y("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?y(Gq,{}):y(qq,{})})}),!i&&K("div",{className:"invoke-ai-logo-wrapper",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),l]})})})})};function QOe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(xOe,{})}},n=Be(),r=ve(_r);return C.exports.useEffect(()=>{r==="img2img"&&n(jE(!1))},[r,n]),K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(SOe,{}),y(RP,{accordionInfo:t})]})}const zP=C.exports.createContext(null),JOe=e=>{const{styleClass:t}=e,n=C.exports.useContext(zP),r=()=>{n&&n()};return y("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:K("div",{className:"image-upload-button",children:[y(Nx,{}),y(Hh,{size:"lg",children:"Click or Drag and Drop"})]})})},eMe=lt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),O8=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Qh(),a=Be(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ve(eMe),f=C.exports.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Y6e(e)),o()};Ze("delete",()=>{s?i():m()},[e,s]);const v=b=>a(eW(!b.target.checked));return K(fn,{children:[C.exports.cloneElement(t,{onClick:e?p:void 0,ref:n}),y(xV,{isOpen:r,leastDestructiveRef:f,onClose:o,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y(t1,{children:K(at,{direction:"column",gap:5,children:[y(yr,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y(Ir,{children:K(at,{alignItems:"center",children:[y(ti,{mb:0,children:"Don't ask me again"}),y(kE,{checked:!s,onChange:v})]})})]})}),K(cx,{children:[y(ds,{ref:f,onClick:o,className:"modal-close-btn",children:"Cancel"}),y(ds,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),tMe=lt([e=>e.system,e=>e.options,e=>e.gallery,_r],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:f,isLightBoxOpen:p}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:f,activeTabName:r,isLightBoxOpen:p}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Zq=()=>{var B,z,j,Y,te,G;const e=Be(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:f,activeTabName:p}=ve(tMe),m=Ty(),{t:v}=Ke(),b=()=>{!u||(f&&e(Qu(!1)),e(C1(u)),e(Go("img2img")))},x=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Ze("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var $,V;!u||(u.metadata&&e(X5e(u.metadata)),(($=u.metadata)==null?void 0:$.image.type)==="img2img"?e(Go("img2img")):((V=u.metadata)==null?void 0:V.image.type)==="txt2img"&&e(Go("txt2img")))};Ze("a",()=>{var $,V;["txt2img","img2img"].includes((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Ly(u.metadata.image.seed))};Ze("s",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var $,V;return((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.prompt)&&e(mx(u.metadata.image.prompt))};Ze("p",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.prompt?(_(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{u&&e(G6e(u))};Ze("Shift+U",()=>{i&&!s&&n&&!t&&o?T():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const A=()=>{u&&e(q6e(u))};Ze("Shift+R",()=>{r&&!s&&n&&!t&&a?A():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(MU(!l)),I=()=>{!u||(f&&e(Qu(!1)),e(Sx(u)),e(vi(!0)),p!=="unifiedCanvas"&&e(Go("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Ze("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const D=()=>{e(Qu(!f))};return K("div",{className:"current-image-options",children:[K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":`${v("options:sendTo")}...`,icon:y(V8e,{})}),children:K("div",{className:"current-image-send-to-popover",children:[y(qr,{size:"sm",onClick:b,leftIcon:y(QI,{}),children:v("options:sendToImg2Img")}),y(qr,{size:"sm",onClick:I,leftIcon:y(QI,{}),children:v("options:sendToUnifiedCanvas")}),y(qr,{size:"sm",onClick:x,leftIcon:y(Ry,{}),children:v("options:copyImageToLink")}),y(qr,{leftIcon:y(sP,{}),size:"sm",children:y(Vh,{download:!0,href:u==null?void 0:u.url,children:v("options:downloadImage")})})]})}),y(Qe,{icon:y(T8e,{}),tooltip:f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"aria-label":f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"data-selected":f,onClick:D})]}),K(io,{isAttached:!0,children:[y(Qe,{icon:y(F8e,{}),tooltip:`${v("options:usePrompt")} (P)`,"aria-label":`${v("options:usePrompt")} (P)`,isDisabled:!((z=(B=u==null?void 0:u.metadata)==null?void 0:B.image)!=null&&z.prompt),onClick:_}),y(Qe,{icon:y(H8e,{}),tooltip:`${v("options:useSeed")} (S)`,"aria-label":`${v("options:useSeed")} (S)`,isDisabled:!((Y=(j=u==null?void 0:u.metadata)==null?void 0:j.image)!=null&&Y.seed),onClick:k}),y(Qe,{icon:y(_8e,{}),tooltip:`${v("options:useAll")} (A)`,"aria-label":`${v("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((G=(te=u==null?void 0:u.metadata)==null?void 0:te.image)==null?void 0:G.type),onClick:E})]}),K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(O8e,{}),"aria-label":v("options:restoreFaces")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(PP,{}),y(qr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:A,children:v("options:restoreFaces")})]})}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(P8e,{}),"aria-label":v("options:upscale")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(LP,{}),y(qr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:T,children:v("options:upscaleImage")})]})})]}),y(io,{isAttached:!0,children:y(Qe,{icon:y($G,{}),tooltip:`${v("options:info")} (I)`,"aria-label":`${v("options:info")} (I)`,"data-selected":l,onClick:R})}),y(O8,{image:u,children:y(Qe,{icon:y(yp,{}),tooltip:`${v("options:deleteImage")} (Del)`,"aria-label":`${v("options:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function nMe(e){return yt({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 $n=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>K(at,{gap:2,children:[n&&y(so,{label:`Recall ${e}`,children:y(fs,{"aria-label":"Use this parameter",icon:y(nMe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y(so,{label:`Copy ${e}`,children:y(fs,{"aria-label":`Copy ${e}`,icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),K(at,{direction:i?"column":"row",children:[K(yr,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?K(Vh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y(_q,{mx:"2px"})]}):y(yr,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),rMe=(e,t)=>e.image.uuid===t.image.uuid,Qq=C.exports.memo(({image:e,styleClass:t})=>{var j,Y;const n=Be();Ze("esc",()=>{n(MU(!1))});const r=((j=e==null?void 0:e.metadata)==null?void 0:j.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:f,orig_path:p,perlin:m,postprocessing:v,prompt:b,sampler:x,scale:E,seamless:k,seed:_,steps:T,strength:A,threshold:R,type:I,variations:D,width:B}=r,z=JSON.stringify(e.metadata,null,2);return y("div",{className:`image-metadata-viewer ${t}`,children:K(at,{gap:1,direction:"column",width:"100%",children:[K(at,{gap:2,children:[y(yr,{fontWeight:"semibold",children:"File:"}),K(Vh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y(_q,{mx:"2px"})]})]}),Object.keys(r).length>0?K(fn,{children:[I&&y($n,{label:"Generation type",value:I}),((Y=e.metadata)==null?void 0:Y.model_weights)&&y($n,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&y($n,{label:"Original image",value:p}),I==="gfpgan"&&A!==void 0&&y($n,{label:"Fix faces strength",value:A,onClick:()=>n(w4(A))}),I==="esrgan"&&E!==void 0&&y($n,{label:"Upscaling scale",value:E,onClick:()=>n(K9(E))}),I==="esrgan"&&A!==void 0&&y($n,{label:"Upscaling strength",value:A,onClick:()=>n(X9(A))}),b&&y($n,{label:"Prompt",labelPosition:"top",value:x4(b),onClick:()=>n(mx(b))}),_!==void 0&&y($n,{label:"Seed",value:_,onClick:()=>n(Ly(_))}),R!==void 0&&y($n,{label:"Noise Threshold",value:R,onClick:()=>n(IU(R))}),m!==void 0&&y($n,{label:"Perlin Noise",value:m,onClick:()=>n(PU(m))}),x&&y($n,{label:"Sampler",value:x,onClick:()=>n(TU(x))}),T&&y($n,{label:"Steps",value:T,onClick:()=>n(RU(T))}),o!==void 0&&y($n,{label:"CFG scale",value:o,onClick:()=>n(wU(o))}),D&&D.length>0&&y($n,{label:"Seed-weight pairs",value:N5(D),onClick:()=>n(AU(N5(D)))}),k&&y($n,{label:"Seamless",value:k,onClick:()=>n(LU(k))}),l&&y($n,{label:"High Resolution Optimization",value:l,onClick:()=>n(jE(l))}),B&&y($n,{label:"Width",value:B,onClick:()=>n(DU(B))}),s&&y($n,{label:"Height",value:s,onClick:()=>n(_U(s))}),u&&y($n,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(C1(u))}),f&&y($n,{label:"Mask image",value:f,isLink:!0,onClick:()=>n(EU(f))}),I==="img2img"&&A&&y($n,{label:"Image to image strength",value:A,onClick:()=>n(Y9(A))}),a&&y($n,{label:"Image to image fit",value:a,onClick:()=>n(OU(a))}),v&&v.length>0&&K(fn,{children:[y(Hh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y($n,{label:"Scale",value:$,onClick:()=>n(K9($))}),y($n,{label:"Strength",value:V,onClick:()=>n(X9(V))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("codeformer"))}}),V&&y($n,{label:"Fidelity",value:V,onClick:()=>{n(CU(V)),n(C4("codeformer"))}})]},G)}})]}),i&&y($n,{withCopy:!0,label:"Dream Prompt",value:i}),K(at,{gap:2,direction:"column",children:[K(at,{gap:2,children:[y(so,{label:"Copy metadata JSON",children:y(fs,{"aria-label":"Copy metadata JSON",icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y(yr,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y("div",{className:"image-json-viewer",children:y("pre",{children:z})})]})]}):y(eH,{width:"100%",pt:10,children:y(yr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},rMe),Jq=lt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var f;return u.uuid===((f=e==null?void 0:e.currentImage)==null?void 0:f.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function iMe(){const e=Be(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return K("div",{className:"current-image-preview",children:[i&&y(nx,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&y(Qq,{image:i,styleClass:"current-image-metadata"})]})}const oMe=lt([e=>e.gallery,e=>e.options,_r],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ve(oMe);return y("div",{className:"current-image-area","data-tab-name":t,children:e?K(fn,{children:[y(Zq,{}),y(iMe,{})]}):y("div",{className:"current-image-display-placeholder",children:y(tLe,{})})})},aMe=()=>{const e=C.exports.useContext(zP);return y(Qe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y(Nx,{}),onClick:e||void 0})};function sMe(){const e=ve(o=>o.options.initialImage),{t}=Ke(),n=Be(),r=Ty(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(xU())};return K(fn,{children:[K("div",{className:"init-image-preview-header",children:[y("h2",{children:t("options:initialImage")}),y(aMe,{})]}),e&&y("div",{className:"init-image-preview",children:y(nx,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const lMe=()=>{const e=ve(r=>r.options.initialImage),{currentImage:t}=ve(r=>r.gallery);return K("div",{className:"workarea-split-view",children:[y("div",{className:"workarea-split-view-left",children:e?y("div",{className:"image-to-image-area",children:y(sMe,{})}):y(JOe,{})}),t&&y("div",{className:"workarea-split-view-right",children:y(eY,{})})]})};function uMe(e){return yt({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 tr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function By(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(p){const{scope:m,children:v,...b}=p,x=(m==null?void 0:m[e][l])||s,E=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(x.Provider,{value:E},v)}function f(p,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,f]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,cMe(i,...t)]}function cMe(...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:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function dMe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tY(...e){return t=>e.forEach(n=>dMe(n,t))}function gs(...e){return C.exports.useCallback(tY(...e),e)}const ny=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(hMe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(M8,Dn({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(M8,Dn({},r,{ref:t}),n)});ny.displayName="Slot";const M8=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...pMe(r,n.props),ref:tY(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});M8.displayName="SlotClone";const fMe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function hMe(e){return C.exports.isValidElement(e)&&e.type===fMe}function pMe(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 gMe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],uc=gMe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ny:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,Dn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nY(e,t){e&&pu.exports.flushSync(()=>e.dispatchEvent(t))}function rY(e){const t=e+"CollectionProvider",[n,r]=By(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:x}=v,E=oe.useRef(null),k=oe.useRef(new Map).current;return oe.createElement(i,{scope:b,itemMap:k,collectionRef:E},x)},s=e+"CollectionSlot",l=oe.forwardRef((v,b)=>{const{scope:x,children:E}=v,k=o(s,x),_=gs(b,k.collectionRef);return oe.createElement(ny,{ref:_},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",p=oe.forwardRef((v,b)=>{const{scope:x,children:E,...k}=v,_=oe.useRef(null),T=gs(b,_),A=o(u,x);return oe.useEffect(()=>(A.itemMap.set(_,{ref:_,...k}),()=>void A.itemMap.delete(_))),oe.createElement(ny,{[f]:"",ref:T},E)});function m(v){const b=o(e+"CollectionConsumer",v);return oe.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>k.indexOf(A.ref.current)-k.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const mMe=C.exports.createContext(void 0);function iY(e){const t=C.exports.useContext(mMe);return e||t||"ltr"}function fu(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function vMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const R8="dismissableLayer.update",yMe="dismissableLayer.pointerDownOutside",bMe="dismissableLayer.focusOutside";let UD;const SMe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xMe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,f=C.exports.useContext(SMe),[p,m]=C.exports.useState(null),v=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),x=gs(t,B=>m(B)),E=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),T=p?E.indexOf(p):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,R=T>=_,I=wMe(B=>{const z=B.target,j=[...f.branches].some(Y=>Y.contains(z));!R||j||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=CMe(B=>{const z=B.target;[...f.branches].some(Y=>Y.contains(z))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return vMe(B=>{T===f.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!p)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),WD(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=UD)}},[p,v,r,f]),C.exports.useEffect(()=>()=>{!p||(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),WD())},[p,f]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(R8,B),()=>document.removeEventListener(R8,B)},[]),C.exports.createElement(uc.div,Dn({},u,{ref:x,style:{pointerEvents:A?R?"auto":"none":void 0,...e.style},onFocusCapture:tr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:tr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:tr(e.onPointerDownCapture,I.onPointerDownCapture)}))});function wMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){oY(yMe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 CMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&oY(bMe,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 WD(){const e=new CustomEvent(R8);document.dispatchEvent(e)}function oY(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?nY(i,o):i.dispatchEvent(o)}let RC=0;function _Me(){C.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:GD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GD()),RC++,()=>{RC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),RC--}},[])}function GD(){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 IC="focusScope.autoFocusOnMount",DC="focusScope.autoFocusOnUnmount",qD={bubbles:!1,cancelable:!0},kMe=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=fu(i),f=fu(o),p=C.exports.useRef(null),m=gs(t,x=>l(x)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let x=function(k){if(v.paused||!s)return;const _=k.target;s.contains(_)?p.current=_:wh(p.current,{select:!0})},E=function(k){v.paused||!s||s.contains(k.relatedTarget)||wh(p.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){KD.add(v);const x=document.activeElement;if(!s.contains(x)){const k=new CustomEvent(IC,qD);s.addEventListener(IC,u),s.dispatchEvent(k),k.defaultPrevented||(EMe(OMe(aY(s)),{select:!0}),document.activeElement===x&&wh(s))}return()=>{s.removeEventListener(IC,u),setTimeout(()=>{const k=new CustomEvent(DC,qD);s.addEventListener(DC,f),s.dispatchEvent(k),k.defaultPrevented||wh(x!=null?x:document.body,{select:!0}),s.removeEventListener(DC,f),KD.remove(v)},0)}}},[s,u,f,v]);const b=C.exports.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(E&&k){const _=x.currentTarget,[T,A]=PMe(_);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),n&&wh(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),n&&wh(A,{select:!0})):k===_&&x.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(uc.div,Dn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function EMe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wh(r,{select:t}),document.activeElement!==n)return}function PMe(e){const t=aY(e),n=YD(t,e),r=YD(t.reverse(),e);return[n,r]}function aY(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 YD(e,t){for(const n of e)if(!TMe(n,{upTo:t}))return n}function TMe(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 LMe(e){return e instanceof HTMLInputElement&&"select"in e}function wh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LMe(e)&&t&&e.select()}}const KD=AMe();function AMe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XD(e,t),e.unshift(t)},remove(t){var n;e=XD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function XD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OMe(e){return e.filter(t=>t.tagName!=="A")}const a1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},MMe=jC["useId".toString()]||(()=>{});let RMe=0;function IMe(e){const[t,n]=C.exports.useState(MMe());return a1(()=>{e||n(r=>r!=null?r:String(RMe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function Kx(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function jP(e){return e==="y"?"height":"width"}function ZD(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=A1(t),l=jP(s),u=r[l]/2-i[l]/2,f=L1(t),p=s==="x";let m;switch(f){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(Kx(t)){case"start":m[s]-=u*(n&&p?-1:1);break;case"end":m[s]+=u*(n&&p?-1:1);break}return m}const DMe=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:u,y:f}=ZD(l,r,s),p=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=sY(r),f={x:i,y:o},p=A1(a),m=Kx(a),v=jP(p),b=await l.getDimensions(n),x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",k=s.reference[v]+s.reference[p]-f[p]-s.floating[v],_=f[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const R=k/2-_/2,I=u[x],D=A-b[v]-u[E],B=A/2-b[v]/2+R,z=I8(I,B,D),te=(m==="start"?u[x]:u[E])>0&&B!==z&&s.reference[v]<=s.floating[v]?BFMe[t])}function zMe(e,t,n){n===void 0&&(n=!1);const r=Kx(e),i=A1(e),o=jP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=X5(a)),{main:a,cross:X5(a)}}const jMe={start:"end",end:"start"};function JD(e){return e.replace(/start|end/g,t=>jMe[t])}const HMe=["top","right","bottom","left"];function VMe(e){const t=X5(e);return[JD(e),t,JD(t)]}const UMe=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:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,x=L1(r),k=p||(x===a||!v?[X5(a)]:VMe(a)),_=[a,...k],T=await K5(t,b),A=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&A.push(T[x]),f){const{main:z,cross:j}=zMe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));A.push(T[z],T[j])}if(R=[...R,{placement:r,overflows:A}],!A.every(z=>z<=0)){var I,D;const z=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,j=_[z];if(j)return{data:{index:z,overflows:R},reset:{placement:j}};let Y="bottom";switch(m){case"bestFit":{var B;const te=(B=R.map(G=>[G,G.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((G,$)=>G[1]-$[1])[0])==null?void 0:B[0].placement;te&&(Y=te);break}case"initialPlacement":Y=a;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function eN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tN(e){return HMe.some(t=>e[t]>=0)}const WMe=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 K5(r,{...n,elementContext:"reference"}),a=eN(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tN(a)}}}case"escaped":{const o=await K5(r,{...n,altBoundary:!0}),a=eN(o,i.floating);return{data:{escapedOffsets:a,escaped:tN(a)}}}default:return{}}}}};async function GMe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=Kx(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,f=o&&l?-1:1,p=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const qMe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await GMe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function lY(e){return e==="x"?"y":"x"}const YMe=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:k,y:_}=E;return{x:k,y:_}}},...l}=e,u={x:n,y:r},f=await K5(t,l),p=A1(L1(i)),m=lY(p);let v=u[p],b=u[m];if(o){const E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",_=v+f[E],T=v-f[k];v=I8(_,v,T)}if(a){const E=m==="y"?"top":"left",k=m==="y"?"bottom":"right",_=b+f[E],T=b-f[k];b=I8(_,b,T)}const x=s.fn({...t,[p]:v,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},KMe=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:u=!0}=e,f={x:n,y:r},p=A1(i),m=lY(p);let v=f[p],b=f[m];const x=typeof s=="function"?s({...o,placement:i}):s,E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const R=p==="y"?"height":"width",I=o.reference[p]-o.floating[R]+E.mainAxis,D=o.reference[p]+o.reference[R]-E.mainAxis;vD&&(v=D)}if(u){var k,_,T,A;const R=p==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[R]+(I&&(k=(_=a.offset)==null?void 0:_[m])!=null?k:0)+(I?0:E.crossAxis),B=o.reference[m]+o.reference[R]+(I?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(I?E.crossAxis:0);bB&&(b=B)}return{[p]:v,[m]:b}}}};function uY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function xc(e){if(e==null)return window;if(!uY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function $y(e){return xc(e).getComputedStyle(e)}function cc(e){return uY(e)?"":e?(e.nodeName||"").toLowerCase():""}function cY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function hu(e){return e instanceof xc(e).HTMLElement}function of(e){return e instanceof xc(e).Element}function XMe(e){return e instanceof xc(e).Node}function HP(e){if(typeof ShadowRoot>"u")return!1;const t=xc(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xx(e){const{overflow:t,overflowX:n,overflowY:r}=$y(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZMe(e){return["table","td","th"].includes(cc(e))}function dY(e){const t=/firefox/i.test(cY()),n=$y(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 fY(){return!/^((?!chrome|android).)*safari/i.test(cY())}const nN=Math.min,l2=Math.max,Z5=Math.round;function dc(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,u=1;t&&hu(e)&&(l=e.offsetWidth>0&&Z5(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Z5(s.height)/e.offsetHeight||1);const f=of(e)?xc(e):window,p=!fY()&&n,m=(s.left+(p&&(r=(i=f.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(p&&(o=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:v,right:m+b,bottom:v+x,left:m,x:m,y:v}}function bf(e){return((XMe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zx(e){return of(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hY(e){return dc(bf(e)).left+Zx(e).scrollLeft}function QMe(e){const t=dc(e);return Z5(t.width)!==e.offsetWidth||Z5(t.height)!==e.offsetHeight}function JMe(e,t,n){const r=hu(t),i=bf(t),o=dc(e,r&&QMe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((cc(t)!=="body"||Xx(i))&&(a=Zx(t)),hu(t)){const l=dc(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=hY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function pY(e){return cc(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||bf(e)}function rN(e){return!hu(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function eRe(e){let t=pY(e);for(HP(t)&&(t=t.host);hu(t)&&!["html","body"].includes(cc(t));){if(dY(t))return t;t=t.parentNode}return null}function D8(e){const t=xc(e);let n=rN(e);for(;n&&ZMe(n)&&getComputedStyle(n).position==="static";)n=rN(n);return n&&(cc(n)==="html"||cc(n)==="body"&&getComputedStyle(n).position==="static"&&!dY(n))?t:n||eRe(e)||t}function iN(e){if(hu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=dc(e);return{width:t.width,height:t.height}}function tRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=hu(n),o=bf(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((cc(n)!=="body"||Xx(o))&&(a=Zx(n)),hu(n))){const l=dc(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 nRe(e,t){const n=xc(e),r=bf(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=fY();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function rRe(e){var t;const n=bf(e),r=Zx(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=l2(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=l2(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+hY(e);const l=-r.scrollTop;return $y(i||n).direction==="rtl"&&(s+=l2(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function gY(e){const t=pY(e);return["html","body","#document"].includes(cc(t))?e.ownerDocument.body:hu(t)&&Xx(t)?t:gY(t)}function Q5(e,t){var n;t===void 0&&(t=[]);const r=gY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xc(r),a=i?[o].concat(o.visualViewport||[],Xx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Q5(a))}function iRe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&HP(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function oRe(e,t){const n=dc(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 oN(e,t,n){return t==="viewport"?Y5(nRe(e,n)):of(t)?oRe(t,n):Y5(rRe(bf(e)))}function aRe(e){const t=Q5(e),r=["absolute","fixed"].includes($y(e).position)&&hu(e)?D8(e):e;return of(r)?t.filter(i=>of(i)&&iRe(i,r)&&cc(i)!=="body"):[]}function sRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?aRe(t):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const p=oN(t,f,i);return u.top=l2(p.top,u.top),u.right=nN(p.right,u.right),u.bottom=nN(p.bottom,u.bottom),u.left=l2(p.left,u.left),u},oN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const lRe={getClippingRect:sRe,convertOffsetParentRelativeRectToViewportRelativeRect:tRe,isElement:of,getDimensions:iN,getOffsetParent:D8,getDocumentElement:bf,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JMe(t,D8(n),r),floating:{...iN(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>$y(e).direction==="rtl"};function uRe(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,u=o&&!s,f=l||u?[...of(e)?Q5(e):[],...Q5(t)]:[];f.forEach(x=>{l&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});let p=null;if(a){let x=!0;p=new ResizeObserver(()=>{x||n(),x=!1}),of(e)&&!s&&p.observe(e),p.observe(t)}let m,v=s?dc(e):null;s&&b();function b(){const x=dc(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,m=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(E=>{l&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),(x=p)==null||x.disconnect(),p=null,s&&cancelAnimationFrame(m)}}const cRe=(e,t,n)=>DMe(e,t,{platform:lRe,...n});var N8=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function B8(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(!B8(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)&&!B8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function dRe(e){const t=C.exports.useRef(e);return N8(()=>{t.current=e}),t}function fRe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=dRe(i),l=C.exports.useRef(null),[u,f]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=C.exports.useState(t);B8(p==null?void 0:p.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||cRe(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&pu.exports.flushSync(()=>{f(T)})})},[p,n,r]);N8(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);N8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=C.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,v);l.current=T}else v()},[v,s]),E=C.exports.useCallback(T=>{o.current=T,x()},[x]),k=C.exports.useCallback(T=>{a.current=T,x()},[x]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:E,floating:k}),[u,v,_,E,k])}const hRe=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?QD({element:t.current,padding:n}).fn(i):{}:t?QD({element:t,padding:n}).fn(i):{}}}};function pRe(e){const[t,n]=C.exports.useState(void 0);return a1(()=>{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,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.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 mY="Popper",[VP,vY]=By(mY),[gRe,yY]=VP(mY),mRe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(gRe,{scope:t,anchor:r,onAnchorChange:i},n)},vRe="PopperAnchor",yRe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=yY(vRe,n),a=C.exports.useRef(null),s=gs(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(uc.div,Dn({},i,{ref:s}))}),J5="PopperContent",[bRe,Hze]=VP(J5),[SRe,xRe]=VP(J5,{hasParent:!1,positionUpdateFns:new Set}),wRe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:E=[],collisionPadding:k=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...R}=e,I=yY(J5,f),[D,B]=C.exports.useState(null),z=gs(t,ue=>B(ue)),[j,Y]=C.exports.useState(null),te=pRe(j),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,V=p+(v!=="center"?"-"+v:""),J=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},Z=Array.isArray(E)?E:[E],U=Z.length>0,X={padding:J,boundary:Z.filter(_Re),altBoundary:U},{reference:le,floating:fe,strategy:Se,x:Ae,y:be,placement:ke,middlewareData:De,update:Je}=fRe({strategy:"fixed",placement:V,whileElementsMounted:uRe,middleware:[qMe({mainAxis:m+$,alignmentAxis:b}),A?YMe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?KMe():void 0,...X}):void 0,j?hRe({element:j,padding:x}):void 0,A?UMe({...X}):void 0,kRe({arrowWidth:G,arrowHeight:$}),T?WMe({strategy:"referenceHidden"}):void 0].filter(CRe)});a1(()=>{le(I.anchor)},[le,I.anchor]);const Ye=Ae!==null&&be!==null,[mt,_t]=bY(ke),dt=(i=De.arrow)===null||i===void 0?void 0:i.x,vt=(o=De.arrow)===null||o===void 0?void 0:o.y,xt=((a=De.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=C.exports.useState();a1(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Rt,positionUpdateFns:ot}=xRe(J5,f),Ct=!Rt;C.exports.useLayoutEffect(()=>{if(!Ct)return ot.add(Je),()=>{ot.delete(Je)}},[Ct,ot,Je]),C.exports.useLayoutEffect(()=>{Ct&&Ye&&Array.from(ot).reverse().forEach(ue=>requestAnimationFrame(ue))},[Ct,Ye,ot]);const ln={"data-side":mt,"data-align":_t,...R,ref:z,style:{...R.style,animation:Ye?void 0:"none",opacity:(s=De.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:Ye?`translate3d(${Math.round(Ae)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=De.transformOrigin)===null||l===void 0?void 0:l.x,(u=De.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(bRe,{scope:f,placedSide:mt,onArrowChange:Y,arrowX:dt,arrowY:vt,shouldHideArrow:xt},Ct?C.exports.createElement(SRe,{scope:f,hasParent:!0,positionUpdateFns:ot},C.exports.createElement(uc.div,ln)):C.exports.createElement(uc.div,ln)))});function CRe(e){return e!==void 0}function _Re(e){return e!==null}const kRe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,v=p?0:e.arrowHeight,[b,x]=bY(s),E={start:"0%",center:"50%",end:"100%"}[x],k=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=p?E:`${k}px`,A=`${-v}px`):b==="top"?(T=p?E:`${k}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=p?E:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=p?E:`${_}px`),{data:{x:T,y:A}}}});function bY(e){const[t,n="center"]=e.split("-");return[t,n]}const ERe=mRe,PRe=yRe,TRe=wRe;function LRe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const SY=e=>{const{present:t,children:n}=e,r=ARe(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=gs(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};SY.displayName="Presence";function ARe(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=LRe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=jb(r.current);o.current=s==="mounted"?u:"none"},[s]),a1(()=>{const u=r.current,f=i.current;if(f!==e){const m=o.current,v=jb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a1(()=>{if(t){const u=p=>{const v=jb(r.current).includes(p.animationName);p.target===t&&v&&pu.exports.flushSync(()=>l("ANIMATION_END"))},f=p=>{p.target===t&&(o.current=jb(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function jb(e){return(e==null?void 0:e.animationName)||"none"}function ORe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=MRe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=fu(n),l=C.exports.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function MRe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=fu(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const NC="rovingFocusGroup.onEntryFocus",RRe={bubbles:!1,cancelable:!0},UP="RovingFocusGroup",[$8,xY,IRe]=rY(UP),[DRe,wY]=By(UP,[IRe]),[NRe,BRe]=DRe(UP),$Re=C.exports.forwardRef((e,t)=>C.exports.createElement($8.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement($8.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(FRe,Dn({},e,{ref:t}))))),FRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=e,p=C.exports.useRef(null),m=gs(t,p),v=iY(o),[b=null,x]=ORe({prop:a,defaultProp:s,onChange:l}),[E,k]=C.exports.useState(!1),_=fu(u),T=xY(n),A=C.exports.useRef(!1),[R,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=p.current;if(D)return D.addEventListener(NC,_),()=>D.removeEventListener(NC,_)},[_]),C.exports.createElement(NRe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>x(D),[x]),onItemShiftTab:C.exports.useCallback(()=>k(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(uc.div,Dn({tabIndex:E||R===0?-1:0,"data-orientation":r},f,{ref:m,style:{outline:"none",...e.style},onMouseDown:tr(e.onMouseDown,()=>{A.current=!0}),onFocus:tr(e.onFocus,D=>{const B=!A.current;if(D.target===D.currentTarget&&B&&!E){const z=new CustomEvent(NC,RRe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const j=T().filter(V=>V.focusable),Y=j.find(V=>V.active),te=j.find(V=>V.id===b),$=[Y,te,...j].filter(Boolean).map(V=>V.ref.current);CY($)}}A.current=!1}),onBlur:tr(e.onBlur,()=>k(!1))})))}),zRe="RovingFocusGroupItem",jRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=IMe(),s=BRe(zRe,n),l=s.currentTabStopId===a,u=xY(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=s;return C.exports.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.exports.createElement($8.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(uc.span,Dn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:tr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:tr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:tr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=URe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let x=u().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=s.loop?WRe(x,E+1):x.slice(E+1)}setTimeout(()=>CY(x))}})})))}),HRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function URe(e,t,n){const r=VRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HRe[r]}function CY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WRe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const GRe=$Re,qRe=jRe,YRe=["Enter"," "],KRe=["ArrowDown","PageUp","Home"],_Y=["ArrowUp","PageDown","End"],XRe=[...KRe,..._Y],Qx="Menu",[F8,ZRe,QRe]=rY(Qx),[Cp,kY]=By(Qx,[QRe,vY,wY]),WP=vY(),EY=wY(),[JRe,Jx]=Cp(Qx),[eIe,GP]=Cp(Qx),tIe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=C.exports.useState(null),f=C.exports.useRef(!1),p=fu(o),m=iY(i);return C.exports.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(ERe,s,C.exports.createElement(JRe,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},C.exports.createElement(eIe,{scope:t,onClose:C.exports.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:a},r)))},nIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return C.exports.createElement(PRe,Dn({},i,r,{ref:t}))}),rIe="MenuPortal",[Vze,iIe]=Cp(rIe,{forceMount:void 0}),Gd="MenuContent",[oIe,PY]=Cp(Gd),aIe=C.exports.forwardRef((e,t)=>{const n=iIe(Gd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Jx(Gd,e.__scopeMenu),a=GP(Gd,e.__scopeMenu);return C.exports.createElement(F8.Provider,{scope:e.__scopeMenu},C.exports.createElement(SY,{present:r||o.open},C.exports.createElement(F8.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(sIe,Dn({},i,{ref:t})):C.exports.createElement(lIe,Dn({},i,{ref:t})))))}),sIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu),r=C.exports.useRef(null),i=gs(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return MH(o)},[]),C.exports.createElement(TY,Dn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),lIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu);return C.exports.createElement(TY,Dn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),TY=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...b}=e,x=Jx(Gd,n),E=GP(Gd,n),k=WP(n),_=EY(n),T=ZRe(n),[A,R]=C.exports.useState(null),I=C.exports.useRef(null),D=gs(t,I,x.onContentChange),B=C.exports.useRef(0),z=C.exports.useRef(""),j=C.exports.useRef(0),Y=C.exports.useRef(null),te=C.exports.useRef("right"),G=C.exports.useRef(0),$=v?yV:C.exports.Fragment,V=v?{as:ny,allowPinchZoom:!0}:void 0,J=U=>{var X,le;const fe=z.current+U,Se=T().filter(Ye=>!Ye.disabled),Ae=document.activeElement,be=(X=Se.find(Ye=>Ye.ref.current===Ae))===null||X===void 0?void 0:X.textValue,ke=Se.map(Ye=>Ye.textValue),De=vIe(ke,fe,be),Je=(le=Se.find(Ye=>Ye.textValue===De))===null||le===void 0?void 0:le.ref.current;(function Ye(mt){z.current=mt,window.clearTimeout(B.current),mt!==""&&(B.current=window.setTimeout(()=>Ye(""),1e3))})(fe),Je&&setTimeout(()=>Je.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),_Me();const Z=C.exports.useCallback(U=>{var X,le;return te.current===((X=Y.current)===null||X===void 0?void 0:X.side)&&bIe(U,(le=Y.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(oIe,{scope:n,searchRef:z,onItemEnter:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(U=>{var X;Z(U)||((X=I.current)===null||X===void 0||X.focus(),R(null))},[Z]),onTriggerLeave:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:j,onPointerGraceIntentChange:C.exports.useCallback(U=>{Y.current=U},[])},C.exports.createElement($,V,C.exports.createElement(kMe,{asChild:!0,trapped:i,onMountAutoFocus:tr(o,U=>{var X;U.preventDefault(),(X=I.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:a},C.exports.createElement(xMe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m},C.exports.createElement(GRe,Dn({asChild:!0},_,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:R,onEntryFocus:U=>{E.isUsingKeyboardRef.current||U.preventDefault()}}),C.exports.createElement(TRe,Dn({role:"menu","aria-orientation":"vertical","data-state":pIe(x.open),"data-radix-menu-content":"",dir:E.dir},k,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:tr(b.onKeyDown,U=>{const le=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Se=U.key.length===1;le&&(U.key==="Tab"&&U.preventDefault(),!fe&&Se&&J(U.key));const Ae=I.current;if(U.target!==Ae||!XRe.includes(U.key))return;U.preventDefault();const ke=T().filter(De=>!De.disabled).map(De=>De.ref.current);_Y.includes(U.key)&&ke.reverse(),gIe(ke)}),onBlur:tr(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(B.current),z.current="")}),onPointerMove:tr(e.onPointerMove,j8(U=>{const X=U.target,le=G.current!==U.clientX;if(U.currentTarget.contains(X)&&le){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),z8="MenuItem",aN="menu.itemSelect",uIe=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=GP(z8,e.__scopeMenu),s=PY(z8,e.__scopeMenu),l=gs(t,o),u=C.exports.useRef(!1),f=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(aN,{bubbles:!0,cancelable:!0});p.addEventListener(aN,v=>r==null?void 0:r(v),{once:!0}),nY(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(cIe,Dn({},i,{ref:l,disabled:n,onClick:tr(e.onClick,f),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:tr(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:tr(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||YRe.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),cIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=PY(z8,n),s=EY(n),l=C.exports.useRef(null),u=gs(t,l),[f,p]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var x;v(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),C.exports.createElement(F8.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(qRe,Dn({asChild:!0},s,{focusable:!r}),C.exports.createElement(uc.div,Dn({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:tr(e.onPointerMove,j8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:tr(e.onPointerLeave,j8(b=>a.onItemLeave(b))),onFocus:tr(e.onFocus,()=>p(!0)),onBlur:tr(e.onBlur,()=>p(!1))}))))}),dIe="MenuRadioGroup";Cp(dIe,{value:void 0,onValueChange:()=>{}});const fIe="MenuItemIndicator";Cp(fIe,{checked:!1});const hIe="MenuSub";Cp(hIe);function pIe(e){return e?"open":"closed"}function gIe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vIe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=mIe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function yIe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=f>r&&n<(u-s)*(r-l)/(f-l)+s&&(i=!i)}return i}function bIe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yIe(n,t)}function j8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const SIe=tIe,xIe=nIe,wIe=aIe,CIe=uIe,LY="ContextMenu",[_Ie,Uze]=By(LY,[kY]),ew=kY(),[kIe,AY]=_Ie(LY),EIe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=ew(t),u=fu(r),f=C.exports.useCallback(p=>{s(p),u(p)},[u]);return C.exports.createElement(kIe,{scope:t,open:a,onOpenChange:f,modal:o},C.exports.createElement(SIe,Dn({},l,{dir:i,open:a,onOpenChange:f,modal:o}),n))},PIe="ContextMenuTrigger",TIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(PIe,n),o=ew(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),f=p=>{a.current={x:p.clientX,y:p.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(xIe,Dn({},o,{virtualRef:s})),C.exports.createElement(uc.span,Dn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:tr(e.onContextMenu,p=>{u(),f(p),p.preventDefault()}),onPointerDown:tr(e.onPointerDown,Hb(p=>{u(),l.current=window.setTimeout(()=>f(p),700)})),onPointerMove:tr(e.onPointerMove,Hb(u)),onPointerCancel:tr(e.onPointerCancel,Hb(u)),onPointerUp:tr(e.onPointerUp,Hb(u))})))}),LIe="ContextMenuContent",AIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(LIe,n),o=ew(n),a=C.exports.useRef(!1);return C.exports.createElement(wIe,Dn({},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)"}}))}),OIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=ew(n);return C.exports.createElement(CIe,Dn({},i,r,{ref:t}))});function Hb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const MIe=EIe,RIe=TIe,IIe=AIe,hd=OIe,DIe=lt([e=>e.gallery,e=>e.options,kr,_r],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightBoxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${f}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),NIe=lt([e=>e.options,e=>e.gallery,e=>e.system,_r],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BIe=e=>e.gallery,$Ie=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,FIe=C.exports.memo(e=>{var G,$,V,J,Z,U,X,le;const t=Be(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ve(NIe),{image:l,isSelected:u}=e,{url:f,thumbnail:p,uuid:m,metadata:v}=l,[b,x]=C.exports.useState(!1),E=Ty(),{t:k}=Ke(),_=()=>x(!0),T=()=>x(!1),A=()=>{l.metadata&&t(mx(l.metadata.image.prompt)),E({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},R=()=>{l.metadata&&t(Ly(l.metadata.image.seed)),E({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(Qu(!1)),t(C1(l)),n!=="img2img"&&t(Go("img2img")),E({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{a&&t(Qu(!1)),t(Sx(l)),t(bx()),n!=="unifiedCanvas"&&t(Go("unifiedCanvas")),E({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},B=()=>{v&&t(Z5e(v)),E({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},z=async()=>{var fe;if((fe=v==null?void 0:v.image)!=null&&fe.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Go("img2img")),t(K5e(v)),E({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}E({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},j=()=>t(wR(l)),Y=fe=>{fe.dataTransfer.setData("invokeai/imageUuid",m),fe.dataTransfer.effectAllowed="move"},te=()=>{t(Qu(!0)),t(wR(l))};return K(MIe,{onOpenChange:fe=>{t($U(fe))},children:[y(RIe,{children:K(rl,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:T,userSelect:"none",draggable:!0,onDragStart:Y,children:[y(nx,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:p||f,loading:"lazy"}),y("div",{className:"hoverable-image-content",onClick:j,children:u&&y($a,{width:"50%",height:"50%",as:aP,className:"hoverable-image-check"})}),b&&i>=64&&y("div",{className:"hoverable-image-delete-button",children:y(O8,{image:l,children:y(fs,{"aria-label":k("options:deleteImage"),icon:y(U8e,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},m)}),K(IIe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:fe=>{fe.detail.originalEvent.preventDefault()},children:[y(hd,{onClickCapture:te,children:k("options:openInViewer")}),y(hd,{onClickCapture:A,disabled:(($=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:$.prompt)===void 0,children:k("options:usePrompt")}),y(hd,{onClickCapture:R,disabled:((J=(V=l==null?void 0:l.metadata)==null?void 0:V.image)==null?void 0:J.seed)===void 0,children:k("options:useSeed")}),y(hd,{onClickCapture:B,disabled:!["txt2img","img2img"].includes((U=(Z=l==null?void 0:l.metadata)==null?void 0:Z.image)==null?void 0:U.type),children:k("options:useAll")}),y(hd,{onClickCapture:z,disabled:((le=(X=l==null?void 0:l.metadata)==null?void 0:X.image)==null?void 0:le.type)!=="img2img",children:k("options:useInitImg")}),y(hd,{onClickCapture:I,children:k("options:sendToImg2Img")}),y(hd,{onClickCapture:D,children:k("options:sendToUnifiedCanvas")}),y(hd,{"data-warning":!0,children:y(O8,{image:l,children:y("p",{children:k("options:deleteImage")})})})]})]})},$Ie),Vb=320,sN=40,zIe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},lN=400;function OY(){const e=Be(),{t}=Ke(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:x,isLightBoxOpen:E,isStaging:k,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=ve(DIe),{galleryMinWidth:A,galleryMaxWidth:R}=E?{galleryMinWidth:lN,galleryMaxWidth:lN}:zIe[f],[I,D]=C.exports.useState(x>=Vb),[B,z]=C.exports.useState(!1),[j,Y]=C.exports.useState(0),te=C.exports.useRef(null),G=C.exports.useRef(null),$=C.exports.useRef(null);C.exports.useEffect(()=>{x>=Vb&&D(!1)},[x]);const V=()=>{e(mSe(!o)),e(vi(!0))},J=()=>{a?U():Z()},Z=()=>{e(Vd(!0)),o&&e(vi(!0))},U=C.exports.useCallback(()=>{e(Vd(!1)),e($U(!1)),e(vSe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),X=()=>{e(c8(r))},le=be=>{e(ev(be))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Se=()=>{$.current&&window.clearTimeout($.current)};Ze("g",()=>{J()},[a,o]),Ze("left",()=>{e(VE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("right",()=>{e(HE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("shift+g",()=>{V()},[o]),Ze("esc",()=>{e(Vd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Ae=32;return Ze("shift+up",()=>{if(l<256){const be=He.clamp(l+Ae,32,256);e(ev(be))}},[l]),Ze("shift+down",()=>{if(l>32){const be=He.clamp(l-Ae,32,256);e(ev(be))}},[l]),C.exports.useEffect(()=>{!G.current||(G.current.scrollTop=s)},[s,a]),C.exports.useEffect(()=>{function be(ke){!o&&te.current&&!te.current.contains(ke.target)&&U()}return document.addEventListener("mousedown",be),()=>{document.removeEventListener("mousedown",be)}},[U,o]),y(Xq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:K("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[K(kq,{minWidth:A,maxWidth:o?R:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(be,ke,De)=>{Y(De.clientHeight),De.style.height=`${De.clientHeight}px`,o&&(De.style.position="fixed",De.style.right="1rem",z(!0))},onResizeStop:(be,ke,De,Je)=>{const Ye=o?He.clamp(Number(x)+Je.width,A,Number(R)):Number(x)+Je.width;e(SSe(Ye)),De.removeAttribute("data-resize-alert"),o&&(De.style.position="relative",De.style.removeProperty("right"),De.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(be,ke,De,Je)=>{const Ye=He.clamp(Number(x)+Je.width,A,Number(o?R:.95*window.innerWidth));Ye>=Vb&&!I?D(!0):YeYe-sN&&e(ev(Ye-sN)),o&&(Ye>=R?De.setAttribute("data-resize-alert","true"):De.removeAttribute("data-resize-alert")),De.style.height=`${j}px`},children:[K("div",{className:"image-gallery-header",children:[y(io,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:I?K(fn,{children:[y(qr,{size:"sm","data-selected":r==="result",onClick:()=>e(gb("result")),children:t("gallery:generations")}),y(qr,{size:"sm","data-selected":r==="user",onClick:()=>e(gb("user")),children:t("gallery:uploads")})]}):K(fn,{children:[y(Qe,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y(M8e,{}),onClick:()=>e(gb("result"))}),y(Qe,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y(G8e,{}),onClick:()=>e(gb("user"))})]})}),K("div",{className:"image-gallery-header-right-icons",children:[y(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y(Qe,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y(cP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:K("div",{className:"image-gallery-settings-popover",children:[K("div",{children:[y(Zo,{value:l,onChange:le,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y(Qe,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ev(64)),icon:y(Hx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y("div",{children:y(Qn,{label:t("gallery:maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(ySe(p==="contain"?"cover":"contain"))})}),y("div",{children:y(Qn,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:be=>e(bSe(be.target.checked))})}),y("div",{children:y(Qn,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:be=>e(xSe(be.target.checked))})})]})}),y(Qe,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:V,icon:o?y(Gq,{}):y(qq,{})})]})]}),y("div",{className:"image-gallery-container",ref:G,children:n.length||b?K(fn,{children:[y("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(be=>{const{uuid:ke}=be;return y(FIe,{image:be,isSelected:i===ke},ke)})}),y(ds,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):K("div",{className:"image-gallery-container-placeholder",children:[y(wq,{}),y("p",{children:t("gallery:noImagesInGallery")})]})})]}),B&&y("div",{style:{width:x+"px",height:"100%"}})]})})}const jIe=lt(BIe,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),HIe=()=>{const{resultImages:e,userImages:t}=ve(jIe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},VIe=lt([e=>e.options,_r],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qP=e=>{const t=Be(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ve(VIe),u=HIe(),f=()=>{t(lSe(!a)),t(vi(!0))},p=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(C1(b)):o==="unifiedCanvas"&&t(Sx(b)))};return y("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:K("div",{className:"workarea-main",children:[n,K("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&y(so,{label:"Toggle Split View",children:y("div",{className:"workarea-split-button","data-selected":a,onClick:f,children:y(uMe,{})})})]}),!s&&y(OY,{})]})})};function UIe(){return y(qP,{optionsPanel:y(QOe,{}),children:y(lMe,{})})}const WIe=()=>{const e=Be(),t=ve(i=>i.options.hiresFix),{t:n}=Ke(),r=i=>e(jE(i.target.checked));return y(at,{gap:2,direction:"column",children:y(os,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:r})})},GIe=()=>K(at,{gap:2,direction:"column",children:[y(Hq,{}),y(WIe,{})]});function qIe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(GIe,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(RP,{accordionInfo:t})]})}const YIe=()=>y("div",{className:"workarea-single-view",children:y("div",{className:"text-to-image-area",children:y(eY,{})})});function KIe(){return y(qP,{optionsPanel:y(qIe,{}),children:y(YIe,{})})}var H8=function(e,t){return H8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},H8(e,t)};function XIe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var su=function(){return su=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Sf(e,t,n,r){var i=fDe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):IY(e,r,n,function(v){var b=s+f*v,x=l+p*v,E=u+m*v;o(b,x,E)})}}function fDe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function hDe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,f=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:f}}var pDe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,f=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:f,minPositionY:p,maxPositionY:m}},YP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=hDe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,f=o.newContentHeight,p=o.newDiffHeight,m=pDe(a,l,u,s,f,p,Boolean(i));return m},s1=function(e,t){var n=YP(e,t);return e.bounds=n,n};function tw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,f=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var v=V8(e,s-p,u+p,r),b=V8(t,l-m,f+m,r);return{x:v,y:b}}var V8=function(e,t,n,r){return r?en?as(n,2):as(e,2):as(e,2)};function nw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*f,m=u-n*f,v=tw(p,m,i,o,0,0,null);return v}function Fy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var cN=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=rw(o,n);return!l},dN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},gDe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},mDe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function vDe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var f=e.bounds,p=f.maxPositionX,m=f.minPositionX,v=f.maxPositionY,b=f.minPositionY,x=n>p||nv||rp?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=nw(e,k,_,i,e.bounds,s||l),A=T.x,R=T.y;return{scale:i,positionX:x?A:n,positionY:E?R:r}}}function yDe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,f=l.positionX,p=l.positionY,m=t!==f,v=n!==p,b=!m||!v;if(!(!a||b||!s)){var x=tw(t,n,s,o,r,i,a),E=x.x,k=x.y;e.setTransformState(u,E,k)}}var bDe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var f=t-r.x,p=n-r.y,m=a?l:f,v=s?u:p;return{x:m,y:v}},eS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},SDe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},xDe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function wDe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function fN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var f=a+(e-a)*u;return f>l?l:fo?o:f}}return r?t:V8(e,o,a,i)}function CDe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function _De(e,t){var n=SDe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=CDe(a,s),f=t.x-r.x,p=t.y-r.y,m=f/u,v=p/u,b=l-i,x=f*f+p*p,E=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:v,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function kDe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=xDe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,f=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,E=r.panning,k=E.lockAxisY,_=E.lockAxisX,T=x.animationType,A=b.sizeX,R=b.sizeY,I=b.velocityAlignmentTime,D=I,B=wDe(e,l),z=Math.max(B,D),j=eS(e,A),Y=eS(e,R),te=j*i.offsetWidth/100,G=Y*i.offsetHeight/100,$=u+te,V=f-te,J=p+G,Z=m-G,U=e.transformState,X=new Date().getTime();IY(e,T,z,function(le){var fe=e.transformState,Se=fe.scale,Ae=fe.positionX,be=fe.positionY,ke=new Date().getTime()-X,De=ke/D,Je=MY[b.animationType],Ye=1-Je(Math.min(1,De)),mt=1-le,_t=Ae+a*mt,dt=be+s*mt,vt=fN(_t,U.positionX,Ae,_,v,f,u,V,$,Ye),xt=fN(dt,U.positionY,be,k,v,m,p,Z,J,Ye);(Ae!==_t||be!==dt)&&e.setTransformState(Se,vt,xt)})}}function hN(e,t){var n=e.transformState.scale;Gl(e),s1(e,n),t.touches?mDe(e,t):gDe(e,t)}function pN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=bDe(e,t,n),u=l.x,f=l.y,p=eS(e,a),m=eS(e,s);_De(e,{x:u,y:f}),yDe(e,u,f,p,m)}}function EDe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,f=(a==null?void 0:a.height)||0,p=s.1&&p;m?kDe(e):DY(e)}}function DY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,f=o||t=a;if((r>=1||s)&&DY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=KP(e,a,v,b);x&&Sf(e,x,f,p)}}function KP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Fy(as(t,2),o,a,0,!1),u=s1(e,l),f=nw(e,n,r,l,u,s),p=f.x,m=f.y;return{scale:l,positionX:p,positionY:m}}var cg={previousScale:1,scale:1,positionX:0,positionY:0},PDe=su(su({},cg),{setComponents:function(){},contextInstance:null}),dv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},BY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:cg.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:cg.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:cg.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:cg.positionY}},gN=function(e){var t=su({},dv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof dv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(dv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=su(su({},dv[n]),e[n]):s?t[n]=uN(uN([],dv[n]),e[n]):t[n]=e[n]}}),t},$Y=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var f=r*Math.exp(t*n),p=Fy(as(f,3),s,a,u,!1);return p};function FY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var f=o.offsetWidth,p=o.offsetHeight,m=(f/2-l)/s,v=(p/2-u)/s,b=$Y(e,t,n),x=KP(e,b,m,v);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,x,r,i)}function zY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=BY(e.props),s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!!i){var p=YP(e,a.scale),m=tw(a.positionX,a.positionY,p,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&f===a.positionY||Sf(e,v,t,n)}}function TDe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return cg;var l=r.getBoundingClientRect(),u=LDe(t),f=u.x,p=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/v,E=Fy(n||Math.min(b,x),a,s,0,!1),k=(l.width-m*E)/2,_=(l.height-v*E)/2,T=(l.left-f)*E+k,A=(l.top-p)*E+_,R=YP(e,E),I=tw(T,A,R,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:E}}function LDe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function ADe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var ODe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,1,t,n,r)}},MDe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,-1,t,n,r)}},RDe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,f=e.wrapperComponent,p=e.contentComponent,m=e.setup.disabled;if(!(m||!f||!p)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Sf(e,v,i,o)}}},IDe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),zY(e,t,n)}},DDe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=jY(t||i.scale,o,a);Sf(e,s,n,r)}}},NDe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Gl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&ADe(a)&&a&&o.contains(a)){var s=TDe(e,a,n);Sf(e,s,r,i)}}},ei=function(e){return{instance:e,state:e.transformState,zoomIn:ODe(e),zoomOut:MDe(e),setTransform:RDe(e),resetTransform:IDe(e),centerView:DDe(e),zoomToElement:NDe(e)}},BC=!1;function $C(){try{var e={get passive(){return BC=!0,!1}};return e}catch(t){return BC=!1,BC}}var rw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},mN=function(e){e&&clearTimeout(e)},BDe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},jY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},$De=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,f=s&&!l&&!r&&u;if(!f||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var p=rw(u,a);return!p};function FDe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ZIe(t,n);return r}function HY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var zDe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size,m=f.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,x=Fy(as(v,3),u,l,p,b);return x},jDe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},HDe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=rw(a,i);return!l},VDe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},UDe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=as(i[0].clientX-r.left,5),a=as(i[0].clientY-r.top,5),s=as(i[1].clientX-r.left,5),l=as(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},VY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},WDe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var f=t/r,p=f*n;return Fy(as(p,2),a,o,l,!u)},GDe=160,qDe=100,YDe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Gl(e),Pi(ei(e),t,r),Pi(ei(e),t,i))},KDe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,f=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,v=p.size,b=p.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var E=FDe(t,null),k=zDe(e,E,x,!t.ctrlKey);if(l!==k){var _=s1(e,k),T=HY(t,o,l),A=b||v===0||f,R=u&&A,I=nw(e,T.x,T.y,k,_,R),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(k,D,B),Pi(ei(e),t,r),Pi(ei(e),t,i)}},XDe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;mN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(NY(e,t.x,t.y),e.wheelAnimationTimer=null)},qDe);var o=jDe(e,t);o&&(mN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,Pi(ei(e),t,r),Pi(ei(e),t,i))},GDe))},ZDe=function(e,t){var n=VY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Gl(e)},QDe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,f=l.size;if(!(r===null||!n)){var p=UDe(t,i,n);if(!(!isFinite(p.x)||!isFinite(p.y))){var m=VY(t),v=WDe(e,m);if(v!==i){var b=s1(e,v),x=u||f===0||s,E=a&&x,k=nw(e,p.x,p.y,v,b,E),_=k.x,T=k.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(v,_,T)}}}},JDe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,NY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function eNe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return zY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var f=i==="zoomOut"?-1:1,p=$Y(e,f,o),m=HY(t,u,l),v=KP(e,p,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,v,a,s)}}var tNe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),f=n&&l&&u&&!a;if(!f)return!1;var p=rw(l,s);return!(p||!f)},UY=oe.createContext(PDe),nNe=function(e){XIe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=BY(n.props),n.setup=gN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=$C();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=$De(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||(YDe(n,r),KDe(n,r),XDe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),Gl(n),hN(n,r),Pi(ei(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=dN(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),pN(n,r.clientX,r.clientY),Pi(ei(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(EDe(n),Pi(ei(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=HDe(n,r);!l||(ZDe(n,r),Gl(n),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=VDe(n);!l||(r.preventDefault(),r.stopPropagation(),QDe(n,r),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(JDe(n),Pi(ei(n),r,o),Pi(ei(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Gl(n);var l=r.touches,u=l.length===1,f=l.length===2;u&&(Gl(n),hN(n,r),Pi(ei(n),r,o)),f&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=dN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];pN(n,s.clientX,s.clientY),Pi(ei(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=tNe(n,r);!o||eNe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ei(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=jY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=BDe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ei(n))},n}return t.prototype.componentDidMount=function(){var n=$C();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=$C();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Gl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s1(this,this.transformState.scale),this.setup=gN(this.props))},t.prototype.render=function(){var n=ei(this),r=this.props.children,i=typeof r=="function"?r(n):r;return y(UY.Provider,{value:su(su({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),rNe=oe.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),y(nNe,{...su({},e,{setRef:i})})});function iNe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var oNe=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; @@ -506,7 +506,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .transform-component-module_content__2jYgh img { pointer-events: none; } -`,vN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};rNe(iNe);var oNe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=C.exports.useContext(UY).setComponents,u=C.exports.useRef(null),f=C.exports.useRef(null);return C.exports.useEffect(function(){var p=u.current,m=f.current;p!==null&&m!==null&&l&&l(p,m)},[]),y("div",{ref:u,className:"react-transform-wrapper "+vN.wrapper+" "+r,style:a,children:y("div",{ref:f,className:"react-transform-component "+vN.content+" "+o,style:s,children:t})})};function aNe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=C.exports.useState(0),[a,s]=C.exports.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},f=()=>{s(!a)};return y(nNe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:p,zoomOut:m,resetTransform:v,centerView:b})=>K(fn,{children:[K("div",{className:"lightbox-image-options",children:[y(Qe,{icon:y(aLe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>p(),fontSize:20}),y(Qe,{icon:y(sLe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),y(Qe,{icon:y(iLe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),y(Qe,{icon:y(oLe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),y(Qe,{icon:y(eLe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:f,fontSize:20}),y(Qe,{icon:y(Hx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),y(oNe,{wrapperStyle:{width:"100%",height:"100%"},children:y("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function sNe(){const e=Be(),t=ve(m=>m.options.isLightBoxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return Ze("Esc",()=>{t&&e(Qu(!1))},[t]),K("div",{className:"lightbox-container",children:[y(Qe,{icon:y(rLe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Qu(!1))},fontSize:20}),K("div",{className:"lightbox-display-container",children:[K("div",{className:"lightbox-preview-wrapper",children:[y(Zq,{}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),n&&K(fn,{children:[y(aNe,{image:n.url,styleClass:"lightbox-image"}),r&&y(Qq,{image:n})]})]}),y(OY,{})]})]})}const lNe=lt([dP],e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),uNe=()=>{const e=Be(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=ve(lNe),{t:o}=Ke();return K(at,{direction:"column",gap:"1rem",children:[y(Zo,{sliderMarkRightOffset:-6,label:o("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:a=>{e(yR(a))},handleReset:()=>e(yR(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-4,label:o("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:a=>{e(vR(a))},handleReset:()=>{e(vR(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-7,label:o("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:a=>{e(SR(a))},handleReset:()=>{e(SR(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-4,label:o("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:i,onChange:a=>{e(bR(a))},handleReset:()=>{e(bR(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},cNe=lt(rn,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),dNe=()=>{const e=Be(),{boundingBoxDimensions:t}=ve(cNe),{t:n}=Ke(),r=s=>{e(_v({...t,width:Math.floor(s)}))},i=s=>{e(_v({...t,height:Math.floor(s)}))},o=()=>{e(_v({...t,width:Math.floor(512)}))},a=()=>{e(_v({...t,height:Math.floor(512)}))};return K(at,{direction:"column",gap:"1rem",children:[y(Zo,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:r,handleReset:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(Zo,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:i,handleReset:a,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},fNe=lt(rn,e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function hNe(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=ve(fNe),n=Be(),{t:r}=Ke();return K(at,{alignItems:"center",columnGap:"1rem",children:[y(Zo,{label:r("options:inpaintReplace"),value:e,onChange:i=>{n(dI(i))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(dI(1)),isResetDisabled:!t}),y(os,{isChecked:t,onChange:i=>n(Wwe(i.target.checked)),marginTop:"1.25rem"})]})}const pNe=lt([dP,al,rn],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),gNe=()=>{const e=Be(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=ve(pNe),{t:s}=Ke(),l=v=>{e(xb({...a,width:Math.floor(v)}))},u=v=>{e(xb({...a,height:Math.floor(v)}))},f=()=>{e(xb({...a,width:Math.floor(512)}))},p=()=>{e(xb({...a,height:Math.floor(512)}))},m=v=>{e($we(v.target.value))};return K(at,{direction:"column",gap:"1rem",children:[y(nl,{label:s("options:scaleBeforeProcessing"),validValues:xwe,value:i,onChange:m}),y(Zo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,handleReset:f,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(Zo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,handleReset:p,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(hNe,{}),y(nl,{label:s("options:infillMethod"),value:n,validValues:r,onChange:v=>e(kU(v.target.value))}),y(Zo,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:v=>{e(xR(v))},handleReset:()=>{e(xR(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function mNe(){const{t:e}=Ke(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:oo.BOUNDING_BOX,content:y(dNe,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:oo.SEAM_CORRECTION,content:y(uNe,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:oo.INFILL_AND_SCALING,content:y(gNe,{})},seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(RP,{accordionInfo:t})]})}const vNe=lt(rn,Uq,_r,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),WY=()=>{const e=Be(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=ve(vNe),o=C.exports.useRef(null);return C.exports.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Fwe({width:a,height:s})),e(i?Bwe():bx()),e(vi(!1))},0)},[e,r,t,n,i]),y("div",{ref:o,className:"inpainting-canvas-area",children:y(by,{thickness:"2px",speed:"1s",size:"xl"})})};var GY={exports:{}};/** +`,vN={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};iNe(oNe);var aNe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=C.exports.useContext(UY).setComponents,u=C.exports.useRef(null),f=C.exports.useRef(null);return C.exports.useEffect(function(){var p=u.current,m=f.current;p!==null&&m!==null&&l&&l(p,m)},[]),y("div",{ref:u,className:"react-transform-wrapper "+vN.wrapper+" "+r,style:a,children:y("div",{ref:f,className:"react-transform-component "+vN.content+" "+o,style:s,children:t})})};function sNe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=C.exports.useState(0),[a,s]=C.exports.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},f=()=>{s(!a)};return y(rNe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:p,zoomOut:m,resetTransform:v,centerView:b})=>K(fn,{children:[K("div",{className:"lightbox-image-options",children:[y(Qe,{icon:y(aLe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>p(),fontSize:20}),y(Qe,{icon:y(sLe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),y(Qe,{icon:y(iLe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),y(Qe,{icon:y(oLe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),y(Qe,{icon:y(eLe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:f,fontSize:20}),y(Qe,{icon:y(Hx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),y(aNe,{wrapperStyle:{width:"100%",height:"100%"},children:y("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function lNe(){const e=Be(),t=ve(m=>m.options.isLightBoxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return Ze("Esc",()=>{t&&e(Qu(!1))},[t]),K("div",{className:"lightbox-container",children:[y(Qe,{icon:y(rLe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Qu(!1))},fontSize:20}),K("div",{className:"lightbox-display-container",children:[K("div",{className:"lightbox-preview-wrapper",children:[y(Zq,{}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),n&&K(fn,{children:[y(sNe,{image:n.url,styleClass:"lightbox-image"}),r&&y(Qq,{image:n})]})]}),y(OY,{})]})]})}const uNe=lt([dP],e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),cNe=()=>{const e=Be(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=ve(uNe),{t:o}=Ke();return K(at,{direction:"column",gap:"1rem",children:[y(Zo,{sliderMarkRightOffset:-6,label:o("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:a=>{e(yR(a))},handleReset:()=>e(yR(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-4,label:o("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:a=>{e(vR(a))},handleReset:()=>{e(vR(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-7,label:o("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:a=>{e(SR(a))},handleReset:()=>{e(SR(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),y(Zo,{sliderMarkRightOffset:-4,label:o("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:i,onChange:a=>{e(bR(a))},handleReset:()=>{e(bR(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},dNe=lt(rn,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),fNe=()=>{const e=Be(),{boundingBoxDimensions:t}=ve(dNe),{t:n}=Ke(),r=s=>{e(_v({...t,width:Math.floor(s)}))},i=s=>{e(_v({...t,height:Math.floor(s)}))},o=()=>{e(_v({...t,width:Math.floor(512)}))},a=()=>{e(_v({...t,height:Math.floor(512)}))};return K(at,{direction:"column",gap:"1rem",children:[y(Zo,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:r,handleReset:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(Zo,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:i,handleReset:a,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},hNe=lt(rn,e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function pNe(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=ve(hNe),n=Be(),{t:r}=Ke();return K(at,{alignItems:"center",columnGap:"1rem",children:[y(Zo,{label:r("options:inpaintReplace"),value:e,onChange:i=>{n(dI(i))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(dI(1)),isResetDisabled:!t}),y(os,{isChecked:t,onChange:i=>n(Wwe(i.target.checked)),marginTop:"1.25rem"})]})}const gNe=lt([dP,al,rn],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),mNe=()=>{const e=Be(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=ve(gNe),{t:s}=Ke(),l=v=>{e(xb({...a,width:Math.floor(v)}))},u=v=>{e(xb({...a,height:Math.floor(v)}))},f=()=>{e(xb({...a,width:Math.floor(512)}))},p=()=>{e(xb({...a,height:Math.floor(512)}))},m=v=>{e($we(v.target.value))};return K(at,{direction:"column",gap:"1rem",children:[y(nl,{label:s("options:scaleBeforeProcessing"),validValues:xwe,value:i,onChange:m}),y(Zo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,handleReset:f,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(Zo,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,handleReset:p,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),y(pNe,{}),y(nl,{label:s("options:infillMethod"),value:n,validValues:r,onChange:v=>e(kU(v.target.value))}),y(Zo,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:v=>{e(xR(v))},handleReset:()=>{e(xR(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function vNe(){const{t:e}=Ke(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:oo.BOUNDING_BOX,content:y(fNe,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:oo.SEAM_CORRECTION,content:y(cNe,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:oo.INFILL_AND_SCALING,content:y(mNe,{})},seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(RP,{accordionInfo:t})]})}const yNe=lt(rn,Uq,_r,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),WY=()=>{const e=Be(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=ve(yNe),o=C.exports.useRef(null);return C.exports.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(Fwe({width:a,height:s})),e(i?Bwe():bx()),e(vi(!1))},0)},[e,r,t,n,i]),y("div",{ref:o,className:"inpainting-canvas-area",children:y(by,{thickness:"2px",speed:"1s",size:"xl"})})};var GY={exports:{}};/** * @license React * react-reconciler.production.min.js * @@ -514,7 +514,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yNe=function(t){var n={},r=C.exports,i=fg.exports,o=Object.assign;function a(d){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+d,S=1;Sse||L[W]!==M[se]){var pe=` @@ -524,7 +524,7 @@ Error generating stack: `+M.message+` `+(P.join(" > ")+` No matching component was found for: - `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return J(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:y0,findFiberByHostInstance:d.findFiberByHostInstance||Im,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)d=!0;else{try{mn=h.inject(d),Zt=h}catch(S){}d=!!h.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,h,S,P){if(!ue)throw Error(a(363));d=wm(d,h);var L=Nt(d,S,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(d,h){var S=h._getVersion;S=S(h._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[h,S]:d.mutableSourceEagerHydrationData.push(h,S)},n.runWithPriority=function(d,h){var S=Xt;try{return Xt=d,h()}finally{Xt=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,h,S,P){var L=h.current,M=_i(),W=Hr(L);return S=Mm(S),h.context===null?h.context=S:h.pendingContext=S,h=Cs(M,W),h.payload={element:d},P=P===void 0?null:P,P!==null&&(h.callback=P),d=ml(L,h,W),d!==null&&(Bo(d,L,W,M),$p(d,L,W)),W},n};(function(e){e.exports=yNe})(GY);const bNe=Q8(GY.exports);var XP={exports:{}},_p={};/** + `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return J(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:y0,findFiberByHostInstance:d.findFiberByHostInstance||Im,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)d=!0;else{try{mn=h.inject(d),Zt=h}catch(S){}d=!!h.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,h,S,P){if(!ue)throw Error(a(363));d=wm(d,h);var L=Nt(d,S,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(d,h){var S=h._getVersion;S=S(h._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[h,S]:d.mutableSourceEagerHydrationData.push(h,S)},n.runWithPriority=function(d,h){var S=Xt;try{return Xt=d,h()}finally{Xt=S}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,h,S,P){var L=h.current,M=_i(),W=Hr(L);return S=Mm(S),h.context===null?h.context=S:h.pendingContext=S,h=Cs(M,W),h.payload={element:d},P=P===void 0?null:P,P!==null&&(h.callback=P),d=ml(L,h,W),d!==null&&(Bo(d,L,W,M),$p(d,L,W)),W},n};(function(e){e.exports=bNe})(GY);const SNe=Q8(GY.exports);var XP={exports:{}},_p={};/** * @license React * react-reconciler-constants.production.min.js * @@ -532,14 +532,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */_p.ConcurrentRoot=1;_p.ContinuousEventPriority=4;_p.DefaultEventPriority=16;_p.DiscreteEventPriority=1;_p.IdleEventPriority=536870912;_p.LegacyRoot=0;(function(e){e.exports=_p})(XP);const yN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let bN=!1,SN=!1;const ZP=".react-konva-event",SNe=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. + */_p.ConcurrentRoot=1;_p.ContinuousEventPriority=4;_p.DefaultEventPriority=16;_p.DiscreteEventPriority=1;_p.IdleEventPriority=536870912;_p.LegacyRoot=0;(function(e){e.exports=_p})(XP);const yN={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let bN=!1,SN=!1;const ZP=".react-konva-event",xNe=`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 -`,xNe=`ReactKonva: You are using "zIndex" attribute for a Konva node. +`,wNe=`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 -`,wNe={};function iw(e,t,n=wNe){if(!bN&&"zIndex"in t&&(console.warn(xNe),bN=!0),!SN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(SNe),SN=!0)}for(var o in n)if(!yN[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 u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var f=t._useStrictMode,p={},m=!1;const v={};for(var o in t)if(!yN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||f&&t[o]!==e.getAttr(o))&&(m=!0,p[o]=t[o])}m&&(e.setAttrs(p),xf(e));for(var l in v)e.on(l+ZP,v[l])}function xf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const qY={},CNe={};rp.Node.prototype._applyProps=iw;function _Ne(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),xf(e)}function kNe(e,t,n){let r=rp[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=rp.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 iw(l,o),l}function ENe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function PNe(e,t,n){return!1}function TNe(e){return e}function LNe(){return null}function ANe(){return null}function ONe(e,t,n,r){return CNe}function MNe(){}function RNe(e){}function INe(e,t){return!1}function DNe(){return qY}function NNe(){return qY}const BNe=setTimeout,$Ne=clearTimeout,FNe=-1;function zNe(e,t){return!1}const jNe=!1,HNe=!0,VNe=!0;function UNe(e,t){t.parent===e?t.moveToTop():e.add(t),xf(e)}function WNe(e,t){t.parent===e?t.moveToTop():e.add(t),xf(e)}function YY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),xf(e)}function GNe(e,t,n){YY(e,t,n)}function qNe(e,t){t.destroy(),t.off(ZP),xf(e)}function YNe(e,t){t.destroy(),t.off(ZP),xf(e)}function KNe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function XNe(e,t,n){}function ZNe(e,t,n,r,i){iw(e,i,r)}function QNe(e){e.hide(),xf(e)}function JNe(e){}function eBe(e,t){(t.visible==null||t.visible)&&e.show()}function tBe(e,t){}function nBe(e){}function rBe(){}const iBe=()=>XP.exports.DefaultEventPriority,oBe=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:_Ne,createInstance:kNe,createTextInstance:ENe,finalizeInitialChildren:PNe,getPublicInstance:TNe,prepareForCommit:LNe,preparePortalMount:ANe,prepareUpdate:ONe,resetAfterCommit:MNe,resetTextContent:RNe,shouldDeprioritizeSubtree:INe,getRootHostContext:DNe,getChildHostContext:NNe,scheduleTimeout:BNe,cancelTimeout:$Ne,noTimeout:FNe,shouldSetTextContent:zNe,isPrimaryRenderer:jNe,warnsIfNotActing:HNe,supportsMutation:VNe,appendChild:UNe,appendChildToContainer:WNe,insertBefore:YY,insertInContainerBefore:GNe,removeChild:qNe,removeChildFromContainer:YNe,commitTextUpdate:KNe,commitMount:XNe,commitUpdate:ZNe,hideInstance:QNe,hideTextInstance:JNe,unhideInstance:eBe,unhideTextInstance:tBe,clearContainer:nBe,detachDeletedInstance:rBe,getCurrentEventPriority:iBe,now:fg.exports.unstable_now,idlePriority:fg.exports.unstable_IdlePriority,run:fg.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var aBe=Object.defineProperty,sBe=Object.defineProperties,lBe=Object.getOwnPropertyDescriptors,xN=Object.getOwnPropertySymbols,uBe=Object.prototype.hasOwnProperty,cBe=Object.prototype.propertyIsEnumerable,wN=(e,t,n)=>t in e?aBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CN=(e,t)=>{for(var n in t||(t={}))uBe.call(t,n)&&wN(e,n,t[n]);if(xN)for(var n of xN(t))cBe.call(t,n)&&wN(e,n,t[n]);return e},dBe=(e,t)=>sBe(e,lBe(t));function QP(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=QP(r,t,n);if(i)return i;r=t?null:r.sibling}}function KY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(t){return e}}const JP=KY(C.exports.createContext(null));class XY extends C.exports.Component{render(){return y(JP.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:fBe,ReactCurrentDispatcher:hBe}=C.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function pBe(){const e=C.exports.useContext(JP);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=C.exports.useId();return C.exports.useMemo(()=>{var r;return(r=fBe.current)!=null?r:QP(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const fv=[],_N=new WeakMap;function gBe(){var e;const t=pBe();fv.splice(0,fv.length),QP(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==JP&&fv.push(KY(i))});for(const n of fv){const r=(e=hBe.current)==null?void 0:e.readContext(n);_N.set(n,r)}return C.exports.useMemo(()=>fv.reduce((n,r)=>i=>C.exports.createElement(n,null,C.exports.createElement(r.Provider,dBe(CN({},i),{value:_N.get(r)}))),n=>y(XY,{...CN({},n)})),[])}function mBe(e){const t=oe.useRef();return oe.useLayoutEffect(()=>{t.current=e}),t.current}const vBe=e=>{const t=oe.useRef(),n=oe.useRef(),r=oe.useRef(),i=mBe(e),o=gBe(),a=s=>{const{forwardedRef:l}=e;!l||(typeof l=="function"?l(s):l.current=s)};return oe.useLayoutEffect(()=>(n.current=new rp.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Ov.createContainer(n.current,XP.exports.LegacyRoot,!1,null),Ov.updateContainer(y(o,{children:e.children}),r.current),()=>{!rp.isBrowser||(a(null),Ov.updateContainer(null,r.current,null),n.current.destroy())}),[]),oe.useLayoutEffect(()=>{a(n.current),iw(n.current,e,i),Ov.updateContainer(y(o,{children:e.children}),r.current,null)}),y("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},hv="Layer",fc="Group",hc="Rect",hh="Circle",tS="Line",ZY="Image",yBe="Transformer",Ov=bNe(oBe);Ov.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:oe.version,rendererPackageName:"react-konva"});const bBe=oe.forwardRef((e,t)=>y(XY,{children:y(vBe,{...e,forwardedRef:t})})),SBe=lt([rn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),xBe=e=>{const{...t}=e,{objects:n}=ve(SBe);return y(fc,{listening:!1,...t,children:n.filter(WE).map((r,i)=>y(tS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})},Wh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},wBe=lt(rn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:f,stageScale:p,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:x}=e,E=x?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:uI/p,colorPickerInnerRadius:(uI-r8+1)/p,maskColorString:Wh({...i,a:.5}),brushColorString:Wh(o),colorPickerColorString:Wh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||f||!t)&&l,strokeWidth:1.5/p,dotRadius:1.5/p,clip:E}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),CBe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:f,brushColorString:p,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:x}=ve(wBe);return l?K(fc,{listening:!1,...x,...t,children:[a==="colorPicker"?K(fn,{children:[y(hh,{x:n,y:r,radius:b,stroke:p,strokeWidth:r8,strokeScaleEnabled:!1}),y(hh,{x:n,y:r,radius:v,stroke:m,strokeWidth:r8,strokeScaleEnabled:!1})]}):K(fn,{children:[y(hh,{x:n,y:r,radius:i,fill:s==="mask"?o:p,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),y(hh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:f*2,strokeEnabled:!0,listening:!1}),y(hh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:f,strokeEnabled:!0,listening:!1})]}),y(hh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),y(hh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},_Be=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),kBe=e=>{const{...t}=e,n=Be(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:f,hitStrokeWidth:p}=ve(_Be),m=C.exports.useRef(null),v=C.exports.useRef(null),[b,x]=C.exports.useState(!1);C.exports.useEffect(()=>{var te;!m.current||!v.current||(m.current.nodes([v.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const E=64*l,k=C.exports.useCallback(te=>{if(!u){n(fC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),$=te.target.y(),V=Xl(G,64),J=Xl($,64);te.target.x(V),te.target.y(J),n(fC({x:V,y:J}))},[n,u]),_=C.exports.useCallback(()=>{if(!v.current)return;const te=v.current,G=te.scaleX(),$=te.scaleY(),V=Math.round(te.width()*G),J=Math.round(te.height()*$),Z=Math.round(te.x()),U=Math.round(te.y());n(_v({width:V,height:J})),n(fC({x:u?Od(Z,64):Z,y:u?Od(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),T=C.exports.useCallback((te,G,$)=>{const V=te.x%E,J=te.y%E;return{x:Od(G.x,E)+V,y:Od(G.y,E)+J}},[E]),A=()=>{n(pC(!0))},R=()=>{n(pC(!1)),n(hC(!1)),n(Sb(!1)),x(!1)},I=()=>{n(hC(!0))},D=()=>{n(pC(!1)),n(hC(!1)),n(Sb(!1)),x(!1)},B=()=>{x(!0)},z=()=>{!s&&!a&&x(!1)},j=()=>{n(Sb(!0))},Y=()=>{n(Sb(!1))};return K(fc,{...t,children:[y(hc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:j,onMouseOver:j,onMouseLeave:Y,onMouseOut:Y}),y(hc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:p,listening:!o&&f==="move",onDragStart:I,onDragEnd:D,onDragMove:k,onMouseDown:I,onMouseOut:z,onMouseOver:B,onMouseEnter:B,onMouseUp:D,onTransform:_,onTransformEnd:R,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),y(yBe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:f==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&f==="move",onDragStart:I,onDragEnd:D,onMouseDown:A,onMouseUp:R,onTransformEnd:R,ref:m,rotateEnabled:!1})]})},EBe=lt([rn,_r,kr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),PBe=()=>{const e=Be(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=ve(EBe),s=C.exports.useRef(null),l=bG(),u=()=>e(GE());Ze(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const f=()=>e(Oy(!o));Ze(["h"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[o]),Ze(["n"],()=>{e(W5(!a))},{enabled:!0,preventDefault:!0},[a]),Ze("esc",()=>{e(Nwe())},{enabled:()=>!0,preventDefault:!0}),Ze("shift+h",()=>{e(Vwe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Ze(["space"],p=>{p.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(iu("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(iu(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},TBe=lt(rn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Wh(t)}}),kN=e=>`data:image/svg+xml;utf8, +`,CNe={};function iw(e,t,n=CNe){if(!bN&&"zIndex"in t&&(console.warn(wNe),bN=!0),!SN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(xNe),SN=!0)}for(var o in n)if(!yN[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 u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var f=t._useStrictMode,p={},m=!1;const v={};for(var o in t)if(!yN[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||f&&t[o]!==e.getAttr(o))&&(m=!0,p[o]=t[o])}m&&(e.setAttrs(p),xf(e));for(var l in v)e.on(l+ZP,v[l])}function xf(e){if(!gt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const qY={},_Ne={};rp.Node.prototype._applyProps=iw;function kNe(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),xf(e)}function ENe(e,t,n){let r=rp[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=rp.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 iw(l,o),l}function PNe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function TNe(e,t,n){return!1}function LNe(e){return e}function ANe(){return null}function ONe(){return null}function MNe(e,t,n,r){return _Ne}function RNe(){}function INe(e){}function DNe(e,t){return!1}function NNe(){return qY}function BNe(){return qY}const $Ne=setTimeout,FNe=clearTimeout,zNe=-1;function jNe(e,t){return!1}const HNe=!1,VNe=!0,UNe=!0;function WNe(e,t){t.parent===e?t.moveToTop():e.add(t),xf(e)}function GNe(e,t){t.parent===e?t.moveToTop():e.add(t),xf(e)}function YY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),xf(e)}function qNe(e,t,n){YY(e,t,n)}function YNe(e,t){t.destroy(),t.off(ZP),xf(e)}function KNe(e,t){t.destroy(),t.off(ZP),xf(e)}function XNe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function ZNe(e,t,n){}function QNe(e,t,n,r,i){iw(e,i,r)}function JNe(e){e.hide(),xf(e)}function eBe(e){}function tBe(e,t){(t.visible==null||t.visible)&&e.show()}function nBe(e,t){}function rBe(e){}function iBe(){}const oBe=()=>XP.exports.DefaultEventPriority,aBe=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:kNe,createInstance:ENe,createTextInstance:PNe,finalizeInitialChildren:TNe,getPublicInstance:LNe,prepareForCommit:ANe,preparePortalMount:ONe,prepareUpdate:MNe,resetAfterCommit:RNe,resetTextContent:INe,shouldDeprioritizeSubtree:DNe,getRootHostContext:NNe,getChildHostContext:BNe,scheduleTimeout:$Ne,cancelTimeout:FNe,noTimeout:zNe,shouldSetTextContent:jNe,isPrimaryRenderer:HNe,warnsIfNotActing:VNe,supportsMutation:UNe,appendChild:WNe,appendChildToContainer:GNe,insertBefore:YY,insertInContainerBefore:qNe,removeChild:YNe,removeChildFromContainer:KNe,commitTextUpdate:XNe,commitMount:ZNe,commitUpdate:QNe,hideInstance:JNe,hideTextInstance:eBe,unhideInstance:tBe,unhideTextInstance:nBe,clearContainer:rBe,detachDeletedInstance:iBe,getCurrentEventPriority:oBe,now:fg.exports.unstable_now,idlePriority:fg.exports.unstable_IdlePriority,run:fg.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var sBe=Object.defineProperty,lBe=Object.defineProperties,uBe=Object.getOwnPropertyDescriptors,xN=Object.getOwnPropertySymbols,cBe=Object.prototype.hasOwnProperty,dBe=Object.prototype.propertyIsEnumerable,wN=(e,t,n)=>t in e?sBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CN=(e,t)=>{for(var n in t||(t={}))cBe.call(t,n)&&wN(e,n,t[n]);if(xN)for(var n of xN(t))dBe.call(t,n)&&wN(e,n,t[n]);return e},fBe=(e,t)=>lBe(e,uBe(t));function QP(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=QP(r,t,n);if(i)return i;r=t?null:r.sibling}}function KY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(t){return e}}const JP=KY(C.exports.createContext(null));class XY extends C.exports.Component{render(){return y(JP.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:hBe,ReactCurrentDispatcher:pBe}=C.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function gBe(){const e=C.exports.useContext(JP);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=C.exports.useId();return C.exports.useMemo(()=>{var r;return(r=hBe.current)!=null?r:QP(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const fv=[],_N=new WeakMap;function mBe(){var e;const t=gBe();fv.splice(0,fv.length),QP(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==JP&&fv.push(KY(i))});for(const n of fv){const r=(e=pBe.current)==null?void 0:e.readContext(n);_N.set(n,r)}return C.exports.useMemo(()=>fv.reduce((n,r)=>i=>C.exports.createElement(n,null,C.exports.createElement(r.Provider,fBe(CN({},i),{value:_N.get(r)}))),n=>y(XY,{...CN({},n)})),[])}function vBe(e){const t=oe.useRef();return oe.useLayoutEffect(()=>{t.current=e}),t.current}const yBe=e=>{const t=oe.useRef(),n=oe.useRef(),r=oe.useRef(),i=vBe(e),o=mBe(),a=s=>{const{forwardedRef:l}=e;!l||(typeof l=="function"?l(s):l.current=s)};return oe.useLayoutEffect(()=>(n.current=new rp.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Ov.createContainer(n.current,XP.exports.LegacyRoot,!1,null),Ov.updateContainer(y(o,{children:e.children}),r.current),()=>{!rp.isBrowser||(a(null),Ov.updateContainer(null,r.current,null),n.current.destroy())}),[]),oe.useLayoutEffect(()=>{a(n.current),iw(n.current,e,i),Ov.updateContainer(y(o,{children:e.children}),r.current,null)}),y("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},hv="Layer",fc="Group",hc="Rect",hh="Circle",tS="Line",ZY="Image",bBe="Transformer",Ov=SNe(aBe);Ov.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:oe.version,rendererPackageName:"react-konva"});const SBe=oe.forwardRef((e,t)=>y(XY,{children:y(yBe,{...e,forwardedRef:t})})),xBe=lt([rn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),wBe=e=>{const{...t}=e,{objects:n}=ve(xBe);return y(fc,{listening:!1,...t,children:n.filter(WE).map((r,i)=>y(tS,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})},Wh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},CBe=lt(rn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:f,stageScale:p,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:x}=e,E=x?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:uI/p,colorPickerInnerRadius:(uI-r8+1)/p,maskColorString:Wh({...i,a:.5}),brushColorString:Wh(o),colorPickerColorString:Wh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||f||!t)&&l,strokeWidth:1.5/p,dotRadius:1.5/p,clip:E}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),_Be=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:f,brushColorString:p,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:x}=ve(CBe);return l?K(fc,{listening:!1,...x,...t,children:[a==="colorPicker"?K(fn,{children:[y(hh,{x:n,y:r,radius:b,stroke:p,strokeWidth:r8,strokeScaleEnabled:!1}),y(hh,{x:n,y:r,radius:v,stroke:m,strokeWidth:r8,strokeScaleEnabled:!1})]}):K(fn,{children:[y(hh,{x:n,y:r,radius:i,fill:s==="mask"?o:p,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),y(hh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:f*2,strokeEnabled:!0,listening:!1}),y(hh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:f,strokeEnabled:!0,listening:!1})]}),y(hh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),y(hh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},kBe=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),EBe=e=>{const{...t}=e,n=Be(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:f,hitStrokeWidth:p}=ve(kBe),m=C.exports.useRef(null),v=C.exports.useRef(null),[b,x]=C.exports.useState(!1);C.exports.useEffect(()=>{var te;!m.current||!v.current||(m.current.nodes([v.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const E=64*l,k=C.exports.useCallback(te=>{if(!u){n(fC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const G=te.target.x(),$=te.target.y(),V=Xl(G,64),J=Xl($,64);te.target.x(V),te.target.y(J),n(fC({x:V,y:J}))},[n,u]),_=C.exports.useCallback(()=>{if(!v.current)return;const te=v.current,G=te.scaleX(),$=te.scaleY(),V=Math.round(te.width()*G),J=Math.round(te.height()*$),Z=Math.round(te.x()),U=Math.round(te.y());n(_v({width:V,height:J})),n(fC({x:u?Od(Z,64):Z,y:u?Od(U,64):U})),te.scaleX(1),te.scaleY(1)},[n,u]),T=C.exports.useCallback((te,G,$)=>{const V=te.x%E,J=te.y%E;return{x:Od(G.x,E)+V,y:Od(G.y,E)+J}},[E]),A=()=>{n(pC(!0))},R=()=>{n(pC(!1)),n(hC(!1)),n(Sb(!1)),x(!1)},I=()=>{n(hC(!0))},D=()=>{n(pC(!1)),n(hC(!1)),n(Sb(!1)),x(!1)},B=()=>{x(!0)},z=()=>{!s&&!a&&x(!1)},j=()=>{n(Sb(!0))},Y=()=>{n(Sb(!1))};return K(fc,{...t,children:[y(hc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:j,onMouseOver:j,onMouseLeave:Y,onMouseOut:Y}),y(hc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:p,listening:!o&&f==="move",onDragStart:I,onDragEnd:D,onDragMove:k,onMouseDown:I,onMouseOut:z,onMouseOver:B,onMouseEnter:B,onMouseUp:D,onTransform:_,onTransformEnd:R,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),y(bBe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:f==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&f==="move",onDragStart:I,onDragEnd:D,onMouseDown:A,onMouseUp:R,onTransformEnd:R,ref:m,rotateEnabled:!1})]})},PBe=lt([rn,_r,kr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),TBe=()=>{const e=Be(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=ve(PBe),s=C.exports.useRef(null),l=bG(),u=()=>e(GE());Ze(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const f=()=>e(Oy(!o));Ze(["h"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[o]),Ze(["n"],()=>{e(W5(!a))},{enabled:!0,preventDefault:!0},[a]),Ze("esc",()=>{e(Nwe())},{enabled:()=>!0,preventDefault:!0}),Ze("shift+h",()=>{e(Vwe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Ze(["space"],p=>{p.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(iu("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(iu(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},LBe=lt(rn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Wh(t)}}),kN=e=>`data:image/svg+xml;utf8, @@ -617,9 +617,9 @@ For more info see: https://github.com/konvajs/react-konva/issues/194 -`.replaceAll("black",e),LBe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ve(TBe),[a,s]=C.exports.useState(null),[l,u]=C.exports.useState(0),f=C.exports.useRef(null),p=C.exports.useCallback(()=>{u(l+1),setTimeout(p,500)},[l]);return C.exports.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=kN(n)},[a,n]),C.exports.useEffect(()=>{!a||(a.src=kN(n))},[a,n]),C.exports.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!gi.exports.isNumber(r.x)||!gi.exports.isNumber(r.y)||!gi.exports.isNumber(o)||!gi.exports.isNumber(i.width)||!gi.exports.isNumber(i.height)?null:y(hc,{ref:f,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:gi.exports.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},ABe=lt([rn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),OBe=e=>{const t=Be(),{isMoveStageKeyHeld:n,stageScale:r}=ve(ABe);return C.exports.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=He.clamp(r*vwe**s,ywe,bwe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Gwe(l)),t(SW(u))},[e,n,r,t])},eT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},QY=()=>{const e=Be(),t=tl(),n=bG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=F0.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(zwe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Lwe())}}},MBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),RBe=e=>{const t=Be(),{tool:n,isStaging:r}=ve(MBe),{commitColorUnderCursor:i}=QY();return C.exports.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(V5(!0));return}if(n==="colorPicker"){i();return}const a=eT(e.current);!a||(o.evt.preventDefault(),t(dW(!0)),t(Twe([a.x,a.y])))},[e,n,r,t,i])},IBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),DBe=(e,t)=>{const n=Be(),{tool:r,isDrawing:i,isStaging:o}=ve(IBe);return C.exports.useCallback(()=>{if(r==="move"||o){n(V5(!1));return}if(!t.current&&i&&e.current){const a=eT(e.current);if(!a)return;n(lW([a.x,a.y]))}else t.current=!1;n(dW(!1))},[t,n,i,o,e,r])},NBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BBe=(e,t,n)=>{const r=Be(),{isDrawing:i,tool:o,isStaging:a}=ve(NBe),{updateColorUnderCursor:s}=QY();return C.exports.useCallback(()=>{if(!e.current)return;const l=eT(e.current);if(!!l){if(r(jwe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(lW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},$Be=()=>{const e=Be();return C.exports.useCallback(()=>{e(Mwe())},[e])},FBe=lt([rn,kr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),zBe=()=>{const e=Be(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ve(FBe);return{handleDragStart:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(V5(!0))},[e,r,n,t]),handleDragMove:C.exports.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(SW(o))},[e,r,n,t]),handleDragEnd:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(V5(!1))},[e,r,n,t])}};var ph=C.exports,jBe=function(t,n,r){const i=ph.useRef("loading"),o=ph.useRef(),[a,s]=ph.useState(0),l=ph.useRef(),u=ph.useRef(),f=ph.useRef();return(l.current!==t||u.current!==n||f.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,f.current=r),ph.useLayoutEffect(function(){if(!t)return;var p=document.createElement("img");function m(){i.current="loaded",o.current=p,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return p.addEventListener("load",m),p.addEventListener("error",v),n&&(p.crossOrigin=n),r&&(p.referrerpolicy=r),p.src=t,function(){p.removeEventListener("load",m),p.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const JY=e=>{const{url:t,x:n,y:r}=e,[i]=jBe(t);return y(ZY,{x:n,y:r,image:i,listening:!1})},HBe=lt([rn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),VBe=()=>{const{objects:e}=ve(HBe);return e?y(fc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(H5(t))return y(JY,{x:t.x,y:t.y,url:t.image.url},n);if(wwe(t)){const r=y(tS,{points:t.points,stroke:t.color?Wh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?y(fc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Cwe(t))return y(hc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Wh(t.color)},n);if(_we(t))return y(hc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},UBe=lt([rn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),WBe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},GBe=()=>{const{colorMode:e}=uy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ve(UBe),[i,o]=C.exports.useState([]),a=C.exports.useCallback(s=>s/t,[t]);return C.exports.useLayoutEffect(()=>{const s=WBe[e],{width:l,height:u}=r,{x:f,y:p}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(f),y:a(p)}},v={x:Math.ceil(a(f)/64)*64,y:Math.ceil(a(p)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},E={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},k=E.x2-E.x1,_=E.y2-E.y1,T=Math.round(k/64)+1,A=Math.round(_/64)+1,R=He.range(0,T).map(D=>y(tS,{x:E.x1+D*64,y:E.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),I=He.range(0,A).map(D=>y(tS,{x:E.x1,y:E.y1+D*64,points:[0,0,k,0],stroke:s,strokeWidth:1},`y_${D}`));o(R.concat(I))},[t,n,r,e,a]),y(fc,{children:i})},qBe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:He.isEqual}}),YBe=e=>{const{...t}=e,n=ve(qBe),[r,i]=C.exports.useState(null);if(C.exports.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?y(ZY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},dg=e=>Math.round(e*100)/100,KBe=lt([rn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${dg(n)}, ${dg(r)})`}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function XBe(){const{cursorCoordinatesString:e}=ve(KBe),{t}=Ke();return y("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const ZBe=lt([rn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:f},stageScale:p,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b}=e;let x="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(x="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:x,boundingBoxCoordinatesString:`(${dg(u)}, ${dg(f)})`,boundingBoxDimensionsString:`${o}\xD7${a}`,scaledBoundingBoxDimensionsString:`${s}\xD7${l}`,canvasCoordinatesString:`${dg(r)}\xD7${dg(i)}`,canvasDimensionsString:`${t}\xD7${n}`,canvasScaleString:Math.round(p*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),QBe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:f,shouldShowBoundingBox:p}=ve(ZBe),{t:m}=Ke();return K("div",{className:"canvas-status-text",children:[y("div",{style:{color:e},children:`${m("unifiedcanvas:activeLayer")}: ${t}`}),y("div",{children:`${m("unifiedcanvas:canvasScale")}: ${u}%`}),p&&y("div",{style:{color:n},children:`${m("unifiedcanvas:boundingBox")}: ${i}`}),a&&y("div",{style:{color:n},children:`${m("unifiedcanvas:scaledBoundingBox")}: ${o}`}),f&&K(fn,{children:[y("div",{children:`${m("unifiedcanvas:boundingBoxPosition")}: ${r}`}),y("div",{children:`${m("unifiedcanvas:canvasDimensions")}: ${l}`}),y("div",{children:`${m("unifiedcanvas:canvasPosition")}: ${s}`}),y(XBe,{})]})]})},JBe=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),e$e=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ve(JBe);return K(fc,{...t,children:[r&&n&&y(JY,{url:n.image.url,x:o,y:a}),i&&K(fc,{children:[y(hc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),y(hc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},t$e=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),n$e=()=>{const e=Be(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ve(t$e),{t:o}=Ke(),a=C.exports.useCallback(()=>{e(fI(!0))},[e]),s=C.exports.useCallback(()=>{e(fI(!1))},[e]);Ze(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ze(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Ze(["enter"],()=>{f()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(Iwe()),u=()=>e(Rwe()),f=()=>e(Awe());return r?y(at,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:K(io,{isAttached:!0,children:[y(Qe,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:y(w8e,{}),onClick:l,"data-selected":!0,isDisabled:t}),y(Qe,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:y(C8e,{}),onClick:u,"data-selected":!0,isDisabled:n}),y(Qe,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:y(aP,{}),onClick:f,"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?y(A8e,{}):y(L8e,{}),onClick:()=>e(Uwe(!i)),"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:y(lP,{}),onClick:()=>e(Q6e(r.image.url)),"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Owe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},r$e=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),i$e=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ve(r$e);return K(fc,{children:[y(hc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),y(hc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},o$e=lt([rn,kr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:f,isMovingStage:p,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let x="none";return f==="move"||t?p?x="grabbing":x="grab":o?x=void 0:b&&!a&&(x="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:x,stageDimensions:l,stageScale:r,tool:f,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eK=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:f}=ve(o$e);PBe();const p=C.exports.useRef(null),m=C.exports.useRef(null),v=C.exports.useCallback(z=>{S9e(z),p.current=z},[]),b=C.exports.useCallback(z=>{b9e(z),m.current=z},[]),x=C.exports.useRef({x:0,y:0}),E=C.exports.useRef(!1),k=OBe(p),_=RBe(p),T=DBe(p,E),A=BBe(p,E,x),R=$Be(),{handleDragStart:I,handleDragMove:D,handleDragEnd:B}=zBe();return y("div",{className:"inpainting-canvas-container",children:K("div",{className:"inpainting-canvas-wrapper",children:[K(bBe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:T,onMouseDown:_,onMouseLeave:R,onMouseMove:A,onMouseUp:T,onDragStart:I,onDragMove:D,onDragEnd:B,onContextMenu:z=>z.evt.preventDefault(),onWheel:k,draggable:(l==="move"||u)&&!t,children:[y(hv,{id:"grid",visible:r,children:y(GBe,{})}),y(hv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:y(VBe,{})}),K(hv,{id:"mask",visible:e,listening:!1,children:[y(xBe,{visible:!0,listening:!1}),y(LBe,{listening:!1})]}),y(hv,{children:y(i$e,{})}),K(hv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&y(CBe,{visible:l!=="move",listening:!1}),y(e$e,{visible:u}),f&&y(YBe,{}),y(kBe,{visible:n&&!u})]})]}),y(QBe,{}),y(n$e,{})]})})},a$e=lt([rn,_r,al],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tK(){const e=Be(),{t}=Ke(),{canUndo:n,activeTabName:r}=ve(a$e),i=()=>{e(qwe())};return Ze(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),y(Qe,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:y(W8e,{}),onClick:i,isDisabled:!n})}const s$e=lt([rn,_r,al],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function nK(){const e=Be(),{canRedo:t,activeTabName:n}=ve(s$e),{t:r}=Ke(),i=()=>{e(Dwe())};return Ze(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),y(Qe,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:y(j8e,{}),onClick:i,isDisabled:!t})}const rK=()=>{const e=ve(kr),t=Be(),{t:n}=Ke(),r=()=>{t(J6e()),t(qE()),t(uW())};return K(CP,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:y(qr,{leftIcon:y(yp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[y("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),y("br",{}),y("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},iK=()=>{const e=ve(kr),t=Be(),{t:n}=Ke();return K(CP,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(uW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:y(qr,{size:"sm",leftIcon:y(yp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[y("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),y("br",{}),y("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},l$e=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),u$e=()=>{const e=Be(),{t}=Ke(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=ve(l$e);Ze(["n"],()=>{e(W5(!l))},{enabled:!0,preventDefault:!0},[l]);const f=p=>e(W5(p.target.checked));return y(Js,{trigger:"hover",triggerComponent:y(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:y(cP,{})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:p=>e(bW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:p=>e(yW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:f}),y(Qn,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:p=>e(gW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:p=>e(hW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:p=>e(pW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:p=>e(xW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:p=>e(vW(p.target.checked))}),y(iK,{}),y(rK,{})]})})};function ow(){return(ow=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function U8(e){var t=C.exports.useRef(e),n=C.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var l1=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(EN(i.current,E,s.current)):x(!1)},b=function(){return x(!1)};function x(E){var k=l.current,_=W8(i.current),T=E?_.addEventListener:_.removeEventListener;T(k?"touchmove":"mousemove",v),T(k?"touchend":"mouseup",b)}return[function(E){var k=E.nativeEvent,_=i.current;if(_&&(PN(k),!function(A,R){return R&&!u2(A)}(k,l.current)&&_)){if(u2(k)){l.current=!0;var T=k.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(EN(_,k,s.current)),x(!0)}},function(E){var k=E.which||E.keyCode;k<37||k>40||(E.preventDefault(),a({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},x]},[a,o]),f=u[0],p=u[1],m=u[2];return C.exports.useEffect(function(){return m},[m]),y("div",{...ow({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:p,tabIndex:0,role:"slider"})})}),aw=function(e){return e.filter(Boolean).join(" ")},nT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=aw(["react-colorful__pointer",e.className]);return y("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:y("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},Co=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},aK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Co(e.h),s:Co(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Co(i/2),a:Co(r,2)}},G8=function(e){var t=aK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},FC=function(e){var t=aK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},c$e=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),u=o%6;return{r:Co(255*[r,s,a,a,l,r][u]),g:Co(255*[l,r,r,s,a,a][u]),b:Co(255*[a,a,l,r,r,s][u]),a:Co(i,2)}},d$e=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:Co(60*(s<0?s+6:s)),s:Co(o?a/o*100:0),v:Co(o/255*100),a:i}},f$e=oe.memo(function(e){var t=e.hue,n=e.onChange,r=aw(["react-colorful__hue",e.className]);return oe.createElement("div",{className:r},oe.createElement(tT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:l1(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Co(t),"aria-valuemax":"360","aria-valuemin":"0"},oe.createElement(nT,{className:"react-colorful__hue-pointer",left:t/360,color:G8({h:t,s:100,v:100,a:1})})))}),h$e=oe.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:G8({h:t.h,s:100,v:100,a:1})};return oe.createElement("div",{className:"react-colorful__saturation",style:r},oe.createElement(tT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:l1(t.s+100*i.left,0,100),v:l1(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Co(t.s)+"%, Brightness "+Co(t.v)+"%"},oe.createElement(nT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:G8(t)})))}),sK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function p$e(e,t,n){var r=U8(n),i=C.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=C.exports.useRef({color:t,hsva:o});C.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),C.exports.useEffect(function(){var u;sK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=C.exports.useCallback(function(u){a(function(f){return Object.assign({},f,u)})},[]);return[o,l]}var g$e=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,m$e=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},TN=new Map,v$e=function(e){g$e(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!TN.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}`,TN.set(t,n);var r=m$e();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},y$e=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+FC(Object.assign({},n,{a:0}))+", "+FC(Object.assign({},n,{a:1}))+")"},o=aw(["react-colorful__alpha",t]),a=Co(100*n.a);return oe.createElement("div",{className:o},y("div",{className:"react-colorful__alpha-gradient",style:i}),oe.createElement(tT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:l1(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},oe.createElement(nT,{className:"react-colorful__alpha-pointer",left:n.a,color:FC(n)})))},b$e=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=oK(e,["className","colorModel","color","onChange"]),s=C.exports.useRef(null);v$e(s);var l=p$e(n,i,o),u=l[0],f=l[1],p=aw(["react-colorful",t]);return oe.createElement("div",ow({},a,{ref:s,className:p}),y(h$e,{hsva:u,onChange:f}),y(f$e,{hue:u.h,onChange:f}),oe.createElement(y$e,{hsva:u,onChange:f,className:"react-colorful__last-control"}))},S$e={defaultColor:{r:0,g:0,b:0,a:1},toHsva:d$e,fromHsva:c$e,equal:sK},x$e=function(e){return oe.createElement(b$e,ow({},e,{colorModel:S$e}))};const nS=e=>{const{styleClass:t,...n}=e;return y(x$e,{className:`invokeai__color-picker ${t}`,...n})},w$e=lt([rn,kr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Wh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),C$e=()=>{const e=Be(),{t}=Ke(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=ve(w$e);Ze(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Ze(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Ze(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(U5(n==="mask"?"base":"mask"))},l=()=>e(GE()),u=()=>e(Oy(!i));return y(Js,{trigger:"hover",triggerComponent:y(io,{children:y(Qe,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:y(D8e,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),y(Qn,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:f=>e(mW(f.target.checked))}),y(nS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:f=>e(fW(f))}),K(qr,{size:"sm",leftIcon:y(yp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},_$e=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),f=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(u)},p=e.toDataURL(f);return e.scale(i),{dataURL:p,boundingBox:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(l),height:Math.round(u)}}},k$e=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},E$e=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");!o||(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},P$e={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Rd=(e=P$e)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(gwe("Exporting Image")),t(sg(!1));const u=n(),{stageScale:f,boundingBoxCoordinates:p,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=tl();if(!b){t(Ws(!1)),t(sg(!0));return}const{dataURL:x,boundingBox:E}=_$e(b,f,v,i?{...p,...m}:void 0);if(!x){t(Ws(!1)),t(sg(!0));return}const k=new FormData;k.append("data",JSON.stringify({dataURL:x,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(window.location.origin+"/upload",{method:"POST",body:k})).json(),{url:A,width:R,height:I}=T,D={uuid:lg(),category:o?"result":"user",...T};a&&(k$e(A),t(Rh({title:Ht.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(E$e(A,R,I),t(Rh({title:Ht.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(ag({image:D,category:"result"})),t(Rh({title:Ht.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Hwe({kind:"image",layer:"base",...E,image:D})),t(Rh({title:Ht.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(Ws(!1)),t(_4(Ht.t("common:statusConnected"))),t(sg(!0))},T$e=lt([rn,kr,al],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),L$e=()=>{const e=Be(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ve(T$e),{t:o}=Ke();Ze(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Ze(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ze(["delete","backspace"],()=>{f()},{enabled:()=>!i,preventDefault:!0}),Ze(["BracketLeft"],()=>{e(Bg(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["BracketRight"],()=>{e(Bg(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["shift+BracketLeft"],()=>{e(Ng({...n,a:He.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ze(["shift+BracketRight"],()=>{e(Ng({...n,a:He.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(iu("brush")),s=()=>e(iu("eraser")),l=()=>e(iu("colorPicker")),u=()=>e(sW()),f=()=>e(aW());return K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:y(UG,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),y(Qe,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:y(zG,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),y(Qe,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y(HG,{}),isDisabled:i,onClick:u}),y(Qe,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y(Iy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:f}),y(Qe,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:y(jG,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:y(uP,{})}),children:K(at,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[y(at,{gap:"1rem",justifyContent:"space-between",children:y(Zo,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:p=>e(Bg(p)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:p=>e(Ng(p))})]})})]})};let LN;const rT=()=>({setOpenUploader:e=>{e&&(LN=e)},openUploader:LN}),A$e=lt([al,rn,kr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),O$e=()=>{const e=Be(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ve(A$e),s=tl(),{t:l}=Ke(),{openUploader:u}=rT();Ze(["v"],()=>{f()},{enabled:()=>!n,preventDefault:!0},[]),Ze(["r"],()=>{p()},{enabled:()=>!0,preventDefault:!0},[s]),Ze(["shift+m"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+s"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["meta+c","ctrl+c"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const f=()=>e(iu("move")),p=()=>{const _=tl();if(!_)return;const T=_.getClientRect({skipTransform:!0});e(cW({contentRect:T}))},m=()=>{e(qE()),e(bx())},v=()=>{e(Rd({cropVisible:!1,shouldSetAsInitialImage:!0}))},b=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},x=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=_=>{const T=_.target.value;e(U5(T)),T==="mask"&&!r&&e(Oy(!0))};return K("div",{className:"inpainting-settings",children:[y(nl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:iW,onChange:k,isDisabled:n}),y(C$e,{}),y(L$e,{}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:y(BG,{}),"data-selected":o==="move"||n,onClick:f}),y(Qe,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:y(FG,{}),onClick:p})]}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y(VG,{}),onClick:v,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y(lP,{}),onClick:b,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y(Ry,{}),onClick:x,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y(sP,{}),onClick:E,isDisabled:n})]}),K(io,{isAttached:!0,children:[y(tK,{}),y(nK,{})]}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:y(Nx,{}),onClick:u,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:y(yp,{}),onClick:m,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),y(io,{isAttached:!0,children:y(u$e,{})})]})},M$e=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),R$e=()=>{const e=Be(),{doesCanvasNeedScaling:t}=ve(M$e);return C.exports.useLayoutEffect(()=>{e(vi(!0));const n=He.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y("div",{className:"workarea-single-view",children:y("div",{className:"workarea-split-view-left",children:K("div",{className:"inpainting-main-area",children:[y(O$e,{}),y("div",{className:"inpainting-canvas-area",children:t?y(WY,{}):y(eK,{})})]})})})},I$e=lt([rn,kr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function D$e(){const e=Be(),{t}=Ke(),{layer:n,isMaskEnabled:r,isStaging:i}=ve(I$e),o=()=>{e(U5(n==="mask"?"base":"mask"))};Ze(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(U5(l)),l==="mask"&&!r&&e(Oy(!0))};return y(nl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:iW,onChange:a,isDisabled:i})}const N$e=lt([rn,kr,al],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),B$e=()=>{const e=Be(),{t}=Ke(),{tool:n,isStaging:r}=ve(N$e);Ze(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Ze(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Ze(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(iu("brush")),o=()=>e(iu("eraser")),a=()=>e(iu("colorPicker")),s=()=>e(sW()),l=()=>e(aW());return K(at,{flexDirection:"column",gap:"0.5rem",children:[K(io,{children:[y(Qe,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:y(UG,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),y(Qe,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:y(zG,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),K(io,{children:[y(Qe,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y(HG,{}),isDisabled:r,onClick:s}),y(Qe,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y(Iy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),y(Qe,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:y(jG,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},$$e=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),F$e=()=>{const e=Be(),{t}=Ke(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=ve($$e);return y(Js,{trigger:"hover",triggerComponent:y(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:y(cP,{})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(bW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(hW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(pW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(vW(a.target.checked))}),y(iK,{}),y(rK,{})]})})};function z$e(){const e=ve(o=>o.canvas.tool),t=ve(kr),n=Be(),{t:r}=Ke();Ze(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(iu("move"));return y(Qe,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:y(BG,{}),"data-selected":e==="move"||t,onClick:i})}function j$e(){const e=tl(),t=Be(),{t:n}=Ke();Ze(["r"],()=>{r()},{enabled:()=>!0,preventDefault:!0},[e]);const r=()=>{const i=tl();if(!i)return;const o=i.getClientRect({skipTransform:!0});t(cW({contentRect:o}))};return y(Qe,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:y(FG,{}),onClick:r})}function H$e(){const e=Be(),{t}=Ke(),n=tl(),r=ve(kr),i=ve(a=>a.system.isProcessing);Ze(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Rd({cropVisible:!1,shouldSetAsInitialImage:!0}))};return y(Qe,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y(VG,{}),onClick:o,isDisabled:r})}function V$e(){const e=ve(kr),t=tl(),n=ve(s=>s.system.isProcessing),r=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Be(),{t:o}=Ke();Ze(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Rd({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return y(Qe,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y(lP,{}),onClick:a,isDisabled:e})}function U$e(){const e=ve(kr),t=tl(),n=ve(s=>s.system.isProcessing),r=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Be(),{t:o}=Ke();Ze(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Rd({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return y(Qe,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y(Ry,{}),onClick:a,isDisabled:e})}function W$e(){const e=Be(),{t}=Ke(),n=tl(),r=ve(kr),i=ve(s=>s.system.isProcessing),o=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave);Ze(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Rd({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return y(Qe,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y(sP,{}),onClick:a,isDisabled:r})}function G$e(){const e=ve(kr),{openUploader:t}=rT(),{t:n}=Ke();return y(Qe,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:y(Nx,{}),onClick:t,isDisabled:e})}function q$e(){const e=Be(),{t}=Ke(),n=ve(kr),r=()=>{e(qE()),e(bx())};return y(Qe,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:y(yp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function Y$e(){const e=ve(i=>i.options.shouldPinOptionsPanel),t=Be(),{t:n}=Ke(),r=()=>{t(Ju(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return K(at,{flexDirection:"column",gap:"0.5rem",children:[y(Qe,{tooltip:`${n("options:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("options:showOptionsPanel"),onClick:r,children:y(uP,{})}),y(at,{children:y(IP,{iconButton:!0})}),y(at,{children:y(DP,{width:"100%",height:"40px"})})]})}const K$e=()=>{const e=ve(t=>t.options.shouldShowOptionsPanel);return K(at,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[y(D$e,{}),y(B$e,{}),K(at,{gap:"0.5rem",children:[y(z$e,{}),y(j$e,{})]}),K(at,{columnGap:"0.5rem",children:[y(H$e,{}),y(V$e,{})]}),K(at,{columnGap:"0.5rem",children:[y(U$e,{}),y(W$e,{})]}),K(at,{gap:"0.5rem",children:[y(tK,{}),y(nK,{})]}),K(at,{gap:"0.5rem",children:[y(G$e,{}),y(q$e,{})]}),y(F$e,{}),!e&&y(Y$e,{})]})};function X$e(){const e=Be(),t=ve(i=>i.canvas.brushSize),{t:n}=Ke(),r=ve(kr);return Ze(["BracketLeft"],()=>{e(Bg(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Ze(["BracketRight"],()=>{e(Bg(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),y(Zo,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Bg(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}const Z$e=lt([rn,kr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function Q$e(){const e=Be(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ve(Z$e),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ze(["shift+BracketLeft"],()=>{e(Ng({...t,a:He.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+BracketRight"],()=>{e(Ng({...t,a:He.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),y(Js,{trigger:"hover",triggerComponent:y(rl,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:K(at,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Ng(a))}),r==="mask"&&y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(fW(a))})]})})}function lK(){return K(at,{columnGap:"1rem",alignItems:"center",children:[y(X$e,{}),y(Q$e,{})]})}function J$e(){const e=Be(),t=ve(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(xW(r.target.checked))})}function eFe(){return K(at,{gap:"1rem",alignItems:"center",children:[y(lK,{}),y(J$e,{})]})}function tFe(){const e=Be(),{t}=Ke();return y(qr,{size:"sm",leftIcon:y(yp,{}),onClick:()=>e(GE()),tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function nFe(){const e=ve(i=>i.canvas.isMaskEnabled),t=Be(),{t:n}=Ke(),r=()=>t(Oy(!e));return y(Qn,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function rFe(){const e=Be(),{t}=Ke(),n=ve(r=>r.canvas.shouldPreserveMaskedArea);return y(Qn,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(mW(r.target.checked))})}function iFe(){return K(at,{gap:"1rem",alignItems:"center",children:[y(lK,{}),y(nFe,{}),y(rFe,{}),y(tFe,{})]})}function oFe(){const e=ve(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Be(),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(gW(r.target.checked))})}function aFe(){const e=ve(r=>r.canvas.shouldShowGrid),t=Be(),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(yW(r.target.checked))})}function sFe(){const e=ve(i=>i.canvas.shouldSnapToGrid),t=Be(),{t:n}=Ke(),r=i=>t(W5(i.target.checked));return y(Qn,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function lFe(){return K(at,{alignItems:"center",gap:"1rem",children:[y(aFe,{}),y(sFe,{}),y(oFe,{})]})}const uFe=lt([rn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function cFe(){const{tool:e,layer:t}=ve(uFe);return K(at,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&y(eFe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&y(iFe,{}),e=="move"&&y(lFe,{})]})}const dFe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),fFe=()=>{const e=Be(),{doesCanvasNeedScaling:t}=ve(dFe);return C.exports.useLayoutEffect(()=>{e(vi(!0));const n=He.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y("div",{className:"workarea-single-view",children:K(at,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[y(K$e,{}),K(at,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[y(cFe,{}),t?y(WY,{}):y(eK,{})]})]})})};function hFe(){const e=ve(t=>t.options.shouldUseCanvasBetaLayout);return y(qP,{optionsPanel:y(mNe,{}),styleClass:"inpainting-workarea-overrides",children:e?y(fFe,{}):y(R$e,{})})}const pFe=bt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:y("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.787L-0,2766.03C-0,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.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.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.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.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.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.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.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.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.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.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.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.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.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,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.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function gFe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:training")}),K("p",{children:[e("common:trainingDesc1"),y("br",{}),y("br",{}),e("common:trainingDesc2")]})]})}const mFe=bt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:y("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.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.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})});function vFe(e){const{i18n:t}=Ke(),n=localStorage.getItem("i18nextLng");oe.useEffect(()=>{e()},[e]),oe.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const ts={txt2img:{title:y(gOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(YIe,{}),tooltip:"Text To Image"},img2img:{title:y(fOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(VIe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:y(pFe,{fill:"black",boxSize:"2.5rem"}),workarea:y(hFe,{}),tooltip:"Unified Canvas"},nodes:{title:y(hOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(cOe,{}),tooltip:"Nodes"},postprocess:{title:y(pOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(dOe,{}),tooltip:"Post Processing"},training:{title:y(mFe,{fill:"black",boxSize:"2.5rem"}),workarea:y(gFe,{}),tooltip:"Training"}};function yFe(){ts.txt2img.tooltip=Ht.t("common:text2img"),ts.img2img.tooltip=Ht.t("common:img2img"),ts.unifiedCanvas.tooltip=Ht.t("common:unifiedCanvas"),ts.nodes.tooltip=Ht.t("common:nodes"),ts.postprocess.tooltip=Ht.t("common:postProcessing"),ts.training.tooltip=Ht.t("common:training")}function bFe(){const e=ve(o=>o.options.activeTab),t=ve(o=>o.options.isLightBoxOpen);vFe(yFe);const n=Be();Ze("1",()=>{n(Go(0))}),Ze("2",()=>{n(Go(1))}),Ze("3",()=>{n(Go(2))}),Ze("4",()=>{n(Go(3))}),Ze("5",()=>{n(Go(4))}),Ze("6",()=>{n(Go(5))}),Ze("z",()=>{n(Qu(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y(so,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:y(XV,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y(YV,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return K(qV,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Go(o))},children:[y("div",{className:"app-tabs-list",children:r()}),y(KV,{className:"app-tabs-panels",children:t?y(sNe,{}):i()})]})}var SFe=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 zy(e,t){var n=xFe(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 xFe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=SFe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var wFe=[".DS_Store","Thumbs.db"];function CFe(e){return m1(this,void 0,void 0,function(){return v1(this,function(t){return rS(e)&&_Fe(e.dataTransfer)?[2,TFe(e.dataTransfer,e.type)]:kFe(e)?[2,EFe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,PFe(e)]:[2,[]]})})}function _Fe(e){return rS(e)}function kFe(e){return rS(e)&&rS(e.target)}function rS(e){return typeof e=="object"&&e!==null}function EFe(e){return q8(e.target.files).map(function(t){return zy(t)})}function PFe(e){return m1(this,void 0,void 0,function(){var t;return v1(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 zy(r)})]}})})}function TFe(e,t){return m1(this,void 0,void 0,function(){var n,r;return v1(this,function(i){switch(i.label){case 0:return e.items?(n=q8(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(LFe))]):[3,2];case 1:return r=i.sent(),[2,AN(uK(r))];case 2:return[2,AN(q8(e.files).map(function(o){return zy(o)}))]}})})}function AN(e){return e.filter(function(t){return wFe.indexOf(t.name)===-1})}function q8(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,DN(n)];if(e.sizen)return[!1,DN(n)]}return[!0,null]}function kh(e){return e!=null}function WFe(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 u=hK(l,n),f=ry(u,1),p=f[0],m=pK(l,r,i),v=ry(m,1),b=v[0],x=s?s(l):null;return p&&b&&!x})}function iS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ub(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 BN(e){e.preventDefault()}function GFe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function qFe(e){return e.indexOf("Edge/")!==-1}function YFe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return GFe(e)||qFe(e)}function Nl(){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 dze(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 iT=C.exports.forwardRef(function(e,t){var n=e.children,r=oS(e,eze),i=bK(r),o=i.open,a=oS(i,tze);return C.exports.useImperativeHandle(t,function(){return{open:o}},[o]),y(C.exports.Fragment,{children:n(mr(mr({},a),{},{open:o}))})});iT.displayName="Dropzone";var yK={disabled:!1,getFilesFromEvent:CFe,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};iT.defaultProps=yK;iT.propTypes={children:Fn.exports.func,accept:Fn.exports.objectOf(Fn.exports.arrayOf(Fn.exports.string)),multiple:Fn.exports.bool,preventDropOnDocument:Fn.exports.bool,noClick:Fn.exports.bool,noKeyboard:Fn.exports.bool,noDrag:Fn.exports.bool,noDragEventsBubbling:Fn.exports.bool,minSize:Fn.exports.number,maxSize:Fn.exports.number,maxFiles:Fn.exports.number,disabled:Fn.exports.bool,getFilesFromEvent:Fn.exports.func,onFileDialogCancel:Fn.exports.func,onFileDialogOpen:Fn.exports.func,useFsAccessApi:Fn.exports.bool,autoFocus:Fn.exports.bool,onDragEnter:Fn.exports.func,onDragLeave:Fn.exports.func,onDragOver:Fn.exports.func,onDrop:Fn.exports.func,onDropAccepted:Fn.exports.func,onDropRejected:Fn.exports.func,onError:Fn.exports.func,validator:Fn.exports.func};var Z8={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function bK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=mr(mr({},yK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,p=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,x=t.onFileDialogCancel,E=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,R=t.noKeyboard,I=t.noDrag,D=t.noDragEventsBubbling,B=t.onError,z=t.validator,j=C.exports.useMemo(function(){return ZFe(n)},[n]),Y=C.exports.useMemo(function(){return XFe(n)},[n]),te=C.exports.useMemo(function(){return typeof E=="function"?E:FN},[E]),G=C.exports.useMemo(function(){return typeof x=="function"?x:FN},[x]),$=C.exports.useRef(null),V=C.exports.useRef(null),J=C.exports.useReducer(fze,Z8),Z=zC(J,2),U=Z[0],X=Z[1],le=U.isFocused,fe=U.isFileDialogActive,Se=C.exports.useRef(typeof window<"u"&&window.isSecureContext&&k&&KFe()),Ae=function(){!Se.current&&fe&&setTimeout(function(){if(V.current){var Ne=V.current.files;Ne.length||(X({type:"closeDialog"}),G())}},300)};C.exports.useEffect(function(){return window.addEventListener("focus",Ae,!1),function(){window.removeEventListener("focus",Ae,!1)}},[V,fe,G,Se]);var be=C.exports.useRef([]),ke=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),be.current=[])};C.exports.useEffect(function(){return T&&(document.addEventListener("dragover",BN,!1),document.addEventListener("drop",ke,!1)),function(){T&&(document.removeEventListener("dragover",BN),document.removeEventListener("drop",ke))}},[$,T]),C.exports.useEffect(function(){return!r&&_&&$.current&&$.current.focus(),function(){}},[$,_,r]);var De=C.exports.useCallback(function(Ce){B?B(Ce):console.error(Ce)},[B]),Je=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce),be.current=[].concat(ize(be.current),[Ce.target]),Ub(Ce)&&Promise.resolve(i(Ce)).then(function(Ne){if(!(iS(Ce)&&!D)){var kt=Ne.length,Nt=kt>0&&WFe({files:Ne,accept:j,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=kt>0&&!Nt;X({isDragAccept:Nt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Ce)}}).catch(function(Ne){return De(Ne)})},[i,u,De,D,j,a,o,s,l,z]),Ye=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce);var Ne=Ub(Ce);if(Ne&&Ce.dataTransfer)try{Ce.dataTransfer.dropEffect="copy"}catch(kt){}return Ne&&p&&p(Ce),!1},[p,D]),mt=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce);var Ne=be.current.filter(function(Nt){return $.current&&$.current.contains(Nt)}),kt=Ne.indexOf(Ce.target);kt!==-1&&Ne.splice(kt,1),be.current=Ne,!(Ne.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ub(Ce)&&f&&f(Ce))},[$,f,D]),_t=C.exports.useCallback(function(Ce,Ne){var kt=[],Nt=[];Ce.forEach(function(Te){var Et=hK(Te,j),Ut=zC(Et,2),Ve=Ut[0],ft=Ut[1],un=pK(Te,a,o),ze=zC(un,2),St=ze[0],ct=ze[1],Vt=z?z(Te):null;if(Ve&&St&&!Vt)kt.push(Te);else{var hn=[ft,ct];Vt&&(hn=hn.concat(Vt)),Nt.push({file:Te,errors:hn.filter(function(Er){return Er})})}}),(!s&&kt.length>1||s&&l>=1&&kt.length>l)&&(kt.forEach(function(Te){Nt.push({file:Te,errors:[UFe]})}),kt.splice(0)),X({acceptedFiles:kt,fileRejections:Nt,type:"setFiles"}),m&&m(kt,Nt,Ne),Nt.length>0&&b&&b(Nt,Ne),kt.length>0&&v&&v(kt,Ne)},[X,s,j,a,o,l,m,v,b,z]),dt=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce),be.current=[],Ub(Ce)&&Promise.resolve(i(Ce)).then(function(Ne){iS(Ce)&&!D||_t(Ne,Ce)}).catch(function(Ne){return De(Ne)}),X({type:"reset"})},[i,_t,De,D]),vt=C.exports.useCallback(function(){if(Se.current){X({type:"openDialog"}),te();var Ce={multiple:s,types:Y};window.showOpenFilePicker(Ce).then(function(Ne){return i(Ne)}).then(function(Ne){_t(Ne,null),X({type:"closeDialog"})}).catch(function(Ne){QFe(Ne)?(G(Ne),X({type:"closeDialog"})):JFe(Ne)?(Se.current=!1,V.current?(V.current.value=null,V.current.click()):De(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."))):De(Ne)});return}V.current&&(X({type:"openDialog"}),te(),V.current.value=null,V.current.click())},[X,te,G,k,_t,De,Y,s]),xt=C.exports.useCallback(function(Ce){!$.current||!$.current.isEqualNode(Ce.target)||(Ce.key===" "||Ce.key==="Enter"||Ce.keyCode===32||Ce.keyCode===13)&&(Ce.preventDefault(),vt())},[$,vt]),Le=C.exports.useCallback(function(){X({type:"focus"})},[]),ut=C.exports.useCallback(function(){X({type:"blur"})},[]),Rt=C.exports.useCallback(function(){A||(YFe()?setTimeout(vt,0):vt())},[A,vt]),ot=function(Ne){return r?null:Ne},Ct=function(Ne){return R?null:ot(Ne)},ln=function(Ne){return I?null:ot(Ne)},ue=function(Ne){D&&Ne.stopPropagation()},Ie=C.exports.useMemo(function(){return function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Ce.refKey,kt=Ne===void 0?"ref":Ne,Nt=Ce.role,Te=Ce.onKeyDown,Et=Ce.onFocus,Ut=Ce.onBlur,Ve=Ce.onClick,ft=Ce.onDragEnter,un=Ce.onDragOver,ze=Ce.onDragLeave,St=Ce.onDrop,ct=oS(Ce,nze);return mr(mr(X8({onKeyDown:Ct(Nl(Te,xt)),onFocus:Ct(Nl(Et,Le)),onBlur:Ct(Nl(Ut,ut)),onClick:ot(Nl(Ve,Rt)),onDragEnter:ln(Nl(ft,Je)),onDragOver:ln(Nl(un,Ye)),onDragLeave:ln(Nl(ze,mt)),onDrop:ln(Nl(St,dt)),role:typeof Nt=="string"&&Nt!==""?Nt:"presentation"},kt,$),!r&&!R?{tabIndex:0}:{}),ct)}},[$,xt,Le,ut,Rt,Je,Ye,mt,dt,R,I,r]),We=C.exports.useCallback(function(Ce){Ce.stopPropagation()},[]),Xe=C.exports.useMemo(function(){return function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Ce.refKey,kt=Ne===void 0?"ref":Ne,Nt=Ce.onChange,Te=Ce.onClick,Et=oS(Ce,rze),Ut=X8({accept:j,multiple:s,type:"file",style:{display:"none"},onChange:ot(Nl(Nt,dt)),onClick:ot(Nl(Te,We)),tabIndex:-1},kt,V);return mr(mr({},Ut),Et)}},[V,n,s,dt,r]);return mr(mr({},U),{},{isFocused:le&&!r,getRootProps:Ie,getInputProps:Xe,rootRef:$,inputRef:V,open:ot(vt)})}function fze(e,t){switch(t.type){case"focus":return mr(mr({},e),{},{isFocused:!0});case"blur":return mr(mr({},e),{},{isFocused:!1});case"openDialog":return mr(mr({},Z8),{},{isFileDialogActive:!0});case"closeDialog":return mr(mr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return mr(mr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return mr(mr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return mr({},Z8);default:return e}}function FN(){}const hze=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Ze("esc",()=>{i(!1)}),K("div",{className:"dropzone-container",children:[t&&y("div",{className:"dropzone-overlay is-drag-accept",children:K(Hh,{size:"lg",children:["Upload Image",r]})}),n&&K("div",{className:"dropzone-overlay is-drag-reject",children:[y(Hh,{size:"lg",children:"Invalid Upload"}),y(Hh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},zN=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=_r(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(window.location.origin+"/upload",{method:"POST",body:a})).json();console.log(l);const u={uuid:lg(),category:"user",...l};t(ag({image:u,category:"user"})),o==="unifiedCanvas"?t(Sx(u)):o==="img2img"&&t(C1(u))},pze=e=>{const{children:t}=e,n=Be(),r=ve(_r),i=Ty({}),{t:o}=Ke(),[a,s]=C.exports.useState(!1),{setOpenUploader:l}=rT(),u=C.exports.useCallback(T=>{s(!0);const A=T.errors.reduce((R,I)=>R+` -`+I.message,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),f=C.exports.useCallback(async T=>{n(zN({imageFile:T}))},[n]),p=C.exports.useCallback((T,A)=>{A.forEach(R=>{u(R)}),T.forEach(R=>{f(R)})},[f,u]),{getRootProps:m,getInputProps:v,isDragAccept:b,isDragReject:x,isDragActive:E,open:k}=bK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:p,onDragOver:()=>s(!0),maxFiles:1});l(k),C.exports.useEffect(()=>{const T=A=>{var B;const R=(B=A.clipboardData)==null?void 0:B.items;if(!R)return;const I=[];for(const z of R)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&I.push(z);if(!I.length)return;if(A.stopImmediatePropagation(),I.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=I[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(zN({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return y(zP.Provider,{value:k,children:K("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[y("input",{...v()}),t,E&&a&&y(hze,{isDragAccept:b,isDragReject:x,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},gze=()=>{const e=Be(),t=ve(K8e),n=Ty();C.exports.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(pwe())},[e,n,t])},SK=lt([e=>e.options,e=>e.gallery,_r],(e,t,n)=>{const{shouldPinOptionsPanel:r,shouldShowOptionsPanel:i,shouldHoldOptionsPanelOpen:o,shouldUseCanvasBetaLayout:a}=e,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=t,f=a&&n==="unifiedCanvas",p=!f&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinOptionsPanel:r,shouldShowProcessButtons:!f&&(!r||!i),shouldShowOptionsPanelButton:p,shouldShowOptionsPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),mze=()=>{const e=Be(),{shouldShowOptionsPanel:t,shouldShowOptionsPanelButton:n,shouldShowProcessButtons:r,shouldPinOptionsPanel:i,shouldShowGallery:o,shouldPinGallery:a}=ve(SK),s=()=>{e(Ju(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return Ze("f",()=>{o||t?(e(Ju(!1)),e(Vd(!1))):(e(Ju(!0)),e(Vd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?K("div",{className:"show-hide-button-options",children:[y(Qe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:y(uP,{})}),r&&K(fn,{children:[y(IP,{iconButton:!0}),y(DP,{})]})]}):null},vze=()=>{const e=Be(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowOptionsPanel:i,shouldPinOptionsPanel:o}=ve(SK),a=()=>{e(Vd(!0)),r&&e(vi(!0))};return Ze("f",()=>{t||i?(e(Ju(!1)),e(Vd(!1))):(e(Ju(!0)),e(Vd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?y(Qe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:y(wq,{})}):null};uOe();const yze=()=>(gze(),K("div",{className:"App",children:[K(pze,{children:[y(m8e,{}),K("div",{className:"app-content",children:[y(vLe,{}),y(bFe,{})]}),y("div",{className:"app-console",children:y(lOe,{})})]}),y(mze,{}),y(vze,{})]}));const bze=SF({key:"invokeai-style-cache",prepend:!0});HC.createRoot(document.getElementById("root")).render(y(oe.StrictMode,{children:y(s8e,{store:xG,children:y(OG,{loading:y(XI,{}),persistor:MG,children:y(Lie,{value:bze,children:y(_4e,{children:y(oe.Suspense,{fallback:y(XI,{}),children:y(yze,{})})})})})})}));export{xze as __vite_legacy_guard}; +`.replaceAll("black",e),ABe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ve(LBe),[a,s]=C.exports.useState(null),[l,u]=C.exports.useState(0),f=C.exports.useRef(null),p=C.exports.useCallback(()=>{u(l+1),setTimeout(p,500)},[l]);return C.exports.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=kN(n)},[a,n]),C.exports.useEffect(()=>{!a||(a.src=kN(n))},[a,n]),C.exports.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!gi.exports.isNumber(r.x)||!gi.exports.isNumber(r.y)||!gi.exports.isNumber(o)||!gi.exports.isNumber(i.width)||!gi.exports.isNumber(i.height)?null:y(hc,{ref:f,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:gi.exports.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},OBe=lt([rn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),MBe=e=>{const t=Be(),{isMoveStageKeyHeld:n,stageScale:r}=ve(OBe);return C.exports.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=He.clamp(r*vwe**s,ywe,bwe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Gwe(l)),t(SW(u))},[e,n,r,t])},eT=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},QY=()=>{const e=Be(),t=tl(),n=bG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=F0.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(zwe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(Lwe())}}},RBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),IBe=e=>{const t=Be(),{tool:n,isStaging:r}=ve(RBe),{commitColorUnderCursor:i}=QY();return C.exports.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(V5(!0));return}if(n==="colorPicker"){i();return}const a=eT(e.current);!a||(o.evt.preventDefault(),t(dW(!0)),t(Twe([a.x,a.y])))},[e,n,r,t,i])},DBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),NBe=(e,t)=>{const n=Be(),{tool:r,isDrawing:i,isStaging:o}=ve(DBe);return C.exports.useCallback(()=>{if(r==="move"||o){n(V5(!1));return}if(!t.current&&i&&e.current){const a=eT(e.current);if(!a)return;n(lW([a.x,a.y]))}else t.current=!1;n(dW(!1))},[t,n,i,o,e,r])},BBe=lt([_r,rn,kr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$Be=(e,t,n)=>{const r=Be(),{isDrawing:i,tool:o,isStaging:a}=ve(BBe),{updateColorUnderCursor:s}=QY();return C.exports.useCallback(()=>{if(!e.current)return;const l=eT(e.current);if(!!l){if(r(jwe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(lW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},FBe=()=>{const e=Be();return C.exports.useCallback(()=>{e(Mwe())},[e])},zBe=lt([rn,kr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),jBe=()=>{const e=Be(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ve(zBe);return{handleDragStart:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(V5(!0))},[e,r,n,t]),handleDragMove:C.exports.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(SW(o))},[e,r,n,t]),handleDragEnd:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(V5(!1))},[e,r,n,t])}};var ph=C.exports,HBe=function(t,n,r){const i=ph.useRef("loading"),o=ph.useRef(),[a,s]=ph.useState(0),l=ph.useRef(),u=ph.useRef(),f=ph.useRef();return(l.current!==t||u.current!==n||f.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,f.current=r),ph.useLayoutEffect(function(){if(!t)return;var p=document.createElement("img");function m(){i.current="loaded",o.current=p,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return p.addEventListener("load",m),p.addEventListener("error",v),n&&(p.crossOrigin=n),r&&(p.referrerpolicy=r),p.src=t,function(){p.removeEventListener("load",m),p.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const JY=e=>{const{url:t,x:n,y:r}=e,[i]=HBe(t);return y(ZY,{x:n,y:r,image:i,listening:!1})},VBe=lt([rn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),UBe=()=>{const{objects:e}=ve(VBe);return e?y(fc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(H5(t))return y(JY,{x:t.x,y:t.y,url:t.image.url},n);if(wwe(t)){const r=y(tS,{points:t.points,stroke:t.color?Wh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?y(fc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(Cwe(t))return y(hc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Wh(t.color)},n);if(_we(t))return y(hc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},WBe=lt([rn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),GBe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},qBe=()=>{const{colorMode:e}=uy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ve(WBe),[i,o]=C.exports.useState([]),a=C.exports.useCallback(s=>s/t,[t]);return C.exports.useLayoutEffect(()=>{const s=GBe[e],{width:l,height:u}=r,{x:f,y:p}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(f),y:a(p)}},v={x:Math.ceil(a(f)/64)*64,y:Math.ceil(a(p)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},E={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},k=E.x2-E.x1,_=E.y2-E.y1,T=Math.round(k/64)+1,A=Math.round(_/64)+1,R=He.range(0,T).map(D=>y(tS,{x:E.x1+D*64,y:E.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),I=He.range(0,A).map(D=>y(tS,{x:E.x1,y:E.y1+D*64,points:[0,0,k,0],stroke:s,strokeWidth:1},`y_${D}`));o(R.concat(I))},[t,n,r,e,a]),y(fc,{children:i})},YBe=lt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:He.isEqual}}),KBe=e=>{const{...t}=e,n=ve(YBe),[r,i]=C.exports.useState(null);if(C.exports.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?y(ZY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},dg=e=>Math.round(e*100)/100,XBe=lt([rn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${dg(n)}, ${dg(r)})`}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function ZBe(){const{cursorCoordinatesString:e}=ve(XBe),{t}=Ke();return y("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const QBe=lt([rn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:f},stageScale:p,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b}=e;let x="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(x="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:x,boundingBoxCoordinatesString:`(${dg(u)}, ${dg(f)})`,boundingBoxDimensionsString:`${o}\xD7${a}`,scaledBoundingBoxDimensionsString:`${s}\xD7${l}`,canvasCoordinatesString:`${dg(r)}\xD7${dg(i)}`,canvasDimensionsString:`${t}\xD7${n}`,canvasScaleString:Math.round(p*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),JBe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:f,shouldShowBoundingBox:p}=ve(QBe),{t:m}=Ke();return K("div",{className:"canvas-status-text",children:[y("div",{style:{color:e},children:`${m("unifiedcanvas:activeLayer")}: ${t}`}),y("div",{children:`${m("unifiedcanvas:canvasScale")}: ${u}%`}),p&&y("div",{style:{color:n},children:`${m("unifiedcanvas:boundingBox")}: ${i}`}),a&&y("div",{style:{color:n},children:`${m("unifiedcanvas:scaledBoundingBox")}: ${o}`}),f&&K(fn,{children:[y("div",{children:`${m("unifiedcanvas:boundingBoxPosition")}: ${r}`}),y("div",{children:`${m("unifiedcanvas:canvasDimensions")}: ${l}`}),y("div",{children:`${m("unifiedcanvas:canvasPosition")}: ${s}`}),y(ZBe,{})]})]})},e$e=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),t$e=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ve(e$e);return K(fc,{...t,children:[r&&n&&y(JY,{url:n.image.url,x:o,y:a}),i&&K(fc,{children:[y(hc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),y(hc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},n$e=lt([rn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),r$e=()=>{const e=Be(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ve(n$e),{t:o}=Ke(),a=C.exports.useCallback(()=>{e(fI(!0))},[e]),s=C.exports.useCallback(()=>{e(fI(!1))},[e]);Ze(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ze(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Ze(["enter"],()=>{f()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(Iwe()),u=()=>e(Rwe()),f=()=>e(Awe());return r?y(at,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:K(io,{isAttached:!0,children:[y(Qe,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:y(w8e,{}),onClick:l,"data-selected":!0,isDisabled:t}),y(Qe,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:y(C8e,{}),onClick:u,"data-selected":!0,isDisabled:n}),y(Qe,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:y(aP,{}),onClick:f,"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?y(A8e,{}):y(L8e,{}),onClick:()=>e(Uwe(!i)),"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:y(lP,{}),onClick:()=>e(Q6e(r.image.url)),"data-selected":!0}),y(Qe,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Owe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},i$e=lt(rn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),o$e=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ve(i$e);return K(fc,{children:[y(hc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),y(hc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},a$e=lt([rn,kr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:f,isMovingStage:p,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let x="none";return f==="move"||t?p?x="grabbing":x="grab":o?x=void 0:b&&!a&&(x="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:x,stageDimensions:l,stageScale:r,tool:f,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eK=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:f}=ve(a$e);TBe();const p=C.exports.useRef(null),m=C.exports.useRef(null),v=C.exports.useCallback(z=>{S9e(z),p.current=z},[]),b=C.exports.useCallback(z=>{b9e(z),m.current=z},[]),x=C.exports.useRef({x:0,y:0}),E=C.exports.useRef(!1),k=MBe(p),_=IBe(p),T=NBe(p,E),A=$Be(p,E,x),R=FBe(),{handleDragStart:I,handleDragMove:D,handleDragEnd:B}=jBe();return y("div",{className:"inpainting-canvas-container",children:K("div",{className:"inpainting-canvas-wrapper",children:[K(SBe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:T,onMouseDown:_,onMouseLeave:R,onMouseMove:A,onMouseUp:T,onDragStart:I,onDragMove:D,onDragEnd:B,onContextMenu:z=>z.evt.preventDefault(),onWheel:k,draggable:(l==="move"||u)&&!t,children:[y(hv,{id:"grid",visible:r,children:y(qBe,{})}),y(hv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:y(UBe,{})}),K(hv,{id:"mask",visible:e,listening:!1,children:[y(wBe,{visible:!0,listening:!1}),y(ABe,{listening:!1})]}),y(hv,{children:y(o$e,{})}),K(hv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&y(_Be,{visible:l!=="move",listening:!1}),y(t$e,{visible:u}),f&&y(KBe,{}),y(EBe,{visible:n&&!u})]})]}),y(JBe,{}),y(r$e,{})]})})},s$e=lt([rn,_r,al],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function tK(){const e=Be(),{t}=Ke(),{canUndo:n,activeTabName:r}=ve(s$e),i=()=>{e(qwe())};return Ze(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),y(Qe,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:y(W8e,{}),onClick:i,isDisabled:!n})}const l$e=lt([rn,_r,al],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function nK(){const e=Be(),{canRedo:t,activeTabName:n}=ve(l$e),{t:r}=Ke(),i=()=>{e(Dwe())};return Ze(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),y(Qe,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:y(j8e,{}),onClick:i,isDisabled:!t})}const rK=()=>{const e=ve(kr),t=Be(),{t:n}=Ke(),r=()=>{t(J6e()),t(qE()),t(uW())};return K(CP,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:y(qr,{leftIcon:y(yp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[y("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),y("br",{}),y("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},iK=()=>{const e=ve(kr),t=Be(),{t:n}=Ke();return K(CP,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(uW()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:y(qr,{size:"sm",leftIcon:y(yp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[y("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),y("br",{}),y("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},u$e=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),c$e=()=>{const e=Be(),{t}=Ke(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=ve(u$e);Ze(["n"],()=>{e(W5(!l))},{enabled:!0,preventDefault:!0},[l]);const f=p=>e(W5(p.target.checked));return y(Js,{trigger:"hover",triggerComponent:y(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:y(cP,{})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:p=>e(bW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:p=>e(yW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:f}),y(Qn,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:p=>e(gW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:p=>e(hW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:p=>e(pW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:p=>e(xW(p.target.checked))}),y(Qn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:p=>e(vW(p.target.checked))}),y(iK,{}),y(rK,{})]})})};function ow(){return(ow=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function U8(e){var t=C.exports.useRef(e),n=C.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var l1=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(EN(i.current,E,s.current)):x(!1)},b=function(){return x(!1)};function x(E){var k=l.current,_=W8(i.current),T=E?_.addEventListener:_.removeEventListener;T(k?"touchmove":"mousemove",v),T(k?"touchend":"mouseup",b)}return[function(E){var k=E.nativeEvent,_=i.current;if(_&&(PN(k),!function(A,R){return R&&!u2(A)}(k,l.current)&&_)){if(u2(k)){l.current=!0;var T=k.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(EN(_,k,s.current)),x(!0)}},function(E){var k=E.which||E.keyCode;k<37||k>40||(E.preventDefault(),a({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},x]},[a,o]),f=u[0],p=u[1],m=u[2];return C.exports.useEffect(function(){return m},[m]),y("div",{...ow({},r,{onTouchStart:f,onMouseDown:f,className:"react-colorful__interactive",ref:i,onKeyDown:p,tabIndex:0,role:"slider"})})}),aw=function(e){return e.filter(Boolean).join(" ")},nT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=aw(["react-colorful__pointer",e.className]);return y("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:y("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},Co=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},aK=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Co(e.h),s:Co(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Co(i/2),a:Co(r,2)}},G8=function(e){var t=aK(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},FC=function(e){var t=aK(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},d$e=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),u=o%6;return{r:Co(255*[r,s,a,a,l,r][u]),g:Co(255*[l,r,r,s,a,a][u]),b:Co(255*[a,a,l,r,r,s][u]),a:Co(i,2)}},f$e=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:Co(60*(s<0?s+6:s)),s:Co(o?a/o*100:0),v:Co(o/255*100),a:i}},h$e=oe.memo(function(e){var t=e.hue,n=e.onChange,r=aw(["react-colorful__hue",e.className]);return oe.createElement("div",{className:r},oe.createElement(tT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:l1(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":Co(t),"aria-valuemax":"360","aria-valuemin":"0"},oe.createElement(nT,{className:"react-colorful__hue-pointer",left:t/360,color:G8({h:t,s:100,v:100,a:1})})))}),p$e=oe.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:G8({h:t.h,s:100,v:100,a:1})};return oe.createElement("div",{className:"react-colorful__saturation",style:r},oe.createElement(tT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:l1(t.s+100*i.left,0,100),v:l1(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Co(t.s)+"%, Brightness "+Co(t.v)+"%"},oe.createElement(nT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:G8(t)})))}),sK=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function g$e(e,t,n){var r=U8(n),i=C.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=C.exports.useRef({color:t,hsva:o});C.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),C.exports.useEffect(function(){var u;sK(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=C.exports.useCallback(function(u){a(function(f){return Object.assign({},f,u)})},[]);return[o,l]}var m$e=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,v$e=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},TN=new Map,y$e=function(e){m$e(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!TN.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}`,TN.set(t,n);var r=v$e();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},b$e=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+FC(Object.assign({},n,{a:0}))+", "+FC(Object.assign({},n,{a:1}))+")"},o=aw(["react-colorful__alpha",t]),a=Co(100*n.a);return oe.createElement("div",{className:o},y("div",{className:"react-colorful__alpha-gradient",style:i}),oe.createElement(tT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:l1(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},oe.createElement(nT,{className:"react-colorful__alpha-pointer",left:n.a,color:FC(n)})))},S$e=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=oK(e,["className","colorModel","color","onChange"]),s=C.exports.useRef(null);y$e(s);var l=g$e(n,i,o),u=l[0],f=l[1],p=aw(["react-colorful",t]);return oe.createElement("div",ow({},a,{ref:s,className:p}),y(p$e,{hsva:u,onChange:f}),y(h$e,{hue:u.h,onChange:f}),oe.createElement(b$e,{hsva:u,onChange:f,className:"react-colorful__last-control"}))},x$e={defaultColor:{r:0,g:0,b:0,a:1},toHsva:f$e,fromHsva:d$e,equal:sK},w$e=function(e){return oe.createElement(S$e,ow({},e,{colorModel:x$e}))};const nS=e=>{const{styleClass:t,...n}=e;return y(w$e,{className:`invokeai__color-picker ${t}`,...n})},C$e=lt([rn,kr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Wh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),_$e=()=>{const e=Be(),{t}=Ke(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=ve(C$e);Ze(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Ze(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Ze(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(U5(n==="mask"?"base":"mask"))},l=()=>e(GE()),u=()=>e(Oy(!i));return y(Js,{trigger:"hover",triggerComponent:y(io,{children:y(Qe,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:y(D8e,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),y(Qn,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:f=>e(mW(f.target.checked))}),y(nS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:f=>e(fW(f))}),K(qr,{size:"sm",leftIcon:y(yp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},k$e=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),f=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(u)},p=e.toDataURL(f);return e.scale(i),{dataURL:p,boundingBox:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(l),height:Math.round(u)}}},E$e=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},P$e=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");!o||(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},T$e={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Rd=(e=T$e)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(gwe("Exporting Image")),t(sg(!1));const u=n(),{stageScale:f,boundingBoxCoordinates:p,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=tl();if(!b){t(Ws(!1)),t(sg(!0));return}const{dataURL:x,boundingBox:E}=k$e(b,f,v,i?{...p,...m}:void 0);if(!x){t(Ws(!1)),t(sg(!0));return}const k=new FormData;k.append("data",JSON.stringify({dataURL:x,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(window.location.origin+"/upload",{method:"POST",body:k})).json(),{url:A,width:R,height:I}=T,D={uuid:lg(),category:o?"result":"user",...T};a&&(E$e(A),t(Rh({title:Ht.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(P$e(A,R,I),t(Rh({title:Ht.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(ag({image:D,category:"result"})),t(Rh({title:Ht.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Hwe({kind:"image",layer:"base",...E,image:D})),t(Rh({title:Ht.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(Ws(!1)),t(_4(Ht.t("common:statusConnected"))),t(sg(!0))},L$e=lt([rn,kr,al],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),A$e=()=>{const e=Be(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ve(L$e),{t:o}=Ke();Ze(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Ze(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ze(["delete","backspace"],()=>{f()},{enabled:()=>!i,preventDefault:!0}),Ze(["BracketLeft"],()=>{e(Bg(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["BracketRight"],()=>{e(Bg(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ze(["shift+BracketLeft"],()=>{e(Ng({...n,a:He.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ze(["shift+BracketRight"],()=>{e(Ng({...n,a:He.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(iu("brush")),s=()=>e(iu("eraser")),l=()=>e(iu("colorPicker")),u=()=>e(sW()),f=()=>e(aW());return K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:y(UG,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),y(Qe,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:y(zG,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),y(Qe,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y(HG,{}),isDisabled:i,onClick:u}),y(Qe,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y(Iy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:f}),y(Qe,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:y(jG,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:y(uP,{})}),children:K(at,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[y(at,{gap:"1rem",justifyContent:"space-between",children:y(Zo,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:p=>e(Bg(p)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:p=>e(Ng(p))})]})})]})};let LN;const rT=()=>({setOpenUploader:e=>{e&&(LN=e)},openUploader:LN}),O$e=lt([al,rn,kr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),M$e=()=>{const e=Be(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ve(O$e),s=tl(),{t:l}=Ke(),{openUploader:u}=rT();Ze(["v"],()=>{f()},{enabled:()=>!n,preventDefault:!0},[]),Ze(["r"],()=>{p()},{enabled:()=>!0,preventDefault:!0},[s]),Ze(["shift+m"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+s"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["meta+c","ctrl+c"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ze(["shift+d"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]);const f=()=>e(iu("move")),p=()=>{const _=tl();if(!_)return;const T=_.getClientRect({skipTransform:!0});e(cW({contentRect:T}))},m=()=>{e(qE()),e(bx())},v=()=>{e(Rd({cropVisible:!1,shouldSetAsInitialImage:!0}))},b=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},x=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},E=()=>{e(Rd({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},k=_=>{const T=_.target.value;e(U5(T)),T==="mask"&&!r&&e(Oy(!0))};return K("div",{className:"inpainting-settings",children:[y(nl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:iW,onChange:k,isDisabled:n}),y(_$e,{}),y(A$e,{}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:y(BG,{}),"data-selected":o==="move"||n,onClick:f}),y(Qe,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:y(FG,{}),onClick:p})]}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y(VG,{}),onClick:v,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y(lP,{}),onClick:b,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y(Ry,{}),onClick:x,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y(sP,{}),onClick:E,isDisabled:n})]}),K(io,{isAttached:!0,children:[y(tK,{}),y(nK,{})]}),K(io,{isAttached:!0,children:[y(Qe,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:y(Nx,{}),onClick:u,isDisabled:n}),y(Qe,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:y(yp,{}),onClick:m,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),y(io,{isAttached:!0,children:y(c$e,{})})]})},R$e=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),I$e=()=>{const e=Be(),{doesCanvasNeedScaling:t}=ve(R$e);return C.exports.useLayoutEffect(()=>{e(vi(!0));const n=He.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y("div",{className:"workarea-single-view",children:y("div",{className:"workarea-split-view-left",children:K("div",{className:"inpainting-main-area",children:[y(M$e,{}),y("div",{className:"inpainting-canvas-area",children:t?y(WY,{}):y(eK,{})})]})})})},D$e=lt([rn,kr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function N$e(){const e=Be(),{t}=Ke(),{layer:n,isMaskEnabled:r,isStaging:i}=ve(D$e),o=()=>{e(U5(n==="mask"?"base":"mask"))};Ze(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(U5(l)),l==="mask"&&!r&&e(Oy(!0))};return y(nl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:iW,onChange:a,isDisabled:i})}const B$e=lt([rn,kr,al],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),$$e=()=>{const e=Be(),{t}=Ke(),{tool:n,isStaging:r}=ve(B$e);Ze(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Ze(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Ze(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Ze(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(iu("brush")),o=()=>e(iu("eraser")),a=()=>e(iu("colorPicker")),s=()=>e(sW()),l=()=>e(aW());return K(at,{flexDirection:"column",gap:"0.5rem",children:[K(io,{children:[y(Qe,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:y(UG,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),y(Qe,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:y(zG,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),K(io,{children:[y(Qe,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:y(HG,{}),isDisabled:r,onClick:s}),y(Qe,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:y(Iy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),y(Qe,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:y(jG,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},F$e=lt([rn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),z$e=()=>{const e=Be(),{t}=Ke(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=ve(F$e);return y(Js,{trigger:"hover",triggerComponent:y(Qe,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:y(cP,{})}),children:K(at,{direction:"column",gap:"0.5rem",children:[y(Qn,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(bW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(hW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(pW(a.target.checked))}),y(Qn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(vW(a.target.checked))}),y(iK,{}),y(rK,{})]})})};function j$e(){const e=ve(o=>o.canvas.tool),t=ve(kr),n=Be(),{t:r}=Ke();Ze(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(iu("move"));return y(Qe,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:y(BG,{}),"data-selected":e==="move"||t,onClick:i})}function H$e(){const e=tl(),t=Be(),{t:n}=Ke();Ze(["r"],()=>{r()},{enabled:()=>!0,preventDefault:!0},[e]);const r=()=>{const i=tl();if(!i)return;const o=i.getClientRect({skipTransform:!0});t(cW({contentRect:o}))};return y(Qe,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:y(FG,{}),onClick:r})}function V$e(){const e=Be(),{t}=Ke(),n=tl(),r=ve(kr),i=ve(a=>a.system.isProcessing);Ze(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Rd({cropVisible:!1,shouldSetAsInitialImage:!0}))};return y(Qe,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:y(VG,{}),onClick:o,isDisabled:r})}function U$e(){const e=ve(kr),t=tl(),n=ve(s=>s.system.isProcessing),r=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Be(),{t:o}=Ke();Ze(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Rd({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return y(Qe,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:y(lP,{}),onClick:a,isDisabled:e})}function W$e(){const e=ve(kr),t=tl(),n=ve(s=>s.system.isProcessing),r=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Be(),{t:o}=Ke();Ze(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Rd({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return y(Qe,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:y(Ry,{}),onClick:a,isDisabled:e})}function G$e(){const e=Be(),{t}=Ke(),n=tl(),r=ve(kr),i=ve(s=>s.system.isProcessing),o=ve(s=>s.canvas.shouldCropToBoundingBoxOnSave);Ze(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Rd({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return y(Qe,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:y(sP,{}),onClick:a,isDisabled:r})}function q$e(){const e=ve(kr),{openUploader:t}=rT(),{t:n}=Ke();return y(Qe,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:y(Nx,{}),onClick:t,isDisabled:e})}function Y$e(){const e=Be(),{t}=Ke(),n=ve(kr),r=()=>{e(qE()),e(bx())};return y(Qe,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:y(yp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function K$e(){const e=ve(i=>i.options.shouldPinOptionsPanel),t=Be(),{t:n}=Ke(),r=()=>{t(Ju(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return K(at,{flexDirection:"column",gap:"0.5rem",children:[y(Qe,{tooltip:`${n("options:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("options:showOptionsPanel"),onClick:r,children:y(uP,{})}),y(at,{children:y(IP,{iconButton:!0})}),y(at,{children:y(DP,{width:"100%",height:"40px"})})]})}const X$e=()=>{const e=ve(t=>t.options.shouldShowOptionsPanel);return K(at,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[y(N$e,{}),y($$e,{}),K(at,{gap:"0.5rem",children:[y(j$e,{}),y(H$e,{})]}),K(at,{columnGap:"0.5rem",children:[y(V$e,{}),y(U$e,{})]}),K(at,{columnGap:"0.5rem",children:[y(W$e,{}),y(G$e,{})]}),K(at,{gap:"0.5rem",children:[y(tK,{}),y(nK,{})]}),K(at,{gap:"0.5rem",children:[y(q$e,{}),y(Y$e,{})]}),y(z$e,{}),!e&&y(K$e,{})]})};function Z$e(){const e=Be(),t=ve(i=>i.canvas.brushSize),{t:n}=Ke(),r=ve(kr);return Ze(["BracketLeft"],()=>{e(Bg(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Ze(["BracketRight"],()=>{e(Bg(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),y(Zo,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Bg(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}const Q$e=lt([rn,kr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function J$e(){const e=Be(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ve(Q$e),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ze(["shift+BracketLeft"],()=>{e(Ng({...t,a:He.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ze(["shift+BracketRight"],()=>{e(Ng({...t,a:He.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),y(Js,{trigger:"hover",triggerComponent:y(rl,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:K(at,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Ng(a))}),r==="mask"&&y(nS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(fW(a))})]})})}function lK(){return K(at,{columnGap:"1rem",alignItems:"center",children:[y(Z$e,{}),y(J$e,{})]})}function eFe(){const e=Be(),t=ve(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(xW(r.target.checked))})}function tFe(){return K(at,{gap:"1rem",alignItems:"center",children:[y(lK,{}),y(eFe,{})]})}function nFe(){const e=Be(),{t}=Ke();return y(qr,{size:"sm",leftIcon:y(yp,{}),onClick:()=>e(GE()),tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function rFe(){const e=ve(i=>i.canvas.isMaskEnabled),t=Be(),{t:n}=Ke(),r=()=>t(Oy(!e));return y(Qn,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function iFe(){const e=Be(),{t}=Ke(),n=ve(r=>r.canvas.shouldPreserveMaskedArea);return y(Qn,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(mW(r.target.checked))})}function oFe(){return K(at,{gap:"1rem",alignItems:"center",children:[y(lK,{}),y(rFe,{}),y(iFe,{}),y(nFe,{})]})}function aFe(){const e=ve(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Be(),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(gW(r.target.checked))})}function sFe(){const e=ve(r=>r.canvas.shouldShowGrid),t=Be(),{t:n}=Ke();return y(Qn,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(yW(r.target.checked))})}function lFe(){const e=ve(i=>i.canvas.shouldSnapToGrid),t=Be(),{t:n}=Ke(),r=i=>t(W5(i.target.checked));return y(Qn,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function uFe(){return K(at,{alignItems:"center",gap:"1rem",children:[y(sFe,{}),y(lFe,{}),y(aFe,{})]})}const cFe=lt([rn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function dFe(){const{tool:e,layer:t}=ve(cFe);return K(at,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&y(tFe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&y(oFe,{}),e=="move"&&y(uFe,{})]})}const fFe=lt([rn],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),hFe=()=>{const e=Be(),{doesCanvasNeedScaling:t}=ve(fFe);return C.exports.useLayoutEffect(()=>{e(vi(!0));const n=He.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),y("div",{className:"workarea-single-view",children:K(at,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[y(X$e,{}),K(at,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[y(dFe,{}),t?y(WY,{}):y(eK,{})]})]})})};function pFe(){const e=ve(t=>t.options.shouldUseCanvasBetaLayout);return y(qP,{optionsPanel:y(vNe,{}),styleClass:"inpainting-workarea-overrides",children:e?y(hFe,{}):y(I$e,{})})}const gFe=bt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:y("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.787L-0,2766.03C-0,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.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.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.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.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.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.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.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.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.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.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.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.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.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,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.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function mFe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:training")}),K("p",{children:[e("common:trainingDesc1"),y("br",{}),y("br",{}),e("common:trainingDesc2")]})]})}const vFe=bt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:y("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.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.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})});function yFe(e){const{i18n:t}=Ke(),n=localStorage.getItem("i18nextLng");oe.useEffect(()=>{e()},[e]),oe.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const ts={txt2img:{title:y(gOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(KIe,{}),tooltip:"Text To Image"},img2img:{title:y(fOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(UIe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:y(gFe,{fill:"black",boxSize:"2.5rem"}),workarea:y(pFe,{}),tooltip:"Unified Canvas"},nodes:{title:y(hOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(cOe,{}),tooltip:"Nodes"},postprocess:{title:y(pOe,{fill:"black",boxSize:"2.5rem"}),workarea:y(dOe,{}),tooltip:"Post Processing"},training:{title:y(vFe,{fill:"black",boxSize:"2.5rem"}),workarea:y(mFe,{}),tooltip:"Training"}};function bFe(){ts.txt2img.tooltip=Ht.t("common:text2img"),ts.img2img.tooltip=Ht.t("common:img2img"),ts.unifiedCanvas.tooltip=Ht.t("common:unifiedCanvas"),ts.nodes.tooltip=Ht.t("common:nodes"),ts.postprocess.tooltip=Ht.t("common:postProcessing"),ts.training.tooltip=Ht.t("common:training")}function SFe(){const e=ve(o=>o.options.activeTab),t=ve(o=>o.options.isLightBoxOpen);yFe(bFe);const n=Be();Ze("1",()=>{n(Go(0))}),Ze("2",()=>{n(Go(1))}),Ze("3",()=>{n(Go(2))}),Ze("4",()=>{n(Go(3))}),Ze("5",()=>{n(Go(4))}),Ze("6",()=>{n(Go(5))}),Ze("z",()=>{n(Qu(!t))},[t]);const r=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y(so,{hasArrow:!0,label:ts[a].tooltip,placement:"right",children:y(XV,{children:ts[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(ts).forEach(a=>{o.push(y(YV,{className:"app-tabs-panel",children:ts[a].workarea},a))}),o};return K(qV,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Go(o))},children:[y("div",{className:"app-tabs-list",children:r()}),y(KV,{className:"app-tabs-panels",children:t?y(lNe,{}):i()})]})}var xFe=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 zy(e,t){var n=wFe(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 wFe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=xFe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var CFe=[".DS_Store","Thumbs.db"];function _Fe(e){return m1(this,void 0,void 0,function(){return v1(this,function(t){return rS(e)&&kFe(e.dataTransfer)?[2,LFe(e.dataTransfer,e.type)]:EFe(e)?[2,PFe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,TFe(e)]:[2,[]]})})}function kFe(e){return rS(e)}function EFe(e){return rS(e)&&rS(e.target)}function rS(e){return typeof e=="object"&&e!==null}function PFe(e){return q8(e.target.files).map(function(t){return zy(t)})}function TFe(e){return m1(this,void 0,void 0,function(){var t;return v1(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 zy(r)})]}})})}function LFe(e,t){return m1(this,void 0,void 0,function(){var n,r;return v1(this,function(i){switch(i.label){case 0:return e.items?(n=q8(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(AFe))]):[3,2];case 1:return r=i.sent(),[2,AN(uK(r))];case 2:return[2,AN(q8(e.files).map(function(o){return zy(o)}))]}})})}function AN(e){return e.filter(function(t){return CFe.indexOf(t.name)===-1})}function q8(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,DN(n)];if(e.sizen)return[!1,DN(n)]}return[!0,null]}function kh(e){return e!=null}function GFe(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 u=hK(l,n),f=ry(u,1),p=f[0],m=pK(l,r,i),v=ry(m,1),b=v[0],x=s?s(l):null;return p&&b&&!x})}function iS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ub(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 BN(e){e.preventDefault()}function qFe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YFe(e){return e.indexOf("Edge/")!==-1}function KFe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return qFe(e)||YFe(e)}function Nl(){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 fze(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 iT=C.exports.forwardRef(function(e,t){var n=e.children,r=oS(e,tze),i=bK(r),o=i.open,a=oS(i,nze);return C.exports.useImperativeHandle(t,function(){return{open:o}},[o]),y(C.exports.Fragment,{children:n(mr(mr({},a),{},{open:o}))})});iT.displayName="Dropzone";var yK={disabled:!1,getFilesFromEvent:_Fe,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};iT.defaultProps=yK;iT.propTypes={children:Fn.exports.func,accept:Fn.exports.objectOf(Fn.exports.arrayOf(Fn.exports.string)),multiple:Fn.exports.bool,preventDropOnDocument:Fn.exports.bool,noClick:Fn.exports.bool,noKeyboard:Fn.exports.bool,noDrag:Fn.exports.bool,noDragEventsBubbling:Fn.exports.bool,minSize:Fn.exports.number,maxSize:Fn.exports.number,maxFiles:Fn.exports.number,disabled:Fn.exports.bool,getFilesFromEvent:Fn.exports.func,onFileDialogCancel:Fn.exports.func,onFileDialogOpen:Fn.exports.func,useFsAccessApi:Fn.exports.bool,autoFocus:Fn.exports.bool,onDragEnter:Fn.exports.func,onDragLeave:Fn.exports.func,onDragOver:Fn.exports.func,onDrop:Fn.exports.func,onDropAccepted:Fn.exports.func,onDropRejected:Fn.exports.func,onError:Fn.exports.func,validator:Fn.exports.func};var Z8={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function bK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=mr(mr({},yK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,p=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,x=t.onFileDialogCancel,E=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,R=t.noKeyboard,I=t.noDrag,D=t.noDragEventsBubbling,B=t.onError,z=t.validator,j=C.exports.useMemo(function(){return QFe(n)},[n]),Y=C.exports.useMemo(function(){return ZFe(n)},[n]),te=C.exports.useMemo(function(){return typeof E=="function"?E:FN},[E]),G=C.exports.useMemo(function(){return typeof x=="function"?x:FN},[x]),$=C.exports.useRef(null),V=C.exports.useRef(null),J=C.exports.useReducer(hze,Z8),Z=zC(J,2),U=Z[0],X=Z[1],le=U.isFocused,fe=U.isFileDialogActive,Se=C.exports.useRef(typeof window<"u"&&window.isSecureContext&&k&&XFe()),Ae=function(){!Se.current&&fe&&setTimeout(function(){if(V.current){var Ne=V.current.files;Ne.length||(X({type:"closeDialog"}),G())}},300)};C.exports.useEffect(function(){return window.addEventListener("focus",Ae,!1),function(){window.removeEventListener("focus",Ae,!1)}},[V,fe,G,Se]);var be=C.exports.useRef([]),ke=function(Ne){$.current&&$.current.contains(Ne.target)||(Ne.preventDefault(),be.current=[])};C.exports.useEffect(function(){return T&&(document.addEventListener("dragover",BN,!1),document.addEventListener("drop",ke,!1)),function(){T&&(document.removeEventListener("dragover",BN),document.removeEventListener("drop",ke))}},[$,T]),C.exports.useEffect(function(){return!r&&_&&$.current&&$.current.focus(),function(){}},[$,_,r]);var De=C.exports.useCallback(function(Ce){B?B(Ce):console.error(Ce)},[B]),Je=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce),be.current=[].concat(oze(be.current),[Ce.target]),Ub(Ce)&&Promise.resolve(i(Ce)).then(function(Ne){if(!(iS(Ce)&&!D)){var kt=Ne.length,Nt=kt>0&&GFe({files:Ne,accept:j,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Te=kt>0&&!Nt;X({isDragAccept:Nt,isDragReject:Te,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Ce)}}).catch(function(Ne){return De(Ne)})},[i,u,De,D,j,a,o,s,l,z]),Ye=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce);var Ne=Ub(Ce);if(Ne&&Ce.dataTransfer)try{Ce.dataTransfer.dropEffect="copy"}catch(kt){}return Ne&&p&&p(Ce),!1},[p,D]),mt=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce);var Ne=be.current.filter(function(Nt){return $.current&&$.current.contains(Nt)}),kt=Ne.indexOf(Ce.target);kt!==-1&&Ne.splice(kt,1),be.current=Ne,!(Ne.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ub(Ce)&&f&&f(Ce))},[$,f,D]),_t=C.exports.useCallback(function(Ce,Ne){var kt=[],Nt=[];Ce.forEach(function(Te){var Et=hK(Te,j),Ut=zC(Et,2),Ve=Ut[0],ft=Ut[1],un=pK(Te,a,o),ze=zC(un,2),St=ze[0],ct=ze[1],Vt=z?z(Te):null;if(Ve&&St&&!Vt)kt.push(Te);else{var hn=[ft,ct];Vt&&(hn=hn.concat(Vt)),Nt.push({file:Te,errors:hn.filter(function(Er){return Er})})}}),(!s&&kt.length>1||s&&l>=1&&kt.length>l)&&(kt.forEach(function(Te){Nt.push({file:Te,errors:[WFe]})}),kt.splice(0)),X({acceptedFiles:kt,fileRejections:Nt,type:"setFiles"}),m&&m(kt,Nt,Ne),Nt.length>0&&b&&b(Nt,Ne),kt.length>0&&v&&v(kt,Ne)},[X,s,j,a,o,l,m,v,b,z]),dt=C.exports.useCallback(function(Ce){Ce.preventDefault(),Ce.persist(),ue(Ce),be.current=[],Ub(Ce)&&Promise.resolve(i(Ce)).then(function(Ne){iS(Ce)&&!D||_t(Ne,Ce)}).catch(function(Ne){return De(Ne)}),X({type:"reset"})},[i,_t,De,D]),vt=C.exports.useCallback(function(){if(Se.current){X({type:"openDialog"}),te();var Ce={multiple:s,types:Y};window.showOpenFilePicker(Ce).then(function(Ne){return i(Ne)}).then(function(Ne){_t(Ne,null),X({type:"closeDialog"})}).catch(function(Ne){JFe(Ne)?(G(Ne),X({type:"closeDialog"})):eze(Ne)?(Se.current=!1,V.current?(V.current.value=null,V.current.click()):De(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."))):De(Ne)});return}V.current&&(X({type:"openDialog"}),te(),V.current.value=null,V.current.click())},[X,te,G,k,_t,De,Y,s]),xt=C.exports.useCallback(function(Ce){!$.current||!$.current.isEqualNode(Ce.target)||(Ce.key===" "||Ce.key==="Enter"||Ce.keyCode===32||Ce.keyCode===13)&&(Ce.preventDefault(),vt())},[$,vt]),Le=C.exports.useCallback(function(){X({type:"focus"})},[]),ut=C.exports.useCallback(function(){X({type:"blur"})},[]),Rt=C.exports.useCallback(function(){A||(KFe()?setTimeout(vt,0):vt())},[A,vt]),ot=function(Ne){return r?null:Ne},Ct=function(Ne){return R?null:ot(Ne)},ln=function(Ne){return I?null:ot(Ne)},ue=function(Ne){D&&Ne.stopPropagation()},Ie=C.exports.useMemo(function(){return function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Ce.refKey,kt=Ne===void 0?"ref":Ne,Nt=Ce.role,Te=Ce.onKeyDown,Et=Ce.onFocus,Ut=Ce.onBlur,Ve=Ce.onClick,ft=Ce.onDragEnter,un=Ce.onDragOver,ze=Ce.onDragLeave,St=Ce.onDrop,ct=oS(Ce,rze);return mr(mr(X8({onKeyDown:Ct(Nl(Te,xt)),onFocus:Ct(Nl(Et,Le)),onBlur:Ct(Nl(Ut,ut)),onClick:ot(Nl(Ve,Rt)),onDragEnter:ln(Nl(ft,Je)),onDragOver:ln(Nl(un,Ye)),onDragLeave:ln(Nl(ze,mt)),onDrop:ln(Nl(St,dt)),role:typeof Nt=="string"&&Nt!==""?Nt:"presentation"},kt,$),!r&&!R?{tabIndex:0}:{}),ct)}},[$,xt,Le,ut,Rt,Je,Ye,mt,dt,R,I,r]),We=C.exports.useCallback(function(Ce){Ce.stopPropagation()},[]),Xe=C.exports.useMemo(function(){return function(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=Ce.refKey,kt=Ne===void 0?"ref":Ne,Nt=Ce.onChange,Te=Ce.onClick,Et=oS(Ce,ize),Ut=X8({accept:j,multiple:s,type:"file",style:{display:"none"},onChange:ot(Nl(Nt,dt)),onClick:ot(Nl(Te,We)),tabIndex:-1},kt,V);return mr(mr({},Ut),Et)}},[V,n,s,dt,r]);return mr(mr({},U),{},{isFocused:le&&!r,getRootProps:Ie,getInputProps:Xe,rootRef:$,inputRef:V,open:ot(vt)})}function hze(e,t){switch(t.type){case"focus":return mr(mr({},e),{},{isFocused:!0});case"blur":return mr(mr({},e),{},{isFocused:!1});case"openDialog":return mr(mr({},Z8),{},{isFileDialogActive:!0});case"closeDialog":return mr(mr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return mr(mr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return mr(mr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return mr({},Z8);default:return e}}function FN(){}const pze=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Ze("esc",()=>{i(!1)}),K("div",{className:"dropzone-container",children:[t&&y("div",{className:"dropzone-overlay is-drag-accept",children:K(Hh,{size:"lg",children:["Upload Image",r]})}),n&&K("div",{className:"dropzone-overlay is-drag-reject",children:[y(Hh,{size:"lg",children:"Invalid Upload"}),y(Hh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},zN=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=_r(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(window.location.origin+"/upload",{method:"POST",body:a})).json();console.log(l);const u={uuid:lg(),category:"user",...l};t(ag({image:u,category:"user"})),o==="unifiedCanvas"?t(Sx(u)):o==="img2img"&&t(C1(u))},gze=e=>{const{children:t}=e,n=Be(),r=ve(_r),i=Ty({}),{t:o}=Ke(),[a,s]=C.exports.useState(!1),{setOpenUploader:l}=rT(),u=C.exports.useCallback(T=>{s(!0);const A=T.errors.reduce((R,I)=>R+` +`+I.message,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),f=C.exports.useCallback(async T=>{n(zN({imageFile:T}))},[n]),p=C.exports.useCallback((T,A)=>{A.forEach(R=>{u(R)}),T.forEach(R=>{f(R)})},[f,u]),{getRootProps:m,getInputProps:v,isDragAccept:b,isDragReject:x,isDragActive:E,open:k}=bK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:p,onDragOver:()=>s(!0),maxFiles:1});l(k),C.exports.useEffect(()=>{const T=A=>{var B;const R=(B=A.clipboardData)==null?void 0:B.items;if(!R)return;const I=[];for(const z of R)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&I.push(z);if(!I.length)return;if(A.stopImmediatePropagation(),I.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=I[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(zN({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${ts[r].tooltip}`:"";return y(zP.Provider,{value:k,children:K("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[y("input",{...v()}),t,E&&a&&y(pze,{isDragAccept:b,isDragReject:x,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},mze=()=>{const e=Be(),t=ve(K8e),n=Ty();C.exports.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(pwe())},[e,n,t])},SK=lt([e=>e.options,e=>e.gallery,_r],(e,t,n)=>{const{shouldPinOptionsPanel:r,shouldShowOptionsPanel:i,shouldHoldOptionsPanelOpen:o,shouldUseCanvasBetaLayout:a}=e,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=t,f=a&&n==="unifiedCanvas",p=!f&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinOptionsPanel:r,shouldShowProcessButtons:!f&&(!r||!i),shouldShowOptionsPanelButton:p,shouldShowOptionsPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),vze=()=>{const e=Be(),{shouldShowOptionsPanel:t,shouldShowOptionsPanelButton:n,shouldShowProcessButtons:r,shouldPinOptionsPanel:i,shouldShowGallery:o,shouldPinGallery:a}=ve(SK),s=()=>{e(Ju(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return Ze("f",()=>{o||t?(e(Ju(!1)),e(Vd(!1))):(e(Ju(!0)),e(Vd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?K("div",{className:"show-hide-button-options",children:[y(Qe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:y(uP,{})}),r&&K(fn,{children:[y(IP,{iconButton:!0}),y(DP,{})]})]}):null},yze=()=>{const e=Be(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowOptionsPanel:i,shouldPinOptionsPanel:o}=ve(SK),a=()=>{e(Vd(!0)),r&&e(vi(!0))};return Ze("f",()=>{t||i?(e(Ju(!1)),e(Vd(!1))):(e(Ju(!0)),e(Vd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?y(Qe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:y(wq,{})}):null};uOe();const bze=()=>(mze(),K("div",{className:"App",children:[K(gze,{children:[y(m8e,{}),K("div",{className:"app-content",children:[y(vLe,{}),y(SFe,{})]}),y("div",{className:"app-console",children:y(lOe,{})})]}),y(vze,{}),y(yze,{})]}));const Sze=SF({key:"invokeai-style-cache",prepend:!0});HC.createRoot(document.getElementById("root")).render(y(oe.StrictMode,{children:y(s8e,{store:xG,children:y(OG,{loading:y(XI,{}),persistor:MG,children:y(Lie,{value:Sze,children:y(_4e,{children:y(oe.Suspense,{fallback:y(XI,{}),children:y(bze,{})})})})})})}));export{wze as __vite_legacy_guard}; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 5c90a6669d..7c448efecb 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ InvokeAI - A Stable Diffusion Toolkit - + @@ -18,6 +18,6 @@ - + diff --git a/frontend/dist/locales/common/de.json b/frontend/dist/locales/common/de.json index b6c396356e..a1b1a12739 100644 --- a/frontend/dist/locales/common/de.json +++ b/frontend/dist/locales/common/de.json @@ -15,6 +15,7 @@ "langPortuguese": "Portugiesisch", "langFrench": "Französich", "langGerman": "Deutsch", + "langSpanish": "Spanisch", "text2img": "Text zu Bild", "img2img": "Bild zu Bild", "unifiedCanvas": "Unified Canvas", diff --git a/frontend/dist/locales/common/en.json b/frontend/dist/locales/common/en.json index 2faf983696..aed5882710 100644 --- a/frontend/dist/locales/common/en.json +++ b/frontend/dist/locales/common/en.json @@ -18,6 +18,7 @@ "langFrench": "French", "langPolish": "Polish", "langSimplifiedChinese": "Simplified Chinese", + "langSpanish": "Spanish", "text2img": "Text To Image", "img2img": "Image To Image", "unifiedCanvas": "Unified Canvas", diff --git a/frontend/dist/locales/common/es.json b/frontend/dist/locales/common/es.json new file mode 100644 index 0000000000..f4259cdaf2 --- /dev/null +++ b/frontend/dist/locales/common/es.json @@ -0,0 +1,58 @@ +{ + "hotkeysLabel": "Atajos de teclado", + "themeLabel": "Tema", + "languagePickerLabel": "Selector de idioma", + "reportBugLabel": "Reportar errores", + "githubLabel": "GitHub", + "discordLabel": "Discord", + "settingsLabel": "Ajustes", + "darkTheme": "Oscuro", + "lightTheme": "Claro", + "greenTheme": "Verde", + "langEnglish": "Inglés", + "langRussian": "Ruso", + "langItalian": "Italiano", + "langBrPortuguese": "Portugués (Brasil)", + "langGerman": "Alemán", + "langPortuguese": "Portugués", + "langFrench": "French", + "langPolish": "Polish", + "langSpanish": "Español", + "text2img": "Texto a Imagen", + "img2img": "Imagen a Imagen", + "unifiedCanvas": "Lienzo Unificado", + "nodes": "Nodos", + "nodesDesc": "Un sistema de generación de imágenes basado en nodos, actualmente se encuentra en desarrollo. Mantente pendiente a nuestras actualizaciones acerca de esta fabulosa funcionalidad.", + "postProcessing": "Post-procesamiento", + "postProcessDesc1": "Invoke AI ofrece una gran variedad de funciones de post-procesamiento, El aumento de tamaño y Restauración de Rostros ya se encuentran disponibles en la interfaz web, puedes acceder desde el menú de Opciones Avanzadas en las pestañas de Texto a Imagen y de Imagen a Imagen. También puedes acceder a estas funciones directamente mediante el botón de acciones en el menú superior de la imagen actual o en el visualizador", + "postProcessDesc2": "Una interfaz de usuario dedicada se lanzará pronto para facilitar flujos de trabajo de postprocesamiento más avanzado.", + "postProcessDesc3": "La Interfaz de Línea de Comandos de Invoke AI ofrece muchas otras características, incluyendo -Embiggen-.", + "training": "Entrenamiento", + "trainingDesc1": "Un flujo de trabajo dedicado para el entrenamiento de sus propios -embeddings- y puntos de control utilizando Inversión Textual y Dreambooth desde la interfaz web.", + "trainingDesc2": "InvokeAI already supports training custom embeddings using Textual Inversion using the main script.", + "trainingDesc2": "InvokeAI ya soporta el entrenamiento de -embeddings- personalizados utilizando la Inversión Textual mediante el script principal.", + "upload": "Subir imagen", + "close": "Cerrar", + "load": "Cargar", + "statusConnected": "Conectado", + "statusDisconnected": "Desconectado", + "statusError": "Error", + "statusPreparing": "Preparando", + "statusProcessingCanceled": "Procesamiento Cancelado", + "statusProcessingComplete": "Procesamiento Completo", + "statusGenerating": "Generando", + "statusGeneratingTextToImage": "Generando Texto a Imagen", + "statusGeneratingImageToImage": "Generando Imagen a Imagen", + "statusGeneratingInpainting": "Generando pintura interior", + "statusGeneratingOutpainting": "Generando pintura exterior", + "statusGenerationComplete": "Generación Completa", + "statusIterationComplete": "Iteración Completa", + "statusSavingImage": "Guardando Imagen", + "statusRestoringFaces": "Restaurando Rostros", + "statusRestoringFacesGFPGAN": "Restaurando Rostros (GFPGAN)", + "statusRestoringFacesCodeFormer": "Restaurando Rostros (CodeFormer)", + "statusUpscaling": "Aumentando Tamaño", + "statusUpscalingESRGAN": "Restaurando Rostros(ESRGAN)", + "statusLoadingModel": "Cargando Modelo", + "statusModelChanged": "Modelo cambiado" +} diff --git a/frontend/dist/locales/common/it.json b/frontend/dist/locales/common/it.json index f0aa150447..293edf3f86 100644 --- a/frontend/dist/locales/common/it.json +++ b/frontend/dist/locales/common/it.json @@ -18,6 +18,7 @@ "langFrench": "Francese", "langPolish": "Polacco", "langSimplifiedChinese": "Cinese semplificato", + "langSpanish": "Spagnolo", "text2img": "Testo a Immagine", "img2img": "Immagine a Immagine", "unifiedCanvas": "Tela unificata", diff --git a/frontend/dist/locales/common/pl.json b/frontend/dist/locales/common/pl.json index 604fb52af6..2b9f3b5903 100644 --- a/frontend/dist/locales/common/pl.json +++ b/frontend/dist/locales/common/pl.json @@ -15,6 +15,7 @@ "langPortuguese": "Portugalski", "langFrench": "Francuski", "langPolish": "Polski", + "langSpanish": "Hiszpański", "text2img": "Tekst na obraz", "img2img": "Obraz na obraz", "unifiedCanvas": "Tryb uniwersalny", diff --git a/frontend/dist/locales/common/pt_br.json b/frontend/dist/locales/common/pt_br.json index 7362624a29..295bcf8184 100644 --- a/frontend/dist/locales/common/pt_br.json +++ b/frontend/dist/locales/common/pt_br.json @@ -15,6 +15,7 @@ "langBrPortuguese": "Português do Brasil", "langPortuguese": "Portuguese", "langFrench": "French", + "langSpanish": "Spanish", "text2img": "Texto Para Imagem", "img2img": "Imagem Para Imagem", "unifiedCanvas": "Tela Unificada", diff --git a/frontend/dist/locales/common/ru.json b/frontend/dist/locales/common/ru.json index 919d648291..efa54fcd47 100644 --- a/frontend/dist/locales/common/ru.json +++ b/frontend/dist/locales/common/ru.json @@ -14,6 +14,7 @@ "langItalian": "Italian", "langPortuguese": "Portuguese", "langFrench": "French", + "langSpanish": "Spanish", "text2img": "Изображение из текста (text2img)", "img2img": "Изображение в изображение (img2img)", "unifiedCanvas": "Универсальный холст", @@ -51,4 +52,3 @@ "statusLoadingModel": "Загрузка модели", "statusModelChanged": "Модель изменена" } - diff --git a/frontend/dist/locales/gallery/es.json b/frontend/dist/locales/gallery/es.json new file mode 100644 index 0000000000..a87ac65c70 --- /dev/null +++ b/frontend/dist/locales/gallery/es.json @@ -0,0 +1,16 @@ +{ + "generations": "Generaciones", + "showGenerations": "Mostrar Generaciones", + "uploads": "Subidas de archivos", + "showUploads": "Mostar Subidas", + "galleryImageSize": "Tamaño de la imagen", + "galleryImageResetSize": "Restablecer tamaño de la imagen", + "gallerySettings": "Ajustes de la galería", + "maintainAspectRatio": "Mantener relación de aspecto", + "autoSwitchNewImages": "Auto seleccionar Imágenes nuevas", + "singleColumnLayout": "Diseño de una columna", + "pinGallery": "Fijar galería", + "allImagesLoaded": "Todas las imágenes cargadas", + "loadMore": "Cargar más", + "noImagesInGallery": "Sin imágenes en la galería" +} diff --git a/frontend/dist/locales/hotkeys/es.json b/frontend/dist/locales/hotkeys/es.json new file mode 100644 index 0000000000..2651a7c19f --- /dev/null +++ b/frontend/dist/locales/hotkeys/es.json @@ -0,0 +1,207 @@ +{ + "keyboardShortcuts": "Atajos de teclado", + "appHotkeys": "Atajos de applicación", + "generalHotkeys": "Atajos generales", + "galleryHotkeys": "Atajos de galería", + "unifiedCanvasHotkeys": "Atajos de lienzo unificado", + "invoke": { + "title": "Invocar", + "desc": "Generar una imagen" + }, + "cancel": { + "title": "Cancelar", + "desc": "Cancelar el proceso de generación de imagen" + }, + "focusPrompt": { + "title": "Mover foco a Entrada de texto", + "desc": "Mover foco hacia el campo de texto de la Entrada" + }, + "toggleOptions": { + "title": "Alternar opciones", + "desc": "Mostar y ocultar el panel de opciones" + }, + "pinOptions": { + "title": "Fijar opciones", + "desc": "Fijar el panel de opciones" + }, + "toggleViewer": { + "title": "Alternar visor", + "desc": "Mostar y ocultar el visor de imágenes" + }, + "toggleGallery": { + "title": "Alternar galería", + "desc": "Mostar y ocultar la galería de imágenes" + }, + "maximizeWorkSpace": { + "title": "Maximizar espacio de trabajo", + "desc": "Cerrar otros páneles y maximizar el espacio de trabajo" + }, + "changeTabs": { + "title": "Cambiar", + "desc": "Cambiar entre áreas de trabajo" + }, + "consoleToggle": { + "title": "Alternar consola", + "desc": "Mostar y ocultar la consola" + }, + "setPrompt": { + "title": "Establecer Entrada", + "desc": "Usar el texto de entrada de la imagen actual" + }, + "setSeed": { + "title": "Establecer semilla", + "desc": "Usar la semilla de la imagen actual" + }, + "setParameters": { + "title": "Establecer parámetros", + "desc": "Usar todos los parámetros de la imagen actual" + }, + "restoreFaces": { + "title": "Restaurar rostros", + "desc": "Restaurar rostros en la imagen actual" + }, + "upscale": { + "title": "Aumentar resolución", + "desc": "Aumentar la resolución de la imagen actual" + }, + "showInfo": { + "title": "Mostrar información", + "desc": "Mostar metadatos de la imagen actual" + }, + "sendToImageToImage": { + "title": "Enviar hacia Imagen a Imagen", + "desc": "Enviar imagen actual hacia Imagen a Imagen" + }, + "deleteImage": { + "title": "Eliminar imagen", + "desc": "Eliminar imagen actual" + }, + "closePanels": { + "title": "Cerrar páneles", + "desc": "Cerrar los páneles abiertos" + }, + "previousImage": { + "title": "Imagen anterior", + "desc": "Muetra la imagen anterior en la galería" + }, + "nextImage": { + "title": "Imagen siguiente", + "desc": "Muetra la imagen siguiente en la galería" + }, + "toggleGalleryPin": { + "title": "Alternar fijado de galería", + "desc": "Fijar o desfijar la galería en la interfaz" + }, + "increaseGalleryThumbSize": { + "title": "Aumentar imagen en galería", + "desc": "Aumenta el tamaño de las miniaturas de la galería" + }, + "decreaseGalleryThumbSize": { + "title": "Reducir imagen en galería", + "desc": "Reduce el tamaño de las miniaturas de la galería" + }, + "selectBrush": { + "title": "Seleccionar pincel", + "desc": "Selecciona el pincel en el lienzo" + }, + "selectEraser": { + "title": "Seleccionar borrador", + "desc": "Selecciona el borrador en el lienzo" + }, + "decreaseBrushSize": { + "title": "Disminuir tamaño de herramienta", + "desc": "Disminuye el tamaño del pincel/borrador en el lienzo" + }, + "increaseBrushSize": { + "title": "Aumentar tamaño del pincel", + "desc": "Aumenta el tamaño del pincel en el lienzo" + }, + "decreaseBrushOpacity": { + "title": "Disminuir opacidad del pincel", + "desc": "Disminuye la opacidad del pincel en el lienzo" + }, + "increaseBrushOpacity": { + "title": "Aumentar opacidad del pincel", + "desc": "Aumenta la opacidad del pincel en el lienzo" + }, + "moveTool": { + "title": "Herramienta de movimiento", + "desc": "Permite navegar por el lienzo" + }, + "fillBoundingBox": { + "title": "Rellenar Caja contenedora", + "desc": "Rellena la caja contenedora con el color seleccionado" + }, + "eraseBoundingBox": { + "title": "Borrar Caja contenedora", + "desc": "Borra el contenido dentro de la caja contenedora" + }, + "colorPicker": { + "title": "Selector de color", + "desc": "Selecciona un color del lienzo" + }, + "toggleSnap": { + "title": "Alternar ajuste de cuadrícula", + "desc": "Activa o desactiva el ajuste automático a la cuadrícula" + }, + "quickToggleMove": { + "title": "Alternar movimiento rápido", + "desc": "Activa momentáneamente la herramienta de movimiento" + }, + "toggleLayer": { + "title": "Alternar capa", + "desc": "Alterna entre las capas de máscara y base" + }, + "clearMask": { + "title": "Limpiar máscara", + "desc": "Limpia toda la máscara actual" + }, + "hideMask": { + "title": "Ocultar máscara", + "desc": "Oculta o muetre la máscara actual" + }, + "showHideBoundingBox": { + "title": "Alternar caja contenedora", + "desc": "Muestra u oculta la caja contenedora" + }, + "mergeVisible": { + "title": "Consolida capas visibles", + "desc": "Consolida todas las capas visibles en una sola" + }, + "saveToGallery": { + "title": "Guardar en galería", + "desc": "Guardar la imagen actual del lienzo en la galería" + }, + "copyToClipboard": { + "title": "Copiar al portapapeles", + "desc": "Copiar el lienzo actual al portapapeles" + }, + "downloadImage": { + "title": "Descargar imagen", + "desc": "Descargar la imagen actual del lienzo" + }, + "undoStroke": { + "title": "Deshar trazo", + "desc": "Desahacer el último trazo del pincel" + }, + "redoStroke": { + "title": "Rehacer trazo", + "desc": "Rehacer el último trazo del pincel" + }, + "resetView": { + "title": "Restablecer vista", + "desc": "Restablecer la vista del lienzo" + }, + "previousStagingImage": { + "title": "Imagen anterior", + "desc": "Imagen anterior en el área de preparación" + }, + "nextStagingImage": { + "title": "Imagen siguiente", + "desc": "Siguiente imagen en el área de preparación" + }, + "acceptStagingImage": { + "title": "Aceptar imagen", + "desc": "Aceptar la imagen actual en el área de preparación" + } +} diff --git a/frontend/dist/locales/modelmanager/es.json b/frontend/dist/locales/modelmanager/es.json new file mode 100644 index 0000000000..963acf5b13 --- /dev/null +++ b/frontend/dist/locales/modelmanager/es.json @@ -0,0 +1,53 @@ +{ + "modelManager": "Gestor de Modelos", + "model": "Modelo", + "modelAdded": "Modelo añadido", + "modelUpdated": "Modelo actualizado", + "modelEntryDeleted": "Endrada de Modelo eliminada", + "cannotUseSpaces": "No se pueden usar Spaces", + "addNew": "Añadir nuevo", + "addNewModel": "Añadir nuevo modelo", + "addManually": "Añadir manualmente", + "manual": "Manual", + "name": "Nombre", + "nameValidationMsg": "Introduce un nombre para tu modelo", + "description": "Descripción", + "descriptionValidationMsg": "Introduce una descripción para tu modelo", + "config": "Config", + "configValidationMsg": "Ruta del archivo de configuración del modelo", + "modelLocation": "Ubicación del Modelo", + "modelLocationValidationMsg": "Ruta del archivo de modelo", + "vaeLocation": "Ubicación VAE", + "vaeLocationValidationMsg": "Ruta del archivo VAE", + "width": "Ancho", + "widthValidationMsg": "Ancho predeterminado de tu modelo", + "height": "Alto", + "heightValidationMsg": "Alto predeterminado de tu modelo", + "addModel": "Añadir Modelo", + "updateModel": "Actualizar Modelo", + "availableModels": "Modelos disponibles", + "search": "Búsqueda", + "load": "Cargar", + "active": "activo", + "notLoaded": "no cargado", + "cached": "en caché", + "checkpointFolder": "Directorio de Checkpoint", + "clearCheckpointFolder": "Limpiar directorio de checkpoint", + "findModels": "Buscar modelos", + "scanAgain": "Escanear de nuevo", + "modelsFound": "Modelos encontrados", + "selectFolder": "Selecciona un directorio", + "selected": "Seleccionado", + "selectAll": "Seleccionar todo", + "deselectAll": "Deseleccionar todo", + "showExisting": "Mostrar existentes", + "addSelected": "Añadir seleccionados", + "modelExists": "Modelo existente", + "selectAndAdd": "Selecciona de la lista un modelo para añadir", + "noModelsFound": "No se encontró ningún modelo", + "delete": "Eliminar", + "deleteModel": "Eliminar Modelo", + "deleteConfig": "Eliminar Configuración", + "deleteMsg1": "¿Estás seguro de querer eliminar esta entrada de modelo de InvokeAI?", + "deleteMsg2": "El checkpoint del modelo no se eliminará de tu disco. Puedes volver a añadirlo si lo deseas." +} diff --git a/frontend/dist/locales/modelmanager/zh_cn.json b/frontend/dist/locales/modelmanager/zh_cn.json index 0967ef424b..c4c296703f 100644 --- a/frontend/dist/locales/modelmanager/zh_cn.json +++ b/frontend/dist/locales/modelmanager/zh_cn.json @@ -1 +1,50 @@ -{} +{ + "modelManager": "模型管理器", + "model": "模型", + "modelAdded": "模型已添加", + "modelUpdated": "模型已更新", + "modelEntryDeleted": "模型已删除", + "cannotUseSpaces": "不能使用空格", + "addNew": "添加", + "addNewModel": "添加新模型", + "addManually": "手动添加", + "manual": "手动", + "name": "名称", + "nameValidationMsg": "输入模型的名称", + "description": "描述", + "descriptionValidationMsg": "添加模型的描述", + "config": "配置", + "configValidationMsg": "模型配置文件的路径", + "modelLocation": "模型位置", + "modelLocationValidationMsg": "模型文件的路径", + "vaeLocation": "VAE 位置", + "vaeLocationValidationMsg": "VAE 文件的路径", + "width": "宽度", + "widthValidationMsg": "模型的默认宽度", + "height": "高度", + "heightValidationMsg": "模型的默认高度", + "addModel": "添加模型", + "updateModel": "更新模型", + "availableModels": "可用模型", + "search": "搜索", + "load": "加载", + "active": "活跃", + "notLoaded": "未加载", + "cached": "缓存", + "checkpointFolder": "模型检查点文件夹", + "clearCheckpointFolder": "清除模型检查点文件夹", + "findModels": "寻找模型", + "modelsFound": "找到的模型", + "selectFolder": "选择文件夹", + "selected": "已选择", + "selectAll": "选择所有", + "deselectAll": "取消选择所有", + "showExisting": "显示已存在", + "addSelected": "添加选择", + "modelExists": "模型已存在", + "delete": "删除", + "deleteModel": "删除模型", + "deleteConfig": "删除配置", + "deleteMsg1": "您确定要将这个模型从 InvokeAI 删除吗?", + "deleteMsg2": "这不会从磁盘中删除模型检查点文件。如果您愿意,可以重新添加它们。" +} diff --git a/frontend/dist/locales/options/es.json b/frontend/dist/locales/options/es.json new file mode 100644 index 0000000000..e722d99dbe --- /dev/null +++ b/frontend/dist/locales/options/es.json @@ -0,0 +1,62 @@ +{ + "images": "Imágenes", + "steps": "Pasos", + "cfgScale": "Escala CFG", + "width": "Ancho", + "height": "Alto", + "sampler": "Muestreo", + "seed": "Semilla", + "randomizeSeed": "Semilla aleatoria", + "shuffle": "Aleatorizar", + "noiseThreshold": "Umbral de Ruido", + "perlinNoise": "Ruido Perlin", + "variations": "Variaciones", + "variationAmount": "Cantidad de Variación", + "seedWeights": "Peso de las semillas", + "faceRestoration": "Restauración de Rostros", + "restoreFaces": "Restaurar rostros", + "type": "Tipo", + "strength": "Fuerza", + "upscaling": "Aumento de resolución", + "upscale": "Aumentar resolución", + "upscaleImage": "Aumentar la resolución de la imagen", + "scale": "Escala", + "otherOptions": "Otras opciones", + "seamlessTiling": "Mosaicos sin parches", + "hiresOptim": "Optimización de Alta Resolución", + "imageFit": "Ajuste tamaño de imagen inicial al tamaño objetivo", + "codeformerFidelity": "Fidelidad", + "seamSize": "Tamaño del parche", + "seamBlur": "Desenfoque del parche", + "seamStrength": "Fuerza del parche", + "seamSteps": "Pasos del parche", + "inpaintReplace": "Reemplazar impresión interior", + "scaleBeforeProcessing": "Redimensionar antes de procesar", + "scaledWidth": "Ancho escalado", + "scaledHeight": "Alto escalado", + "infillMethod": "Método de relleno", + "tileSize": "Tamaño del mosaico", + "boundingBoxHeader": "Caja contenedora", + "seamCorrectionHeader": "Corrección de parches", + "infillScalingHeader": "Remplazo y escalado", + "img2imgStrength": "Peso de Imagen a Imagen", + "toggleLoopback": "Alternar Retroalimentación", + "invoke": "Invocar", + "cancel": "Cancelar", + "promptPlaceholder": "Ingrese la entrada aquí. [símbolos negativos], (subir peso)++, (bajar peso)--, también disponible alternado y mezclado (ver documentación)", + "sendTo": "Enviar a", + "sendToImg2Img": "Enviar a Imagen a Imagen", + "sendToUnifiedCanvas": "Enviar a Lienzo Unificado", + "copyImageToLink": "Copiar imagen a enlace", + "downloadImage": "Descargar imagen", + "openInViewer": "Abrir en Visor", + "closeViewer": "Cerrar Visor", + "usePrompt": "Usar Entrada", + "useSeed": "Usar Semilla", + "useAll": "Usar Todo", + "useInitImg": "Usar Imagen Inicial", + "info": "Información", + "deleteImage": "Eliminar Imagen", + "initialImage": "Imagen Inicial", + "showOptionsPanel": "Mostrar panel de opciones" +} diff --git a/frontend/dist/locales/options/ru.json b/frontend/dist/locales/options/ru.json index afd0bdbd9b..02ea25f929 100644 --- a/frontend/dist/locales/options/ru.json +++ b/frontend/dist/locales/options/ru.json @@ -5,7 +5,7 @@ "width": "Ширина", "height": "Высота", "sampler": "Семплер", - "seed": "Сид (Seed)", + "seed": "Сид", "randomizeSeed": "Случайный сид", "shuffle": "Обновить", "noiseThreshold": "Порог шума", diff --git a/frontend/dist/locales/settings/es.json b/frontend/dist/locales/settings/es.json new file mode 100644 index 0000000000..4fadf79977 --- /dev/null +++ b/frontend/dist/locales/settings/es.json @@ -0,0 +1,13 @@ +{ + "models": "Modelos", + "displayInProgress": "Mostrar imágenes en progreso", + "saveSteps": "Guardar imágenes cada n pasos", + "confirmOnDelete": "Confirmar antes de eliminar", + "displayHelpIcons": "Mostrar iconos de ayuda", + "useCanvasBeta": "Usar versión beta del Lienzo", + "enableImageDebugging": "Habilitar depuración de imágenes", + "resetWebUI": "Restablecer interfaz web", + "resetWebUIDesc1": "Al restablecer la interfaz web, solo se restablece la caché local del navegador de sus imágenes y la configuración guardada. No se elimina ninguna imagen de su disco duro.", + "resetWebUIDesc2": "Si las imágenes no se muestran en la galería o algo más no funciona, intente restablecer antes de reportar un incidente en GitHub.", + "resetComplete": "La interfaz web se ha restablecido. Actualice la página para recargarla." +} diff --git a/frontend/dist/locales/settings/pl.json b/frontend/dist/locales/settings/pl.json index b7846fde2e..1fb901c30c 100644 --- a/frontend/dist/locales/settings/pl.json +++ b/frontend/dist/locales/settings/pl.json @@ -4,7 +4,7 @@ "saveSteps": "Zapisuj obrazy co X kroków", "confirmOnDelete": "Potwierdzaj usuwanie", "displayHelpIcons": "Wyświetlaj ikony pomocy", - "useCanvasBeta": "Nowego układ trybu uniwersalnego", + "useCanvasBeta": "Nowy układ trybu uniwersalnego", "enableImageDebugging": "Włącz debugowanie obrazu", "resetWebUI": "Zresetuj interfejs", "resetWebUIDesc1": "Resetowanie interfejsu wyczyści jedynie dane i ustawienia zapisane w pamięci przeglądarki. Nie usunie żadnych obrazów z dysku.", diff --git a/frontend/dist/locales/toast/es.json b/frontend/dist/locales/toast/es.json new file mode 100644 index 0000000000..fe544d4f50 --- /dev/null +++ b/frontend/dist/locales/toast/es.json @@ -0,0 +1,32 @@ +{ + "tempFoldersEmptied": "Directorio temporal vaciado", + "uploadFailed": "Error al subir archivo", + "uploadFailedMultipleImagesDesc": "Únicamente se puede subir una imágen a la vez", + "uploadFailedUnableToLoadDesc": "No se pudo cargar la imágen", + "downloadImageStarted": "Descargando imágen", + "imageCopied": "Imágen copiada", + "imageLinkCopied": "Enlace de imágen copiado", + "imageNotLoaded": "No se cargó la imágen", + "imageNotLoadedDesc": "No se encontró imagen para enviar al módulo Imagen a Imagen", + "imageSavedToGallery": "Imágen guardada en la galería", + "canvasMerged": "Lienzo consolidado", + "sentToImageToImage": "Enviar hacia Imagen a Imagen", + "sentToUnifiedCanvas": "Enviar hacia Lienzo Consolidado", + "parametersSet": "Parámetros establecidos", + "parametersNotSet": "Parámetros no establecidos", + "parametersNotSetDesc": "No se encontraron metadatos para esta imágen.", + "parametersFailed": "Error cargando parámetros", + "parametersFailedDesc": "No fue posible cargar la imagen inicial.", + "seedSet": "Semilla establecida", + "seedNotSet": "Semilla no establecida", + "seedNotSetDesc": "No se encontró una semilla para esta imágen.", + "promptSet": "Entrada establecida", + "promptNotSet": "Entrada no establecida", + "promptNotSetDesc": "No se encontró una entrada para esta imágen.", + "upscalingFailed": "Error al aumentar tamaño de imagn", + "faceRestoreFailed": "Restauración de rostro fallida", + "metadataLoadFailed": "Error al cargar metadatos", + "initialImageSet": "Imágen inicial establecida", + "initialImageNotSet": "Imagen inicial no establecida", + "initialImageNotSetDesc": "Error al establecer la imágen inicial" +} diff --git a/frontend/dist/locales/tooltip/de.json b/frontend/dist/locales/tooltip/de.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/dist/locales/tooltip/de.json @@ -0,0 +1 @@ +{} diff --git a/frontend/dist/locales/tooltip/en-US.json b/frontend/dist/locales/tooltip/en-US.json new file mode 100644 index 0000000000..1d03f54b7f --- /dev/null +++ b/frontend/dist/locales/tooltip/en-US.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "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.", + "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", + "other": "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.", + "seed": "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.", + "variations": "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.", + "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", + "faceCorrection": "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.", + "imageToImage": "Image to Image 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.", + "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." + } +} diff --git a/frontend/dist/locales/tooltip/en.json b/frontend/dist/locales/tooltip/en.json new file mode 100644 index 0000000000..1d03f54b7f --- /dev/null +++ b/frontend/dist/locales/tooltip/en.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "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.", + "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", + "other": "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.", + "seed": "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.", + "variations": "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.", + "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", + "faceCorrection": "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.", + "imageToImage": "Image to Image 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.", + "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." + } +} diff --git a/frontend/dist/locales/tooltip/es.json b/frontend/dist/locales/tooltip/es.json new file mode 100644 index 0000000000..543aad6a8c --- /dev/null +++ b/frontend/dist/locales/tooltip/es.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "Este campo tomará todo el texto de entrada, incluidos tanto los términos de contenido como los estilísticos. Si bien se pueden incluir pesos en la solicitud, los comandos/parámetros estándar de línea de comandos no funcionarán.", + "gallery": "Conforme se generan nuevas invocaciones, los archivos del directorio de salida se mostrarán aquí. Las generaciones tienen opciones adicionales para configurar nuevas generaciones.", + "other": "Estas opciones habilitarán modos de procesamiento alternativos para Invoke. El modo sin costuras funciona para generar patrones repetitivos en la salida. La optimización de alta resolución realiza un ciclo de generación de dos pasos y debe usarse en resoluciones más altas cuando desee una imagen/composición más coherente.", + "seed": "Los valores de semilla proporcionan un conjunto inicial de ruido que guían el proceso de eliminación de ruido y se pueden aleatorizar o rellenar con una semilla de una invocación anterior. La función Umbral se puede usar para mitigar resultados indeseables a valores CFG más altos (intente entre 0-10), y Perlin se puede usar para agregar ruido Perlin al proceso de eliminación de ruido. Ambos sirven para agregar variación a sus salidas.", + "variations": "Pruebe una variación con una cantidad entre 0 y 1 para cambiar la imagen de salida para la semilla establecida. Se encuentran variaciones interesantes en la semilla entre 0.1 y 0.3.", + "upscale": "Usando ESRGAN, puede aumentar la resolución de salida sin requerir un ancho/alto más alto en la generación inicial.", + "faceCorrection": "Usando GFPGAN o Codeformer, la corrección de rostros intentará identificar rostros en las salidas y corregir cualquier defecto/anormalidad. Los valores de fuerza más altos aplicarán una presión correctiva más fuerte en las salidas, lo que resultará en rostros más atractivos. Con Codeformer, una mayor fidelidad intentará preservar la imagen original, a expensas de la fuerza de corrección de rostros.", + "imageToImage": "Imagen a Imagen permite cargar una imagen inicial, que InvokeAI usará para guiar el proceso de generación, junto con una solicitud. Un valor más bajo para esta configuración se parecerá más a la imagen original. Se aceptan valores entre 0-1, y se recomienda un rango de .25-.75.", + "boundingBox": "La caja delimitadora es análoga a las configuraciones de Ancho y Alto para Texto a Imagen o Imagen a Imagen. Solo se procesará el área en la caja.", + "seamCorrection": "Controla el manejo de parches visibles que pueden ocurrir cuando se pega una imagen generada de nuevo en el lienzo.", + "infillAndScaling": "Administra los métodos de relleno (utilizados en áreas enmascaradas o borradas del lienzo) y la escala (útil para tamaños de caja delimitadora pequeños)." + } +} diff --git a/frontend/dist/locales/tooltip/it.json b/frontend/dist/locales/tooltip/it.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/dist/locales/tooltip/it.json @@ -0,0 +1 @@ +{} diff --git a/frontend/dist/locales/tooltip/pl.json b/frontend/dist/locales/tooltip/pl.json new file mode 100644 index 0000000000..be473bfb84 --- /dev/null +++ b/frontend/dist/locales/tooltip/pl.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "To pole musi zawierać cały tekst sugestii, w tym zarówno opis oczekiwanej zawartości, jak i terminy stylistyczne. Chociaż wagi mogą być zawarte w sugestiach, inne parametry znane z linii poleceń nie będą działać.", + "gallery": "W miarę generowania nowych wywołań w tym miejscu będą wyświetlane pliki z katalogu wyjściowego. Obrazy mają dodatkowo opcje konfiguracji nowych wywołań.", + "other": "Opcje umożliwią alternatywne tryby przetwarzania. Płynne scalanie będzie pomocne przy generowaniu powtarzających się wzorów. Optymalizacja wysokiej rozdzielczości wykonuje dwuetapowy cykl generowania i powinna być używana przy wyższych rozdzielczościach, gdy potrzebny jest bardziej spójny obraz/kompozycja.", + "seed": "Inicjator określa początkowy zestaw szumów, który kieruje procesem odszumiania i może być losowy lub pobrany z poprzedniego wywołania. Funkcja \"Poziom szumu\" może być użyta do złagodzenia saturacji przy wyższych wartościach CFG (spróbuj między 0-10), a Perlin może być użyty w celu dodania wariacji do twoich wyników.", + "variations": "Poziom zróżnicowania przyjmuje wartości od 0 do 1 i pozwala zmienić obraz wyjściowy dla ustawionego inicjatora. Interesujące wyniki uzyskuje się zwykle między 0,1 a 0,3.", + "upscale": "Korzystając z ESRGAN, możesz zwiększyć rozdzielczość obrazu wyjściowego bez konieczności zwiększania szerokości/wysokości w ustawieniach początkowych.", + "faceCorrection": "Poprawianie twarzy próbuje identyfikować twarze na obrazie wyjściowym i korygować wszelkie defekty/nieprawidłowości. W GFPGAN im większa siła, tym mocniejszy efekt. W metodzie Codeformer wyższa wartość oznacza bardziej wierne odtworzenie oryginalnej twarzy, nawet kosztem siły korekcji.", + "imageToImage": "Tryb \"Obraz na obraz\" pozwala na załadowanie obrazu wzorca, który obok wprowadzonych sugestii zostanie użyty porzez InvokeAI do wygenerowania nowego obrazu. Niższa wartość tego ustawienia będzie bardziej przypominać oryginalny obraz. Akceptowane są wartości od 0 do 1, a zalecany jest zakres od 0,25 do 0,75.", + "boundingBox": "Zaznaczony obszar odpowiada ustawieniom wysokości i szerokości w trybach Tekst na obraz i Obraz na obraz. Jedynie piksele znajdujące się w obszarze zaznaczenia zostaną uwzględnione podczas wywoływania nowego obrazu.", + "seamCorrection": "Opcje wpływające na poziom widoczności szwów, które mogą wystąpić, gdy wygenerowany obraz jest ponownie wklejany na płótno.", + "infillAndScaling": "Zarządzaj metodami wypełniania (używanymi na zamaskowanych lub wymazanych obszarach płótna) i skalowaniem (przydatne w przypadku zaznaczonego obszaru o b. małych rozmiarach)." + } +} diff --git a/frontend/dist/locales/tooltip/pt_br.json b/frontend/dist/locales/tooltip/pt_br.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/dist/locales/tooltip/pt_br.json @@ -0,0 +1 @@ +{} diff --git a/frontend/dist/locales/tooltip/ru.json b/frontend/dist/locales/tooltip/ru.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/frontend/dist/locales/tooltip/ru.json @@ -0,0 +1 @@ +{} diff --git a/frontend/dist/locales/unifiedcanvas/es.json b/frontend/dist/locales/unifiedcanvas/es.json new file mode 100644 index 0000000000..0cef74984e --- /dev/null +++ b/frontend/dist/locales/unifiedcanvas/es.json @@ -0,0 +1,59 @@ +{ + "layer": "Capa", + "base": "Base", + "mask": "Máscara", + "maskingOptions": "Opciones de máscara", + "enableMask": "Habilitar Máscara", + "preserveMaskedArea": "Preservar área enmascarada", + "clearMask": "Limpiar máscara", + "brush": "Pincel", + "eraser": "Borrador", + "fillBoundingBox": "Rellenar Caja Contenedora", + "eraseBoundingBox": "Eliminar Caja Contenedora", + "colorPicker": "Selector de color", + "brushOptions": "Opciones de pincel", + "brushSize": "Tamaño", + "move": "Mover", + "resetView": "Restablecer vista", + "mergeVisible": "Consolidar vista", + "saveToGallery": "Guardar en galería", + "copyToClipboard": "Copiar al portapapeles", + "downloadAsImage": "Descargar como imagen", + "undo": "Deshacer", + "redo": "Rehacer", + "clearCanvas": "Limpiar lienzo", + "canvasSettings": "Ajustes de lienzo", + "showIntermediates": "Mostrar intermedios", + "showGrid": "Mostrar cuadrícula", + "snapToGrid": "Ajustar a cuadrícula", + "darkenOutsideSelection": "Oscurecer fuera de la selección", + "autoSaveToGallery": "Guardar automáticamente en galería", + "saveBoxRegionOnly": "Guardar solo región dentro de la caja", + "limitStrokesToBox": "Limitar trazos a la caja", + "showCanvasDebugInfo": "Mostrar información de depuración de lienzo", + "clearCanvasHistory": "Limpiar historial de lienzo", + "clearHistory": "Limpiar historial", + "clearCanvasHistoryMessage": "Limpiar el historial de lienzo también restablece completamente el lienzo unificado. Esto incluye todo el historial de deshacer/rehacer, las imágenes en el área de preparación y la capa base del lienzo.", + "clearCanvasHistoryConfirm": "¿Está seguro de que desea limpiar el historial del lienzo?", + "emptyTempImageFolder": "Vaciar directorio de imágenes temporales", + "emptyFolder": "Vaciar directorio", + "emptyTempImagesFolderMessage": "Vaciar el directorio de imágenes temporales también restablece completamente el lienzo unificado. Esto incluye todo el historial de deshacer/rehacer, las imágenes en el área de preparación y la capa base del lienzo.", + "emptyTempImagesFolderConfirm": "¿Está seguro de que desea vaciar el directorio temporal?", + "activeLayer": "Capa activa", + "canvasScale": "Escala de lienzo", + "boundingBox": "Caja contenedora", + "scaledBoundingBox": "Caja contenedora escalada", + "boundingBoxPosition": "Posición de caja contenedora", + "canvasDimensions": "Dimensiones de lienzo", + "canvasPosition": "Posición de lienzo", + "cursorPosition": "Posición del cursor", + "previous": "Anterior", + "next": "Siguiente", + "accept": "Aceptar", + "showHide": "Mostrar/Ocultar", + "discardAll": "Descartar todo", + "betaClear": "Limpiar", + "betaDarkenOutside": "Oscurecer fuera", + "betaLimitToBox": "Limitar a caja", + "betaPreserveMasked": "Preservar área enmascarada" +} From e7ee4ecac7071ea642e36ac8159ec8b28e147298 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 30 Dec 2022 22:13:02 +1300 Subject: [PATCH 05/11] Fix NumberInput not respecting min and max values on stepper click --- frontend/src/common/components/IAINumberInput.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/common/components/IAINumberInput.tsx b/frontend/src/common/components/IAINumberInput.tsx index c61658ce40..20da3a1314 100644 --- a/frontend/src/common/components/IAINumberInput.tsx +++ b/frontend/src/common/components/IAINumberInput.tsx @@ -142,6 +142,8 @@ const IAINumberInput = (props: Props) => { Date: Fri, 30 Dec 2022 22:13:14 +1300 Subject: [PATCH 06/11] Fix styling of slider input to accommodate 4 digit values --- frontend/src/common/components/IAISlider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/common/components/IAISlider.tsx b/frontend/src/common/components/IAISlider.tsx index 1a71c55d79..e0aa6e2a8a 100644 --- a/frontend/src/common/components/IAISlider.tsx +++ b/frontend/src/common/components/IAISlider.tsx @@ -80,7 +80,7 @@ export default function IAISlider(props: IAIFullSliderProps) { sliderMarkRightOffset = -7, withInput = false, isInteger = false, - inputWidth = '5rem', + inputWidth = '5.5rem', inputReadOnly = true, withReset = false, hideTooltip = false, @@ -236,6 +236,7 @@ export default function IAISlider(props: IAIFullSliderProps) { From edc22e06c37c074c5f3c83653873d121cf1aa0f9 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 30 Dec 2022 22:16:22 +1300 Subject: [PATCH 07/11] RU Localization for Model Manager and Tooltips Co-Authored-By: Artur <83028930+netsvetaev@users.noreply.github.com> --- frontend/public/locales/modelmanager/ru.json | 54 +++++++++++++++++++- frontend/public/locales/tooltip/ru.json | 16 +++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/frontend/public/locales/modelmanager/ru.json b/frontend/public/locales/modelmanager/ru.json index 0967ef424b..37cef8a774 100644 --- a/frontend/public/locales/modelmanager/ru.json +++ b/frontend/public/locales/modelmanager/ru.json @@ -1 +1,53 @@ -{} +{ + "modelManager": "Менеджер моделей", + "model": "Модель", + "modelAdded": "Модель добавлена", + "modelUpdated": "Модель обновлена", + "modelEntryDeleted": "Запись о модели удалена", + "cannotUseSpaces": "Нельзя использовать пробелы", + "addNew": "Добавить новую", + "addNewModel": "Добавить новую модель", + "addManually": "Добавить вручную", + "manual": "Ручное", + "name": "Название", + "nameValidationMsg": "Введите название модели", + "description": "Описание", + "descriptionValidationMsg": "Введите описание модели", + "config": "Файл конфигурации", + "configValidationMsg": "Путь до файла конфигурации", + "modelLocation": "Расположение модели", + "modelLocationValidationMsg": "Путь до файла с моделью", + "vaeLocation": "Расположение VAE", + "vaeLocationValidationMsg": "Путь до VAE", + "width": "Ширина", + "widthValidationMsg": "Исходная ширина изображений", + "height": "Высота", + "heightValidationMsg": "Исходная высота изображений", + "addModel": "Добавить модель", + "updateModel": "Обновить модель", + "availableModels": "Доступные модели", + "search": "Искать", + "load": "Загрузить", + "active": "активна", + "notLoaded": "не загружена", + "cached": "кэширована", + "checkpointFolder": "Папка с моделями", + "clearCheckpointFolder": "Очистить папку с моделями", + "findModels": "Найти модели", + "scanAgain": "Сканировать снова", + "modelsFound": "Найденные модели", + "selectFolder": "Выбрать папку", + "selected": "Выбраны", + "selectAll": "Выбрать все", + "deselectAll": "Снять выделение", + "showExisting": "Показывать добавленные", + "addSelected": "Добавить выбранные", + "modelExists": "Модель уже добавлена", + "selectAndAdd": "Выберите и добавьте модели из списка", + "noModelsFound": "Модели не найдены", + "delete": "Удалить", + "deleteModel": "Удалить модель", + "deleteConfig": "Удалить конфигурацию", + "deleteMsg1": "Вы точно хотите удалить модель из InvokeAI?", + "deleteMsg2": "Это не удалит файл модели с диска. Позже вы можете добавить его снова." +} diff --git a/frontend/public/locales/tooltip/ru.json b/frontend/public/locales/tooltip/ru.json index 0967ef424b..ad4793dca8 100644 --- a/frontend/public/locales/tooltip/ru.json +++ b/frontend/public/locales/tooltip/ru.json @@ -1 +1,15 @@ -{} +{ + "feature": { + "prompt": "Это поле для текста запроса, включая объекты генерации и стилистические термины. В запрос можно включить и коэффициенты веса (значимости токена), но консольные команды и параметры не будут работать.", + "gallery": "Здесь отображаются генерации из папки outputs по мере их появления.", + "other": "Эти опции включают альтернативные режимы обработки для Invoke. 'Бесшовный узор' создаст повторяющиеся узоры на выходе. 'Высокое разрешение' это генерация в два этапа с помощью img2img: используйте эту настройку, когда хотите получить цельное изображение большего размера без артефактов.", + "seed": "Значение сида влияет на начальный шум, из которого сформируется изображение. Можно использовать уже имеющийся сид из предыдущих изображений. 'Порог шума' используется для смягчения артефактов при высоких значениях CFG (попробуйте в диапазоне 0-10), а Перлин для добавления шума Перлина в процессе генерации: оба параметра служат для большей вариативности результатов.", + "variations": "Попробуйте вариацию со значением от 0.1 до 1.0, чтобы изменить результат для заданного сида. Интересные вариации сида находятся между 0.1 и 0.3.", + "upscale": "Используйте ESRGAN, чтобы увеличить изображение сразу после генерации.", + "faceCorrection": "Коррекция лиц с помощью GFPGAN или Codeformer: алгоритм определяет лица в готовом изображении и исправляет любые дефекты. Высокие значение силы меняет изображение сильнее, в результате лица будут выглядеть привлекательнее. У Codeformer более высокая точность сохранит исходное изображение в ущерб коррекции лица.", + "imageToImage": "'Изображение в изображение' загружает любое изображение, которое затем используется для генерации вместе с запросом. Чем больше значение, тем сильнее изменится изображение в результате. Возможны значения от 0 до 1, рекомендуется диапазон .25-.75", + "boundingBox": "'Ограничительная рамка' аналогична настройкам Ширина и Высота для 'Избражения из текста' или 'Изображения в изображение'. Будет обработана только область в рамке.", + "seamCorrection": "Управление обработкой видимых швов, возникающих между изображениями на холсте.", + "infillAndScaling": "Управление методами заполнения (используется для масок или стертых областей холста) и масштабирования (полезно для малых размеров ограничивающей рамки)." + } +} From 686640af3acece799307daeee20d10e2d66405e4 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 30 Dec 2022 23:16:23 +1300 Subject: [PATCH 08/11] Fix status localization not working when iteration count > 0 --- frontend/src/features/system/components/StatusIndicator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/features/system/components/StatusIndicator.tsx b/frontend/src/features/system/components/StatusIndicator.tsx index b13fb9b274..6e16a537fd 100644 --- a/frontend/src/features/system/components/StatusIndicator.tsx +++ b/frontend/src/features/system/components/StatusIndicator.tsx @@ -61,7 +61,7 @@ const StatusIndicator = () => { if (statusMessage) if (isProcessing) { if (totalIterations > 1) { - statusMessage += ` (${currentIteration}/${totalIterations})`; + statusMessage = t(statusMessage as keyof typeof t) + ` (${currentIteration}/${totalIterations})`; } } From 5d4da31dcd782d1c3c010d60d9ec9d88ad799384 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 31 Dec 2022 04:30:52 +1300 Subject: [PATCH 09/11] Localization Updates --- frontend/public/locales/modelmanager/de.json | 3 +++ frontend/public/locales/tooltip/de.json | 16 +++++++++++++++- frontend/public/locales/tooltip/en-US.json | 20 ++++++++++---------- frontend/public/locales/tooltip/en.json | 20 ++++++++++---------- frontend/public/locales/tooltips/it.json | 15 +++++++++++++++ 5 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 frontend/public/locales/tooltips/it.json diff --git a/frontend/public/locales/modelmanager/de.json b/frontend/public/locales/modelmanager/de.json index 395267878c..63da31026a 100644 --- a/frontend/public/locales/modelmanager/de.json +++ b/frontend/public/locales/modelmanager/de.json @@ -34,6 +34,7 @@ "checkpointFolder": "Checkpoint-Ordner", "clearCheckpointFolder": "Checkpoint-Ordner löschen", "findModels": "Models finden", + "scanAgain": "Erneut scannen", "modelsFound": "Models gefunden", "selectFolder": "Ordner auswählen", "selected": "Ausgewählt", @@ -42,6 +43,8 @@ "showExisting": "Vorhandene anzeigen", "addSelected": "Auswahl hinzufügen", "modelExists": "Model existiert", + "selectAndAdd": "Unten aufgeführte Models auswählen und hinzufügen", + "noModelsFound": "Keine Models gefunden", "delete": "Löschen", "deleteModel": "Model löschen", "deleteConfig": "Konfiguration löschen", diff --git a/frontend/public/locales/tooltip/de.json b/frontend/public/locales/tooltip/de.json index 0967ef424b..f88cecb146 100644 --- a/frontend/public/locales/tooltip/de.json +++ b/frontend/public/locales/tooltip/de.json @@ -1 +1,15 @@ -{} +{ + "feature": { + "prompt": "Dies ist das Prompt-Feld. Ein Prompt enthält Generierungsobjekte und stilistische Begriffe. Sie können auch Gewichtungen (Token-Bedeutung) dem Prompt hinzufügen, aber CLI-Befehle und Parameter funktionieren nicht.", + "gallery": "Die Galerie zeigt erzeugte Bilder aus dem Ausgabeordner an, sobald sie erstellt wurden. Die Einstellungen werden in den Dateien gespeichert und können über das Kontextmenü aufgerufen werden.", + "other": "Mit diesen Optionen werden alternative Verarbeitungsmodi für InvokeAI aktiviert. 'Nahtlose Kachelung' erzeugt sich wiederholende Muster in der Ausgabe. 'Hohe Auflösungen' werden in zwei Schritten mit img2img erzeugt: Verwenden Sie diese Einstellung, wenn Sie ein größeres und kohärenteres Bild ohne Artefakte wünschen. Es dauert länger als das normale txt2img.", + "seed": "Der Seed-Wert beeinflusst das Ausgangsrauschen, aus dem das Bild erstellt wird. Sie können die bereits vorhandenen Seeds von früheren Bildern verwenden. 'Der Rauschschwellenwert' wird verwendet, um Artefakte bei hohen CFG-Werten abzuschwächen (versuchen Sie es im Bereich 0-10), und Perlin, um während der Erzeugung Perlin-Rauschen hinzuzufügen: Beide dienen dazu, Ihre Ergebnisse zu variieren.", + "variations": "Versuchen Sie eine Variation mit einem Wert zwischen 0,1 und 1,0, um das Ergebnis für ein bestimmtes Seed zu ändern. Interessante Variationen des Seeds liegen zwischen 0,1 und 0,3.", + "upscale": "Verwenden Sie ESRGAN, um das Bild unmittelbar nach der Erzeugung zu vergrößern.", + "faceCorrection": "Gesichtskorrektur mit GFPGAN oder Codeformer: Der Algorithmus erkennt Gesichter im Bild und korrigiert alle Fehler. Ein hoher Wert verändert das Bild stärker, was zu attraktiveren Gesichtern führt. Codeformer mit einer höheren Genauigkeit bewahrt das Originalbild auf Kosten einer stärkeren Gesichtskorrektur.", + "imageToImage": "Bild zu Bild lädt ein beliebiges Bild als Ausgangsbild, aus dem dann zusammen mit dem Prompt ein neues Bild erzeugt wird. Je höher der Wert ist, desto stärker wird das Ergebnisbild verändert. Werte von 0,0 bis 1,0 sind möglich, der empfohlene Bereich ist .25-.75", + "boundingBox": "Der Begrenzungsrahmen ist derselbe wie die Einstellungen für Breite und Höhe bei Text zu Bild oder Bild zu Bild. Es wird nur der Bereich innerhalb des Rahmens verarbeitet.", + "seamCorrection": "Steuert die Behandlung von sichtbaren Übergängen, die zwischen den erzeugten Bildern auf der Leinwand auftreten.", + "infillAndScaling": "Verwalten Sie Infill-Methoden (für maskierte oder gelöschte Bereiche der Leinwand) und Skalierung (nützlich für kleine Begrenzungsrahmengrößen)." + } +} diff --git a/frontend/public/locales/tooltip/en-US.json b/frontend/public/locales/tooltip/en-US.json index 1d03f54b7f..572594fe65 100644 --- a/frontend/public/locales/tooltip/en-US.json +++ b/frontend/public/locales/tooltip/en-US.json @@ -1,15 +1,15 @@ { "feature": { - "prompt": "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.", - "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", - "other": "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.", - "seed": "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.", - "variations": "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.", - "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", - "faceCorrection": "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.", - "imageToImage": "Image to Image 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.", - "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", - "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "prompt": "This is the prompt field. Prompt includes generation objects and stylistic terms. You can add weight (token importance) in the prompt as well, but CLI commands and parameters will not work.", + "gallery": "Gallery displays generations from the outputs folder as they're created. Settings are stored within files and accesed by context menu.", + "other": "These options will enable alternative processing modes for Invoke. 'Seamless tiling' will create repeating patterns in the output. 'High resolution' is generation in two steps with img2img: use this setting when you want a larger and more coherent image without artifacts. It will take longer that usual txt2img.", + "seed": "Seed value affects the initial noise from which the image is formed. You can use the already existing seeds from previous images. 'Noise Threshold' is used to mitigate artifacts at high CFG values (try the 0-10 range), and Perlin to add Perlin noise during generation: both serve to add variation to your outputs.", + "variations": "Try a variation with a value between 0.1 and 1.0 to change the result for a given seed. Interesting variations of the seed are between 0.1 and 0.3.", + "upscale": "Use ESRGAN to enlarge the image immediately after generation.", + "faceCorrection": "Face correction with GFPGAN or Codeformer: the algorithm detects faces in the image and corrects any defects. High value will change the image more, resulting in more attractive faces. Codeformer with a higher fidelity preserves the original image at the expense of stronger face correction.", + "imageToImage": "Image to Image loads any image as initial, which is then used to generate a new one along with the prompt. The higher the value, the more the result image will change. Values from 0.0 to 1.0 are possible, the recommended range is .25-.75", + "boundingBox": "The bounding box is the same as the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Controls the handling of visible seams that occur between generated images on the canvas.", "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." } } diff --git a/frontend/public/locales/tooltip/en.json b/frontend/public/locales/tooltip/en.json index 1d03f54b7f..572594fe65 100644 --- a/frontend/public/locales/tooltip/en.json +++ b/frontend/public/locales/tooltip/en.json @@ -1,15 +1,15 @@ { "feature": { - "prompt": "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.", - "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", - "other": "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.", - "seed": "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.", - "variations": "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.", - "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", - "faceCorrection": "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.", - "imageToImage": "Image to Image 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.", - "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", - "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "prompt": "This is the prompt field. Prompt includes generation objects and stylistic terms. You can add weight (token importance) in the prompt as well, but CLI commands and parameters will not work.", + "gallery": "Gallery displays generations from the outputs folder as they're created. Settings are stored within files and accesed by context menu.", + "other": "These options will enable alternative processing modes for Invoke. 'Seamless tiling' will create repeating patterns in the output. 'High resolution' is generation in two steps with img2img: use this setting when you want a larger and more coherent image without artifacts. It will take longer that usual txt2img.", + "seed": "Seed value affects the initial noise from which the image is formed. You can use the already existing seeds from previous images. 'Noise Threshold' is used to mitigate artifacts at high CFG values (try the 0-10 range), and Perlin to add Perlin noise during generation: both serve to add variation to your outputs.", + "variations": "Try a variation with a value between 0.1 and 1.0 to change the result for a given seed. Interesting variations of the seed are between 0.1 and 0.3.", + "upscale": "Use ESRGAN to enlarge the image immediately after generation.", + "faceCorrection": "Face correction with GFPGAN or Codeformer: the algorithm detects faces in the image and corrects any defects. High value will change the image more, resulting in more attractive faces. Codeformer with a higher fidelity preserves the original image at the expense of stronger face correction.", + "imageToImage": "Image to Image loads any image as initial, which is then used to generate a new one along with the prompt. The higher the value, the more the result image will change. Values from 0.0 to 1.0 are possible, the recommended range is .25-.75", + "boundingBox": "The bounding box is the same as the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Controls the handling of visible seams that occur between generated images on the canvas.", "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." } } diff --git a/frontend/public/locales/tooltips/it.json b/frontend/public/locales/tooltips/it.json new file mode 100644 index 0000000000..182fa9e62a --- /dev/null +++ b/frontend/public/locales/tooltips/it.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "Questo è il campo del prompt. Il prompt include oggetti di generazione e termini stilistici. Puoi anche aggiungere il peso (importanza del token) nel prompt, ma i comandi e i parametri dell'interfaccia a linea di comando non funzioneranno.", + "gallery": "Galleria visualizza le generazioni dalla cartella degli output man mano che vengono create. Le impostazioni sono memorizzate all'interno di file e accessibili dal menu contestuale.", + "other": "Queste opzioni abiliteranno modalità di elaborazione alternative per Invoke. 'Piastrella senza cuciture' creerà modelli ripetuti nell'output. 'Ottimizzzazione Alta risoluzione' è la generazione in due passaggi con 'Immagine a Immagine': usa questa impostazione quando vuoi un'immagine più grande e più coerente senza artefatti. Ci vorrà più tempo del solito 'Testo a Immagine'.", + "seed": "Il valore del Seme influenza il rumore iniziale da cui è formata l'immagine. Puoi usare i semi già esistenti dalle immagini precedenti. 'Soglia del rumore' viene utilizzato per mitigare gli artefatti a valori CFG elevati (provare l'intervallo 0-10) e Perlin per aggiungere il rumore Perlin durante la generazione: entrambi servono per aggiungere variazioni ai risultati.", + "variations": "Prova una variazione con un valore compreso tra 0.1 e 1.0 per modificare il risultato per un dato seme. Variazioni interessanti del seme sono comprese tra 0.1 e 0.3.", + "upscale": "Utilizza ESRGAN per ingrandire l'immagine subito dopo la generazione.", + "faceCorrection": "Correzione del volto con GFPGAN o Codeformer: l'algoritmo rileva i volti nell'immagine e corregge eventuali difetti. Un valore alto cambierà maggiormente l'immagine, dando luogo a volti più attraenti. Codeformer con una maggiore fedeltà preserva l'immagine originale a scapito di una correzione facciale più forte.", + "imageToImage": "Da Immagine a Immagine carica qualsiasi immagine come iniziale, che viene quindi utilizzata per generarne una nuova in base al prompt. Più alto è il valore, più cambierà l'immagine risultante. Sono possibili valori da 0.0 a 1.0, l'intervallo consigliato è 0.25-0.75", + "boundingBox": "Il riquadro di selezione è lo stesso delle impostazioni Larghezza e Altezza per dat Testo a Immagine o da Immagine a Immagine. Verrà elaborata solo l'area nella casella.", + "seamCorrection": "Controlla la gestione delle giunzioni visibili che si verificano tra le immagini generate sulla tela.", + "infillAndScaling": "Gestisce i metodi di riempimento (utilizzati su aree mascherate o cancellate dell'area di disegno) e il ridimensionamento (utile per i riquadri di selezione di piccole dimensioni)." + } +} From 9f719883c822bb087b51fbdfba112e4ca229cd58 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 31 Dec 2022 04:33:35 +1300 Subject: [PATCH 10/11] WebUI 2.2.5 Bug Fix Build --- ...y-3415d492.js => index-legacy-f39d2eb7.js} | 2 +- .../{index.dca51560.js => index.726ca2dc.js} | 2 +- frontend/dist/index.html | 4 +- frontend/dist/locales/modelmanager/de.json | 3 ++ frontend/dist/locales/modelmanager/ru.json | 54 ++++++++++++++++++- frontend/dist/locales/tooltip/de.json | 16 +++++- frontend/dist/locales/tooltip/en-US.json | 20 +++---- frontend/dist/locales/tooltip/en.json | 20 +++---- frontend/dist/locales/tooltip/ru.json | 16 +++++- frontend/dist/locales/tooltips/it.json | 15 ++++++ 10 files changed, 125 insertions(+), 27 deletions(-) rename frontend/dist/assets/{index-legacy-3415d492.js => index-legacy-f39d2eb7.js} (78%) rename frontend/dist/assets/{index.dca51560.js => index.726ca2dc.js} (83%) create mode 100644 frontend/dist/locales/tooltips/it.json diff --git a/frontend/dist/assets/index-legacy-3415d492.js b/frontend/dist/assets/index-legacy-f39d2eb7.js similarity index 78% rename from frontend/dist/assets/index-legacy-3415d492.js rename to frontend/dist/assets/index-legacy-f39d2eb7.js index 7a5e0b8470..3babd3134a 100644 --- a/frontend/dist/assets/index-legacy-3415d492.js +++ b/frontend/dist/assets/index-legacy-f39d2eb7.js @@ -26,7 +26,7 @@ var Y=a.exports,Z=G.exports;function X(e){for(var t="https://reactjs.org/docs/er * 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="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",y="[object Array]",b="[object Boolean]",x="[object Date]",w="[object Error]",k="[object Function]",S="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",P="[object Promise]",L="[object RegExp]",O="[object Set]",M="[object String]",T="[object Symbol]",A="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",F="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,Z=RegExp(q.source),X=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Me="['’]",Te="["+Se+"]",Ae="["+Oe+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+Se+Oe+Re+_e+Ee+Pe+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+Se+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Pe+"]",Ve="\\u200d",$e="(?:"+De+"|"+ze+")",Ue="(?:"+We+"|"+ze+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ie+"|"+Be+")"+"?",Ze="["+Le+"]?",Xe=Ze+Ye+("(?:"+Ve+"(?:"+[je,Fe,He].join("|")+")"+Ze+Ye+")*"),Ke="(?:"+[Ne,Fe,He].join("|")+")"+Xe,Qe="(?:"+[je+Ie+"?",Ie,Fe,He,Te].join("|")+")",Je=RegExp(Me,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+Ge+"(?="+[Ae,We,"$"].join("|")+")",Ue+"+"+qe+"(?="+[Ae,We+$e,"$"].join("|")+")",We+"?"+$e+"+"+Ge,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ve+Se+Ce+Le+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[j]=st[F]=st[H]=st[W]=st[V]=!0,st[v]=st[y]=st[I]=st[b]=st[R]=st[x]=st[w]=st[k]=st[C]=st[_]=st[E]=st[L]=st[O]=st[M]=st[A]=!1;var lt={};lt[v]=lt[y]=lt[I]=lt[R]=lt[b]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[j]=lt[C]=lt[_]=lt[E]=lt[L]=lt[O]=lt[M]=lt[T]=lt[F]=lt[H]=lt[W]=lt[V]=!0,lt[w]=lt[k]=lt[A]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof o&&o&&o.Object===Object&&o,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,yt=vt&&ht.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(B2){}}(),xt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,kt=bt&&bt.isMap,St=bt&&bt.isRegExp,Ct=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var yn=function e(t){var o,ae=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,Se=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Pe=t.Object,Le=t.RegExp,Oe=t.String,Me=t.TypeError,Te=ae.prototype,Ae=_e.prototype,Ie=Pe.prototype,Re=t["__core-js_shared__"],Ne=Ae.toString,De=Ie.hasOwnProperty,ze=0,Be=(o=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",je=Ie.toString,Fe=Ne.call(Pe),He=pt._,We=Le("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=vt?t.Buffer:n,$e=t.Symbol,Ue=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:n,qe=un(Pe.getPrototypeOf,Pe),Ye=Pe.create,Ze=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=$e?$e.isConcatSpreadable:n,Qe=$e?$e.iterator:n,tt=$e?$e.toStringTag:n,rt=function(){try{var e=pi(Pe,"defineProperty");return e({},"",{}),e}catch(B2){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Se&&Se.now!==pt.Date.now&&Se.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,yt=Pe.getOwnPropertySymbols,bt=Ve?Ve.isBuffer:n,jt=t.isFinite,qt=Te.join,bn=un(Pe.keys,Pe),xn=Ee.max,wn=Ee.min,kn=Se.now,Sn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Pn=pi(t,"Map"),Ln=pi(t,"Promise"),On=pi(t,"Set"),Mn=pi(t,"WeakMap"),Tn=pi(Pe,"create"),An=Mn&&new Mn,In={},Rn=Hi(En),Nn=Hi(Pn),Dn=Hi(Ln),zn=Hi(On),Bn=Hi(Mn),jn=$e?$e.prototype:n,Fn=jn?jn.valueOf:n,Hn=jn?jn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Un(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ao(e,s)}else{var h=vi(e),f=h==k||h==S;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:bi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Po(e);case b:case x:return new r(+e);case R:return function(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case j:case F:case H:case W:case V:return Lo(e,n);case C:return new r;case _:case M:return new r(e);case L:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case T:return o=e,Fn?Pe(Fn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Lt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Pe(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,o){if("function"!=typeof e)throw new Me(r);return Ri((function(){e.apply(n,o)}),t)}function fr(e,t,n,r){var o=-1,i=At,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Pn||Yn),string:new qn}},Zn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return hi(this,e).get(e)},Zn.prototype.has=function(e){return hi(this,e).has(e)},Zn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(kr),gr=Do(Sr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?br(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,Rs)}function Sr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=ko(t,e)).length;null!=e&&rt}function Or(e,t){return null!=e&&De.call(e,t)}function Mr(e,t){return null!=e&&t in Pe(e)}function Tr(e,t,r){for(var o=r?It:At,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Oi(e,t,al),e+"")}function Jr(e){return Jn(Vs(e))}function eo(e,t){var n=Vs(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=ko(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Lo(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Oo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&ki(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Pe(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var o=t.length,i=o,a=Un.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Me(r);if(a&&!l&&"wrapper"==ci(s))var l=new Un([],!0)}for(i=l?i:o;++i1&&y.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Lt(m,(function(n){var r="_."+n[0];t&n[1]&&!At(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=kn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Gn&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Un(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ya=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ho(Gi),xa=Ho(qi);function wa(e,t){return(qa(e)?Lt:pr)(e,di(t,3))}function ka(e,t){return(qa(e)?Ot:gr)(e,di(t,3))}var Sa=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Za(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Ar(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var Pa=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var La=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,br(t,1),[])})),Oa=ht||function(){return pt.Date.now()};function Ma(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var o;if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Aa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Aa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,o){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Me(r);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(y,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function y(){var e=Oa();if(v(e))return b(e);c=Ri(y,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function b(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Oa(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(y,t),g(u)}return c===n&&(c=Ri(y,t)),l}return t=bs(t)||0,rs(o)&&(h=!!o.leading,s=(f="maxWait"in o)?xn(bs(o.maxWait)||0,t):s,p="trailing"in o?!!o.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:b(Oa())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,bs(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Zn),n}function Ba(e){if("function"!=typeof e)throw new Me(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Zn;var ja=So((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(br(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),Ga=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ze.call(e,"callee")},qa=ae.isArray,Ya=xt?Qt(xt):function(e){return os(e)&&Pr(e)==I};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Za(e)}var Ka=bt||bl,Qa=wt?Qt(wt):function(e){return os(e)&&Pr(e)==x};function Ja(e){if(!os(e))return!1;var t=Pr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Pr(e);return t==k||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=kt?Qt(kt):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Pr(e)==_}function ss(e){if(!os(e)||Pr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ls=St?Qt(St):function(e){return os(e)&&Pr(e)==L};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==O};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Pr(e)==M}function ds(e){return"symbol"==typeof e||os(e)&&Pr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Pr(e)]};var fs=Zo(Fr),ps=Zo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Za(e))return us(e)?gn(e):Ao(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==O?hn:Vs)(e)}function ms(e){return e?(e=bs(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?cr(vs(e),0,g):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||ye.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var ks=No((function(e,t){if(Ei(t)||Za(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),Ss=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ps=Qr((function(e,t){e=Pe(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&ki(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var js=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Vs(e){return null==e?[]:Jt(e,Rs(e))}var $s=jo((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=jo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=jo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Bo("toLowerCase");var Xs=jo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=jo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=jo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(B2){return Ja(B2)?B2:new Ce(B2)}})),nl=ii((function(e,t){return Lt(t,(function(t){t=Fi(t),sr(e,t,Aa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Ao(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=Go(Rt),fl=Go(Mt),pl=Go(Bt);function gl(e){return Si(e)?Gt(Fi(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Yo(),vl=Yo(!0);function yl(){return[]}function bl(){return!1}var xl=Uo((function(e,t){return e+t}),0),wl=Ko("ceil"),kl=Uo((function(e,t){return e/t}),1),Sl=Ko("floor");var Cl,_l=Uo((function(e,t){return e*t}),1),El=Ko("round"),Pl=Uo((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Ma,Wn.assign=ks,Wn.assignIn=Ss,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Aa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?ki(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:ys(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Me(r);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Me(r);return rs(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:o,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,Fi):ds(e)?[e]:Ao(ji(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Vn(qe(e)):{}}return(o?Lt:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Ma(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Vs,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return Fa(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return bo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return bo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=Ss,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=$s,Wn.capitalize=Us,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),cr(bs(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=Gs,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=kl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Va,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Y,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?Mt:mr;return r&&ki(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ba,Wn.findIndex=Gi,Wn.findKey=function(e,t){return Ft(e,di(t,3),kr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return Ft(e,di(t,3),Sr)},Wn.floor=Sl,Wn.forEach=wa,Wn.forEachRight=ka,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&kr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&Sr(e,di(t,3))},Wn.get=Os,Wn.gt=$a,Wn.gte=Ua,Wn.has=function(e,t){return null!=e&&yi(e,t,Or)},Wn.hasIn=Ms,Wn.head=Zi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Za(e)?e:Vs(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==A},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Pr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,$t,i,!0)},Wn.lowerCase=Ys,Wn.lowerFirst=Zs,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Lr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Lr):n},Wn.mean=function(e){return Ut(e,al)},Wn.meanBy=function(e,t){return Ut(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,Fr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Fr):n},Wn.stubArray=yl,Wn.stubFalse=bl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Ur(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Oa,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?ki(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Le(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Z.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=ka,Wn.first=Zi,ul(Wn,(Cl={},kr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Lt(["drop","take"],(function(e,t){Gn.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new Gn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(di(e)))},Gn.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},kr(Gn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Un(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Vo(n,2).name]=[{name:"wrapper",func:n}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Ao(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ao(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ao(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=yn)._=yn,gt._=yn):pt._=yn}).call(o)}(MU,MU.exports);const TU=MU.exports,AU=AV({name:"gallery",initialState:{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,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=MU.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].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},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:IU,clearIntermediateImage:RU,removeImage:NU,setCurrentImage:DU,addGalleryImages:zU,setIntermediateImage:BU,selectNextImage:jU,selectPrevImage:FU,setShouldPinGallery:HU,setShouldShowGallery:WU,setGalleryScrollPosition:VU,setGalleryImageMinimumWidth:$U,setGalleryImageObjectFit:UU,setShouldHoldGalleryOpen:GU,setShouldAutoSwitchToNewImages:qU,setCurrentCategory:YU,setGalleryWidth:ZU,setShouldUseSingleGalleryColumn:XU}=AU.actions,KU=AU.reducer;function QU(e){return QU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QU(e)}function JU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eG(e){var t=function(e,t){if("object"!==QU(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==QU(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===QU(t)?t:String(t)}function tG(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.init(t,n)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fG,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function wG(e,t,n){var r=xG(e,t,Object);r.obj[r.k]=n}function kG(e,t){var n=xG(e,t),r=n.obj,o=n.k;if(r)return r[o]}function SG(e,t,n){var r=kG(e,n);return void 0!==r?r:kG(t,n)}function CG(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):CG(e[r],t[r],n):e[r]=t[r]);return e}function _G(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var EG={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function PG(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return EG[e]})):e}var LG="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,OG=[" ",",","?","!",";"];function MG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TG(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?IG(l,c,n):void 0}o=o[r[i]]}return o}}var RG=function(e){iG(n,e);var t=AG(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return nG(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=kG(this.data,a);return s||!i||"string"!=typeof n?s:IG(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),wG(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=kG(this.data,a)||{};r?CG(s,n,o):s=TG(TG({},s),n),wG(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?TG(TG({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(mG),NG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function DG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zG(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),bG(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,rG(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gG.create("translator"),r}return nG(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=OG.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==QU(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),g=p&&p.res,m=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(g),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(w&&g&&k&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,g,zG(zG({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?v:m;for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,zG(zG({},t),{joinArrays:!1,ns:c})),_[P]===L&&(_[P]=g[P])}g=_}}else if(w&&"string"==typeof x&&"[object Array]"===y)(g=g.join(x))&&(g=this.extendTranslation(g,e,t,r));else{var O=!1,M=!1,T=void 0!==t.count&&"string"!=typeof t.count,A=n.hasDefaultValue(t),I=T?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(g)&&A&&(O=!0,g=R),this.isValidLookup(g)||(M=!0,g=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&M?void 0:g,z=A&&R!==g&&this.options.updateMissing;if(M||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,u,l,z?R:g),a){var B=this.resolve(l,zG(zG({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!jG["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(jG["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var g="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(g),d&&(l.push(g+u),h&&l.push(g+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(mG);function HG(e){return e.charAt(0).toUpperCase()+e.slice(1)}var WG=function(){function e(t){JU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gG.create("languageUtils")}return nG(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=HG(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),VG=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},UG=["v1","v2","v3"],GG={zero:0,one:1,two:2,few:3,many:4,other:5};function qG(){var e={};return VG.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:$G[t.fc]}}))})),e}var YG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.languageUtils=t,this.options=n,this.logger=gG.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=qG()}return nG(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return GG[e]-GG[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!UG.includes(this.options.compatibilityJSON)}}]),e}();function ZG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return nG(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:PG,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_G(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_G(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?_G(t.nestingPrefix):t.nestingPrefixEscaped||_G("$t("),this.nestingSuffix=t.nestingSuffix?_G(t.nestingSuffix):t.nestingSuffixEscaped||_G(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=SG(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,XG(XG(XG({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(SG(t,l,a),c,n,XG(XG(XG({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yG(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),h?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=XG(XG({},t),o))}catch(B2){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),B2),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=XG({},a)).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yG(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,XG(XG({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function QG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("formatter"),this.options=t,this.formats={number:eq((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:eq((function(e,t){var n=new Intl.NumberFormat(e,JG(JG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:eq((function(e,t){var n=new Intl.DateTimeFormat(e,JG({},t));return function(e){return n.format(e)}})),relativetime:eq((function(e,t){var n=new Intl.RelativeTimeFormat(e,JG({},t));return function(e){return n.format(e,t.range||"day")}})),list:eq((function(e,t){var n=new Intl.ListFormat(e,JG({},t));return function(e){return n.format(e)}}))},this.init(t)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=eq(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=uG(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,JG(JG(JG({},s),r),c))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function nq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rq(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return JU(this,n),i=t.call(this),LG&&mG.call(rG(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=gG.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return nG(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=xG(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=rq(rq({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var c;(c=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(Hhe){a(Hhe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(mG);function aq(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===QU(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===QU(e[2])||"object"===QU(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function sq(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(JU(this,n),e=t.call(this),LG&&mG.call(rG(e)),e.options=sq(r),e.services={},e.logger=gG,e.modules={external:[]},hq(rG(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),aG(e,rG(e));setTimeout((function(){e.init(r,o)}),0)}return e}return nG(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=aq();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=cq(cq(cq({},r),this.options),sq(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=cq(cq({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?gG.init(o(this.modules.logger),this.options):gG.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=tq);var a=new WG(this.options);this.store=new RG(this.options.resources,this.options);var s=this.services;s.logger=gG,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new YG(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new KG(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new iq(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=vG(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=vG();return e||(e=this.languages),t||(t=this.options.ns),n||(n=dq),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&NG.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=vG();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==QU(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=vG();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=vG();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new WG(aq());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,o=cq(cq(cq({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=cq({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new FG(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fq(e,t)}));var pq=fq.createInstance();function gq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mq(e){return mq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mq(e)}function vq(e){var t=function(e,t){if("object"!==mq(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==mq(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mq(t)?t:String(t)}function yq(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Sq.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Sq.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},_q=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=Cq(e,encodeURIComponent(t),o)},Eq=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},Oq=null,Mq=function(){if(null!==Oq)return Oq;try{Oq="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(B2){Oq=!1}return Oq},Tq={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Mq()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Mq()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Aq=null,Iq=function(){if(null!==Aq)return Aq;try{Aq="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(B2){Aq=!1}return Aq},Rq={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Iq()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Iq()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},Nq={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Dq={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},zq={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},Bq={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var jq=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};gq(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=kq(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Pq),this.addDetector(Lq),this.addDetector(Tq),this.addDetector(Rq),this.addDetector(Nq),this.addDetector(Dq),this.addDetector(zq),this.addDetector(Bq)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&yq(t.prototype,n),r&&yq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fq(e){return Fq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fq(e)}jq.type="languageDetector";var Hq=[],Wq=Hq.forEach,Vq=Hq.slice;function $q(e){return Wq.call(Vq.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function Uq(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Fq(XMLHttpRequest))}function Gq(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qq,Yq={exports:{}},Zq={exports:{}};function Xq(){return qq||(qq=1,function(e,t){var n="undefined"!=typeof self?self:o,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(B2){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];w.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(Hhe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Zq,Zq.exports)),Zq.exports}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==o&&o.fetch?o.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==Gq&&("undefined"==typeof window||void 0===window.document)){var r=n||Xq();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(Yq,Yq.exports);const Kq=Yq.exports,Qq=r({__proto__:null,default:Kq},[Yq.exports]);function Jq(e){return Jq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jq(e)}var eY,tY,nY;"function"==typeof fetch&&(eY="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),Uq()&&("undefined"!=typeof global&&global.XMLHttpRequest?tY=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(tY=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?nY=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(nY=window.ActiveXObject)),eY||!Qq||tY||nY||(eY=Kq||Qq),"function"!=typeof eY&&(eY=void 0);var rY=function(e,t){if(t&&"object"===Jq(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},oY=function(e,t,n){eY(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},iY=!1,aY=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},eY&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=rY(t,e.queryStringParams));var o=$q({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=$q({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},iY?{}:i);try{oY(t,a,r)}catch(B2){if(!i||0===Object.keys(i).length||!B2.message||B2.message.indexOf("not implemented")<0)return r(B2);try{Object.keys(i).forEach((function(e){delete a[e]})),oY(t,a,r),iY=!0}catch(Hhe){r(Hhe)}}}(e,t,n,r):Uq()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===Jq(n)&&(n=rY("",n).slice(1)),e.queryStringParams&&(t=rY(t,e.queryStringParams));try{var o;(o=tY?new tY:new nY("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(B2){console&&console.log(B2)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function sY(e){return sY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sY(e)}function lY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cY(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};lY(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=$q(n,this.options||{},dY()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(B2){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var u=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,u,a,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&cY(t.prototype,n),r&&cY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fY(e){return fY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fY(e)}function pY(e){var t=function(e,t){if("object"!==fY(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fY(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fY(t)?t:String(t)}function gY(e,t,n){return(t=pY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mY(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function wY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return yY("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):xY(e,t,n)}var kY=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SY={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},CY=function(e){return SY[e]};function _Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function EY(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};LY=EY(EY({},LY),e)}(e.options.react),function(e){PY=e}(e)}},IY=a.exports.createContext(),RY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&TY(t.prototype,n),r&&TY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function NY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=a.exports.useContext(IY)||{},o=r.i18n,i=r.defaultNS,s=n||o||MY();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new RY),!s){yY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&yY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BY(BY(BY({},OY()),s.options.react),t),d=u.useSuspense,h=u.keyPrefix,f=e||i||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var p=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return wY(e,s,u)}));function g(){return s.getFixedT(null,"fallback"===u.nsMode?f:f[0],h)}var m=a.exports.useState(g),v=DY(m,2),y=v[0],b=v[1],x=f.join(),w=jY(x),k=a.exports.useRef(!0);a.exports.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&b(g)}return k.current=!0,p||d||bY(s,f,(function(){k.current&&b(g)})),p&&w&&w!==x&&k.current&&b(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){k.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var S=a.exports.useRef(!0);a.exports.useEffect((function(){k.current&&!S.current&&b(g),S.current=!1}),[s,h]);var C=[y,s,p];if(C.t=y,C.i18n=s,C.ready=p,p)return C;if(!p&&!d)return C;throw new Promise((function(e){bY(s,f,(function(){e()}))}))}pq.use(hY).use(jq).use(AY).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","options","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const HY=AV({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:pq.isInitialized?pq.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=pq.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?pq.t("common:statusConnected"):pq.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},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=pq.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=pq.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=pq.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:WY,setIsProcessing:VY,addLogEntry:$Y,setShouldShowLogViewer:UY,setIsConnected:GY,setSocketId:qY,setShouldConfirmOnDelete:YY,setOpenAccordions:ZY,setSystemStatus:XY,setCurrentStatus:KY,setSystemConfig:QY,setShouldDisplayGuides:JY,processingCanceled:eZ,errorOccurred:tZ,errorSeen:nZ,setModelList:rZ,setIsCancelable:oZ,modelChangeRequested:iZ,setSaveIntermediatesInterval:aZ,setEnableImageDebugging:sZ,generationRequested:lZ,addToast:cZ,clearToastQueue:uZ,setProcessingIndeterminateTask:dZ,setSearchFolder:hZ,setFoundModels:fZ,setOpenModel:pZ}=HY.actions,gZ=HY.reducer,mZ=(e,t)=>Math.floor(e/t)*t,vZ=(e,t)=>Math.round(e/t)*t,yZ=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),bZ=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},xZ=.95,wZ=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),kZ=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=vZ(a/o,64)):o<1&&(r.height=a,r.width=vZ(a*o,64)),i=r.width*r.height}return r},SZ=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],CZ=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],_Z=e=>"line"===e.kind&&"mask"===e.layer,EZ=e=>"image"===e.kind&&"base"===e.layer,PZ=e=>"line"===e.kind,LZ={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},OZ=AV({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:LZ,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!_Z(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:mZ(TU.clamp(n.width,64,512),64),height:mZ(TU.clamp(n.height,64,512),64)},i={x:vZ(n.width/2-o.width/2,64),y:vZ(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState={...LZ,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=bZ(r.width,r.height,n.width,n.height,xZ),s=yZ(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:vZ(r.width,64),height:vZ(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=kZ(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=wZ(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(PZ);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(TU.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState=LZ,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(EZ),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=bZ(o.width,o.height,512,512,xZ),n=yZ(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=kZ(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=bZ(t,n,i,a,.95),l=yZ(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=wZ(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(EZ)){const t=bZ(r.width,r.height,512,512,xZ),n=yZ(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=bZ(r,o,s,l,xZ),n=yZ(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=bZ(r,o,512,512,xZ),n=yZ(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=kZ(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:mZ(TU.clamp(i,64,512),64),height:mZ(TU.clamp(a,64,512),64)},n={x:vZ(i/2-t.width/2,64),y:vZ(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=kZ(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=kZ(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:MZ,addFillRect:TZ,addImageToStagingArea:AZ,addLine:IZ,addPointToCurrentLine:RZ,clearCanvasHistory:NZ,clearMask:DZ,commitColorPickerColor:zZ,commitStagingAreaImage:BZ,discardStagedImages:jZ,fitBoundingBoxToStage:FZ,mouseLeftCanvas:HZ,nextStagingAreaImage:WZ,prevStagingAreaImage:VZ,redo:$Z,resetCanvas:UZ,resetCanvasInteractionState:GZ,resetCanvasView:qZ,resizeAndScaleCanvas:YZ,resizeCanvas:ZZ,setBoundingBoxCoordinates:XZ,setBoundingBoxDimensions:KZ,setBoundingBoxPreviewFill:QZ,setBoundingBoxScaleMethod:JZ,setBrushColor:eX,setBrushSize:tX,setCanvasContainerDimensions:nX,setColorPickerColor:rX,setCursorPosition:oX,setDoesCanvasNeedScaling:iX,setInitialCanvasImage:aX,setInpaintReplace:sX,setIsDrawing:lX,setIsMaskEnabled:cX,setIsMouseOverBoundingBox:uX,setIsMoveBoundingBoxKeyHeld:dX,setIsMoveStageKeyHeld:hX,setIsMovingBoundingBox:fX,setIsMovingStage:pX,setIsTransformingBoundingBox:gX,setLayer:mX,setMaskColor:vX,setMergedCanvas:yX,setShouldAutoSave:bX,setShouldCropToBoundingBoxOnSave:xX,setShouldDarkenOutsideBoundingBox:wX,setShouldLockBoundingBox:kX,setShouldPreserveMaskedArea:SX,setShouldShowBoundingBox:CX,setShouldShowBrush:_X,setShouldShowBrushPreview:EX,setShouldShowCanvasDebugInfo:PX,setShouldShowCheckboardTransparency:LX,setShouldShowGrid:OX,setShouldShowIntermediates:MX,setShouldShowStagingImage:TX,setShouldShowStagingOutline:AX,setShouldSnapToGrid:IX,setShouldUseInpaintReplace:RX,setStageCoordinates:NX,setStageScale:DX,setTool:zX,toggleShouldLockBoundingBox:BX,toggleTool:jX,undo:FX,setScaledBoundingBoxDimensions:HX,setShouldRestrictStrokesToBox:WX}=OZ.actions,VX=OZ.reducer,$X=Object.create(null);$X.open="0",$X.close="1",$X.ping="2",$X.pong="3",$X.message="4",$X.upgrade="5",$X.noop="6";const UX=Object.create(null);Object.keys($X).forEach((e=>{UX[$X[e]]=e}));const GX={type:"error",data:"parser error"},qX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YX="function"==typeof ArrayBuffer,ZX=({type:e,data:t},n,r)=>qX&&t instanceof Blob?n?r(t):XX(t,r):YX&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):XX(new Blob([t]),r):r($X[e]+(t||"")),XX=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},KX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QX="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:nK(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:tK(e.substring(1),t)};return UX[n]?e.length>1?{type:UX[n],data:e.substring(1)}:{type:UX[n]}:GX},tK=(e,t)=>{if(JX){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return nK(n,t)}return{base64:!0,data:e}},nK=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,rK=String.fromCharCode(30);function oK(e){if(e)return function(e){for(var t in oK.prototype)e[t]=oK.prototype[t];return e}(e)}oK.prototype.on=oK.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},oK.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},oK.prototype.off=oK.prototype.removeListener=oK.prototype.removeAllListeners=oK.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const sK=setTimeout,lK=clearTimeout;function cK(e,t){t.useNativeTimers?(e.setTimeoutFn=sK.bind(iK),e.clearTimeoutFn=lK.bind(iK)):(e.setTimeoutFn=setTimeout.bind(iK),e.clearTimeoutFn=clearTimeout.bind(iK))}function uK(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class dK extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class hK extends oK{constructor(e){super(),this.writable=!1,cK(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new dK(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=eK(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pK={};let gK,mK=0,vK=0;function yK(e){let t="";do{t=fK[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function bK(){const e=yK(+new Date);return e!==gK?(mK=0,gK=e):e+"."+yK(mK++)}for(;vK<64;vK++)pK[fK[vK]]=vK;function xK(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let wK=!1;try{wK="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Hhe){}const kK=wK;function SK(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||kK))return new XMLHttpRequest}catch(B2){}if(!t)try{return new(iK[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(B2){}}function CK(){}const _K=null!=new SK({xdomain:!1}).responseType;class EK extends oK{constructor(e,t){super(),cK(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=aK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new SK(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(B2){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(B2){}try{t.setRequestHeader("Accept","*/*")}catch(B2){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(B2){return void this.setTimeoutFn((()=>{this.onError(B2)}),0)}"undefined"!=typeof document&&(this.index=EK.requestsCount++,EK.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=CK,e)try{this.xhr.abort()}catch(B2){}"undefined"!=typeof document&&delete EK.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(EK.requestsCount=0,EK.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",PK);else if("function"==typeof addEventListener){addEventListener("onpagehide"in iK?"pagehide":"unload",PK,!1)}function PK(){for(let e in EK.requests)EK.requests.hasOwnProperty(e)&&EK.requests[e].abort()}const LK="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),OK=iK.WebSocket||iK.MozWebSocket,MK="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const TK={websocket:class extends hK{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=MK?{}:aK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=MK?new OK(e,t,n):t?new OK(e,t):new OK(e)}catch(Hhe){return this.emitReserved("error",Hhe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(B2){}r&&LK((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||(e.b64=1);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!OK}},polling:class extends hK{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=_K&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(rK),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZX(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(rK))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new EK(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},AK=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RK(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=AK.exec(e||""),i={},a=14;for(;a--;)i[IK[a]]=o[a]||"";return-1!=n&&-1!=r&&(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=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class NK extends oK{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=RK(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=RK(t.host).host),cK(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new TK[e](n)}open(){let e;if(this.opts.rememberUpgrade&&NK.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(B2){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;NK.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;NK.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",NK.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){NK.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||BK&&e instanceof Blob||jK&&e instanceof File}function HK(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case GK.ACK:case GK.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class YK{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=$K(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ZK=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return GK},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==GK.EVENT&&e.type!==GK.ACK||!HK(e)?[this.encodeAsString(e)]:(e.type=e.type===GK.EVENT?GK.BINARY_EVENT:GK.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==GK.BINARY_EVENT&&e.type!==GK.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=WK(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:qK},Symbol.toStringTag,{value:"Module"}));function XK(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const KK=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class QK extends oK{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[XK(e,"open",this.onopen.bind(this)),XK(e,"packet",this.onpacket.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(KK.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:GK.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:GK.CONNECT,data:e})})):this.packet({type:GK.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case GK.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}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 GK.EVENT:case GK.BINARY_EVENT:this.onevent(e);break;case GK.ACK:case GK.BINARY_ACK:this.onack(e);break;case GK.DISCONNECT:this.ondisconnect();break;case GK.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:GK.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:GK.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}JK.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=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},JK.prototype.reset=function(){this.attempts=0},JK.prototype.setMin=function(e){this.ms=e},JK.prototype.setMax=function(e){this.max=e},JK.prototype.setJitter=function(e){this.jitter=e};class eQ extends oK{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,cK(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new JK({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||ZK;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new NK(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=XK(t,"open",(function(){n.onopen(),e&&e()})),o=XK(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(XK(e,"ping",this.onping.bind(this)),XK(e,"data",this.ondata.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this)),XK(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(B2){this.onclose("parse error",B2)}}ondecoded(e){LK((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new QK(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const tQ={};function nQ(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=RK(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=tQ[o]&&i in tQ[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new eQ(r,t):(tQ[o]||(tQ[o]=new eQ(r,t)),s=tQ[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}let rQ;Object.assign(nQ,{Manager:eQ,Socket:QK,io:nQ,connect:nQ});const oQ=new Uint8Array(16);function iQ(){if(!rQ&&(rQ="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rQ))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rQ(oQ)}const aQ=[];for(let e=0;e<256;++e)aQ.push((e+256).toString(16).slice(1));const sQ={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lQ(e,t,n){if(sQ.randomUUID&&!t&&!e)return sQ.randomUUID();const r=(e=e||{}).random||(e.rng||iQ)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(aQ[e[t+0]]+aQ[e[t+1]]+aQ[e[t+2]]+aQ[e[t+3]]+"-"+aQ[e[t+4]]+aQ[e[t+5]]+"-"+aQ[e[t+6]]+aQ[e[t+7]]+"-"+aQ[e[t+8]]+aQ[e[t+9]]+"-"+aQ[e[t+10]]+aQ[e[t+11]]+aQ[e[t+12]]+aQ[e[t+13]]+aQ[e[t+14]]+aQ[e[t+15]]).toLowerCase()}(r)}var cQ=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,uQ=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,dQ=/[^-+\dA-Z]/g;function hQ(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(fQ[t]||t||fQ.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return vQ(e)},m=function(){return yQ(e)},v={d:function(){return a()},dd:function(){return gQ(a())},ddd:function(){return pQ.dayNames[s()]},DDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()],short:!0})},dddd:function(){return pQ.dayNames[s()+7]},DDDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return gQ(l()+1)},mmm:function(){return pQ.monthNames[l()]},mmmm:function(){return pQ.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return gQ(c(),4)},h:function(){return u()%12||12},hh:function(){return gQ(u()%12||12)},H:function(){return u()},HH:function(){return gQ(u())},M:function(){return d()},MM:function(){return gQ(d())},s:function(){return h()},ss:function(){return gQ(h())},l:function(){return gQ(f(),3)},L:function(){return gQ(Math.floor(f()/10))},t:function(){return u()<12?pQ.timeNames[0]:pQ.timeNames[1]},tt:function(){return u()<12?pQ.timeNames[2]:pQ.timeNames[3]},T:function(){return u()<12?pQ.timeNames[4]:pQ.timeNames[5]},TT:function(){return u()<12?pQ.timeNames[6]:pQ.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":bQ(e)},o:function(){return(p()>0?"-":"+")+gQ(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+gQ(Math.floor(Math.abs(p())/60),2)+":"+gQ(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return gQ(g())},N:function(){return m()}};return t.replace(cQ,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var fQ={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"},pQ={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"]},gQ=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},mQ=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},vQ=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},yQ=function(e){var t=e.getDay();return 0===t&&(t=7),t},bQ=function(e){return(String(e).match(uQ)||[""]).pop().replace(dQ,"").replace(/GMT\+0000/g,"UTC")};const xQ=MV("socketio/generateImage"),wQ=MV("socketio/runESRGAN"),kQ=MV("socketio/runFacetool"),SQ=MV("socketio/deleteImage"),CQ=MV("socketio/requestImages"),_Q=MV("socketio/requestNewImages"),EQ=MV("socketio/cancelProcessing"),PQ=MV("socketio/requestSystemConfig"),LQ=MV("socketio/searchForModels"),OQ=MV("socketio/addNewModel"),MQ=MV("socketio/deleteModel"),TQ=MV("socketio/requestModelChange"),AQ=MV("socketio/saveStagingAreaImageToGallery"),IQ=MV("socketio/requestEmptyTempFolder"),RQ=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],NQ=[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],DQ=[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],zQ=[{key:"2x",value:2},{key:"4x",value:4}],BQ=4294967295,jQ=["gfpgan","codeformer"],FQ=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],HQ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var WQ=Math.PI/180;const VQ="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},$Q={_global:VQ,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>$Q.angleDeg?e*WQ: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:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>$Q.DD.isDragging,isDragReady:()=>!!$Q.DD.node,releaseCanvasOnDestroy:!0,document:VQ.document,_injectGlobal(e){VQ.Konva=e}},UQ=e=>{$Q[e.prototype.getClassName()]=e};$Q._injectGlobal($Q);class GQ{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 GQ(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=eJ._getRotation(i.rotation),i}}var qQ=Math.PI/180,YQ=180/Math.PI,ZQ="Konva error: ",XQ={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]},KQ=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,QQ=[];const JQ="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},eJ={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){QQ.push(e),1===QQ.length&&JQ((function(){const e=QQ;QQ=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(B2){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=eJ.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in XQ?{r:(t=XQ[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=KQ.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=>(e=e||"black",eJ._namedColorToRBA(e)||eJ._hex3ColorToRGBA(e)||eJ._hex6ColorToRGBA(e)||eJ._rgbColorToRGBA(e)||eJ._rgbaColorToRGBA(e)||eJ._hslColorToRGBA(e)),_namedColorToRBA(e){var t=XQ[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)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]&&4===e.length)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,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*qQ,radToDeg:e=>e*YQ,_degToRad:e=>(eJ.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),eJ.degToRad(e)),_radToDeg:e=>(eJ.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),eJ.radToDeg(e)),_getRotation:e=>$Q.angleDeg?eJ.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(ZQ+e)},error(e){console.error(ZQ+e)},warn(e){$Q.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=eJ.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=eJ._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){$Q.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function tJ(e){return eJ._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||eJ._isBoolean(e)?e:Object.prototype.toString.call(e)}function nJ(e){return e>255?255:e<0?0:Math.round(e)}function rJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function oJ(e){if($Q.isUnminified)return function(t,n){let r=eJ._isNumber(t),o=eJ._isArray(t)&&t.length==e;return r||o||eJ.warn(tJ(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function iJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||"auto"===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function aJ(){if($Q.isUnminified)return function(e,t){return eJ._isString(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function sJ(){if($Q.isUnminified)return function(e,t){const n=eJ._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function lJ(){if($Q.isUnminified)return function(e,t){return!0===e||!1===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var cJ="get",uJ="set";const dJ={addGetterSetter(e,t,n,r,o){dJ.addGetter(e,t,n),dJ.addSetter(e,t,r,o),dJ.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cJ+eJ._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]||dJ.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=eJ._capitalize,c=cJ+l(t),u=uJ+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},dJ.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=eJ._capitalize(t),r=uJ+n,o=cJ+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){eJ.error("Adding deprecated "+t);var o=cJ+eJ._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){eJ.error(i);var e=this.attrs[t];return void 0===e?n:e},dJ.addSetter(e,t,r,(function(){eJ.error(i)})),dJ.addOverloadedGetterSetter(e,t)},backCompat(e,t){eJ.each(t,(function(t,n){var r=e.prototype[n],o=cJ+eJ._capitalize(t),i=uJ+eJ._capitalize(t);function a(){r.apply(this,arguments),eJ.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function hJ(e){var t,n,r=[],o=e.length,i=eJ;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=fJ.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=hJ(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return wJ._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];wJ._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=eJ._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];wJ._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(wJ.justDragged=!0,$Q._mouseListenClick=!1,$Q._touchListenClick=!1,$Q._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof $Q.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){wJ._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&wJ._dragElements.delete(n)}))}};$Q.isBrowser&&(window.addEventListener("mouseup",wJ._endDragBefore,!0),window.addEventListener("touchend",wJ._endDragBefore,!0),window.addEventListener("mousemove",wJ._drag),window.addEventListener("touchmove",wJ._drag),window.addEventListener("mouseup",wJ._endDragAfter,!1),window.addEventListener("touchend",wJ._endDragAfter,!1));var kJ="absoluteOpacity",SJ="allEventListeners",CJ="absoluteTransform",_J="absoluteScale",EJ="canvas",PJ="listening",LJ="mouseenter",OJ="mouseleave",MJ="Shape",TJ=" ",AJ="stage",IJ="transform",RJ="visible",NJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(TJ);let DJ=1;class zJ{constructor(e){this._id=DJ++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==IJ&&e!==CJ||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===IJ||e===CJ)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(TJ);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(EJ)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===CJ&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(EJ)){const{scene:e,filter:t,hit:n}=this._cache.get(EJ);eJ.releaseCanvas(e,t,n),this._cache.delete(EJ)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new bJ({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new bJ({pixelRatio:i,width:0,height:0}),f=new xJ({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(EJ),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(kJ),this._clearSelfAndDescendantCache(_J),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(EJ,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}eJ.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(EJ)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+eJ._capitalize(t),eJ._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(PJ,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(RJ,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;wJ._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!$Q.hitOnDragEnabled&&r;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 e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new GQ,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(IJ);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={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,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return eJ.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return eJ.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&eJ.warn("Unexpected value "+e+" 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 t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(kJ,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],eJ.isObject(t)&&!eJ._isPlainObject(t)&&!eJ._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),eJ._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,eJ._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():$Q.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;wJ._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=wJ._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&wJ._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return eJ.haveIntersection(n,this.getClientRect())}static create(e,t){return eJ._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=zJ.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),$Q[i]||(eJ.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,$Q[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=zJ.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=zJ.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",m0=e=>{const t=g0(e);return"pointer"===t?$Q.pointerEventsEnabled&&p0.pointer:"touch"===t?p0.touch:"mouse"===t?p0.mouse:void 0};function v0(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&eJ.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const y0=[];class b0 extends jJ{constructor(e){super(v0(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),y0.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{v0(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||eJ.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&y0.splice(t,1),eJ.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(eJ.warn("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);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new bJ({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&eJ.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),$Q.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}getLayers(){return this.children}_bindContentEvents(){$Q.isBrowser&&f0.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!wJ.isDragging||$Q.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);wJ.justDragged=!1,$Q["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;$Q.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=m0(e.type),n=g0(e.type);if(!t)return;if(wJ.isDragging&&wJ.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!wJ.isDragging||$Q.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=WJ(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=m0(e.type),n=g0(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=WJ(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;$Q["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):wJ.justDragged||($Q["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){$Q["_"+n+"InDblClickWindow"]=!1}),$Q.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),$Q["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,$Q["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),$Q["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(s0,{evt:e}):this._fire(s0,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(h0,{evt:e}):this._fire(h0,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=WJ(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(t0,VJ(e)),GJ(e.pointerId)}_lostpointercapture(e){GJ(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}])}_setPointerPosition(e){eJ.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new bJ({width:this.width(),height:this.height()}),this.bufferHitCanvas=new xJ({pixelRatio:1,width:this.width(),height:this.height()}),$Q.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return eJ.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(e){e.batchDraw()})),this}}b0.prototype.nodeType="Stage",UQ(b0),dJ.addGetterSetter(b0,"container");var x0="hasShadow",w0="shadowRGBA",k0="patternImage",S0="linearGradient",C0="radialGradient";let _0;function E0(){return _0||(_0=eJ.createCanvasElement().getContext("2d"),_0)}const P0={};class L0 extends zJ{constructor(e){let t;for(super(e);t=eJ.getRandomColor(),!t||t in P0;);this.colorKey=t,P0[t]=this}getContext(){return eJ.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return eJ.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(x0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(k0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=E0().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new GQ;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate($Q.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(S0,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=E0(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return zJ.prototype.destroy.call(this),delete P0[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){eJ.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||eJ.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()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=eJ._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(B2){eJ.error("Unable to draw hit graph from cached scene canvas. "+B2.message)}return this}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}}L0.prototype._fillFunc=function(e){e.fill()},L0.prototype._strokeFunc=function(e){e.stroke()},L0.prototype._fillFuncHit=function(e){e.fill()},L0.prototype._strokeFuncHit=function(e){e.stroke()},L0.prototype._centroid=!1,L0.prototype.nodeType="Shape",UQ(L0),L0.prototype.eventListeners={},L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(x0)})),L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(w0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(k0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(S0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(C0)})),dJ.addGetterSetter(L0,"stroke",void 0,sJ()),dJ.addGetterSetter(L0,"strokeWidth",2,rJ()),dJ.addGetterSetter(L0,"fillAfterStrokeEnabled",!1),dJ.addGetterSetter(L0,"hitStrokeWidth","auto",iJ()),dJ.addGetterSetter(L0,"strokeHitEnabled",!0,lJ()),dJ.addGetterSetter(L0,"perfectDrawEnabled",!0,lJ()),dJ.addGetterSetter(L0,"shadowForStrokeEnabled",!0,lJ()),dJ.addGetterSetter(L0,"lineJoin"),dJ.addGetterSetter(L0,"lineCap"),dJ.addGetterSetter(L0,"sceneFunc"),dJ.addGetterSetter(L0,"hitFunc"),dJ.addGetterSetter(L0,"dash"),dJ.addGetterSetter(L0,"dashOffset",0,rJ()),dJ.addGetterSetter(L0,"shadowColor",void 0,aJ()),dJ.addGetterSetter(L0,"shadowBlur",0,rJ()),dJ.addGetterSetter(L0,"shadowOpacity",1,rJ()),dJ.addComponentsGetterSetter(L0,"shadowOffset",["x","y"]),dJ.addGetterSetter(L0,"shadowOffsetX",0,rJ()),dJ.addGetterSetter(L0,"shadowOffsetY",0,rJ()),dJ.addGetterSetter(L0,"fillPatternImage"),dJ.addGetterSetter(L0,"fill",void 0,sJ()),dJ.addGetterSetter(L0,"fillPatternX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternY",0,rJ()),dJ.addGetterSetter(L0,"fillLinearGradientColorStops"),dJ.addGetterSetter(L0,"strokeLinearGradientColorStops"),dJ.addGetterSetter(L0,"fillRadialGradientStartRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientEndRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientColorStops"),dJ.addGetterSetter(L0,"fillPatternRepeat","repeat"),dJ.addGetterSetter(L0,"fillEnabled",!0),dJ.addGetterSetter(L0,"strokeEnabled",!0),dJ.addGetterSetter(L0,"shadowEnabled",!0),dJ.addGetterSetter(L0,"dashEnabled",!0),dJ.addGetterSetter(L0,"strokeScaleEnabled",!0),dJ.addGetterSetter(L0,"fillPriority","color"),dJ.addComponentsGetterSetter(L0,"fillPatternOffset",["x","y"]),dJ.addGetterSetter(L0,"fillPatternOffsetX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternOffsetY",0,rJ()),dJ.addComponentsGetterSetter(L0,"fillPatternScale",["x","y"]),dJ.addGetterSetter(L0,"fillPatternScaleX",1,rJ()),dJ.addGetterSetter(L0,"fillPatternScaleY",1,rJ()),dJ.addComponentsGetterSetter(L0,"fillLinearGradientStartPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientStartPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillLinearGradientEndPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientEndPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientStartPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientEndPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientEndPointY",0),dJ.addGetterSetter(L0,"fillPatternRotation",0),dJ.backCompat(L0,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var O0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],M0=O0.length;class T0 extends jJ{constructor(e){super(e),this.canvas=new bJ,this.hitCanvas=new xJ({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),jJ.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),jJ.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return eJ.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}T0.prototype.nodeType="Layer",UQ(T0),dJ.addGetterSetter(T0,"imageSmoothingEnabled",!0),dJ.addGetterSetter(T0,"clearBeforeDraw",!0),dJ.addGetterSetter(T0,"hitGraphEnabled",!0,lJ());class A0 extends T0{constructor(e){super(e),this.listening(!1),eJ.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}A0.prototype.nodeType="FastLayer",UQ(A0);class I0 extends jJ{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&eJ.throw("You may only add groups and shapes to groups.")}}I0.prototype.nodeType="Group",UQ(I0);var R0=VQ.performance&&VQ.performance.now?function(){return VQ.performance.now()}:function(){return(new Date).getTime()};class N0{constructor(e,t){this.id=N0.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:R0(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class F0{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||H0.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=z0++;var l=o.getLayer()||(o instanceof $Q.Stage?o.getLayers():null);for(n in l||eJ.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new N0((function(){r.tween.onEnterFrame()}),l),this.tween=new j0(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),F0.attrs[i]||(F0.attrs[i]={}),F0.attrs[i][this._id]||(F0.attrs[i][this._id]={}),F0.tweens[i]||(F0.tweens[i]={}),e)void 0===D0[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=F0.tweens[d][e])&&delete F0.attrs[d][o][e],n=u.getAttr(e),eJ._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=eJ._prepareArrayForTween(n,t,u.closed())):(s=t,t=eJ._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.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(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=F0.tweens[t];for(e in this.pause(),r)delete F0.tweens[t][e];delete F0.attrs[t][n]}}F0.attrs={},F0.tweens={},zJ.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new F0(e).play()};const H0={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-H0.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},W0=eJ._assign($Q,{Util:eJ,Transform:GQ,Node:zJ,Container:jJ,Stage:b0,stages:y0,Layer:T0,FastLayer:A0,Group:I0,DD:wJ,Shape:L0,shapes:P0,Animation:N0,Tween:F0,Easings:H0,Context:pJ,Canvas:yJ});class V0 extends L0{_sceneFunc(e){var t=$Q.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=$Q.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function $0(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function U0(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=q0.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return q0.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return q0.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return q0.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,q0.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,y,b,x,w,k,S,C,_,E,P=null,L=[],O=l,M=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),P="L",L.push(l,c);break;case"L":l=f.shift(),c=f.shift(),L.push(l,c);break;case"m":var T=f.shift(),A=f.shift();if(l+=T,c+=A,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+A;break}L.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),P="M",L.push(l,c),h="L";break;case"h":l+=f.shift(),P="L",L.push(l,c);break;case"H":l=f.shift(),P="L",L.push(l,c);break;case"v":c+=f.shift(),P="L",L.push(l,c);break;case"V":c=f.shift(),P="L",L.push(l,c);break;case"C":L.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"c":L.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"S":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,f.shift(),f.shift()),l=f.shift(),c=f.shift(),P="C",L.push(l,c);break;case"s":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"Q":L.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"q":L.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="Q",L.push(l,c);break;case"T":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l=f.shift(),c=f.shift(),P="Q",L.push(y,b,l,c);break;case"t":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),P="Q",L.push(y,b,l,c);break;case"A":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k);break;case"a":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k)}a.push({command:P||h,points:L,start:{x:O,y:M},pathLength:this.calcLength(O,M,P||h,L)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=q0;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}q0.prototype.className="Path",q0.prototype._attrsAffectingSize=["data"],UQ(q0),dJ.addGetterSetter(q0,"data");class Y0 extends G0{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=q0.calcLength(r[r.length-4],r[r.length-3],"C",e),o=q0.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}Y0.prototype.className="Arrow",UQ(Y0),dJ.addGetterSetter(Y0,"pointerLength",10,rJ()),dJ.addGetterSetter(Y0,"pointerWidth",10,rJ()),dJ.addGetterSetter(Y0,"pointerAtBeginning",!1),dJ.addGetterSetter(Y0,"pointerAtEnding",!0);class Z0 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Z0.prototype._centroid=!0,Z0.prototype.className="Circle",Z0.prototype._attrsAffectingSize=["radius"],UQ(Z0),dJ.addGetterSetter(Z0,"radius",0,rJ());class X0 extends L0{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}X0.prototype.className="Ellipse",X0.prototype._centroid=!0,X0.prototype._attrsAffectingSize=["radiusX","radiusY"],UQ(X0),dJ.addComponentsGetterSetter(X0,"radius",["x","y"]),dJ.addGetterSetter(X0,"radiusX",0,rJ()),dJ.addGetterSetter(X0,"radiusY",0,rJ());class K0 extends L0{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=eJ.createImageElement();r.onload=function(){var e=new K0({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}K0.prototype.className="Image",UQ(K0),dJ.addGetterSetter(K0,"image"),dJ.addComponentsGetterSetter(K0,"crop",["x","y","width","height"]),dJ.addGetterSetter(K0,"cropX",0,rJ()),dJ.addGetterSetter(K0,"cropY",0,rJ()),dJ.addGetterSetter(K0,"cropWidth",0,rJ()),dJ.addGetterSetter(K0,"cropHeight",0,rJ());var Q0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],J0="up",e1="right",t1="down",n1="left",r1=Q0.length;class o1 extends I0{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}s1.prototype.className="RegularPolygon",s1.prototype._centroid=!0,s1.prototype._attrsAffectingSize=["radius"],UQ(s1),dJ.addGetterSetter(s1,"radius",0,rJ()),dJ.addGetterSetter(s1,"sides",0,rJ());var l1=2*Math.PI;class c1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,l1,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),l1,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}c1.prototype.className="Ring",c1.prototype._centroid=!0,c1.prototype._attrsAffectingSize=["innerRadius","outerRadius"],UQ(c1),dJ.addGetterSetter(c1,"innerRadius",0,rJ()),dJ.addGetterSetter(c1,"outerRadius",0,rJ());class u1 extends L0{constructor(e){super(e),this._updated=!0,this.anim=new N0((()=>{var e=this._updated;return this._updated=!1,e})),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(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=eJ._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===p1||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===p1||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return eJ.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=S1(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+b1+this.fontVariant()+b1+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===g1&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return S1().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==p1&&void 0!==o,s=i!==p1&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==x1,p=this.ellipsis();this.textArr=[],S1().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;y.length>0;){for(var x=0,w=y.length,k="",S=0;x>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,k=_,S=E):w=C}if(!k)break;if(f){var P,L=y[k.length];(P=(L===b1||"-"===L)&&S<=c?k.length:Math.max(k.lastIndexOf(b1),k.lastIndexOf("-"))+1)>0&&(x=P,k=k.slice(0,x),S=this._getTextWidth(k))}if(k=k.trimRight(),this._addTextLine(k),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(x)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=c){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==p1&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==x1)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==p1&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=h1(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=q0.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],y=d.points[5],b=d.points[4]+y;0===g?g=v+1e-8:o>s?g+=Math.PI/180*y/Math.abs(y):g-=Math.PI/360*y/Math.abs(y),(y<0&&g=0&&g>b)&&(g=b,p=!0),u=q0.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=q0.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=q0.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=q0.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;be+`.${O1}`)).join(" "),T1="nodesRect",A1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],I1={"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 R1="ontouchstart"in $Q._global;var N1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function D1(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=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:o})}function z1(e,t){const n=function(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)}}(e);return D1(e,t,n)}class B1 extends I0{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(M1,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return eJ.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return O1+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(A1.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(T1),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(T1,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=($Q.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return D1({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-$Q.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new GQ;var n,r,o,i;t.rotate(-$Q.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:$Q.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(),N1.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new a1({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:R1?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=$Q.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=eJ.degToRad(I1[e]||0);var n=(eJ.radToDeg(t)%360+360)%360;return eJ._inRange(n,337.5,360)||eJ._inRange(n,0,22.5)?"ns-resize":eJ._inRange(n,22.5,67.5)?"nesw-resize":eJ._inRange(n,67.5,112.5)?"ew-resize":eJ._inRange(n,112.5,157.5)?"nwse-resize":eJ._inRange(n,157.5,202.5)?"ns-resize":eJ._inRange(n,202.5,247.5)?"nesw-resize":eJ._inRange(n,247.5,292.5)?"ew-resize":eJ._inRange(n,292.5,337.5)?"nwse-resize":(eJ.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new L0({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*eJ._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(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 i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(eJ._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(eJ._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new GQ;if(o.rotate($Q.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:eJ.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new GQ;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new GQ;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new GQ;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(eJ._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(eJ._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*eJ._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),I0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return zJ.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}B1.prototype.className="Transformer",UQ(B1),dJ.addGetterSetter(B1,"enabledAnchors",N1,(function(e){return e instanceof Array||eJ.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===N1.indexOf(e)&&eJ.warn("Unknown anchor name: "+e+". Available names are: "+N1.join(", "))})),e||[]})),dJ.addGetterSetter(B1,"flipEnabled",!0,lJ()),dJ.addGetterSetter(B1,"resizeEnabled",!0),dJ.addGetterSetter(B1,"anchorSize",10,rJ()),dJ.addGetterSetter(B1,"rotateEnabled",!0),dJ.addGetterSetter(B1,"rotationSnaps",[]),dJ.addGetterSetter(B1,"rotateAnchorOffset",50,rJ()),dJ.addGetterSetter(B1,"rotationSnapTolerance",5,rJ()),dJ.addGetterSetter(B1,"borderEnabled",!0),dJ.addGetterSetter(B1,"anchorStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"anchorStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"anchorFill","white"),dJ.addGetterSetter(B1,"anchorCornerRadius",0,rJ()),dJ.addGetterSetter(B1,"borderStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"borderStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"borderDash"),dJ.addGetterSetter(B1,"keepRatio",!0),dJ.addGetterSetter(B1,"centeredScaling",!1),dJ.addGetterSetter(B1,"ignoreStroke",!1),dJ.addGetterSetter(B1,"padding",0,rJ()),dJ.addGetterSetter(B1,"node"),dJ.addGetterSetter(B1,"nodes"),dJ.addGetterSetter(B1,"boundBoxFunc"),dJ.addGetterSetter(B1,"anchorDragBoundFunc"),dJ.addGetterSetter(B1,"shouldOverdrawWholeArea",!1),dJ.addGetterSetter(B1,"useSingleNodeRotation",!0),dJ.backCompat(B1,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class j1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,$Q.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function F1(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}j1.prototype.className="Wedge",j1.prototype._centroid=!0,j1.prototype._attrsAffectingSize=["radius"],UQ(j1),dJ.addGetterSetter(j1,"radius",0,rJ()),dJ.addGetterSetter(j1,"angle",0,rJ()),dJ.addGetterSetter(j1,"clockwise",!1),dJ.backCompat(j1,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var H1=[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],W1=[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];dJ.addGetterSetter(zJ,"blurRadius",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"brightness",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"contrast",0,rJ(),dJ.afterSetFilter);function V1(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}dJ.addGetterSetter(zJ,"embossStrength",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossWhiteLevel",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossDirection","top-left",null,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossBlend",!1,null,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"enhance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"luminance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"value",0,rJ(),dJ.afterSetFilter);function $1(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function U1(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}dJ.addGetterSetter(zJ,"kaleidoscopePower",2,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"kaleidoscopeAngle",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"threshold",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"noise",.2,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"pixelSize",8,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"levels",.5,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));dJ.addGetterSetter(zJ,"threshold",.5,rJ(),dJ.afterSetFilter);const G1=W0.Util._assign(W0,{Arc:V0,Arrow:Y0,Circle:Z0,Ellipse:X0,Image:K0,Label:o1,Tag:i1,Line:G0,Path:q0,Rect:a1,RegularPolygon:s1,Ring:c1,Sprite:u1,Star:d1,Text:C1,TextPath:L1,Transformer:B1,Wedge:j1,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,y,b,x,w,k,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,M=P-1,T=L-1,A=t+1,I=A*(A+1)/2,R=new F1,N=null,D=R,z=null,B=null,j=H1[t],F=W1[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(c*j>>F)*C,E[s+1]=(u*j>>F)*C,E[s+2]=(d*j>>F)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(c*j>>F)*C,E[i+1]=(u*j>>F)*C,E[i+2]=(d*j>>F)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+A)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:eJ.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var y=p+4*(g-1+v),b=s[m]-s[y],x=s[m+1]-s[y+1],w=s[m+2]-s[y+2],k=b,S=k>0?k:-k;if((x>0?x:-x)>S&&(k=x),(w>0?w:-w)>S&&(k=w),k*=t,o){var C=s[m]+k,_=s[m+1]+k,E=s[m+2]+k;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var P=n-k;P<0?P=0:P>255&&(P=255),s[m]=s[m+1]=s[m+2]=P}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,y,b,x,w,k;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),y=u+f*(255-u),b=c-f*(c-0),w=h+f*(255-h),k=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),y=u+f*(u-(v=.5*(u+c))),b=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),k=d+f*(d-x)),o=0;ov?a:v;var y,b,x,w,k=u,S=c,C=360/S*Math.PI/180;for(b=0;bu&&(b=y,x=0,w=-1),n=0;nb?l:b;var x,w,k,S=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;tq1,X1=()=>Y1,K1=e=>{const t=Z1(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:y,seamBlur:b,seamless:x,seamSize:w,seamSteps:k,seamStrength:S,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:P,shouldRandomizeSeed:L,shouldRunESRGAN:O,shouldRunFacetool:M,steps:T,threshold:A,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:j,enableImageDebugging:F}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:A,perlin:m,height:u,width:z,sampler_name:y,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:j,generation_mode:n,init_mask:""};let W=!1,V=!1;if(H.seed=L?HQ(0,BQ):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,O&&(W={level:R,strength:N}),M&&(V={type:c,strength:l},"codeformer"===c&&(V.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new G1.Stage({container:o,width:n,height:r}),a=new G1.Layer,s=new G1.Layer;a.add(new G1.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new G1.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(_Z):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),y=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});F&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:y,caption:"image sent as init_img"}]),t.scale(m),H.init_img=y,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=b,H.seam_strength=S,H.seam_steps=k,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return P?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,F&&(H.enable_image_debugging=F),{generationParameters:H,esrganParameters:W,facetoolParameters:V}},Q1=()=>{const{origin:e}=new URL(window.location.href),t=nQ(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onFoundModels:v,onNewModelAdded:y,onModelDeleted:b,onModelChangeFailed:x,onTempFolderEmptied:w}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(GY(!0)),t(KY(pq.t("common:statusConnected"))),t(PQ());const e=n().gallery;e.categories.result.latest_mtime?t(_Q("result")):t(CQ("result")),e.categories.user.latest_mtime?t(_Q("user")):t(CQ("user"))}catch(B2){console.error(B2)}},onDisconnect:()=>{try{t(GY(!1)),t(KY(pq.t("common:statusDisconnected"))),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(B2){console.error(B2)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:lQ(),...l};if(["txt2img","img2img"].includes(s)&&t(IU({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(AZ({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(IU({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===P$[i]&&t(G$(c)),t(RU()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onIntermediateResult:e=>{try{t(BU({uuid:lQ(),...e,category:"result"})),e.isBase64||t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onPostprocessingResult:e=>{try{t(IU({category:"result",image:{uuid:lQ(),...e,category:"result"}})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(B2){console.error(B2)}},onProgressUpdate:e=>{try{t(VY(!0)),t(XY(e))}catch(B2){console.error(B2)}},onError:e=>{const{message:n,additionalData:r}=e;try{t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(tZ()),t(RU())}catch(B2){console.error(B2)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:lQ(),...e})));t(zU({images:i,areMoreImagesAvailable:r,category:o})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(eZ());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(IU({category:"result",image:e})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(RU())),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(NU(e));const{initialImage:o,maskPath:i}=n().options;o!==r&&o?.url!==r||t(M$()),i===r&&t(Z$("")),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(QY(e)),e.infill_methods.includes("patchmatch")||t(U$(e.infill_methods[0]))},onFoundModels:e=>{const{search_folder:n,found_models:r}=e;t(hZ(n)),t(fZ(r))},onNewModelAdded:e=>{const{new_model_name:n,model_list:r,update:o}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model Added: ${n}`,level:"info"})),t(cZ({title:o?`${pq.t("modelmanager:modelUpdated")}: ${n}`:`${pq.t("modelmanager:modelAdded")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:e=>{const{deleted_model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`${pq.t("modelmanager:modelAdded")}: ${n}`,level:"info"})),t(cZ({title:`${pq.t("modelmanager:modelEntryDeleted")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(KY(pq.t("common:statusModelChanged"))),t(VY(!1)),t(oZ(!0)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t(oZ(!0)),t(tZ()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(cZ({title:pq.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:k,emitRunESRGAN:S,emitRunFacetool:C,emitDeleteImage:_,emitRequestImages:E,emitRequestNewImages:P,emitCancelProcessing:L,emitRequestSystemConfig:O,emitSearchForModels:M,emitAddNewModel:T,emitDeleteModel:A,emitRequestModelChange:I,emitSaveStagingAreaImageToGallery:R,emitRequestEmptyTempFolder:N}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n(VY(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(lZ());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=K1(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n(VY(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n(VY(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(NU(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:e=>{t.emit("searchForModels",e)},emitAddNewModel:e=>{t.emit("addNewModel",e)},emitDeleteModel:e=>{t.emit("deleteModel",e)},emitRequestModelChange:e=>{n(iZ()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("foundModels",(e=>{v(e)})),t.on("newModelAdded",(e=>{y(e)})),t.on("modelDeleted",(e=>{b(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{x(e)})),t.on("tempFolderEmptied",(()=>{w()})),n=!0),o.type){case"socketio/generateImage":k(o.payload);break;case"socketio/runESRGAN":S(o.payload);break;case"socketio/runFacetool":C(o.payload);break;case"socketio/deleteImage":_(o.payload);break;case"socketio/requestImages":E(o.payload);break;case"socketio/requestNewImages":P(o.payload);break;case"socketio/cancelProcessing":L();break;case"socketio/requestSystemConfig":O();break;case"socketio/searchForModels":M(o.payload);break;case"socketio/addNewModel":T(o.payload);break;case"socketio/deleteModel":A(o.payload);break;case"socketio/requestModelChange":I(o.payload);break;case"socketio/saveStagingAreaImageToGallery":R(o.payload);break;case"socketio/requestEmptyTempFolder":N()}r(o)}},J1=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),e2=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((e=>`system.${e}`)),t2=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),n2=nV({options:OU,gallery:KU,system:gZ,canvas:VX}),r2=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||QV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=o$(h,["_persist"]);if(d.type===VV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=XV(e)),f)return n$({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)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 d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),n$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===$V)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:jV).concat(e.key);return t.removeItem(n,e$)}(e)),n$({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),n$({},t(p,d),{_persist:f});if(d.type===WV)l=!0;else if(d.type===HV){if(s)return n$({},p,{_persist:n$({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),y=d.payload,b=n$({},!1!==r&&void 0!==y?r(y,u,v,e):v,{_persist:n$({},f,{rehydrated:!0})});return c(b)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(n$({},x,{_persist:f}))}}(x$.getPersistConfig({key:"root",storage:y$,rootReducer:n2,blacklist:[...J1,...e2,...t2],debounce:300}),n2),o2=function(e){var t,n=OV(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=nV(i)}var p=s;"function"==typeof p&&(p=p(n));var g=oV.apply(void 0,p),m=rV;c&&(m=EV(CV({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=mV([g],f):"function"==typeof f&&(v=f(v)),tV(t,d,m.apply(void 0,v))}({reducer:r2,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Q1()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var i2={exports:{}},a2={},s2=a.exports;var l2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c2=s2.useState,u2=s2.useEffect,d2=s2.useLayoutEffect,h2=s2.useDebugValue;function f2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!l2(e,n)}catch(nue){return!0}}var p2="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=c2({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return d2((function(){o.value=n,o.getSnapshot=t,f2(o)&&i({inst:o})}),[e,n,t]),u2((function(){return f2(o)&&i({inst:o}),e((function(){f2(o)&&i({inst:o})}))}),[e]),h2(n),n};a2.useSyncExternalStore=void 0!==s2.useSyncExternalStore?s2.useSyncExternalStore:p2,function(e){e.exports=a2}(i2);var g2={exports:{}},m2={},v2=a.exports,y2=i2.exports;var b2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},x2=y2.useSyncExternalStore,w2=v2.useRef,k2=v2.useEffect,S2=v2.useMemo,C2=v2.useDebugValue;m2.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=w2(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=S2((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,b2(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var s=x2(e,i[0],i[1]);return k2((function(){a.hasValue=!0,a.value=s}),[s]),C2(s),s},function(e){e.exports=m2}(g2);let _2=function(e){e()};const E2=()=>_2,P2=a.exports.createContext(null);function L2(){return a.exports.useContext(P2)}let O2=()=>{throw new Error("uSES not initialized!")};const M2=(e,t)=>e===t;function T2(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(e,n=M2){const{store:r,subscription:o,getServerState:i}=t(),s=O2(o.addNestedSub,r.getState,i||r.getState,e,n);return a.exports.useDebugValue(s),s}}const A2=T2();var I2,R2={},N2=Symbol.for("react.element"),D2=Symbol.for("react.portal"),z2=Symbol.for("react.fragment"),B2=Symbol.for("react.strict_mode"),j2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),H2=Symbol.for("react.context"),W2=Symbol.for("react.server_context"),V2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),G2=Symbol.for("react.memo"),q2=Symbol.for("react.lazy"),Y2=Symbol.for("react.offscreen");function Z2(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N2:switch(e=e.type){case z2:case j2:case B2:case $2:case U2:return e;default:switch(e=e&&e.$$typeof){case W2:case H2:case V2:case q2:case G2:case F2:return e;default:return t}}case D2:return t}}}I2=Symbol.for("react.module.reference"),R2.ContextConsumer=H2,R2.ContextProvider=F2,R2.Element=N2,R2.ForwardRef=V2,R2.Fragment=z2,R2.Lazy=q2,R2.Memo=G2,R2.Portal=D2,R2.Profiler=j2,R2.StrictMode=B2,R2.Suspense=$2,R2.SuspenseList=U2,R2.isAsyncMode=function(){return!1},R2.isConcurrentMode=function(){return!1},R2.isContextConsumer=function(e){return Z2(e)===H2},R2.isContextProvider=function(e){return Z2(e)===F2},R2.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N2},R2.isForwardRef=function(e){return Z2(e)===V2},R2.isFragment=function(e){return Z2(e)===z2},R2.isLazy=function(e){return Z2(e)===q2},R2.isMemo=function(e){return Z2(e)===G2},R2.isPortal=function(e){return Z2(e)===D2},R2.isProfiler=function(e){return Z2(e)===j2},R2.isStrictMode=function(e){return Z2(e)===B2},R2.isSuspense=function(e){return Z2(e)===$2},R2.isSuspenseList=function(e){return Z2(e)===U2},R2.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===z2||e===j2||e===B2||e===$2||e===U2||e===Y2||"object"==typeof e&&null!==e&&(e.$$typeof===q2||e.$$typeof===G2||e.$$typeof===F2||e.$$typeof===H2||e.$$typeof===V2||e.$$typeof===I2||void 0!==e.getModuleId)},R2.typeOf=Z2,function(e){e.exports=R2}({exports:{}});const X2={notify(){},get:()=>[]};function K2(e,t){let n,r=X2;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=E2();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=X2)},getListeners:()=>r};return a}const Q2=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?a.exports.useLayoutEffect:a.exports.useEffect;function J2({store:e,context:t,children:n,serverState:r}){const o=a.exports.useMemo((()=>{const t=K2(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=a.exports.useMemo((()=>e.getState()),[e]);Q2((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);return ld((t||P2).Provider,{value:o,children:n})}function e5(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(){const{store:e}=t();return e}}const t5=e5();function n5(e=P2){const t=e===P2?t5:e5(e);return function(){return t().dispatch}}const r5=n5();var o5;function i5(e){return i5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i5(e)}function a5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s5(e,t){for(var n=0;n{O2=e})(g2.exports.useSyncExternalStoreWithSelector),o5=$.exports.unstable_batchedUpdates,_2=o5;var f5=function(e){function t(){var e,n;a5(this,t);for(var r=arguments.length,o=new Array(r),i=0;ild(CI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:ld(hT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),m5=r5,v5=A2,y5=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),b5=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=v5(y5),o=t?Math.round(100*t/n):0;return ld(eF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};var x5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w5=H.createContext&&H.createContext(x5),k5=globalThis&&globalThis.__assign||function(){return k5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return ld(YH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:ld(zT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function S3(e){const{title:t,hotkey:n,description:r}=e;return cd("div",{className:"hotkey-modal-item",children:[cd("div",{className:"hotkey-info",children:[ld("p",{className:"hotkey-title",children:t}),r&&ld("p",{className:"hotkey-description",children:r})]}),ld("div",{className:"hotkey-key",children:n})]})}function C3({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY(),i=[{title:o("hotkeys:invoke.title"),desc:o("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys:cancel.title"),desc:o("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys:focusPrompt.title"),desc:o("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys:toggleOptions.title"),desc:o("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys:pinOptions.title"),desc:o("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys:toggleViewer.title"),desc:o("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys:toggleGallery.title"),desc:o("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys:maximizeWorkSpace.title"),desc:o("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys:changeTabs.title"),desc:o("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys:consoleToggle.title"),desc:o("hotkeys:consoleToggle.desc"),hotkey:"`"}],s=[{title:o("hotkeys:setPrompt.title"),desc:o("hotkeys:setPrompt.desc"),hotkey:"P"},{title:o("hotkeys:setSeed.title"),desc:o("hotkeys:setSeed.desc"),hotkey:"S"},{title:o("hotkeys:setParameters.title"),desc:o("hotkeys:setParameters.desc"),hotkey:"A"},{title:o("hotkeys:restoreFaces.title"),desc:o("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys:upscale.title"),desc:o("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys:showInfo.title"),desc:o("hotkeys:showInfo.desc"),hotkey:"I"},{title:o("hotkeys:sendToImageToImage.title"),desc:o("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys:deleteImage.title"),desc:o("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys:closePanels.title"),desc:o("hotkeys:closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys:previousImage.title"),desc:o("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextImage.title"),desc:o("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:toggleGalleryPin.title"),desc:o("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys:increaseGalleryThumbSize.title"),desc:o("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys:decreaseGalleryThumbSize.title"),desc:o("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],c=[{title:o("hotkeys:selectBrush.title"),desc:o("hotkeys:selectBrush.desc"),hotkey:"B"},{title:o("hotkeys:selectEraser.title"),desc:o("hotkeys:selectEraser.desc"),hotkey:"E"},{title:o("hotkeys:decreaseBrushSize.title"),desc:o("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys:increaseBrushSize.title"),desc:o("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys:decreaseBrushOpacity.title"),desc:o("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys:increaseBrushOpacity.title"),desc:o("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys:moveTool.title"),desc:o("hotkeys:moveTool.desc"),hotkey:"V"},{title:o("hotkeys:fillBoundingBox.title"),desc:o("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys:eraseBoundingBox.title"),desc:o("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys:colorPicker.title"),desc:o("hotkeys:colorPicker.desc"),hotkey:"C"},{title:o("hotkeys:toggleSnap.title"),desc:o("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys:quickToggleMove.title"),desc:o("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys:toggleLayer.title"),desc:o("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys:clearMask.title"),desc:o("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys:hideMask.title"),desc:o("hotkeys:hideMask.desc"),hotkey:"H"},{title:o("hotkeys:showHideBoundingBox.title"),desc:o("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys:mergeVisible.title"),desc:o("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys:saveToGallery.title"),desc:o("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys:copyToClipboard.title"),desc:o("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys:downloadImage.title"),desc:o("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys:undoStroke.title"),desc:o("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys:redoStroke.title"),desc:o("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys:resetView.title"),desc:o("hotkeys:resetView.desc"),hotkey:"R"},{title:o("hotkeys:previousStagingImage.title"),desc:o("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextStagingImage.title"),desc:o("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:acceptStagingImage.title"),desc:o("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=e=>{const t=[];return e.forEach(((e,n)=>{t.push(ld(S3,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),ld("div",{className:"hotkey-modal-category",children:t})};return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,children:[ld(GB,{}),cd(WB,{className:" modal hotkeys-modal",children:[ld(DB,{className:"modal-close-btn"}),ld("h1",{children:"Keyboard Shorcuts"}),ld("div",{className:"hotkeys-modal-items",children:cd(uT,{allowMultiple:!0,children:[cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:appHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(i)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:generalHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(s)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:galleryHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(l)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:unifiedCanvasHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(c)})]})]})})]})]})]})}const _3=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return cd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...o,children:[ld(eA,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...i,children:t}),ld(nH,{className:"invokeai__switch-root",...s})]})},E3=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="sm",styleClass:l,...c}=e;return cd(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&ld(eA,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),ld(YH,{label:o,...i,children:ld(rF,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?ld("option",{value:e,className:"invokeai__select-option",children:e},e):ld("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},P3=/^-?(0\.)?\.?$/,L3=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:o=!1,showStepper:i=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:b,...x}=e,[w,k]=a.exports.useState(String(u));a.exports.useEffect((()=>{w.match(P3)||u===Number(w)||k(String(u))}),[u,w]);return ld(YH,{...b,children:cd(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&ld(eA,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...m,children:t}),cd(fj,{className:"invokeai__number-input-root",value:w,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{k(e),e.match(P3)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=TU.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);k(String(t)),d(t)},width:s,...x,children:[ld(gj,{className:"invokeai__number-input-field",textAlign:l,...v}),i&&cd("div",{className:"invokeai__number-input-stepper",children:[ld(yj,{...y,className:"invokeai__number-input-stepper-button"}),ld(vj,{...y,className:"invokeai__number-input-stepper-button"})]})]})]})})},O3=e=>e.system,M3=e=>e.system.toastQueue,T3=uV((e=>e.options),(e=>P$[e.activeTab]),{memoizeOptions:{equalityCheck:TU.isEqual}});uV((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});const A3=e=>e.options,I3=uV([O3,A3],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:TU.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),R3=({children:e})=>{const t=m5(),{t:n}=FY(),r=v5((e=>e.options.steps)),{isOpen:o,onOpen:i,onClose:s}=QA(),{isOpen:l,onOpen:c,onClose:u}=QA(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:f,saveIntermediatesInterval:p,enableImageDebugging:g,shouldUseCanvasBetaLayout:m}=v5(I3);return cd(sd,{children:[a.exports.cloneElement(e,{onClick:i}),cd(RB,{isOpen:o,onClose:s,size:"lg",children:[ld(GB,{}),cd(WB,{className:"modal settings-modal",children:[ld($B,{className:"settings-modal-header",children:n("common:settingsLabel")}),ld(DB,{className:"modal-close-btn"}),cd(NB,{className:"settings-modal-content",children:[cd("div",{className:"settings-modal-items",children:[cd("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[ld(E3,{label:n("settings:displayInProgress"),validValues:FQ,value:d,onChange:e=>t(WY(e.target.value))}),"full-res"===d&&ld(L3,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:e=>{e>r&&(e=r),e<1&&(e=1),t(aZ(e))},value:p,width:"auto",textAlign:"center"})]}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:e=>t(YY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:f,onChange:e=>t(JY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:m,onChange:e=>t(PU(e.target.checked))})]}),cd("div",{className:"settings-modal-items",children:[ld("h2",{style:{fontWeight:"bold"},children:"Developer"}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:g,onChange:e=>t(sZ(e.target.checked))})]}),cd("div",{className:"settings-modal-reset",children:[ld(LI,{size:"md",children:n("settings:resetWebUI")}),ld(RT,{colorScheme:"red",onClick:()=>{p5.purge().then((()=>{s(),c()}))},children:n("settings:resetWebUI")}),ld(VI,{children:n("settings:resetWebUIDesc1")}),ld(VI,{children:n("settings:resetWebUIDesc2")})]})]}),ld(VB,{children:ld(RT,{onClick:s,className:"modal-close-btn",children:n("common:close")})})]})]}),cd(RB,{closeOnOverlayClick:!1,isOpen:l,onClose:u,isCentered:!0,children:[ld(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),ld(WB,{children:ld(NB,{pb:6,pt:6,children:ld(CI,{justifyContent:"center",children:ld(VI,{fontSize:"lg",children:ld(VI,{children:n("settings:resetComplete")})})})})})]})]})},N3=uV((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:MU.exports.isEqual}}),D3=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=v5(N3),s=m5(),{t:l}=FY();let c;c=e&&!i?"status-good":"status-bad";let u=o;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(u)&&(c="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`);return ld(YH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:ld(VI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(nZ())},className:`status ${c}`,children:l(u)})})},z3=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return cd(Aj,{...i,children:[ld(Wj,{children:t}),cd(Fj,{className:`invokeai__popover-content ${r}`,children:[o&&ld(Ij,{className:"invokeai__popover-arrow"}),n]})]})},B3=ok(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return ld(YH,{label:r,...o,children:ld(RT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function j3(){const{t:e}=FY(),{setColorMode:t,colorMode:n}=dd(),r=m5(),o=v5((e=>e.options.currentTheme)),i={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};a.exports.useEffect((()=>{n!==o&&t(o)}),[t,n,o]);return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(o3,{})}),children:ld(WI,{align:"stretch",children:(()=>{const e=[];return Object.keys(i).forEach((t=>{e.push(ld(B3,{style:{width:"6rem"},leftIcon:o===t?ld(z5,{}):void 0,size:"sm",onClick:()=>(e=>{r(j$(e))})(t),children:i[t]},t))})),e})()})})}const F3=uV([O3],(e=>{const{isProcessing:t,model_list:n}=e,r=TU.map(n,((e,t)=>t)),o=TU.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),H3=()=>{const e=m5(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=v5(F3);return ld(CI,{style:{paddingLeft:"0.3rem"},children:ld(E3,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(TQ(t.target.value))}})})};function W3(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:o="sm",width:i,size:a="sm",isInvalid:s,...l}=e;return cd(GT,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[""!==t&&ld(eA,{fontSize:o,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),ld(eI,{...l,className:"input-entry",size:a,width:i})]})}var V3=Array.isArray,$3=Object.keys,U3=Object.prototype.hasOwnProperty,G3="undefined"!=typeof Element;function q3(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,o,i=V3(e),a=V3(t);if(i&&a){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!q3(e[n],t[n]))return!1;return!0}if(i!=a)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!=u)return!1;if(c&&u)return e.toString()==t.toString();var d=$3(e);if((r=d.length)!==$3(t).length)return!1;for(n=r;0!=n--;)if(!U3.call(t,d[n]))return!1;if(G3&&e instanceof Element&&t instanceof Element)return e===t;for(n=r;0!=n--;)if(!("_owner"===(o=d[n])&&e.$$typeof||q3(e[o],t[o])))return!1;return!0}return e!=e&&t!=t}var Y3=function(e,t){try{return q3(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}},Z3=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===X3}(e)}(e)};var X3="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K3(e,t){return!1!==t.clone&&t.isMergeableObject(e)?J3((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Q3(e,t,n){return e.concat(t).map((function(e){return K3(e,n)}))}function J3(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Q3,n.isMergeableObject=n.isMergeableObject||Z3;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=K3(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=J3(e[o],t[o],n):r[o]=K3(t[o],n)})),r}(e,t,n):K3(t,n)}J3.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return J3(e,n,t)}),{})};var e4=J3;const t4="object"==typeof global&&global&&global.Object===Object&&global;var n4="object"==typeof self&&self&&self.Object===Object&&self;const r4=t4||n4||Function("return this")();const o4=r4.Symbol;var i4=Object.prototype,a4=i4.hasOwnProperty,s4=i4.toString,l4=o4?o4.toStringTag:void 0;var c4=Object.prototype.toString;var u4=o4?o4.toStringTag:void 0;function d4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u4&&u4 in Object(e)?function(e){var t=a4.call(e,l4),n=e[l4];try{e[l4]=void 0;var r=!0}catch(B2){}var o=s4.call(e);return r&&(t?e[l4]=n:delete e[l4]),o}(e):function(e){return c4.call(e)}(e)}function h4(e,t){return function(n){return e(t(n))}}const f4=h4(Object.getPrototypeOf,Object);function p4(e){return null!=e&&"object"==typeof e}var g4=Function.prototype,m4=Object.prototype,v4=g4.toString,y4=m4.hasOwnProperty,b4=v4.call(Object);function x4(e){if(!p4(e)||"[object Object]"!=d4(e))return!1;var t=f4(e);if(null===t)return!0;var n=y4.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&v4.call(n)==b4}function w4(e,t){return e===t||e!=e&&t!=t}function k4(e,t){for(var n=e.length;n--;)if(w4(e[n][0],t))return n;return-1}var S4=Array.prototype.splice;function C4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},C4.prototype.set=function(e,t){var n=this.__data__,r=k4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function E4(e){if(!_4(e))return!1;var t=d4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}const P4=r4["__core-js_shared__"];var L4,O4=(L4=/[^.]+$/.exec(P4&&P4.keys&&P4.keys.IE_PROTO||""))?"Symbol(src)_1."+L4:"";var M4=Function.prototype.toString;function T4(e){if(null!=e){try{return M4.call(e)}catch(B2){}try{return e+""}catch(B2){}}return""}var A4=/^\[object .+?Constructor\]$/,I4=Function.prototype,R4=Object.prototype,N4=I4.toString,D4=R4.hasOwnProperty,z4=RegExp("^"+N4.call(D4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B4(e){return!(!_4(e)||(t=e,O4&&O4 in t))&&(E4(e)?z4:A4).test(T4(e));var t}function j4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B4(n)?n:void 0}const F4=j4(r4,"Map");const H4=j4(Object,"create");var W4=Object.prototype.hasOwnProperty;var V4=Object.prototype.hasOwnProperty;function $4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var f6={};function p6(e){return function(t){return e(t)}}f6["[object Float32Array]"]=f6["[object Float64Array]"]=f6["[object Int8Array]"]=f6["[object Int16Array]"]=f6["[object Int32Array]"]=f6["[object Uint8Array]"]=f6["[object Uint8ClampedArray]"]=f6["[object Uint16Array]"]=f6["[object Uint32Array]"]=!0,f6["[object Arguments]"]=f6["[object Array]"]=f6["[object ArrayBuffer]"]=f6["[object Boolean]"]=f6["[object DataView]"]=f6["[object Date]"]=f6["[object Error]"]=f6["[object Function]"]=f6["[object Map]"]=f6["[object Number]"]=f6["[object Object]"]=f6["[object RegExp]"]=f6["[object Set]"]=f6["[object String]"]=f6["[object WeakMap]"]=!1;var g6="object"==typeof t&&t&&!t.nodeType&&t,m6=g6&&"object"==typeof n&&n&&!n.nodeType&&n,v6=m6&&m6.exports===g6&&t4.process,y6=function(){try{var e=m6&&m6.require&&m6.require("util").types;return e||v6&&v6.binding&&v6.binding("util")}catch(B2){}}();const b6=y6;var x6=b6&&b6.isTypedArray,w6=x6?p6(x6):function(e){return p4(e)&&h6(e.length)&&!!f6[d4(e)]};const k6=w6;var S6=Object.prototype.hasOwnProperty;function C6(e,t){var n=i6(e),r=!n&&o6(e),o=!n&&!r&&c6(e),i=!n&&!r&&!o&&k6(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function q7(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Y7=function(e){return Array.isArray(e)&&0===e.length},Z7=function(e){return"function"==typeof e},X7=function(e){return null!==e&&"object"==typeof e},K7=function(e){return String(Math.floor(Number(e)))===e},Q7=function(e){return"[object String]"===Object.prototype.toString.call(e)},J7=function(e){return 0===a.exports.Children.count(e)},e9=function(e){return X7(e)&&Z7(e.then)};function t9(e,t,n,r){void 0===r&&(r=0);for(var o=V7(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function r9(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;t9(t,a.path)||(t=n9(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),_=a.exports.useCallback((function(e,t){return new Promise((function(n){return n(b.current[e].validate(t))}))}),[]),E=a.exports.useCallback((function(e){var t=Object.keys(b.current).filter((function(e){return Z7(b.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,t9(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=n9(e,t[r],n)),e}),{})}))}),[_]),P=a.exports.useCallback((function(e){return Promise.all([E(e),f.validationSchema?C(e):{},f.validate?S(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return e4.all([t,n,r],{arrayMerge:f9})}))}),[f.validate,f.validationSchema,E,S,C]),L=g9((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return y.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));a.exports.useEffect((function(){s&&!0===y.current&&Y3(p.current,f.initialValues)&&L(p.current)}),[s,L]);var O=a.exports.useCallback((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:g.current?g.current:f.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:f.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:f.initialStatus;p.current=t,g.current=n,m.current=r,v.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);e9(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);a.exports.useEffect((function(){!0!==y.current||Y3(p.current,f.initialValues)||(u&&(p.current=f.initialValues,O()),s&&L(p.current))}),[u,f.initialValues,O,s,L]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(g.current,f.initialErrors)&&(g.current=f.initialErrors||l9,k({type:"SET_ERRORS",payload:f.initialErrors||l9}))}),[u,f.initialErrors]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(m.current,f.initialTouched)&&(m.current=f.initialTouched||c9,k({type:"SET_TOUCHED",payload:f.initialTouched||c9}))}),[u,f.initialTouched]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(v.current,f.initialStatus)&&(v.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var M=g9((function(e){if(b.current[e]&&Z7(b.current[e].validate)){var t=t9(w.values,e),n=b.current[e].validate(t);return e9(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),C(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),T=a.exports.useCallback((function(e,t){var n=t.validate;b.current[e]={validate:n}}),[]),A=a.exports.useCallback((function(e){delete b.current[e]}),[]),I=g9((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?L(w.values):Promise.resolve()})),R=a.exports.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),N=g9((function(e,t){var r=Z7(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?L(r):Promise.resolve()})),D=a.exports.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),z=g9((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?L(n9(w.values,e,t)):Promise.resolve()})),B=a.exports.useCallback((function(e,t){var n,r=t,o=e;if(!Q7(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,c=i.value,u=i.checked,d=(i.outerHTML,i.options),h=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(t9(w.values,r),u,c):d&&h?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):c}r&&z(r,o)}),[z,w.values]),j=g9((function(e){if(Q7(e))return function(t){return B(t,e)};B(e)})),F=g9((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?L(w.values):Promise.resolve()})),H=a.exports.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));F(i,!0)}),[F]),W=g9((function(e){if(Q7(e))return function(t){return H(t,e)};H(e)})),V=a.exports.useCallback((function(e){Z7(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),$=a.exports.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=a.exports.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=g9((function(){return k({type:"SUBMIT_ATTEMPT"}),L().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return y.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(y.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(y.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:O,validateForm:L,validateField:M,setErrors:R,setFieldError:D,setFieldTouched:F,setFieldValue:z,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,setFormikState:V,submitForm:G},Z=g9((function(){return d(w.values,Y)})),X=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),O()})),K=a.exports.useCallback((function(e){return{value:t9(w.values,e),error:t9(w.errors,e),touched:!!t9(w.touched,e),initialValue:t9(p.current,e),initialTouched:!!t9(m.current,e),initialError:t9(g.current,e)}}),[w.errors,w.touched,w.values]),Q=a.exports.useCallback((function(e){return{setValue:function(t,n){return z(e,t,n)},setTouched:function(t,n){return F(e,t,n)},setError:function(t){return D(e,t)}}}),[z,F,D]),J=a.exports.useCallback((function(e){var t=X7(e),n=t?e.name:e,r=t9(w.values,n),o={name:n,value:r,onChange:j,onBlur:W};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[W,j,w.values]),ee=a.exports.useMemo((function(){return!Y3(p.current,w.values)}),[p.current,w.values]),te=a.exports.useMemo((function(){return void 0!==l?ee?w.errors&&0===Object.keys(w.errors).length:!1!==l&&Z7(l)?l(f):l:w.errors&&0===Object.keys(w.errors).length}),[l,ee,w.errors,f]);return U7({},w,{initialValues:p.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:W,handleChange:j,handleReset:X,handleSubmit:q,resetForm:O,setErrors:R,setFormikState:V,setFieldTouched:F,setFieldValue:z,setFieldError:D,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,submitForm:G,validateForm:L,validateField:M,isValid:te,dirty:ee,unregisterField:A,registerField:T,getFieldProps:J,getFieldMeta:K,getFieldHelpers:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:s})}function d9(e){var t=u9(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return a.exports.useImperativeHandle(i,(function(){return t})),a.exports.createElement(i9,{value:t},n?a.exports.createElement(n,t):o?o(t):r?Z7(r)?r(t):J7(r)?null:a.exports.Children.only(r):null)}function h9(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||x4(e)?h9(e):""!==e?e:void 0})):x4(e[r])?t[r]=h9(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function f9(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?e4(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=e4(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var p9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.exports.useLayoutEffect:a.exports.useEffect;function g9(e){var t=a.exports.useRef(e);return p9((function(){t.current=e})),a.exports.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(U7({},e,{length:t+1}))}return[]},b9=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=n9(n.values,i,e(t9(n.values,i))),l=r?o(t9(n.errors,i)):void 0,c=t?a(t9(n.touched,i)):void 0;return Y7(l)&&(l=void 0),Y7(c)&&(c=void 0),U7({},n,{values:s,errors:r?n9(n.errors,i,l):n.errors,touched:t?n9(n.touched,i,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(y9(t),[$7(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return v9(n,e,t)}),(function(t){return v9(t,e,null)}),(function(t){return v9(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(q7(n)),n.pop=n.pop.bind(q7(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Y3(t9(e.formik.values,e.name),t9(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?y9(n):[];return t||(t=r[e]),Z7(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,s=U7({},e,{form:G7(t.formik,["validate","validationSchema"]),name:i});return n?a.exports.createElement(n,s):r?r(s):o?"function"==typeof o?o(s):J7(o)?null:a.exports.Children.only(o):null},r}(a.exports.Component);b9.defaultProps={validateOnChange:!0};const x9=uV([O3],(e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function w9(){const{openModel:e,model_list:t}=v5(x9),n=v5((e=>e.system.isProcessing)),r=m5(),{t:o}=FY(),[i,s]=a.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});a.exports.useEffect((()=>{if(e){const n=TU.pickBy(t,((t,n)=>TU.isEqual(n,e)));s({name:e,description:n[e]?.description,config:n[e]?.config,weights:n[e]?.weights,vae:n[e]?.vae,width:n[e]?.width,height:n[e]?.height,default:n[e]?.default})}}),[t,e]);return e?cd(CI,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[ld(CI,{alignItems:"center",children:ld(VI,{fontSize:"lg",fontWeight:"bold",children:e})}),ld(CI,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:ld(d9,{enableReinitialize:!0,initialValues:i,onSubmit:e=>{r(OQ(e))},children:({handleSubmit:e,errors:t,touched:r})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",alignItems:"start",children:[cd(GT,{isInvalid:!!t.description&&r.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"lg"}),t.description&&r.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&r.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"lg"}),t.config&&r.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&r.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"lg"}),t.weights&&r.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&r.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"lg"}),t.vae&&r.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&r.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&r.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&r.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&r.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelmanager:updateModel")})]})})})})]}):ld(CI,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:ld(VI,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const k9=e=>{const{label:t,styleClass:n,...r}=e;return ld(TA,{className:`invokeai__checkbox ${n}`,...r,children:t})};function S9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function C9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function _9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function E9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function P9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function L9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function O9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function M9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function T9(e){return _5({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 A9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function I9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function R9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function N9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const D9=uV([O3],(e=>{const{model_list:t}=e,n=[];return TU.forEach(t,(e=>{n.push(e.weights)})),n}));function z9(){const{t:e}=FY();return ld(mI,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function B9({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=v5(D9);return cd(mI,{position:"relative",children:[r.includes(e.location)?ld(z9,{}):null,ld(k9,{value:e.name,label:ld(sd,{children:cd(WI,{alignItems:"start",children:[ld("p",{style:{fontWeight:"bold"},children:e.name}),ld("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:e=>{t.includes(e.target.value)?n(TU.remove(t,(t=>t!==e.target.value))):n([...t,e.target.value])},padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function j9(){const e=m5(),{t:t}=FY(),n=v5((e=>e.system.searchFolder)),r=v5((e=>e.system.foundModels)),o=v5(D9),i=v5((e=>e.options.shouldShowExistingModelsInSearch)),a=v5((e=>e.system.isProcessing)),[s,l]=H.useState([]);return cd(sd,{children:[n?cd(CI,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),ld(k3,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:ld(T9,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(LQ(n))}),ld(k3,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:ld(a3,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:()=>{e(hZ(null)),e(fZ(null)),l([])}})]}):ld(d9,{initialValues:{checkpointFolder:""},onSubmit:t=>{(t=>{e(LQ(t.checkpointFolder))})(t)},children:({handleSubmit:e})=>ld("form",{onSubmit:e,children:cd(HI,{columnGap:"0.5rem",children:[ld(GT,{isRequired:!0,width:"max-content",children:ld(m9,{as:W3,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),ld(k3,{icon:ld(S9,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&cd(CI,{flexDirection:"column",rowGap:"1rem",children:[cd(CI,{justifyContent:"space-between",alignItems:"center",children:[cd("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),cd("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),cd(CI,{columnGap:"0.5rem",justifyContent:"space-between",children:[cd(CI,{columnGap:"0.5rem",children:[ld(B3,{isDisabled:s.length===r.length,onClick:()=>{l([]),r&&r.forEach((e=>{o.includes(e.location)||l((t=>[...t,e.name]))}))},children:t("modelmanager:selectAll")}),ld(B3,{isDisabled:0===s.length,onClick:()=>{l([])},children:t("modelmanager:deselectAll")}),ld(k9,{label:t("modelmanager:showExisting"),isChecked:i,onChange:()=>e(LU(!i))})]}),ld(B3,{isDisabled:0===s.length,onClick:()=>{const t=r?.filter((e=>s.includes(e.name)));t?.forEach((t=>{const n={name:t.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:t.location,vae:"",width:512,height:512,default:!1};e(OQ(n))})),l([])},backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),cd(CI,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?0===s.length&&ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),(()=>{const e=[],t=[];return r&&r.forEach(((n,r)=>{o.includes(n.location)?t.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r)):e.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r))})),cd(sd,{children:[e,i&&t]})})()]})]})]})}function F9(){const{isOpen:e,onOpen:t,onClose:n}=QA(),r=m5(),{t:o}=FY(),i=v5((e=>e.system.isProcessing));function a(e){let t;return function(e){return/\\s/g.test(e)}(e)&&(t=o("modelmanager:cannotUseSpaces")),t}const[s,l]=H.useState(!1);return cd(sd,{children:[ld(B3,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:cd(CI,{columnGap:"0.5rem",alignItems:"center",children:[ld(a3,{}),o("modelmanager:addNew")]})}),cd(RB,{isOpen:e,onClose:()=>{n()},size:"3xl",closeOnOverlayClick:!1,children:[ld(GB,{}),cd(WB,{className:"modal add-model-modal",children:[ld($B,{children:o("modelmanager:addNewModel")}),ld(DB,{}),cd(NB,{className:"add-model-modal-body",children:[ld(j9,{}),ld(k9,{label:o("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&ld(d9,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},onSubmit:e=>{r(OQ(e)),n()},children:({handleSubmit:e,errors:t,touched:n})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",children:[ld(VI,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:o("modelmanager:manual")}),cd(GT,{isInvalid:!!t.name&&n.name,isRequired:!0,children:[ld(eA,{htmlFor:"name",fontSize:"sm",children:o("modelmanager:name")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"name",name:"name",type:"text",validate:a,width:"2xl"}),t.name&&n.name?ld(QT,{children:t.name}):ld(qT,{margin:0,children:o("modelmanager:nameValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.description&&n.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"2xl"}),t.description&&n.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&n.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"2xl"}),t.config&&n.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&n.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"2xl"}),t.weights&&n.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&n.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"2xl"}),t.vae&&n.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&n.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&n.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&n.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&n.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:i,children:o("modelmanager:addModel")})]})})})]})]})]})]})}Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"SunIcon",path:cd("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[ld("circle",{cx:"12",cy:"12",r:"5"}),ld("path",{d:"M12 1v2"}),ld("path",{d:"M12 21v2"}),ld("path",{d:"M4.22 4.22l1.42 1.42"}),ld("path",{d:"M18.36 18.36l1.42 1.42"}),ld("path",{d:"M1 12h2"}),ld("path",{d:"M21 12h2"}),ld("path",{d:"M4.22 19.78l1.42-1.42"}),ld("path",{d:"M18.36 5.64l1.42-1.42"})]})}),Sk({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"}),Sk({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"ViewIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("circle",{cx:"12",cy:"12",r:"2"})]})}),Sk({displayName:"ViewOffIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"});var H9=Sk({displayName:"DeleteIcon",path:ld("g",{fill:"currentColor",children:ld("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"})})});Sk({displayName:"RepeatIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"RepeatClockIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})});var W9=Sk({displayName:"EditIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ld("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});Sk({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),Sk({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),Sk({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),Sk({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Sk({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),Sk({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),Sk({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),Sk({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"}),Sk({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var V9=Sk({displayName:"ExternalLinkIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ld("path",{d:"M15 3h6v6"}),ld("path",{d:"M10 14L21 3"})]})});Sk({displayName:"LinkIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"PlusSquareIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),ld("path",{d:"M12 8v8"}),ld("path",{d:"M8 12h8"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"TimeIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowRightIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowLeftIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"EmailIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"SpinnerIcon",path:cd(sd,{children:[ld("defs",{children:cd("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[ld("stop",{stopColor:"currentColor",offset:"0%"}),ld("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),cd("g",{transform:"translate(2)",fill:"none",children:[ld("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),ld("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),ld("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),Sk({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"}),Sk({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"InfoOutlineIcon",path:cd("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[ld("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),ld("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),ld("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"QuestionOutlineIcon",path:cd("g",{stroke:"currentColor",strokeWidth:"1.5",children:[ld("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"}),ld("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),ld("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),Sk({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"}),Sk({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"}),Sk({viewBox:"0 0 14 14",path:ld("g",{fill:"currentColor",children:ld("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Sk({displayName:"MinusIcon",path:ld("g",{fill:"currentColor",children:ld("rect",{height:"4",width:"20",x:"2",y:"10"})})}),Sk({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"});const $9=ok(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:i,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=QA(),f=a.exports.useRef(null);return cd(sd,{children:[a.exports.cloneElement(c,{onClick:d,ref:t}),ld(qB,{isOpen:u,leastDestructiveRef:f,onClose:h,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:l}),ld(NB,{children:s}),cd(VB,{children:[ld(RT,{ref:f,onClick:()=>{i&&i(),h()},className:"modal-close-btn",children:o}),ld(RT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})}));function U9(e){const{isProcessing:t,isConnected:n}=v5((e=>e.system)),r=v5((e=>e.system.openModel)),{t:o}=FY(),i=m5(),{name:a,status:s,description:l}=e,c=()=>{i(pZ(a))};return cd(CI,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[ld(mI,{onClick:c,cursor:"pointer",children:ld(YH,{label:l,hasArrow:!0,placement:"bottom",children:ld(VI,{fontWeight:"bold",children:a})})}),ld(zI,{onClick:c,cursor:"pointer"}),cd(CI,{gap:2,alignItems:"center",children:[ld(VI,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),ld(RT,{size:"sm",onClick:()=>{i(TQ(a))},isDisabled:"active"===s||t||!n,className:"modal-close-btn",children:o("modelmanager:load")}),ld(k3,{icon:ld(W9,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===s||t||!n,className:" modal-close-btn"}),ld($9,{title:o("modelmanager:deleteModel"),acceptCallback:()=>{i(MQ(a)),i(pZ(null))},acceptButtonText:o("modelmanager:delete"),triggerComponent:ld(k3,{icon:ld(H9,{}),size:"sm","aria-label":o("modelmanager:deleteConfig"),isDisabled:"active"===s||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:cd(CI,{rowGap:"1rem",flexDirection:"column",children:[ld("p",{style:{fontWeight:"bold"},children:o("modelmanager:deleteMsg1")}),ld("p",{style:{color:"var(--text-color-secondary"},children:o("modelmanager:deleteMsg2")})]})})]})]})}const G9=uV((e=>e.system),(e=>{const t=TU.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),q9=()=>{const{models:e}=v5(G9),[t,n]=a.exports.useState(""),{t:r}=FY(),o=TU.debounce((e=>{n(e.target.value)}),400);return cd(CI,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[cd(CI,{justifyContent:"space-between",children:[ld(VI,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),ld(F9,{})]}),ld(W3,{onChange:o,label:r("modelmanager:search")}),ld(CI,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:(()=>{const n=[],r=[];return e.forEach(((e,o)=>{e.name.startsWith(t)&&r.push(ld(U9,{name:e.name,status:e.status,description:e.description},o)),n.push(ld(U9,{name:e.name,status:e.status,description:e.description},o))})),""!==t?r:n})()})]})};function Y9({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY();return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,size:"6xl",children:[ld(GB,{}),cd(WB,{className:" modal",children:[ld(DB,{className:"modal-close-btn"}),ld($B,{children:o("modelmanager:modelManager")}),cd(CI,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[ld(q9,{}),ld(w9,{})]})]})]})]})}function Z9(){const{t:e,i18n:t}=FY(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")};return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:ld(J5,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:ld(WI,{children:(()=>{const e=[];return Object.keys(n).forEach((r=>{e.push(ld(B3,{"data-selected":localStorage.getItem("i18nextLng")===r,onClick:()=>t.changeLanguage(r),className:"modal-close-btn lang-select-btn","aria-label":n[r],tooltip:n[r],size:"sm",minWidth:"200px",children:n[r]},r))})),e})()})})}const X9=()=>{const{t:e}=FY();return cd("div",{className:"site-header",children:[cd("div",{className:"site-header-left-side",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),cd("div",{className:"site-header-right-side",children:[ld(D3,{}),ld(H3,{}),ld(Y9,{children:ld(k3,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(H5,{})})}),ld(C3,{children:ld(k3,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(Q5,{})})}),ld(j3,{}),ld(Z9,{}),ld(k3,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:ld(D5,{})})}),ld(k3,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:ld(L5,{})})}),ld(k3,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:ld(P5,{})})}),ld(R3,{children:ld(k3,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:ld(_9,{})})})]})]})};var K9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q9=globalThis&&globalThis.__assign||function(){return Q9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n()=>(t||e((t={exports:{}}).exports,t),t.exports),C8=(e,t,n)=>(n=null!=e?v8(w8(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of x8(t))!k8.call(e,o)&&o!==n&&y8(e,o,{get:()=>t[o],enumerable:!(r=b8(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:y8(n,"default",{value:e,enumerable:!0}),e)),_8=S8(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),E8=S8(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),P8=S8(((e,t)=>{var n=E8();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),L8=S8(((e,t)=>{var n=P8(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),O8=S8(((e,t)=>{var n=P8();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),M8=S8(((e,t)=>{var n=P8();t.exports=function(e){return n(this.__data__,e)>-1}})),T8=S8(((e,t)=>{var n=P8();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),A8=S8(((e,t)=>{var n=_8(),r=L8(),o=O8(),i=M8(),a=T8();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8();t.exports=function(){this.__data__=new n,this.size=0}})),R8=S8(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),N8=S8(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),D8=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),z8=S8(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),B8=S8(((e,t)=>{var n=z8(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),j8=S8(((e,t)=>{var n=B8().Symbol;t.exports=n})),F8=S8(((e,t)=>{var n=j8(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),H8=S8(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),W8=S8(((e,t)=>{var n=j8(),r=F8(),o=H8(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),V8=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),$8=S8(((e,t)=>{var n=W8(),r=V8();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),U8=S8(((e,t)=>{var n=B8()["__core-js_shared__"];t.exports=n})),G8=S8(((e,t)=>{var n=U8(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),q8=S8(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),Y8=S8(((e,t)=>{var n=$8(),r=G8(),o=V8(),i=q8(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),Z8=S8(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),X8=S8(((e,t)=>{var n=Y8(),r=Z8();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),K8=S8(((e,t)=>{var n=X8()(B8(),"Map");t.exports=n})),Q8=S8(((e,t)=>{var n=X8()(Object,"create");t.exports=n})),J8=S8(((e,t)=>{var n=Q8();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),eee=S8(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),tee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),nee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),ree=S8(((e,t)=>{var n=Q8();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),oee=S8(((e,t)=>{var n=J8(),r=eee(),o=tee(),i=nee(),a=ree();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=oee(),r=A8(),o=K8();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),aee=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),see=S8(((e,t)=>{var n=aee();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),lee=S8(((e,t)=>{var n=see();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),cee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).get(e)}})),uee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).has(e)}})),dee=S8(((e,t)=>{var n=see();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),hee=S8(((e,t)=>{var n=iee(),r=lee(),o=cee(),i=uee(),a=dee();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8(),r=K8(),o=hee();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),pee=S8(((e,t)=>{var n=A8(),r=I8(),o=R8(),i=N8(),a=D8(),s=fee();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),gee=S8(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),mee=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),vee=S8(((e,t)=>{var n=hee(),r=gee(),o=mee();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),xee=S8(((e,t)=>{var n=vee(),r=yee(),o=bee();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=B8().Uint8Array;t.exports=n})),kee=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),See=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),Cee=S8(((e,t)=>{var n=j8(),r=wee(),o=E8(),i=xee(),a=kee(),s=See(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),_ee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),Pee=S8(((e,t)=>{var n=_ee(),r=Eee();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),Lee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),Mee=S8(((e,t)=>{var n=Lee(),r=Oee(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),Tee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),Iee=S8(((e,t)=>{var n=W8(),r=Aee();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),Ree=S8(((e,t)=>{var n=Iee(),r=Aee(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),Nee=S8(((e,t)=>{t.exports=function(){return!1}})),Dee=S8(((e,t)=>{var n=B8(),r=Nee(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),zee=S8(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),jee=S8(((e,t)=>{var n=W8(),r=Bee(),o=Aee(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),Fee=S8(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Hee=S8(((e,t)=>{var n=z8(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),Wee=S8(((e,t)=>{var n=jee(),r=Fee(),o=Hee(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Vee=S8(((e,t)=>{var n=Tee(),r=Ree(),o=Eee(),i=Dee(),a=zee(),s=Wee(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),$ee=S8(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),Uee=S8(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),Gee=S8(((e,t)=>{var n=Uee()(Object.keys,Object);t.exports=n})),qee=S8(((e,t)=>{var n=$ee(),r=Gee(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),Yee=S8(((e,t)=>{var n=$8(),r=Bee();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),Zee=S8(((e,t)=>{var n=Vee(),r=qee(),o=Yee();t.exports=function(e){return o(e)?n(e):r(e)}})),Xee=S8(((e,t)=>{var n=Pee(),r=Mee(),o=Zee();t.exports=function(e){return n(e,o,r)}})),Kee=S8(((e,t)=>{var n=Xee(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=X8()(B8(),"DataView");t.exports=n})),Jee=S8(((e,t)=>{var n=X8()(B8(),"Promise");t.exports=n})),ete=S8(((e,t)=>{var n=X8()(B8(),"Set");t.exports=n})),tte=S8(((e,t)=>{var n=X8()(B8(),"WeakMap");t.exports=n})),nte=S8(((e,t)=>{var n=Qee(),r=K8(),o=Jee(),i=ete(),a=tte(),s=W8(),l=q8(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),y=l(a),b=s;(n&&b(new n(new ArrayBuffer(1)))!=f||r&&b(new r)!=c||o&&b(o.resolve())!=u||i&&b(new i)!=d||a&&b(new a)!=h)&&(b=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case y:return h}return t}),t.exports=b})),rte=S8(((e,t)=>{var n=pee(),r=xee(),o=Cee(),i=Kee(),a=nte(),s=Eee(),l=Dee(),c=Wee(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var y=s(e),b=s(t),x=y?d:a(e),w=b?d:a(t),k=(x=x==u?h:x)==h,S=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;y=!0,k=!1}if(C&&!k)return v||(v=new n),y||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=k&&f.call(e,"__wrapped__"),E=S&&f.call(t,"__wrapped__");if(_||E){var P=_?e.value():e,L=E?t.value():t;return v||(v=new n),m(P,L,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),ote=S8(((e,t)=>{var n=rte(),r=Aee();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),ite=S8(((e,t)=>{var n=ote();t.exports=function(e,t){return n(e,t)}})),ate=["ctrl","shift","alt","meta","mod"],ste={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function lte(e,t=","){return"string"==typeof e?e.split(t):e}function cte(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>ste[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!ate.includes(e)));return{...r,keys:o}}function ute({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var dte=a.exports.createContext(void 0),hte=a.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),fte=C8(ite());var pte=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function gte(e,t,n,r){let o=a.exports.useRef(null),{current:i}=a.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=a.exports.useCallback(t,[...l]),u=function(e){let t=a.exports.useRef(void 0);return(0,fte.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=a.exports.useContext(hte),h=a.exports.useContext(dte);return a.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return ute(e,["input","textarea","select"])}(t)||ute(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void pte(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||lte(e,u?.splitKey).forEach((e=>{let n=cte(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,i)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void pte(t);c(t,n)}}))}},n=e=>{i.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.addHotkey(cte(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.removeHotkey(cte(e,u?.combinationKey))))}}),[e,c,u,d]),o}C8(ite());var mte=new Set;window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>mte.add(cte(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=cte(e);for(let n of mte)n.keys?.every((e=>t.keys?.includes(e)))&&mte.delete(n)}))}(e.key)}))}));const vte=uV((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),yte=uV((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),bte=()=>{const e=m5(),t=v5(vte),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=v5(yte),[i,s]=a.exports.useState(!0),l=a.exports.useRef(null);a.exports.useLayoutEffect((()=>{null!==l.current&&i&&(l.current.scrollTop=l.current.scrollHeight)}),[i,t,n]);gte("`",(()=>{e(UY(!n))}),[n]),gte("esc",(()=>{e(UY(!1))}));return cd(sd,{children:[n&&ld(m8,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:ld("div",{className:"console",ref:l,onScroll:()=>{l.current&&i&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return cd("div",{className:`console-entry console-${o}-color`,children:[cd("p",{className:"console-timestamp",children:[n,":"]}),ld("p",{className:"console-message",children:r})]},t)}))})}),n&&ld(YH,{hasArrow:!0,label:i?"Autoscroll On":"Autoscroll Off",children:ld(zT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":i,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:ld(O5,{}),onClick:()=>s(!i)})}),ld(YH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:ld(zT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:ld(n?n3:B5,{}),onClick:()=>{e(nZ()),e(UY(!n))}})})]})};function xte(){const{t:e}=FY();return cd("div",{className:"work-in-progress nodes-work-in-progress",children:[ld("h1",{children:e("common:nodes")}),ld("p",{children:e("common:nodesDesc")})]})}const wte=()=>{const{t:e}=FY();return cd("div",{className:"work-in-progress post-processing-work-in-progress",children:[ld("h1",{children:e("common:postProcessing")}),ld("p",{children:e("common:postProcessDesc1")}),ld("p",{children:e("common:postProcessDesc2")}),ld("p",{children:e("common:postProcessDesc3")})]})},kte=Sk({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:ld("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"})})}),Ste=Sk({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),Cte=Sk({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),_te=Sk({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:ld("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 Ete=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Ete||{});const Pte=e=>{const t=(()=>{const{t:e}=FY();return a.exports.useMemo((()=>({0:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},1:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},2:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},3:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},4:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},5:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},6:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},7:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},8:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}})),[e])})();return t[e]},Lte=uV((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ote=uV((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Mte=()=>{const e=m5(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=v5(Lte),{isGFPGANAvailable:o}=v5(Ote),{t:i}=FY();return cd(CI,{direction:"column",gap:2,children:[ld(E3,{label:i("options:type"),validValues:jQ.concat(),value:n,onChange:t=>e(H$(t.target.value))}),ld(L3,{isDisabled:!o,label:i("options:strength"),step:.05,min:0,max:1,onChange:t=>e(F$(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&ld(L3,{isDisabled:!o,label:i("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:t=>e(B$(t)),value:r,width:"90px",isInteger:!1})]})};function Tte(){const e=v5((e=>e.system.isGFPGANAvailable)),t=v5((e=>e.options.shouldRunFacetool)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(gU(e.target.checked))})}function Ate(){const e=m5(),t=v5((e=>e.options.shouldFitToWidthHeight)),{t:n}=FY();return ld(_3,{label:n("options:imageFit"),isChecked:t,onChange:t=>e(lU(t.target.checked))})}function Ite(e){const[t,n]=a.exports.useState(!1),{label:r,value:o,min:i=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5rem",inputReadOnly:y=!0,withReset:b=!1,hideTooltip:x=!1,isCompact:w=!1,handleReset:k,isResetDisabled:S,isSliderDisabled:C,isInputDisabled:_,styleClass:E,sliderFormControlProps:P,sliderFormLabelProps:L,sliderMarkProps:O,sliderTrackProps:M,sliderThumbProps:T,sliderNumberInputProps:A,sliderNumberInputFieldProps:I,sliderNumberInputStepperProps:R,sliderTooltipProps:N,sliderIAIIconButtonProps:D,...z}=e,[B,j]=a.exports.useState(String(o)),F=a.exports.useMemo((()=>A?.max?A.max:s),[s,A?.max]);a.exports.useEffect((()=>{String(o)!==B&&""!==B&&j(String(o))}),[o,B,j]);const H=e=>{j(String(e)),c(Number(e))};return cd(GT,{className:E?`invokeai__slider-component ${E}`:"invokeai__slider-component","data-markers":h,style:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...P,children:[ld(eA,{className:"invokeai__slider-component-label",...L,children:r}),cd(HI,{w:"100%",gap:2,alignItems:"center",children:[cd(ZF,{"aria-label":r,value:o,min:i,max:s,step:l,onChange:H,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:C,width:u,...z,children:[h&&cd(sd,{children:[ld(JF,{value:i,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...O,children:i}),ld(JF,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...O,children:s})]}),ld(KF,{className:"invokeai__slider_track",...M,children:ld(QF,{className:"invokeai__slider_track-filled"})}),ld(YH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...N,children:ld(XF,{className:"invokeai__slider-thumb",...T})})]}),g&&cd(fj,{min:i,max:F,step:l,value:B,onChange:H,onBlur:e=>{const t=TU.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),i,F);j(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:_,...A,children:[ld(gj,{className:"invokeai__slider-number-input",width:v,readOnly:y,...I}),cd(pj,{...R,children:[ld(yj,{className:"invokeai__slider-number-stepper"}),ld(vj,{className:"invokeai__slider-number-stepper"})]})]}),b&&ld(k3,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:ld(T9,{}),onClick:()=>{k&&k()},isDisabled:S,...D})]})]})}function Rte(e){const{t:t}=FY(),{label:n=`${t("options:strength")}`,styleClass:r}=e,o=v5((e=>e.options.img2imgStrength)),i=m5();return ld(Ite,{label:n,step:.01,min:.01,max:.99,onChange:e=>i($$(e)),value:o,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i($$(.75))}})}const Nte=()=>{const e=m5(),t=v5((e=>e.options.seamless)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:t=>e(nU(t.target.checked))})})},Dte=()=>ld(CI,{gap:2,direction:"column",children:ld(Nte,{})});function zte(){const e=m5(),{t:t}=FY(),n=v5((e=>e.options.shouldRandomizeSeed));return ld(_3,{label:t("options:randomizeSeed"),isChecked:n,onChange:t=>e(fU(t.target.checked))})}function Bte(){const e=v5((e=>e.options.seed)),t=v5((e=>e.options.shouldRandomizeSeed)),n=v5((e=>e.options.shouldGenerateVariations)),{t:r}=FY(),o=m5();return ld(L3,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:0,max:BQ,isDisabled:t,isInvalid:e<0&&n,onChange:e=>o(aU(e)),value:e,width:"auto"})}function jte(){const e=m5(),t=v5((e=>e.options.shouldRandomizeSeed)),{t:n}=FY();return ld(RT,{size:"sm",isDisabled:t,onClick:()=>e(aU(HQ(0,BQ))),padding:"0 1.5rem",children:ld("p",{children:n("options:shuffle")})})}function Fte(){const e=m5(),t=v5((e=>e.options.threshold)),{t:n}=FY();return ld(L3,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:t=>e(wU(t)),value:t,isInteger:!1})}function Hte(){const e=m5(),t=v5((e=>e.options.perlin)),{t:n}=FY();return ld(L3,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:t=>e(Q$(t)),value:t,isInteger:!1})}const Wte=()=>cd(CI,{gap:2,direction:"column",children:[ld(zte,{}),cd(CI,{gap:2,children:[ld(Bte,{}),ld(jte,{})]}),ld(CI,{gap:2,children:ld(Fte,{})}),ld(CI,{gap:2,children:ld(Hte,{})})]}),Vte=uV((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),$te=uV((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ute=()=>{const e=m5(),{upscalingLevel:t,upscalingStrength:n}=v5(Vte),{isESRGANAvailable:r}=v5($te),{t:o}=FY();return cd("div",{className:"upscale-options",children:[ld(E3,{isDisabled:!r,label:o("options:scale"),value:t,onChange:t=>e(SU(Number(t.target.value))),validValues:zQ}),ld(L3,{isDisabled:!r,label:o("options:strength"),step:.05,min:0,max:1,onChange:t=>e(CU(t)),value:n,isInteger:!1})]})};function Gte(){const e=v5((e=>e.system.isESRGANAvailable)),t=v5((e=>e.options.shouldRunESRGAN)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(pU(e.target.checked))})}function qte(){const e=v5((e=>e.options.shouldGenerateVariations)),t=m5();return ld(_3,{isChecked:e,width:"auto",onChange:e=>t(cU(e.target.checked))})}function Yte(){const e=v5((e=>e.options.seedWeights)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(W3,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(_$(e)||""===e),isDisabled:!t,onChange:e=>r(sU(e.target.value))})}function Zte(){const e=v5((e=>e.options.variationAmount)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(L3,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>r(_U(e)),isInteger:!1})}const Xte=()=>cd(CI,{gap:2,direction:"column",children:[ld(Zte,{}),ld(Yte,{})]});function Kte(){const e=m5(),t=v5((e=>e.options.cfgScale)),{t:n}=FY();return ld(L3,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:t=>e(z$(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function Qte(){const e=v5((e=>e.options.height)),t=v5(T3),n=m5(),{t:r}=FY();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:r("options:height"),value:e,flexGrow:1,onChange:e=>n(W$(Number(e.target.value))),validValues:DQ,styleClass:"main-option-block"})}const Jte=uV([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function ene(){const e=m5(),{iterations:t}=v5(Jte),{t:n}=FY();return ld(L3,{label:n("options:images"),step:1,min:1,max:9999,onChange:t=>e(Y$(t)),value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function tne(){const e=v5((e=>e.options.sampler)),t=m5(),{t:n}=FY();return ld(E3,{label:n("options:sampler"),value:e,onChange:e=>t(eU(e.target.value)),validValues:RQ,styleClass:"main-option-block"})}function nne(){const e=m5(),t=v5((e=>e.options.steps)),{t:n}=FY();return ld(L3,{label:n("options:steps"),min:1,max:9999,step:1,onChange:t=>e(xU(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function rne(){const e=v5((e=>e.options.width)),t=v5(T3),{t:n}=FY(),r=m5();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:n("options:width"),value:e,flexGrow:1,onChange:e=>r(EU(Number(e.target.value))),validValues:NQ,styleClass:"main-option-block"})}function one(){return ld("div",{className:"main-options",children:cd("div",{className:"main-options-list",children:[cd("div",{className:"main-options-row",children:[ld(ene,{}),ld(nne,{}),ld(Kte,{})]}),cd("div",{className:"main-options-row",children:[ld(rne,{}),ld(Qte,{}),ld(tne,{})]})]})})}const ine=uV((e=>e.system),(e=>e.shouldDisplayGuides)),ane=({children:e,feature:t})=>{const n=v5(ine),{text:r}=Pte(t);return n?cd(Aj,{trigger:"hover",children:[ld(Wj,{children:ld(mI,{children:e})}),cd(Fj,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[ld(Ij,{className:"guide-popover-arrow"}),ld("div",{className:"guide-popover-guide-content",children:r})]})]}):null},sne=ok((({feature:e,icon:t=C9},n)=>ld(ane,{feature:e,children:ld(mI,{ref:n,children:ld(kk,{marginBottom:"-.15rem",as:t})})})));function lne(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return cd(lT,{className:"advanced-settings-item",children:[ld(nT,{className:"advanced-settings-header",children:cd(CI,{width:"100%",gap:"0.5rem",align:"center",children:[ld(mI,{flexGrow:1,textAlign:"left",children:t}),o,n&&ld(sne,{feature:n}),ld(sT,{})]})}),ld(cT,{className:"advanced-settings-panel",children:r})]})}const cne=e=>{const{accordionInfo:t}=e,n=v5((e=>e.system.openAccordions)),r=m5();return ld(uT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(ZY(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(ld(lne,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})},une=e=>e.canvas,dne=uV([une,T3,O3],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),hne=e=>e.canvas.layerState.objects.find(EZ),fne=uV([e=>e.options,e=>e.system,hne,T3],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!_$(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:TU.isEqual,resultEqualityCheck:TU.isEqual}});function pne(e){const{iconButton:t=!1,...n}=e,r=m5(),{isReady:o}=v5(fne),i=v5(T3),a=()=>{r(xQ(i))},{t:s}=FY();return gte(["ctrl+enter","meta+enter"],(()=>{r(xQ(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),ld("div",{style:{flexGrow:4},children:t?ld(k3,{"aria-label":s("options:invoke"),type:"submit",icon:ld(i3,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):ld(B3,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const gne=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function mne(e){const{...t}=e,n=m5(),{isProcessing:r,isConnected:o,isCancelable:i}=v5(gne),a=()=>n(EQ()),{t:s}=FY();return gte("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),ld(k3,{icon:ld(O9,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const vne=uV((e=>e.options),(e=>e.shouldLoopback)),yne=()=>{const e=m5(),t=v5(vne),{t:n}=FY();return ld(k3,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:ld(l3,{}),onClick:()=>{e(dU(!t))}})},bne=()=>{const e=v5(T3);return cd("div",{className:"process-buttons",children:[ld(pne,{}),"img2img"===e&&ld(yne,{}),ld(mne,{})]})},xne=uV([e=>e.options,T3],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),wne=()=>{const e=m5(),{prompt:t,activeTabName:n}=v5(xne),{isReady:r}=v5(fne),o=a.exports.useRef(null),{t:i}=FY();gte("alt+a",(()=>{o.current?.focus()}),[]);return ld("div",{className:"prompt-bar",children:ld(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:ld(_H,{id:"prompt",name:"prompt",placeholder:i("options:promptPlaceholder"),size:"lg",value:t,onChange:t=>{e(J$(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(xQ(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function kne(e){return _5({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 Sne(e){return _5({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function Cne(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const _ne=!1,Ene=H.createContext(null);var Pne=function(e){return e.scrollTop},Lne="unmounted",One="exited",Mne="entering",Tne="entered",Ane="exiting",Ine=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=One,r.appearStatus=Mne):o=Tne:o=t.unmountOnExit||t.mountOnEnter?Lne:One,r.state={status:o},r.nextCallback=null,r}DD(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Lne?{status:One}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Mne&&n!==Tne&&(t=Mne):n!==Mne&&n!==Tne||(t=Ane)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Mne){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&Pne(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===One&&this.setState({status:Lne})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||_ne?this.safeSetState({status:Tne},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Mne},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:Tne},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!_ne?(this.props.onExit(r),this.safeSetState({status:Ane},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:One},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:One},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Lne)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=gD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ld(Ene.Provider,{value:null,children:"function"==typeof n?n(e,r):H.cloneElement(H.Children.only(n),r)})},t}(H.Component);function Rne(){}Ine.contextType=Ene,Ine.propTypes={},Ine.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rne,onEntering:Rne,onEntered:Rne,onExit:Rne,onExiting:Rne,onExited:Rne},Ine.UNMOUNTED=Lne,Ine.EXITED=One,Ine.ENTERING=Mne,Ine.ENTERED=Tne,Ine.EXITING=Ane;const Nne=Ine;var Dne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},zne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Cne(n.className,r):n.setAttribute("class",Cne(n.className&&n.className.baseVal||"",r)));var n,r}))},Bne=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Hne=e=>{const t=m5(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=v5(Fne),i=a.exports.useRef(null),s=a.exports.useRef(null),l=a.exports.useRef(null),{children:c}=e;gte("o",(()=>{t(vU(!n)),o&&setTimeout((()=>t(iX(!0))),400)}),[n,o]),gte("esc",(()=>{t(vU(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),gte("shift+o",(()=>{h(),t(iX(!0))}),[o]);const u=a.exports.useCallback((()=>{o||(t(X$(s.current?s.current.scrollTop:0)),t(vU(!1)),t(uU(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(hU(!o)),t(iX(!0))};return a.exports.useEffect((()=>{function e(e){i.current&&!i.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),ld(jne,{nodeRef:i,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:ld("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:i,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:ld("div",{className:"options-panel-margin",children:cd("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[ld(YH,{label:"Pin Options Panel",children:ld("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:ld(o?kne:Sne,{})})}),!o&&cd("div",{className:"invoke-ai-logo-wrapper",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),c]})})})})};function Wne(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Dte,{})}},n=m5(),r=v5(T3);return a.exports.useEffect((()=>{if("img2img"===r){(()=>n(V$(!1)))()}}),[r,n]),cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(Ate,{}),ld(cne,{accordionInfo:t})]})}const Vne=a.exports.createContext(null),$ne=e=>{const{styleClass:t}=e,n=a.exports.useContext(Vne);return ld("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:cd("div",{className:"image-upload-button",children:[ld(y3,{}),ld(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},Une=uV((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Gne=a.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:i}=QA(),s=m5(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=v5(Une),d=a.exports.useRef(null),h=()=>{c&&!u&&e&&s(SQ(e)),i()};gte("delete",(()=>{l?o():h()}),[e,l]);return cd(sd,{children:[a.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),ld(qB,{isOpen:r,leastDestructiveRef:d,onClose:i,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),ld(NB,{children:cd(CI,{direction:"column",gap:5,children:[ld(VI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),ld(GT,{children:cd(CI,{alignItems:"center",children:[ld(eA,{mb:0,children:"Don't ask me again"}),ld(nH,{checked:!l,onChange:e=>s(YY(!e.target.checked))})]})})]})}),cd(VB,{children:[ld(RT,{ref:d,onClick:i,className:"modal-close-btn",children:"Cancel"}),ld(RT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),qne=uV([e=>e.system,e=>e.options,e=>e.gallery,T3],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Yne=()=>{const e=m5(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=v5(qne),h=zH(),{t:f}=FY(),p=()=>{c&&(u&&e(q$(!1)),e(G$(c)),e(I$("img2img")))};gte("shift+i",(()=>{c?(p(),h({title:f("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:imageNotLoaded"),description:f("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c&&(c.metadata&&e(N$(c.metadata)),"img2img"===c.metadata?.image.type?e(I$("img2img")):"txt2img"===c.metadata?.image.type&&e(I$("txt2img")))};gte("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(g(),h({title:f("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:parametersNotSet"),description:f("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>{c?.metadata&&e(aU(c.metadata.image.seed))};gte("s",(()=>{c?.metadata?.image?.seed?(m(),h({title:f("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:seedNotSet"),description:f("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>c?.metadata?.image?.prompt&&e(J$(c.metadata.image.prompt));gte("p",(()=>{c?.metadata?.image?.prompt?(v(),h({title:f("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:promptNotSet"),description:f("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const y=()=>{c&&e(wQ(c))};gte("Shift+U",(()=>{o&&!s&&n&&!t&&i?y():h({title:f("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(kQ(c))};gte("Shift+R",(()=>{r&&!s&&n&&!t&&a?b():h({title:f("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const x=()=>e(mU(!l));gte("i",(()=>{c?x():h({title:f("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[c,l]);return cd("div",{className:"current-image-options",children:[cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":`${f("options:sendTo")}...`,icon:ld(h3,{})}),children:cd("div",{className:"current-image-send-to-popover",children:[ld(B3,{size:"sm",onClick:p,leftIcon:ld(f3,{}),children:f("options:sendToImg2Img")}),ld(B3,{size:"sm",onClick:()=>{c&&(u&&e(q$(!1)),e(aX(c)),e(iX(!0)),"unifiedCanvas"!==d&&e(I$("unifiedCanvas")),h({title:f("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:ld(f3,{}),children:f("options:sendToUnifiedCanvas")}),ld(B3,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:f("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:ld(j5,{}),children:f("options:copyImageToLink")}),ld(B3,{leftIcon:ld(W5,{}),size:"sm",children:ld(MI,{download:!0,href:c?.url,children:f("options:downloadImage")})})]})}),ld(k3,{icon:ld(U5,{}),tooltip:u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"aria-label":u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"data-selected":u,onClick:()=>{e(q$(!u))}})]}),cd(DT,{isAttached:!0,children:[ld(k3,{icon:ld(s3,{}),tooltip:`${f("options:usePrompt")} (P)`,"aria-label":`${f("options:usePrompt")} (P)`,isDisabled:!c?.metadata?.image?.prompt,onClick:v}),ld(k3,{icon:ld(d3,{}),tooltip:`${f("options:useSeed")} (S)`,"aria-label":`${f("options:useSeed")} (S)`,isDisabled:!c?.metadata?.image?.seed,onClick:m}),ld(k3,{icon:ld(N5,{}),tooltip:`${f("options:useAll")} (A)`,"aria-label":`${f("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:g})]}),cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld(X5,{}),"aria-label":f("options:restoreFaces")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Mte,{}),ld(B3,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:f("options:restoreFaces")})]})}),ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld($5,{}),"aria-label":f("options:upscale")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Ute,{}),ld(B3,{isDisabled:!(o&&c&&n&&!t&&i),onClick:y,children:f("options:upscaleImage")})]})})]}),ld(DT,{isAttached:!0,children:ld(k3,{icon:ld(B5,{}),tooltip:`${f("options:info")} (I)`,"aria-label":`${f("options:info")} (I)`,"data-selected":l,onClick:x})}),ld(Gne,{image:c,children:ld(k3,{icon:ld(m3,{}),tooltip:`${f("options:deleteImage")} (Del)`,"aria-label":`${f("options:deleteImage")} (Del)`,isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function Zne(e){return _5({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 Xne=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>cd(CI,{gap:2,children:[n&&ld(YH,{label:`Recall ${e}`,children:ld(zT,{"aria-label":"Use this parameter",icon:ld(Zne,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&ld(YH,{label:`Copy ${e}`,children:ld(zT,{"aria-label":`Copy ${e}`,icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),cd(CI,{direction:o?"column":"row",children:[cd(VI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?cd(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",ld(V9,{mx:"2px"})]}):ld(VI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Kne=a.exports.memo((({image:e,styleClass:t})=>{const n=m5();gte("esc",(()=>{n(mU(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:y,steps:b,strength:x,threshold:w,type:k,variations:S,width:C}=r,_=JSON.stringify(e.metadata,null,2);return ld("div",{className:`image-metadata-viewer ${t}`,children:cd(CI,{gap:1,direction:"column",width:"100%",children:[cd(CI,{gap:2,children:[ld(VI,{fontWeight:"semibold",children:"File:"}),cd(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,ld(V9,{mx:"2px"})]})]}),Object.keys(r).length>0?cd(sd,{children:[k&&ld(Xne,{label:"Generation type",value:k}),e.metadata?.model_weights&&ld(Xne,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(k)&&ld(Xne,{label:"Original image",value:d}),"gfpgan"===k&&void 0!==x&&ld(Xne,{label:"Fix faces strength",value:x,onClick:()=>n(F$(x))}),"esrgan"===k&&void 0!==m&&ld(Xne,{label:"Upscaling scale",value:m,onClick:()=>n(SU(m))}),"esrgan"===k&&void 0!==x&&ld(Xne,{label:"Upscaling strength",value:x,onClick:()=>n(CU(x))}),p&&ld(Xne,{label:"Prompt",labelPosition:"top",value:C$(p),onClick:()=>n(J$(p))}),void 0!==y&&ld(Xne,{label:"Seed",value:y,onClick:()=>n(aU(y))}),void 0!==w&&ld(Xne,{label:"Noise Threshold",value:w,onClick:()=>n(wU(w))}),void 0!==h&&ld(Xne,{label:"Perlin Noise",value:h,onClick:()=>n(Q$(h))}),g&&ld(Xne,{label:"Sampler",value:g,onClick:()=>n(eU(g))}),b&&ld(Xne,{label:"Steps",value:b,onClick:()=>n(xU(b))}),void 0!==i&&ld(Xne,{label:"CFG scale",value:i,onClick:()=>n(z$(i))}),S&&S.length>0&&ld(Xne,{label:"Seed-weight pairs",value:E$(S),onClick:()=>n(sU(E$(S)))}),v&&ld(Xne,{label:"Seamless",value:v,onClick:()=>n(nU(v))}),l&&ld(Xne,{label:"High Resolution Optimization",value:l,onClick:()=>n(V$(l))}),C&&ld(Xne,{label:"Width",value:C,onClick:()=>n(EU(C))}),s&&ld(Xne,{label:"Height",value:s,onClick:()=>n(W$(s))}),c&&ld(Xne,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(G$(c))}),u&&ld(Xne,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Z$(u))}),"img2img"===k&&x&&ld(Xne,{label:"Image to image strength",value:x,onClick:()=>n($$(x))}),a&&ld(Xne,{label:"Image to image fit",value:a,onClick:()=>n(lU(a))}),f&&f.length>0&&cd(sd,{children:[ld(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),ld(Xne,{label:"Scale",value:r,onClick:()=>n(SU(r))}),ld(Xne,{label:"Strength",value:o,onClick:()=>n(CU(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("codeformer"))}}),o&&ld(Xne,{label:"Fidelity",value:o,onClick:()=>{n(B$(o)),n(H$("codeformer"))}})]},t)}}))]}),o&&ld(Xne,{withCopy:!0,label:"Dream Prompt",value:o}),cd(CI,{gap:2,direction:"column",children:[cd(CI,{gap:2,children:[ld(YH,{label:"Copy metadata JSON",children:ld(zT,{"aria-label":"Copy metadata JSON",icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),ld(VI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),ld("div",{className:"image-json-viewer",children:ld("pre",{children:_})})]})]}):ld(bI,{width:"100%",pt:10,children:ld(VI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),Qne=uV([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function Jne(){const e=m5(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return cd("div",{className:"current-image-preview",children:[o&&ld(ET,{src:o.url,width:o.width,height:o.height,style:{imageRendering:i?"pixelated":"initial"}}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),r&&o&&ld(Kne,{image:o,styleClass:"current-image-metadata"})]})}const ere=uV([e=>e.gallery,e=>e.options,T3],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),tre=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=v5(ere);return ld("div",{className:"current-image-area","data-tab-name":t,children:e?cd(sd,{children:[ld(Yne,{}),ld(Jne,{})]}):ld("div",{className:"current-image-display-placeholder",children:ld(L9,{})})})},nre=()=>{const e=a.exports.useContext(Vne);return ld(k3,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:ld(y3,{}),onClick:e||void 0})};function rre(){const e=v5((e=>e.options.initialImage)),{t:t}=FY(),n=m5(),r=zH();return cd(sd,{children:[cd("div",{className:"init-image-preview-header",children:[ld("h2",{children:t("options:initialImage")}),ld(nre,{})]}),e&&ld("div",{className:"init-image-preview",children:ld(ET,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(M$())}})})]})}const ore=()=>{const e=v5((e=>e.options.initialImage)),{currentImage:t}=v5((e=>e.gallery));return cd("div",{className:"workarea-split-view",children:[ld("div",{className:"workarea-split-view-left",children:e?ld("div",{className:"image-to-image-area",children:ld(rre,{})}):ld($ne,{})}),t&&ld("div",{className:"workarea-split-view-right",children:ld(tre,{})})]})};function ire(e){return _5({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 are(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function sre(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>a.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return a.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=a.exports.createContext(r),i=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][i])||o,c=a.exports.useMemo((()=>s),Object.values(s));return a.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||o,c=a.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},lre(r,...t)]}function lre(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return a.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function cre(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function ure(...e){return a.exports.useCallback(cre(...e),e)}const dre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=a.exports.Children.toArray(n),i=o.find(pre);if(i){const e=i.props.children,n=o.map((t=>t===i?a.exports.Children.count(e)>1?a.exports.Children.only(null):a.exports.isValidElement(e)?e.props.children:null:t));return a.exports.createElement(hre,vp({},r,{ref:t}),a.exports.isValidElement(e)?a.exports.cloneElement(e,void 0,n):null)}return a.exports.createElement(hre,vp({},r,{ref:t}),n)}));dre.displayName="Slot";const hre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return a.exports.isValidElement(n)?a.exports.cloneElement(n,{...gre(r,n.props),ref:cre(t,n.ref)}):a.exports.Children.count(n)>1?a.exports.Children.only(null):null}));hre.displayName="SlotClone";const fre=({children:e})=>a.exports.createElement(a.exports.Fragment,null,e);function pre(e){return a.exports.isValidElement(e)&&e.type===fre}function gre(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]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const mre=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=a.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?dre:t;return a.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),a.exports.createElement(i,vp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function vre(e,t){e&&$.exports.flushSync((()=>e.dispatchEvent(t)))}function yre(e){const t=e+"CollectionProvider",[n,r]=sre(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=H.useRef(null),i=H.useRef(new Map).current;return H.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:H.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=ure(t,i(a,n).collectionRef);return H.createElement(dre,{ref:o},r)})),ItemSlot:H.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=H.useRef(null),c=ure(t,a),u=i(s,n);return H.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),H.createElement(dre,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=H.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const bre=a.exports.createContext(void 0);function xre(e){const t=a.exports.useContext(bre);return e||t||"ltr"}function wre(e){const t=a.exports.useRef(e);return a.exports.useEffect((()=>{t.current=e})),a.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const kre="dismissableLayer.update",Sre="dismissableLayer.pointerDownOutside",Cre="dismissableLayer.focusOutside";let _re;const Ere=a.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pre=a.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=a.exports.useContext(Ere),[h,f]=a.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=a.exports.useState({}),m=ure(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,S=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1),o=a.exports.useRef((()=>{}));return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){Ore(Sre,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1);return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Ore(Cre,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e);a.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),a.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_re=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Lre(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_re)}}),[h,p,r,d]),a.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Lre())}),[h,d]),a.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(kre,e),()=>document.removeEventListener(kre,e)}),[]),a.exports.createElement(mre.div,vp({},u,{ref:m,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:are(e.onFocusCapture,C.onFocusCapture),onBlurCapture:are(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:are(e.onPointerDownCapture,S.onPointerDownCapture)}))}));function Lre(){const e=new CustomEvent(kre);document.dispatchEvent(e)}function Ore(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?vre(o,i):o.dispatchEvent(i)}let Mre=0;function Tre(){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 Are="focusScope.autoFocusOnMount",Ire="focusScope.autoFocusOnUnmount",Rre={bubbles:!1,cancelable:!0},Nre=a.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=a.exports.useState(null),u=wre(o),d=wre(i),h=a.exports.useRef(null),f=ure(t,(e=>c(e))),p=a.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:jre(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||jre(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),a.exports.useEffect((()=>{if(l){Fre.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Are,Rre);l.addEventListener(Are,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jre(r,{select:t}),document.activeElement!==n)return}((e=Dre(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&jre(l))}return()=>{l.removeEventListener(Are,u),setTimeout((()=>{const e=new CustomEvent(Ire,Rre);l.addEventListener(Ire,d),l.dispatchEvent(e),e.defaultPrevented||jre(null!=t?t:document.body,{select:!0}),l.removeEventListener(Ire,d),Fre.remove(p)}),0)}}var e}),[l,u,d,p]);const g=a.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=Dre(e),n=zre(t,e),r=zre(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&jre(i,{select:!0})):(e.preventDefault(),n&&jre(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return a.exports.createElement(mre.div,vp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function Dre(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zre(e,t){for(const n of e)if(!Bre(n,{upTo:t}))return n}function Bre(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function jre(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Fre=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Hre(e,t),e.unshift(t)},remove(t){var n;e=Hre(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Hre(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Wre=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?a.exports.useLayoutEffect:()=>{},Vre=W["useId".toString()]||(()=>{});let $re=0;function Ure(e){return e.split("-")[0]}function Gre(e){return e.split("-")[1]}function qre(e){return["top","bottom"].includes(Ure(e))?"x":"y"}function Yre(e){return"y"===e?"height":"width"}function Zre(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,s=qre(t),l=Yre(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Ure(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Gre(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function Xre(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kre(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qre(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=Xre(f),g=s[h?"floating"===d?"reference":"floating":d],m=Kre(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=Kre(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const Jre=Math.min,eoe=Math.max;function toe(e,t,n){return eoe(e,Jre(t,n))}const noe=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=Xre(r),u={x:o,y:i},d=qre(a),h=Gre(a),f=Yre(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-y/2,k=c[g],S=x-p[f]-c[m],C=x/2-p[f]/2+w,_=toe(k,C,S),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?Croe[e]))}const ioe={start:"end",end:"start"};function aoe(e){return e.replace(/start|end/g,(e=>ioe[e]))}const soe=["top","right","bottom","left"];const loe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=Ure(r),m=d||(g===a||!f?[ooe(a)]:function(e){const t=ooe(e);return[aoe(e),t,aoe(t)]}(a)),v=[a,...m],y=await Qre(t,p),b=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Gre(e),o=qre(e),i=Yre(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ooe(a)),{main:a,cross:ooe(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,k;const e=(null!=(w=null==(k=o.flip)?void 0:k.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var S;const e=null==(S=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function coe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uoe(e){return soe.some((t=>e[t]>=0))}const doe=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=coe(await Qre(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:uoe(t)}}}case"escaped":{const t=coe(await Qre(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:uoe(t)}}}default:return{}}}}};const hoe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ure(n),s=Gre(n),l="x"===qre(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function foe(e){return"x"===e?"y":"x"}const poe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Qre(t,l),d=qre(Ure(o)),h=foe(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=toe(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=toe(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},goe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=qre(o),h=foe(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,y,b,x;const e="y"===d?"width":"height",t=["top","left"].includes(Ure(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(y=a.offset)?void 0:y[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(b=null==(x=a.offset)?void 0:x[h])?b:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function moe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function voe(e){if(null==e)return window;if(!moe(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function yoe(e){return voe(e).getComputedStyle(e)}function boe(e){return moe(e)?"":e?(e.nodeName||"").toLowerCase():""}function xoe(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function woe(e){return e instanceof voe(e).HTMLElement}function koe(e){return e instanceof voe(e).Element}function Soe(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof voe(e).ShadowRoot||e instanceof ShadowRoot}function Coe(e){const{overflow:t,overflowX:n,overflowY:r}=yoe(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function _oe(e){return["table","td","th"].includes(boe(e))}function Eoe(e){const t=/firefox/i.test(xoe()),n=yoe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function Poe(){return!/^((?!chrome|android).)*safari/i.test(xoe())}const Loe=Math.min,Ooe=Math.max,Moe=Math.round;function Toe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&woe(e)&&(l=e.offsetWidth>0&&Moe(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Moe(s.height)/e.offsetHeight||1);const u=koe(e)?voe(e):window,d=!Poe()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Aoe(e){return((function(e){return e instanceof voe(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ioe(e){return koe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Roe(e){return Toe(Aoe(e)).left+Ioe(e).scrollLeft}function Noe(e,t,n){const r=woe(t),o=Aoe(t),i=Toe(e,r&&function(e){const t=Toe(e);return Moe(t.width)!==e.offsetWidth||Moe(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==boe(t)||Coe(o))&&(a=Ioe(t)),woe(t)){const e=Toe(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Roe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Doe(e){return"html"===boe(e)?e:e.assignedSlot||e.parentNode||(Soe(e)?e.host:null)||Aoe(e)}function zoe(e){return woe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Boe(e){const t=voe(e);let n=zoe(e);for(;n&&_oe(n)&&"static"===getComputedStyle(n).position;)n=zoe(n);return n&&("html"===boe(n)||"body"===boe(n)&&"static"===getComputedStyle(n).position&&!Eoe(n))?t:n||function(e){let t=Doe(e);for(Soe(t)&&(t=t.host);woe(t)&&!["html","body"].includes(boe(t));){if(Eoe(t))return t;t=t.parentNode}return null}(e)||t}function joe(e){if(woe(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Toe(e);return{width:t.width,height:t.height}}function Foe(e){const t=Doe(e);return["html","body","#document"].includes(boe(t))?e.ownerDocument.body:woe(t)&&Coe(t)?t:Foe(t)}function Hoe(e,t){var n;void 0===t&&(t=[]);const r=Foe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=voe(r),a=o?[i].concat(i.visualViewport||[],Coe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Hoe(a))}function Woe(e,t,n){return"viewport"===t?Kre(function(e,t){const n=voe(e),r=Aoe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Poe();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):koe(t)?function(e,t){const n=Toe(e,!1,"fixed"===t),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}}(t,n):Kre(function(e){var t;const n=Aoe(e),r=Ioe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ooe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ooe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Roe(e);const l=-r.scrollTop;return"rtl"===yoe(o||n).direction&&(s+=Ooe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(Aoe(e)))}function Voe(e){const t=Hoe(e),n=["absolute","fixed"].includes(yoe(e).position)&&woe(e)?Boe(e):e;return koe(n)?t.filter((e=>koe(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Soe(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==boe(e))):[]}const $oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Voe(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Woe(t,n,o);return e.top=Ooe(r.top,e.top),e.right=Loe(r.right,e.right),e.bottom=Loe(r.bottom,e.bottom),e.left=Ooe(r.left,e.left),e}),Woe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=woe(n),i=Aoe(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==boe(n)||Coe(i))&&(a=Ioe(n)),woe(n))){const e=Toe(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:koe,getDimensions:joe,getOffsetParent:Boe,getDocumentElement:Aoe,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Noe(t,Boe(n),r),floating:{...joe(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===yoe(e).direction};function Uoe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...koe(e)?Hoe(e):[],...Hoe(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),koe(e)&&!s&&h.observe(e),h.observe(t)}let f=s?Toe(e):null;return s&&function t(){const r=Toe(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const Goe=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=Zre(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=a.exports.useRef(null),[u,d]=a.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=a.exports.useState(t);Yoe(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=a.exports.useCallback((()=>{i.current&&s.current&&Goe(i.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&$.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);qoe((()=>{g.current&&p()}),[p]);const g=a.exports.useRef(!1);qoe((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=a.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),i.current&&s.current)if(l.current){const e=l.current(i.current,s.current,p);c.current=e}else p()}),[p,l]),v=a.exports.useCallback((e=>{i.current=e,m()}),[m]),y=a.exports.useCallback((e=>{s.current=e,m()}),[m]),b=a.exports.useMemo((()=>({reference:i,floating:s})),[]);return a.exports.useMemo((()=>({...u,update:p,refs:b,reference:v,floating:y})),[u,p,b,v,y])}const Xoe=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?noe({element:t.current,padding:n}).fn(e):{}:t?noe({element:t,padding:n}).fn(e):{}}};const Koe="Popper",[Qoe,Joe]=sre(Koe),[eie,tie]=Qoe(Koe),nie=a.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=tie("PopperAnchor",n),s=a.exports.useRef(null),l=ure(t,s);return a.exports.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:a.exports.createElement(mre.div,vp({},o,{ref:l}))})),rie="PopperContent",[oie,iie]=Qoe(rie),[aie,sie]=Qoe(rie,{hasParent:!1,positionUpdateFns:new Set}),lie=a.exports.forwardRef(((e,t)=>{var n,r,o,i,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...k}=e,S=tie(rie,d),[C,_]=a.exports.useState(null),E=ure(t,(e=>_(e))),[P,L]=a.exports.useState(null),O=function(e){const[t,n]=a.exports.useState(void 0);return Wre((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(P),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A=h+("center"!==p?"-"+p:""),I="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(uie),altBoundary:N},{reference:z,floating:B,strategy:j,x:F,y:H,placement:W,middlewareData:V,update:$}=Zoe({strategy:"fixed",placement:A,whileElementsMounted:Uoe,middleware:[hoe({mainAxis:f+T,alignmentAxis:g}),w?poe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?goe():void 0,...D}):void 0,P?Xoe({element:P,padding:m}):void 0,w?loe({...D}):void 0,die({arrowWidth:M,arrowHeight:T}),x?doe({strategy:"referenceHidden"}):void 0].filter(cie)});Wre((()=>{z(S.anchor)}),[z,S.anchor]);const U=null!==F&&null!==H,[G,q]=hie(W),Y=null===(o=V.arrow)||void 0===o?void 0:o.x,Z=null===(i=V.arrow)||void 0===i?void 0:i.y,X=0!==(null===(s=V.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=a.exports.useState();Wre((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=sie(rie,d),te=!J;a.exports.useLayoutEffect((()=>{if(!te)return ee.add($),()=>{ee.delete($)}}),[te,ee,$]),a.exports.useLayoutEffect((()=>{te&&U&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,U,ee]);const ne={"data-side":G,"data-align":q,...k,ref:E,style:{...k.style,animation:U?void 0:"none",opacity:null!==(l=V.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return a.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:j,left:0,top:0,transform:U?`translate3d(${Math.round(F)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=V.transformOrigin)||void 0===c?void 0:c.x,null===(u=V.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},a.exports.createElement(oie,{scope:d,placedSide:G,onArrowChange:L,arrowX:Y,arrowY:Z,shouldHideArrow:X},te?a.exports.createElement(aie,{scope:d,hasParent:!0,positionUpdateFns:ee},a.exports.createElement(mre.div,ne)):a.exports.createElement(mre.div,ne)))}));function cie(e){return void 0!==e}function uie(e){return null!==e}const die=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=hie(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let y="",b="";return"bottom"===f?(y=u?g:`${m}px`,b=-h+"px"):"top"===f?(y=u?g:`${m}px`,b=`${l.floating.height+h}px`):"right"===f?(y=-h+"px",b=u?g:`${v}px`):"left"===f&&(y=`${l.floating.width+h}px`,b=u?g:`${v}px`),{data:{x:y,y:b}}}});function hie(e){const[t,n="center"]=e.split("-");return[t,n]}const fie=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.exports.useState(null);return a.exports.createElement(eie,{scope:t,anchor:r,onAnchorChange:o},n)},pie=nie,gie=lie;const mie=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.exports.useState(),r=a.exports.useRef({}),o=a.exports.useRef(e),i=a.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.exports.useEffect((()=>{const e=vie(r.current);i.current="mounted"===l?e:"none"}),[l]),Wre((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=vie(t);if(e)c("MOUNT");else if("none"===a||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Wre((()=>{if(t){const e=e=>{const n=vie(r.current).includes(e.animationName);e.target===t&&n&&$.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=vie(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):a.exports.Children.only(n),i=ure(r.ref,o.ref);return"function"==typeof n||r.isPresent?a.exports.cloneElement(o,{ref:i}):null};function vie(e){return(null==e?void 0:e.animationName)||"none"}function yie({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=a.exports.useState(e),[r]=n,o=a.exports.useRef(r),i=wre(t);return a.exports.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,l=wre(n),c=a.exports.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l]);return[s,c]}mie.displayName="Presence";const bie="rovingFocusGroup.onEntryFocus",xie={bubbles:!1,cancelable:!0},wie="RovingFocusGroup",[kie,Sie,Cie]=yre(wie),[_ie,Eie]=sre(wie,[Cie]),[Pie,Lie]=_ie(wie),Oie=a.exports.forwardRef(((e,t)=>a.exports.createElement(kie.Provider,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(kie.Slot,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(Mie,vp({},e,{ref:t})))))),Mie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=a.exports.useRef(null),f=ure(t,h),p=xre(i),[g=null,m]=yie({prop:s,defaultProp:l,onChange:c}),[v,y]=a.exports.useState(!1),b=wre(u),x=Sie(n),w=a.exports.useRef(!1),[k,S]=a.exports.useState(0);return a.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(bie,b),()=>e.removeEventListener(bie,b)}),[b]),a.exports.createElement(Pie,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:a.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:a.exports.useCallback((()=>y(!0)),[]),onFocusableItemAdd:a.exports.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:a.exports.useCallback((()=>S((e=>e-1))),[])},a.exports.createElement(mre.div,vp({tabIndex:v||0===k?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:are(e.onMouseDown,(()=>{w.current=!0})),onFocus:are(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(bie,xie);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));Iie([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:are(e.onBlur,(()=>y(!1)))})))})),Tie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=e,s=function(e){const[t,n]=a.exports.useState(Vre());return Wre((()=>{e||n((e=>null!=e?e:String($re++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=Lie("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=Sie(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return a.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),a.exports.createElement(kie.ItemSlot,{scope:n,id:s,focusable:r,active:o},a.exports.createElement(mre.span,vp({tabIndex:c?0:-1,"data-orientation":l.orientation},i,{ref:t,onMouseDown:are(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:are(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:are(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Aie[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Iie(o)))}var n,r}))})))})),Aie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Iie(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const Rie=Oie,Nie=Tie,Die=["Enter"," "],zie=["ArrowUp","PageDown","End"],Bie=["ArrowDown","PageUp","Home",...zie],jie="Menu",[Fie,Hie,Wie]=yre(jie),[Vie,$ie]=sre(jie,[Wie,Joe,Eie]),Uie=Joe(),Gie=Eie(),[qie,Yie]=Vie(jie),[Zie,Xie]=Vie(jie),Kie=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=Uie(n);return a.exports.createElement(pie,vp({},o,r,{ref:t}))})),[Qie,Jie]=Vie("MenuPortal",{forceMount:void 0}),eae="MenuContent",[tae,nae]=Vie(eae),rae=a.exports.forwardRef(((e,t)=>{const n=Jie(eae,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Yie(eae,e.__scopeMenu),s=Xie(eae,e.__scopeMenu);return a.exports.createElement(Fie.Provider,{scope:e.__scopeMenu},a.exports.createElement(mie,{present:r||i.open},a.exports.createElement(Fie.Slot,{scope:e.__scopeMenu},s.modal?a.exports.createElement(oae,vp({},o,{ref:t})):a.exports.createElement(iae,vp({},o,{ref:t})))))})),oae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu),r=a.exports.useRef(null),o=ure(t,r);return a.exports.useEffect((()=>{const e=r.current;if(e)return pD(e)}),[]),a.exports.createElement(aae,vp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:are(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),iae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu);return a.exports.createElement(aae,vp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),aae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=Yie(eae,n),v=Xie(eae,n),y=Uie(n),b=Gie(n),x=Hie(n),[w,k]=a.exports.useState(null),S=a.exports.useRef(null),C=ure(t,S,m.onContentChange),_=a.exports.useRef(0),E=a.exports.useRef(""),P=a.exports.useRef(0),L=a.exports.useRef(null),O=a.exports.useRef("right"),M=a.exports.useRef(0),T=p?_B:a.exports.Fragment,A=p?{as:dre,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};a.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),a.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Tre()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Tre()),Mre++,()=>{1===Mre&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mre--}}),[]);const R=a.exports.useCallback((e=>{var t,n;return O.current===(null===(t=L.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=L.current)||void 0===n?void 0:n.area)}),[]);return a.exports.createElement(tae,{scope:n,searchRef:E,onItemEnter:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:a.exports.useCallback((e=>{var t;R(e)||(null===(t=S.current)||void 0===t||t.focus(),k(null))}),[R]),onTriggerLeave:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:P,onPointerGraceIntentChange:a.exports.useCallback((e=>{L.current=e}),[])},a.exports.createElement(T,A,a.exports.createElement(Nre,{asChild:!0,trapped:o,onMountAutoFocus:are(i,(e=>{var t;e.preventDefault(),null===(t=S.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},a.exports.createElement(Pre,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},a.exports.createElement(Rie,vp({asChild:!0},b,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),a.exports.createElement(gie,vp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},y,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:are(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=S.current;if(e.target!==o)return;if(!Bie.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));zie.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:are(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:are(e.onPointerMove,dae((e=>{const t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>M.current?"right":"left";O.current=t,M.current=e.clientX}})))})))))));var N})),sae="MenuItem",lae="menu.itemSelect",cae=a.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.exports.useRef(null),s=Xie(sae,e.__scopeMenu),l=nae(sae,e.__scopeMenu),c=ure(t,i),u=a.exports.useRef(!1);return a.exports.createElement(uae,vp({},o,{ref:c,disabled:n,onClick:are(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(lae,{bubbles:!0,cancelable:!0});e.addEventListener(lae,(e=>null==r?void 0:r(e)),{once:!0}),vre(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:are(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:are(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||Die.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),uae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=nae(sae,n),l=Gie(n),c=a.exports.useRef(null),u=ure(t,c),[d,h]=a.exports.useState(!1),[f,p]=a.exports.useState("");return a.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[i.children]),a.exports.createElement(Fie.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},a.exports.createElement(Nie,vp({asChild:!0},l,{focusable:!r}),a.exports.createElement(mre.div,vp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:are(e.onPointerMove,dae((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:are(e.onPointerLeave,dae((e=>s.onItemLeave(e)))),onFocus:are(e.onFocus,(()=>h(!0))),onBlur:are(e.onBlur,(()=>h(!1)))}))))}));Vie("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});Vie("MenuItemIndicator",{checked:!1});function dae(e){return t=>"mouse"===t.pointerType?e(t):void 0}Vie("MenuSub");const hae=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=Uie(t),[c,u]=a.exports.useState(null),d=a.exports.useRef(!1),h=wre(i),f=xre(o);return a.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),a.exports.createElement(fie,l,a.exports.createElement(qie,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},a.exports.createElement(Zie,{scope:t,onClose:a.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},fae=Kie,pae=rae,gae=cae,mae="ContextMenu",[vae,yae]=sre(mae,[$ie]),bae=$ie(),[xae,wae]=vae(mae);function kae(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const Sae=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[s,l]=a.exports.useState(!1),c=bae(t),u=wre(r),d=a.exports.useCallback((e=>{l(e),u(e)}),[u]);return a.exports.createElement(xae,{scope:t,open:s,onOpenChange:d,modal:i},a.exports.createElement(hae,vp({},c,{dir:o,open:s,onOpenChange:d,modal:i}),n))},Cae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuTrigger",n),i=bae(n),s=a.exports.useRef({x:0,y:0}),l=a.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=a.exports.useRef(0),u=a.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return a.exports.useEffect((()=>u),[u]),a.exports.createElement(a.exports.Fragment,null,a.exports.createElement(fae,vp({},i,{virtualRef:l})),a.exports.createElement(mre.span,vp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:are(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:are(e.onPointerDown,kae((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:are(e.onPointerMove,kae(u)),onPointerCancel:are(e.onPointerCancel,kae(u)),onPointerUp:are(e.onPointerUp,kae(u))})))})),_ae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuContent",n),i=bae(n),s=a.exports.useRef(!1);return a.exports.createElement(pae,vp({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),Eae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=bae(n);return a.exports.createElement(gae,vp({},o,r,{ref:t}))})),Pae=uV([e=>e.gallery,e=>e.options,dne,T3],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Lae=uV([e=>e.options,e=>e.gallery,e=>e.system,T3],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Oae=a.exports.memo((e=>{const t=m5(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:i,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=v5(Lae),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=a.exports.useState(!1),v=zH(),{t:y}=FY();return cd(Sae,{onOpenChange:e=>{t(GU(e))},children:[ld(Cae,{children:cd(mI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[ld(ET,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),ld("div",{className:"hoverable-image-content",onClick:()=>t(DU(c)),children:u&&ld(kk,{width:"50%",height:"50%",as:z5,className:"hoverable-image-check"})}),g&&o>=64&&ld("div",{className:"hoverable-image-delete-button",children:ld(Gne,{image:c,children:ld(zT,{"aria-label":y("options:deleteImage"),icon:ld(g3,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!i})})})]},f)}),cd(_ae,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[ld(Eae,{onClickCapture:()=>{t(q$(!0)),t(DU(c))},children:y("options:openInViewer")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(J$(c.metadata.image.prompt)),v({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:y("options:usePrompt")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(aU(c.metadata.image.seed)),v({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:y("options:useSeed")}),ld(Eae,{onClickCapture:()=>{p&&t(D$(p)),v({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:y("options:useAll")}),ld(Eae,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(I$("img2img")),t(R$(p)),void v({title:y("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0})}v({title:y("toast:initialImageNotSet"),description:y("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:y("options:useInitImg")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(G$(c)),"img2img"!==n&&t(I$("img2img")),v({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToImg2Img")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(aX(c)),t(YZ()),"unifiedCanvas"!==n&&t(I$("unifiedCanvas")),v({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToUnifiedCanvas")}),ld(Eae,{"data-warning":!0,children:ld(Gne,{image:c,children:ld("p",{children:y("options:deleteImage")})})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),Mae=320,Tae={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Aae(){const e=m5(),{t:t}=FY(),{images:n,currentCategory:r,currentImageUuid:o,shouldPinGallery:i,shouldShowGallery:s,galleryScrollPosition:l,galleryImageMinimumWidth:c,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:p,areMoreImagesAvailable:g,galleryWidth:m,isLightBoxOpen:v,isStaging:y,shouldEnableResize:b,shouldUseSingleGalleryColumn:x}=v5(Pae),{galleryMinWidth:w,galleryMaxWidth:k}=v?{galleryMinWidth:400,galleryMaxWidth:400}:Tae[d],[S,C]=a.exports.useState(m>=Mae),[_,E]=a.exports.useState(!1),[P,L]=a.exports.useState(0),O=a.exports.useRef(null),M=a.exports.useRef(null),T=a.exports.useRef(null);a.exports.useEffect((()=>{m>=Mae&&C(!1)}),[m]);const A=()=>{e(HU(!i)),e(iX(!0))},I=()=>{e(WU(!0)),i&&e(iX(!0))},R=a.exports.useCallback((()=>{e(WU(!1)),e(GU(!1)),e(VU(M.current?M.current.scrollTop:0)),setTimeout((()=>i&&e(iX(!0))),400)}),[e,i]),N=()=>{T.current&&window.clearTimeout(T.current)};gte("g",(()=>{s?R():I()}),[s,i]),gte("left",(()=>{e(FU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("right",(()=>{e(jU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("shift+g",(()=>{A()}),[i]),gte("esc",(()=>{e(WU(!1))}),{enabled:()=>!i,preventDefault:!0},[i]);return gte("shift+up",(()=>{if(c<256){const t=TU.clamp(c+32,32,256);e($U(t))}}),[c]),gte("shift+down",(()=>{if(c>32){const t=TU.clamp(c-32,32,256);e($U(t))}}),[c]),a.exports.useEffect((()=>{M.current&&(M.current.scrollTop=l)}),[l,s]),a.exports.useEffect((()=>{function e(e){i||!O.current||O.current.contains(e.target)||R()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[R,i]),ld(jne,{nodeRef:O,in:s||f,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:cd("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:O,onMouseLeave:i?void 0:()=>{f||(T.current=window.setTimeout((()=>R()),500))},onMouseEnter:i?void 0:N,onMouseOver:i?void 0:N,children:[cd(m8,{minWidth:w,maxWidth:i?k:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:m,height:i?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,i&&(n.style.position="fixed",n.style.right="1rem",E(!0))},onResizeStop:(t,n,r,o)=>{const a=i?TU.clamp(Number(m)+o.width,w,Number(k)):Number(m)+o.width;e(ZU(a)),r.removeAttribute("data-resize-alert"),i&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",i?"100%":"100vh"),E(!1),e(iX(!0)))},onResize:(t,n,r,o)=>{const a=TU.clamp(Number(m)+o.width,w,Number(i?k:.95*window.innerWidth));a>=Mae&&!S?C(!0):aa-40&&e($U(a-40)),i&&(a>=k?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${P}px`},children:[cd("div",{className:"image-gallery-header",children:[ld(DT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:cd(sd,S?{children:[ld(B3,{size:"sm","data-selected":"result"===r,onClick:()=>e(YU("result")),children:t("gallery:generations")}),ld(B3,{size:"sm","data-selected":"user"===r,onClick:()=>e(YU("user")),children:t("gallery:uploads")})]}:{children:[ld(k3,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===r,icon:ld(K5,{}),onClick:()=>e(YU("result"))}),ld(k3,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===r,icon:ld(b3,{}),onClick:()=>e(YU("user"))})]})}),cd("div",{className:"image-gallery-header-right-icons",children:[ld(z3,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:ld(k3,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:ld(x3,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:cd("div",{className:"image-gallery-settings-popover",children:[cd("div",{children:[ld(Ite,{value:c,onChange:t=>{e($U(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),ld(k3,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e($U(64)),icon:ld(T9,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),ld("div",{children:ld(k9,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===h,onChange:()=>e(UU("contain"===h?"cover":"contain"))})}),ld("div",{children:ld(k9,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:t=>e(qU(t.target.checked))})}),ld("div",{children:ld(k9,{label:t("gallery:singleColumnLayout"),isChecked:x,onChange:t=>e(XU(t.target.checked))})})]})}),ld(k3,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:A,icon:ld(i?kne:Sne,{})})]})]}),ld("div",{className:"image-gallery-container",ref:M,children:n.length||g?cd(sd,{children:[ld("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map((e=>{const{uuid:t}=e;return ld(Oae,{image:e,isSelected:o===t},t)}))}),ld(RT,{onClick:()=>{e(CQ(r))},isDisabled:!g,className:"image-gallery-load-more-btn",children:t(g?"gallery:loadMore":"gallery:allImagesLoaded")})]}):cd("div",{className:"image-gallery-container-placeholder",children:[ld(P9,{}),ld("p",{children:t("gallery:noImagesInGallery")})]})})]}),_&&ld("div",{style:{width:m+"px",height:"100%"}})]})})}const Iae=uV((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),Rae=uV([e=>e.options,T3],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Nae=e=>{const t=m5(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=v5(Rae),c=(()=>{const{resultImages:e,userImages:t}=v5(Iae);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return ld("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:cd("div",{className:"workarea-main",children:[n,cd("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(G$(r)):"unifiedCanvas"===i&&t(aX(r)))},children:[r,l&&ld(YH,{label:"Toggle Split View",children:ld("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(bU(!a)),t(iX(!0))},children:ld(ire,{})})})]}),!s&&ld(Aae,{})]})})};function Dae(){return ld(Nae,{optionsPanel:ld(Wne,{}),children:ld(ore,{})})}const zae=()=>{const e=m5(),t=v5((e=>e.options.hiresFix)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:t=>e(V$(t.target.checked))})})},Bae=()=>cd(CI,{gap:2,direction:"column",children:[ld(Nte,{}),ld(zae,{})]});function jae(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Bae,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(cne,{accordionInfo:t})]})}const Fae=()=>ld("div",{className:"workarea-single-view",children:ld("div",{className:"text-to-image-area",children:ld(tre,{})})});function Hae(){return ld(Nae,{optionsPanel:ld(jae,{}),children:ld(Fae,{})})}var Wae=function(e,t){return Wae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Wae(e,t)};var Vae=function(){return Vae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Kae(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):Xae(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var Qae=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Jae=function(e,t){var n=Qae(e,t);return e.bounds=n,n};function ese(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:tse(e,s-d,c+d,r),y:tse(t,l-h,u+h,r)}}var tse=function(e,t,n,r){return Uae(r?en?n:e:e,2)};function nse(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):ese(l-t*u,c-n*u,o,i,0,0,null)}function rse(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var ose=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!Tse(i,n)},ise=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var ase=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function sse(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:tse(e,i,a,o)}function lse(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function cse(e,t){var n=e.transformState.scale;Zae(e),Jae(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function use(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=ase(e,i),d=ase(e,a);lse(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=ese(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function dse(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,y=m.lockAxisX,b=g.animationType,x=p.sizeX,w=p.sizeY,k=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,k),_=ase(e,x),E=ase(e,w),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=c+P,M=u-P,T=d+L,A=h-L,I=e.transformState,R=(new Date).getTime();Xae(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/k,g=1-(0,qae[p.animationType])(Math.min(1,l)),m=1-t,b=o+a*m,x=i+s*m,w=sse(b,I.positionX,o,y,f,u,c,M,O,g),S=sse(x,I.positionY,i,v,f,h,d,A,T,g);o===b&&i===x||e.setTransformState(r,w,S)}))}}(e):hse(e)}}function hse(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=v.x,b=v.y;return{scale:o,positionX:g?y:n,positionY:m?b:r}}}(e);u&&Kae(e,u,l,c)}}function fse(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&hse(e),!h&&o&&e.mounted){var f=pse(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&Kae(e,f,u,d)}}function pse(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=rse(Uae(t,2),i,a,0,!1),c=nse(e,n,r,l,Jae(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var gse={previousScale:1,scale:1,positionX:0,positionY:0},mse=Vae(Vae({},gse),{setComponents:function(){},contextInstance:null}),vse={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},yse=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:gse.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:gse.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:gse.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:gse.positionY}},bse=function(e){var t=Vae({},vse);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==vse[n]&&r){var o=Object.prototype.toString.call(vse[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Vae(Vae({},vse[n]),e[n]):a?$ae($ae([],vse[n]),e[n]):e[n]}})),t},xse=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return rse(Uae(c,3),s,a,l,!1)};function wse(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=pse(e,xse(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,r,o)}function kse(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=yse(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=Qae(e,a.scale),h=ese(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||Kae(e,f,t,n)}}var Sse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,1,t,n,r)}},Cse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,-1,t,n,r)}},_se=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};Kae(e,h,o,i)}}},Ese=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),kse(e,t,n)}},Pse=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=Rse(t||o.scale,i,a);Kae(e,s,n,r)}}},Lse=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Zae(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return gse;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=rse(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,y=(l.height-f*m)/2,b=ese((l.left-u)*m+v,(l.top-d)*m+y,Qae(e,m),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:m}}(e,a,n);Kae(e,s,r,o)}}},Ose=function(e){return{instance:e,state:e.transformState,zoomIn:Sse(e),zoomOut:Cse(e),setTransform:_se(e),resetTransform:Ese(e),centerView:Pse(e),zoomToElement:Lse(e)}};function Mse(){try{return{get passive(){return!0,!1}}}catch(Hhe){return!1}}var Tse=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Ase=function(e){e&&clearTimeout(e)},Ise=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},Rse=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Nse=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!Tse(c,a)))};function Dse(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var zse=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!Tse(a,o)},Bse=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},jse=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Fse=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Zae(e),Gae(Ose(e),t,r),Gae(Ose(e),t,o))},Hse=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return rse(Uae(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=Jae(e,m),y=Dse(t,i,s),b=l&&(f||0===h||c),x=nse(e,y.x,y.y,m,v,b),w=x.x,k=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,k),Gae(Ose(e),t,r),Gae(Ose(e),t,o)}},Wse=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Ase(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(fse(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Ase(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Gae(Ose(e),t,r),Gae(Ose(e),t,o))}),160))},Vse=function(e,t){var n=jse(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Zae(e)},$se=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Uae(o[0].clientX-r.left,5),a=Uae(o[0].clientY-r.top,5);return{x:(i+Uae(o[1].clientX-r.left,5))/2/t,y:(a+Uae(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=jse(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:rse(Uae(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=Jae(e,f),g=a&&(c||0===u||s),m=nse(e,d.x,d.y,f,p,g),v=m.x,y=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,y)}}}},Use=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,fse(e,null==t?void 0:t.x,null==t?void 0:t.y)};function Gse(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return kse(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=xse(e,"zoomOut"===o?-1:1,i),d=Dse(t,c,l),h=pse(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,a,s)}}var qse=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!Tse(l,s)&&!!u)},Yse=H.createContext(mse),Zse=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=yse(t.props),t.setup=bse(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=Mse();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Nse(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Fse(t,e),Hse(t,e),Wse(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||ose(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Zae(t),cse(t,e),Gae(Ose(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||ise(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),use(t,e.clientX,e.clientY),Gae(Ose(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(dse(t),Gae(Ose(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||zse(t,e)&&(Vse(t,e),Zae(t),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Bse(t)&&(e.preventDefault(),e.stopPropagation(),$se(t,e),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Use(t),Gae(Ose(t),e,r),Gae(Ose(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&ose(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Zae(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Zae(t),cse(t,e),Gae(Ose(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!ise(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];use(t,o.clientX,o.clientY),Gae(Ose(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||qse(t,e)&&Gse(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Jae(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,Gae(Ose(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Rse(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Ise(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(Ose(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=Mse();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=Mse();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Zae(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Jae(this,this.transformState.scale),this.setup=bse(this.props))},t.prototype.render=function(){var e=Ose(this),t=this.props.children,n="function"==typeof t?t(e):t;return ld(Yse.Provider,{value:Vae(Vae({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(a.exports.Component),Xse=H.forwardRef((function(e,t){var n=a.exports.useState(null),r=n[0],o=n[1];return a.exports.useImperativeHandle(t,(function(){return r}),[r]),ld(Zse,{...Vae({},e,{setRef:o})})}));var Kse="transform-component-module_wrapper__1_Fgj",Qse="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Jse=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=a.exports.useContext(Yse).setComponents,u=a.exports.useRef(null),d=a.exports.useRef(null);return a.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),ld("div",{ref:u,className:"react-transform-wrapper "+Kse+" "+r,style:s,children:ld("div",{ref:d,className:"react-transform-component "+Qse+" "+i,style:l,children:t})})};function ele({image:e,alt:t,ref:n,styleClass:r}){const[o,i]=a.exports.useState(0),[s,l]=a.exports.useState(!1),c=()=>{i(-3===o?0:o-1)},u=()=>{i(3===o?0:o+1)},d=()=>{l(!s)};return ld(Xse,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:a,zoomOut:h,resetTransform:f,centerView:p})=>cd(sd,{children:[cd("div",{className:"lightbox-image-options",children:[ld(k3,{icon:ld(R9,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>a(),fontSize:20}),ld(k3,{icon:ld(N9,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),ld(k3,{icon:ld(A9,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),ld(k3,{icon:ld(I9,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),ld(k3,{icon:ld(E9,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),ld(k3,{icon:ld(T9,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),i(0),l(!1)},fontSize:20})]}),ld(Jse,{wrapperStyle:{width:"100%",height:"100%"},children:ld("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function tle(){const e=m5(),t=v5((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return gte("Esc",(()=>{t&&e(q$(!1))}),[t]),cd("div",{className:"lightbox-container",children:[ld(k3,{icon:ld(M9,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(q$(!1))},fontSize:20}),cd("div",{className:"lightbox-display-container",children:[cd("div",{className:"lightbox-preview-wrapper",children:[ld(Yne,{}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!i&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),n&&cd(sd,{children:[ld(ele,{image:n.url,styleClass:"lightbox-image"}),r&&ld(Kne,{image:n})]})]}),ld(Aae,{})]})]})}const nle=uV([A3],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),rle=()=>{const e=m5(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=v5(nle),{t:i}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{sliderMarkRightOffset:-6,label:i("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(rU(t))},handleReset:()=>e(rU(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(tU(t))},handleReset:()=>{e(tU(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-7,label:i("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:t=>{e(iU(t))},handleReset:()=>{e(iU(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(oU(t))},handleReset:()=>{e(oU(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},ole=uV(une,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),ile=()=>{const e=m5(),{boundingBoxDimensions:t}=v5(ole),{t:n}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:n=>{e(KZ({...t,width:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:n=>{e(KZ({...t,height:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},ale=uV(une,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function sle(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=v5(ale),n=m5(),{t:r}=FY();return cd(CI,{alignItems:"center",columnGap:"1rem",children:[ld(Ite,{label:r("options:inpaintReplace"),value:e,onChange:e=>{n(sX(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(sX(1)),isResetDisabled:!t}),ld(_3,{isChecked:t,onChange:e=>n(RX(e.target.checked)),marginTop:"1.25rem"})]})}const lle=uV([A3,O3,une],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),cle=()=>{const e=m5(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=v5(lle),{t:s}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(E3,{label:s("options:scaleBeforeProcessing"),validValues:CZ,value:o,onChange:t=>{e(JZ(t.target.value))}}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:t=>{e(HX({...a,width:Math.floor(t)}))},handleReset:()=>{e(HX({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:t=>{e(HX({...a,height:Math.floor(t)}))},handleReset:()=>{e(HX({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(sle,{}),ld(E3,{label:s("options:infillMethod"),value:n,validValues:r,onChange:t=>e(U$(t.target.value))}),ld(Ite,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(kU(t))},handleReset:()=>{e(kU(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function ule(){const{t:e}=FY(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:Ete.BOUNDING_BOX,content:ld(ile,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:Ete.SEAM_CORRECTION,content:ld(rle,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:Ete.INFILL_AND_SCALING,content:ld(cle,{})},seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(cne,{accordionInfo:t})]})}const dle=uV(une,hne,T3,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),hle=()=>{const e=m5(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=v5(dle),i=a.exports.useRef(null);return a.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!i.current)return;const{clientWidth:t,clientHeight:n}=i.current;e(nX({width:t,height:n})),e(o?ZZ():YZ()),e(iX(!1))}),0)}),[e,r,t,n,o]),ld("div",{ref:i,className:"inpainting-canvas-area",children:ld(hT,{thickness:"2px",speed:"1s",size:"xl"})})};var fle={exports:{}},ple=function(e){var t={},n=a.exports,r=G.exports,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function yt(e,t,n){if(ht.current!==dt)throw Error(i(168));ut(ht,t),ut(ft,n)}function bt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,C(e)||"Unknown",a));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=bt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var kt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(St(e)/Ct|0)|0},St=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Pt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Pt(s):0!==(i&=a)&&(r=Pt(i))}else 0!==(a=n&~o)?r=Pt(a):0!==i&&(r=Pt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-kt(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<>=a,o-=a,cn=1<<32-kt(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var b=m(o,h,y.value,c);if(null===b){null===h&&(h=p);break}e&&h&&null===b.alternate&&t(o,h),s=a(b,s,f),null===d?u=b:d.sibling=b,d=b,h=p}if(y.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=g(o,y.value,c))&&(s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return vn&&dn(o,f),u}for(h=r(o,h);!y.done;f++,y=l.next())null!==(y=v(h,o,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===b&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case b:return e(r,i,(f=a._init)(a._payload),d)}if(A(a))return y(r,i,a,d);if(k(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),yr=lt(gr);function br(e){if(e===gr)throw Error(i(174));return e}function xr(e,t){ut(yr,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(yr)}function kr(e){var t=br(yr.current),n=br(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function Sr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Pr(){for(var e=0;en?n:4,e(!0);var r=Or.transition;Or.transition={};try{e(!1),t()}finally{Nt=n,Or.transition=r}}function vo(){return Vr().memoizedState}function yo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Un(e,t,n,r))){Na(n,e,r,Ia()),ko(n,t,r)}}function bo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Yt(s,a)){var l=t.interleaved;return null===l?(o.next=o,$n(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(V2){}null!==(n=Un(e,t,o,r))&&(Na(n,e,r,o=Ia()),ko(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var So={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?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=yo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===aa)throw Error(i(349));0!=(30&Mr)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,io(Kr.bind(null,r,a,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-kt(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Ur,useRef:no,useState:function(){return Ur($r)},useDebugValue:ho,useDeferredValue:function(e){return go(Vr(),Ar.memoizedState,e)},useTransition:function(){return[Ur($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr($r)},useDebugValue:ho,useDeferredValue:function(e){var t=Vr();return null===Ar?t.memoizedState=e:go(t,Ar.memoizedState,e)},useTransition:function(){return[Gr($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1};function Po(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(nue){o="\nError generating stack: "+nue.message+"\n"+nue.stack}return{value:e,source:t,stack:o,digest:null}}function Lo(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Oo(e,t){try{console.error(t.value)}catch(Jce){setTimeout((function(){throw Jce}))}}var Mo="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Sa||(Sa=!0,Ca=r),Oo(0,t)},n}function Ao(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Oo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Oo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Mo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=Fr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Fo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Mn)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Mn(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return $o(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=Fr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Uo(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:An(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?yt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yt(0,t.context,!1),xr(e,t.containerInfo)}function Yo(e,t,n,r,o){return Pn(),Ln(o),t.flags|=256,Bo(e,t,n,r),t.child}var Zo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,a=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),ut(Cr,1&a),null===e)return Sn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Lo(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,a);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=je(o).digest,a=Error(i(419)),r=Lo(a,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Gn(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Lo(Error(i(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),Fe(o,t),null):(e=a.treeContext,K&&(mn=$e(o),gn=t,vn=!0,bn=null,yn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Ln(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Fn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Z)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=br(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),Oe(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Oe(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Le(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Me(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=br(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Pe(i,c,n,a,r,t,e,s),F(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Zo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=br(yr.current),n=br(mr.current),t.stateNode=V(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Pr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==bn&&(ja(bn),bn=null))),Xo(e,t),fi(t),null;case 5:Sr(t),n=br(yr.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=br(mr.current),_n(t)){if(!K)throw Error(i(175));e=Ue(t.stateNode,t.type,t.memoizedProps,n,e,t,!yn),t.updateQueue=e,null!==e&&ci(t)}else{var a=B(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,F(a,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=br(yr.current),n=br(mr.current),_n(t)){if(!K)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ge(e,n,t,!yn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Pn(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!K)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));qe(o,t)}else Pn(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==bn&&(ja(bn),bn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return jn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ba&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ba&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Z&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Pr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Sr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));Pn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return jn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var mi=!1,vi=!1,yi="function"==typeof WeakSet?WeakSet:Set,bi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(oue){ns(e,t,oue)}else n.current=null}function wi(e,t,n){try{n()}catch(oue){ns(e,t,oue)}}var ki=!1;function Si(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),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 Pi(e){return 5===e.tag||3===e.tag||4===e.tag}function Li(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Pi(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ye(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}var Ti=null,Ai=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount(Gt,n)}catch(iue){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Z){var r=Ti,o=Ai;Ti=null,Ii(e,t,n),Ai=o,null!==(Ti=r)&&(Ai?xe(Ti,n.stateNode):be(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Z&&null!==Ti&&(Ai?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Z?(r=Ti,o=Ai,Ti=n.stateNode.containerInfo,Ai=!0,Ii(e,t,n),Ti=r,Ai=o):(X&&(r=n.stateNode.containerInfo,o=Le(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(iue){ns(n,t,iue)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new yi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Qi(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=$(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(i(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&($a(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=va,va=n,null!==t&&ja(t)),e}function ja(e){null===va?va=e:va.push.apply(va,e)}function Fa(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Pa)var r=!1;else{if(e=Pa,Pa=null,La=0,0!=(6&ia))throw Error(i(331));var o=ia;for(ia|=4,bi=e.current;null!==bi;){var a=bi,s=a.child;if(0!=(16&bi.flags)){var l=a.deletions;if(null!==l){for(var c=0;cHt()-ya?$a(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=Gn(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(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 cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=a,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=a,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=a,e;case x:return ps(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case y:s=14;break e;case b:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function ys(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yn(i),e}function bs(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(mt(n))return bt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=L(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&a>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>a&&(c.height+=h-a,c.y=a),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Ss,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Gt=t.inject(e),qt=t}catch(Jce){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(i(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=bs(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; + */!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,l=32,c=64,u=128,d=256,h=1/0,f=9007199254740991,p=NaN,g=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",l],["partialRight",c],["rearg",d]],v="[object Arguments]",y="[object Array]",b="[object Boolean]",x="[object Date]",w="[object Error]",k="[object Function]",S="[object GeneratorFunction]",C="[object Map]",_="[object Number]",E="[object Object]",P="[object Promise]",L="[object RegExp]",O="[object Set]",M="[object String]",T="[object Symbol]",A="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",F="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",V="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,Z=RegExp(q.source),X=RegExp(Y.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(re.source),ie=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Me="['’]",Te="["+Se+"]",Ae="["+Oe+"]",Ie="["+Ce+"]",Re="\\d+",Ne="["+_e+"]",De="["+Ee+"]",ze="[^"+Se+Oe+Re+_e+Ee+Pe+"]",Be="\\ud83c[\\udffb-\\udfff]",je="[^"+Se+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Pe+"]",Ve="\\u200d",$e="(?:"+De+"|"+ze+")",Ue="(?:"+We+"|"+ze+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ie+"|"+Be+")"+"?",Ze="["+Le+"]?",Xe=Ze+Ye+("(?:"+Ve+"(?:"+[je,Fe,He].join("|")+")"+Ze+Ye+")*"),Ke="(?:"+[Ne,Fe,He].join("|")+")"+Xe,Qe="(?:"+[je+Ie+"?",Ie,Fe,He,Te].join("|")+")",Je=RegExp(Me,"g"),et=RegExp(Ie,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Xe,"g"),nt=RegExp([We+"?"+De+"+"+Ge+"(?="+[Ae,We,"$"].join("|")+")",Ue+"+"+qe+"(?="+[Ae,We+$e,"$"].join("|")+")",We+"?"+$e+"+"+Ge,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Re,Ke].join("|"),"g"),rt=RegExp("["+Ve+Se+Ce+Le+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["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"],at=-1,st={};st[N]=st[D]=st[z]=st[B]=st[j]=st[F]=st[H]=st[W]=st[V]=!0,st[v]=st[y]=st[I]=st[b]=st[R]=st[x]=st[w]=st[k]=st[C]=st[_]=st[E]=st[L]=st[O]=st[M]=st[A]=!1;var lt={};lt[v]=lt[y]=lt[I]=lt[R]=lt[b]=lt[x]=lt[N]=lt[D]=lt[z]=lt[B]=lt[j]=lt[C]=lt[_]=lt[E]=lt[L]=lt[O]=lt[M]=lt[T]=lt[F]=lt[H]=lt[W]=lt[V]=!0,lt[w]=lt[k]=lt[A]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,dt=parseInt,ht="object"==typeof o&&o&&o.Object===Object&&o,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,yt=vt&&ht.process,bt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(B2){}}(),xt=bt&&bt.isArrayBuffer,wt=bt&&bt.isDate,kt=bt&&bt.isMap,St=bt&&bt.isRegExp,Ct=bt&&bt.isSet,_t=bt&&bt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function ln(e){return rt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var yn=function e(t){var o,ae=(t=null==t?pt:yn.defaults(pt.Object(),t,yn.pick(pt,it))).Array,Se=t.Date,Ce=t.Error,_e=t.Function,Ee=t.Math,Pe=t.Object,Le=t.RegExp,Oe=t.String,Me=t.TypeError,Te=ae.prototype,Ae=_e.prototype,Ie=Pe.prototype,Re=t["__core-js_shared__"],Ne=Ae.toString,De=Ie.hasOwnProperty,ze=0,Be=(o=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",je=Ie.toString,Fe=Ne.call(Pe),He=pt._,We=Le("^"+Ne.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=vt?t.Buffer:n,$e=t.Symbol,Ue=t.Uint8Array,Ge=Ve?Ve.allocUnsafe:n,qe=un(Pe.getPrototypeOf,Pe),Ye=Pe.create,Ze=Ie.propertyIsEnumerable,Xe=Te.splice,Ke=$e?$e.isConcatSpreadable:n,Qe=$e?$e.iterator:n,tt=$e?$e.toStringTag:n,rt=function(){try{var e=pi(Pe,"defineProperty");return e({},"",{}),e}catch(B2){}}(),ct=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Se&&Se.now!==pt.Date.now&&Se.now,ft=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,yt=Pe.getOwnPropertySymbols,bt=Ve?Ve.isBuffer:n,jt=t.isFinite,qt=Te.join,bn=un(Pe.keys,Pe),xn=Ee.max,wn=Ee.min,kn=Se.now,Sn=t.parseInt,Cn=Ee.random,_n=Te.reverse,En=pi(t,"DataView"),Pn=pi(t,"Map"),Ln=pi(t,"Promise"),On=pi(t,"Set"),Mn=pi(t,"WeakMap"),Tn=pi(Pe,"create"),An=Mn&&new Mn,In={},Rn=Hi(En),Nn=Hi(Pn),Dn=Hi(Ln),zn=Hi(On),Bn=Hi(Mn),jn=$e?$e.prototype:n,Fn=jn?jn.valueOf:n,Hn=jn?jn.toString:n;function Wn(e){if(os(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Un)return e;if(De.call(e,"__wrapped__"))return Wi(e)}return new Un(e)}var Vn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function Un(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,r,o,i,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=i?r(e,o,i,a):r(e)),s!==n)return s;if(!rs(e))return e;var d=qa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Ao(e,s)}else{var h=vi(e),f=h==k||h==S;if(Ka(e))return Eo(e,l);if(h==E||h==v||f&&!i){if(s=c||f?{}:bi(e),!l)return c?function(e,t){return Io(e,mi(e),t)}(e,function(e,t){return e&&Io(t,Ns(t),e)}(s,e)):function(e,t){return Io(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[h])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case I:return Po(e);case b:case x:return new r(+e);case R:return function(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case D:case z:case B:case j:case F:case H:case W:case V:return Lo(e,n);case C:return new r;case _:case M:return new r(e);case L:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new r;case T:return o=e,Fn?Pe(Fn.call(o)):{}}var o}(e,h,l)}}a||(a=new Kn);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(n){s.add(ur(n,t,r,n,e,a))})):is(e)&&e.forEach((function(n,o){s.set(o,ur(n,t,r,o,e,a))}));var g=d?n:(u?c?si:ai:c?Ns:Rs)(e);return Lt(g||e,(function(n,o){g&&(n=e[o=n]),rr(s,o,ur(n,t,r,o,e,a))})),s}function dr(e,t,r){var o=r.length;if(null==e)return!o;for(e=Pe(e);o--;){var i=r[o],a=t[i],s=e[i];if(s===n&&!(i in e)||!a(s))return!1}return!0}function hr(e,t,o){if("function"!=typeof e)throw new Me(r);return Ri((function(){e.apply(n,o)}),t)}function fr(e,t,n,r){var o=-1,i=At,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Rt(t,Qt(n))),r?(i=It,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Pn||Yn),string:new qn}},Zn.prototype.delete=function(e){var t=hi(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return hi(this,e).get(e)},Zn.prototype.has=function(e){return hi(this,e).has(e)},Zn.prototype.set=function(e,t){var n=hi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,i),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var pr=Do(kr),gr=Do(Sr,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,r){for(var o=-1,i=e.length;++o0&&n(s)?t>1?br(s,t-1,n,r,o):Nt(o,s):r||(o[o.length]=s)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,Rs)}function Sr(e,t){return e&&wr(e,t,Rs)}function Cr(e,t){return Tt(t,(function(t){return es(e[t])}))}function _r(e,t){for(var r=0,o=(t=ko(t,e)).length;null!=e&&rt}function Or(e,t){return null!=e&&De.call(e,t)}function Mr(e,t){return null!=e&&t in Pe(e)}function Tr(e,t,r){for(var o=r?It:At,i=e[0].length,a=e.length,s=a,l=ae(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Rt(d,Qt(t))),c=wn(d.length,c),l[s]=!r&&(t||i>=120&&d.length>=120)?new Xn(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(Cn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Ni(Oi(e,t,al),e+"")}function Jr(e){return Jn(Vs(e))}function eo(e,t){var n=Vs(e);return Bi(n,cr(t,0,n.length))}function to(e,t,r,o){if(!rs(e))return e;for(var i=-1,a=(t=ko(t,e)).length,s=a-1,l=e;null!=l&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=ae(o);++r>>1,a=e[i];null!==a&&!ds(a)&&(n?a<=t:a=200){var c=t?null:Qo(e);if(c)return hn(c);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=o?e:io(e,t,r)}var _o=ct||function(e){return pt.clearTimeout(e)};function Eo(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Lo(e,t){var n=t?Po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Oo(e,t){if(e!==t){var r=e!==n,o=null===e,i=e==e,a=ds(e),s=t!==n,l=null===t,c=t==t,u=ds(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&e1?r[i-1]:n,s=i>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(i--,a):n,s&&ki(r[0],r[1],s)&&(a=i<3?n:a,i=1),t=Pe(t);++o-1?i[a?t[s]:s]:n}}function Wo(e){return ii((function(t){var o=t.length,i=o,a=Un.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Me(r);if(a&&!l&&"wrapper"==ci(s))var l=new Un([],!0)}for(i=l?i:o;++i1&&y.reverse(),h&&cl))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new Xn:n;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Lt(m,(function(n){var r="_."+n[0];t&n[1]&&!At(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(r),n)))}function zi(e){var t=0,r=0;return function(){var o=kn(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bi(e,t){var r=-1,o=e.length,i=o-1;for(t=t===n?o:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,la(e,r)}));function ga(e){var t=Wn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,r=t?e[0]:0,o=this.__wrapped__,i=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Gn&&wi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:n}),new Un(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(i)}));var ya=Ro((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ho(Gi),xa=Ho(qi);function wa(e,t){return(qa(e)?Lt:pr)(e,di(t,3))}function ka(e,t){return(qa(e)?Ot:gr)(e,di(t,3))}var Sa=Ro((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var r=-1,o="function"==typeof t,i=Za(e)?ae(e.length):[];return pr(e,(function(e){i[++r]=o?Et(t,e,n):Ar(e,t,n)})),i})),_a=Ro((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(qa(e)?Rt:Hr)(e,di(t,3))}var Pa=Ro((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var La=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,br(t,1),[])})),Oa=ht||function(){return pt.Date.now()};function Ma(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,ei(e,u,n,n,n,n,t)}function Ta(e,t){var o;if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=n),o}}var Aa=Qr((function(e,t,n){var r=1;if(n.length){var o=dn(n,ui(Aa));r|=l}return ei(e,r,t,n,o)})),Ia=Qr((function(e,t,n){var r=3;if(n.length){var o=dn(n,ui(Ia));r|=l}return ei(t,r,e,n,o)}));function Ra(e,t,o){var i,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Me(r);function g(t){var r=i,o=a;return i=a=n,d=t,l=e.apply(o,r)}function m(e){return d=e,c=Ri(y,t),h?g(e):l}function v(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function y(){var e=Oa();if(v(e))return b(e);c=Ri(y,function(e){var n=t-(e-u);return f?wn(n,s-(e-d)):n}(e))}function b(e){return c=n,p&&i?g(e):(i=a=n,l)}function x(){var e=Oa(),r=v(e);if(i=arguments,a=this,u=e,r){if(c===n)return m(u);if(f)return _o(c),c=Ri(y,t),g(u)}return c===n&&(c=Ri(y,t)),l}return t=bs(t)||0,rs(o)&&(h=!!o.leading,s=(f="maxWait"in o)?xn(bs(o.maxWait)||0,t):s,p="trailing"in o?!!o.trailing:p),x.cancel=function(){c!==n&&_o(c),d=0,i=u=a=c=n},x.flush=function(){return c===n?l:b(Oa())},x}var Na=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,bs(t)||0,n)}));function za(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(r);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(za.Cache||Zn),n}function Ba(e){if("function"!=typeof e)throw new Me(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}za.Cache=Zn;var ja=So((function(e,t){var n=(t=1==t.length&&qa(t[0])?Rt(t[0],Qt(di())):Rt(br(t,1),Qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o=t})),Ga=Ir(function(){return arguments}())?Ir:function(e){return os(e)&&De.call(e,"callee")&&!Ze.call(e,"callee")},qa=ae.isArray,Ya=xt?Qt(xt):function(e){return os(e)&&Pr(e)==I};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Za(e)}var Ka=bt||bl,Qa=wt?Qt(wt):function(e){return os(e)&&Pr(e)==x};function Ja(e){if(!os(e))return!1;var t=Pr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Pr(e);return t==k||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=kt?Qt(kt):function(e){return os(e)&&vi(e)==C};function as(e){return"number"==typeof e||os(e)&&Pr(e)==_}function ss(e){if(!os(e)||Pr(e)!=E)return!1;var t=qe(e);if(null===t)return!0;var n=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Fe}var ls=St?Qt(St):function(e){return os(e)&&Pr(e)==L};var cs=Ct?Qt(Ct):function(e){return os(e)&&vi(e)==O};function us(e){return"string"==typeof e||!qa(e)&&os(e)&&Pr(e)==M}function ds(e){return"symbol"==typeof e||os(e)&&Pr(e)==T}var hs=_t?Qt(_t):function(e){return os(e)&&ns(e.length)&&!!st[Pr(e)]};var fs=Zo(Fr),ps=Zo((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Za(e))return us(e)?gn(e):Ao(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vi(e);return(t==C?cn:t==O?hn:Vs)(e)}function ms(e){return e?(e=bs(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?cr(vs(e),0,g):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return p;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=me.test(e);return n||ye.test(e)?dt(e.slice(2),n?2:8):ge.test(e)?p:+e}function xs(e){return Io(e,Ns(e))}function ws(e){return null==e?"":ho(e)}var ks=No((function(e,t){if(Ei(t)||Za(t))Io(t,Rs(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),Ss=No((function(e,t){Io(t,Ns(t),e)})),Cs=No((function(e,t,n,r){Io(t,Ns(t),e,r)})),_s=No((function(e,t,n,r){Io(t,Rs(t),e,r)})),Es=ii(lr);var Ps=Qr((function(e,t){e=Pe(e);var r=-1,o=t.length,i=o>2?t[2]:n;for(i&&ki(t[0],t[1],i)&&(o=1);++r1),t})),Io(e,si(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var js=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Rt(si(e),(function(e){return[e]}));return t=di(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Jo(Rs),Ws=Jo(Ns);function Vs(e){return null==e?[]:Jt(e,Rs(e))}var $s=jo((function(e,t,n){return t=t.toLowerCase(),e+(n?Us(t):t)}));function Us(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(xe,on).replace(et,"")}var qs=jo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=jo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Bo("toLowerCase");var Xs=jo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ks=jo((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=jo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Bo("toUpperCase");function el(e,t,r){return e=ws(e),(t=r?n:t)===n?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,n,t)}catch(B2){return Ja(B2)?B2:new Ce(B2)}})),nl=ii((function(e,t){return Lt(t,(function(t){t=Fi(t),sr(e,t,Aa(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Wo(),il=Wo(!0);function al(e){return e}function sl(e){return zr("function"==typeof e?e:ur(e,1))}var ll=Qr((function(e,t){return function(n){return Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function ul(e,t,n){var r=Rs(t),o=Cr(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Cr(t,Rs(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return Lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Ao(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function dl(){}var hl=Go(Rt),fl=Go(Mt),pl=Go(Bt);function gl(e){return Si(e)?Gt(Fi(e)):function(e){return function(t){return _r(t,e)}}(e)}var ml=Yo(),vl=Yo(!0);function yl(){return[]}function bl(){return!1}var xl=Uo((function(e,t){return e+t}),0),wl=Ko("ceil"),kl=Uo((function(e,t){return e/t}),1),Sl=Ko("floor");var Cl,_l=Uo((function(e,t){return e*t}),1),El=Ko("round"),Pl=Uo((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Me(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Ma,Wn.assign=ks,Wn.assignIn=Ss,Wn.assignInWith=Cs,Wn.assignWith=_s,Wn.at=Es,Wn.before=Ta,Wn.bind=Aa,Wn.bindAll=nl,Wn.bindKey=Ia,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Wn.chain=ga,Wn.chunk=function(e,t,r){t=(r?ki(e,t,r):t===n)?1:xn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,s=ae(gt(o/t));ii?0:i+r),(o=o===n||o>i?i:vs(o))<0&&(o+=i),o=r>o?0:ys(o);r>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ho(t))&&ln(e)?Co(gn(e),0,r):e.split(t,r):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Me(r);return t=null==t?0:xn(vs(t),0),Qr((function(n){var r=n[t],o=Co(n,0,t);return r&&Nt(o,r),Et(e,this,o)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Wn.take=function(e,t,r){return e&&e.length?io(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},Wn.takeRight=function(e,t,r){var o=null==e?0:e.length;return o?io(e,(t=o-(t=r||t===n?1:vs(t)))<0?0:t,o):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new Me(r);return rs(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Ra(e,t,{leading:o,maxWait:t,trailing:i})},Wn.thru=ma,Wn.toArray=gs,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return qa(e)?Rt(e,Fi):ds(e)?[e]:Ao(ji(ws(e)))},Wn.toPlainObject=xs,Wn.transform=function(e,t,n){var r=qa(e),o=r||Ka(e)||hs(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Vn(qe(e)):{}}return(o?Lt:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Wn.unary=function(e){return Ma(e,1)},Wn.union=oa,Wn.unionBy=ia,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fo(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?fo(e,n,t):[]},Wn.unset=function(e,t){return null==e||po(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Wn.updateWith=function(e,t,r,o){return o="function"==typeof o?o:n,null==e?e:go(e,t,wo(r),o)},Wn.values=Vs,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ns(e))},Wn.without=ca,Wn.words=el,Wn.wrap=function(e,t){return Fa(wo(t),e)},Wn.xor=ua,Wn.xorBy=da,Wn.xorWith=ha,Wn.zip=fa,Wn.zipObject=function(e,t){return bo(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return bo(e||[],t||[],to)},Wn.zipWith=pa,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=Ss,Wn.extendWith=Cs,ul(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=$s,Wn.capitalize=Us,Wn.ceil=wl,Wn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=bs(r))==r?r:0),t!==n&&(t=(t=bs(t))==t?t:0),cr(bs(e),t,r)},Wn.clone=function(e){return ur(e,4)},Wn.cloneDeep=function(e){return ur(e,5)},Wn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:n)},Wn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:n)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,Rs(t))},Wn.deburr=Gs,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=kl,Wn.endsWith=function(e,t,r){e=ws(e),t=ho(t);var o=e.length,i=r=r===n?o:cr(vs(r),0,o);return(r-=t.length)>=0&&e.slice(r,i)==t},Wn.eq=Va,Wn.escape=function(e){return(e=ws(e))&&X.test(e)?e.replace(Y,an):e},Wn.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(re,"\\$&"):e},Wn.every=function(e,t,r){var o=qa(e)?Mt:mr;return r&&ki(e,t,r)&&(t=n),o(e,di(t,3))},Wn.find=ba,Wn.findIndex=Gi,Wn.findKey=function(e,t){return Ft(e,di(t,3),kr)},Wn.findLast=xa,Wn.findLastIndex=qi,Wn.findLastKey=function(e,t){return Ft(e,di(t,3),Sr)},Wn.floor=Sl,Wn.forEach=wa,Wn.forEachRight=ka,Wn.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Ns)},Wn.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Ns)},Wn.forOwn=function(e,t){return e&&kr(e,di(t,3))},Wn.forOwnRight=function(e,t){return e&&Sr(e,di(t,3))},Wn.get=Os,Wn.gt=$a,Wn.gte=Ua,Wn.has=function(e,t){return null!=e&&yi(e,t,Or)},Wn.hasIn=Ms,Wn.head=Zi,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Za(e)?e:Vs(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),us(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=xn(r+o,0)),Wt(e,t,o)},Wn.inRange=function(e,t,r){return t=ms(t),r===n?(r=t,t=0):r=ms(r),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=f},Wn.isSet=cs,Wn.isString=us,Wn.isSymbol=ds,Wn.isTypedArray=hs,Wn.isUndefined=function(e){return e===n},Wn.isWeakMap=function(e){return os(e)&&vi(e)==A},Wn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Pr(e)},Wn.join=function(e,t){return null==e?"":qt.call(e,t)},Wn.kebabCase=qs,Wn.last=Ji,Wn.lastIndexOf=function(e,t,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==n&&(i=(i=vs(r))<0?xn(o+i,0):wn(i,o-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,$t,i,!0)},Wn.lowerCase=Ys,Wn.lowerFirst=Zs,Wn.lt=fs,Wn.lte=ps,Wn.max=function(e){return e&&e.length?vr(e,al,Lr):n},Wn.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Lr):n},Wn.mean=function(e){return Ut(e,al)},Wn.meanBy=function(e,t){return Ut(e,di(t,2))},Wn.min=function(e){return e&&e.length?vr(e,al,Fr):n},Wn.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Fr):n},Wn.stubArray=yl,Wn.stubFalse=bl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=_l,Wn.nth=function(e,t){return e&&e.length?Ur(e,vs(t)):n},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Oa,Wn.pad=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Wn.padEnd=function(e,t,n){e=ws(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var o=e;e=t,t=o}if(r||e%1||t%1){var i=Cn();return wn(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Wn.reduce=function(e,t,n){var r=qa(e)?Dt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,pr)},Wn.reduceRight=function(e,t,n){var r=qa(e)?zt:Yt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Wn.repeat=function(e,t,r){return t=(r?ki(e,t,r):t===n)?1:vs(t),Kr(ws(e),t)},Wn.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,r){var o=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=n);++of)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Xt(r,t);++n=a)return e;var l=r-pn(o);if(l<1)return o;var c=s?Co(s,0,l).join(""):e.slice(0,l);if(i===n)return c+o;if(s&&(l+=c.length-l),ls(i)){if(e.slice(l).search(i)){var u,d=c;for(i.global||(i=Le(i.source,ws(pe.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(ho(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Wn.unescape=function(e){return(e=ws(e))&&Z.test(e)?e.replace(q,vn):e},Wn.uniqueId=function(e){var t=++ze;return ws(e)+t},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=ka,Wn.first=Zi,ul(Wn,(Cl={},kr(Wn,(function(e,t){De.call(Wn.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Wn.VERSION="4.17.21",Lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),Lt(["drop","take"],(function(e,t){Gn.prototype[e]=function(r){r=r===n?1:xn(vs(r),0);var o=this.__filtered__&&!t?new Gn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(r,o.__takeCount__):o.__views__.push({size:wn(r,g),type:e+(o.__dir__<0?"Right":"")}),o},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(di(e)))},Gn.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(g)},kr(Gn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=Wn[o?"take"+("last"==t?"Right":""):t],a=o||/^find/.test(t);i&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||qa(t),d=function(e){var t=i.apply(Wn,Nt([e],s));return o&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[d],thisArg:n}),new Un(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?o?m.value()[0]:m.value():m)})})),Lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";De.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Vo(n,2).name]=[{name:"wrapper",func:n}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Ao(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ao(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ao(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var o=Wi(r);o.__index__=0,o.__values__=n,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:n}),new Un(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qe&&(Wn.prototype[Qe]=function(){return this}),Wn}();mt?((mt.exports=yn)._=yn,gt._=yn):pt._=yn}).call(o)}(MU,MU.exports);const TU=MU.exports,AU=AV({name:"gallery",initialState:{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,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,o=e.categories[r].images,i=o.filter((e=>e.uuid!==n));if(n===e.currentImageUuid){const t=o.findIndex((e=>e.uuid===n)),r=MU.exports.clamp(t,0,i.length-1);e.currentImage=i.length?i[r]:void 0,e.currentImageUuid=i.length?i[r].uuid:""}e.categories[r].images=i},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:o,url:i,mtime:a}=n,s=e.categories[r];s.images.find((e=>e.url===i&&e.mtime===a))||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=o,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex((e=>e.uuid===t.uuid));if(r>0){const t=n[r-1];e.currentImage=t,e.currentImageUuid=t.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:o}=t.payload,i=e.categories[o].images;if(n.length>0){const t=n.filter((e=>!i.find((t=>t.url===e.url&&t.mtime===e.mtime))));if(e.categories[o].images=i.concat(t).sort(((e,t)=>t.mtime-e.mtime)),!e.currentImage){const t=n[0];e.currentImage=t,e.currentImageUuid=t.uuid}e.categories[o].latest_mtime=n[0].mtime,e.categories[o].earliest_mtime=n[n.length-1].mtime}void 0!==r&&(e.categories[o].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},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:IU,clearIntermediateImage:RU,removeImage:NU,setCurrentImage:DU,addGalleryImages:zU,setIntermediateImage:BU,selectNextImage:jU,selectPrevImage:FU,setShouldPinGallery:HU,setShouldShowGallery:WU,setGalleryScrollPosition:VU,setGalleryImageMinimumWidth:$U,setGalleryImageObjectFit:UU,setShouldHoldGalleryOpen:GU,setShouldAutoSwitchToNewImages:qU,setCurrentCategory:YU,setGalleryWidth:ZU,setShouldUseSingleGalleryColumn:XU}=AU.actions,KU=AU.reducer;function QU(e){return QU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QU(e)}function JU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eG(e){var t=function(e,t){if("object"!==QU(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==QU(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===QU(t)?t:String(t)}function tG(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.init(t,n)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||fG,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function wG(e,t,n){var r=xG(e,t,Object);r.obj[r.k]=n}function kG(e,t){var n=xG(e,t),r=n.obj,o=n.k;if(r)return r[o]}function SG(e,t,n){var r=kG(e,n);return void 0!==r?r:kG(t,n)}function CG(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):CG(e[r],t[r],n):e[r]=t[r]);return e}function _G(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var EG={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function PG(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return EG[e]})):e}var LG="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,OG=[" ",",","?","!",";"];function MG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TG(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(i+a).join(n);return c?IG(l,c,n):void 0}o=o[r[i]]}return o}}var RG=function(e){iG(n,e);var t=AG(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return nG(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=kG(this.data,a);return s||!i||"string"!=typeof n?s:IG(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),wG(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=kG(this.data,a)||{};r?CG(s,n,o):s=TG(TG({},s),n),wG(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?TG(TG({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(mG),NG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function DG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zG(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return JU(this,n),r=t.call(this),LG&&mG.call(rG(r)),bG(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,rG(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gG.create("translator"),r}return nG(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=OG.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==QU(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),g=p&&p.res,m=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(g),b=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(w&&g&&k&&b.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,g,zG(zG({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?v:m;for(var P in g)if(Object.prototype.hasOwnProperty.call(g,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,zG(zG({},t),{joinArrays:!1,ns:c})),_[P]===L&&(_[P]=g[P])}g=_}}else if(w&&"string"==typeof x&&"[object Array]"===y)(g=g.join(x))&&(g=this.extendTranslation(g,e,t,r));else{var O=!1,M=!1,T=void 0!==t.count&&"string"!=typeof t.count,A=n.hasDefaultValue(t),I=T?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(g)&&A&&(O=!0,g=R),this.isValidLookup(g)||(M=!0,g=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&M?void 0:g,z=A&&R!==g&&this.options.updateMissing;if(M||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,u,l,z?R:g),a){var B=this.resolve(l,zG(zG({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!jG["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(jG["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var g="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(g),d&&(l.push(g+u),h&&l.push(g+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(mG);function HG(e){return e.charAt(0).toUpperCase()+e.slice(1)}var WG=function(){function e(t){JU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gG.create("languageUtils")}return nG(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=HG(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=HG(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),VG=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},UG=["v1","v2","v3"],GG={zero:0,one:1,two:2,few:3,many:4,other:5};function qG(){var e={};return VG.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:$G[t.fc]}}))})),e}var YG=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};JU(this,e),this.languageUtils=t,this.options=n,this.logger=gG.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=qG()}return nG(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return GG[e]-GG[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!UG.includes(this.options.compatibilityJSON)}}]),e}();function ZG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return nG(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:PG,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_G(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_G(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?_G(t.nestingPrefix):t.nestingPrefixEscaped||_G("$t("),this.nestingSuffix=t.nestingSuffix?_G(t.nestingSuffix):t.nestingSuffixEscaped||_G(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=SG(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,XG(XG(XG({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(SG(t,l,a),c,n,XG(XG(XG({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yG(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),h?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=XG(XG({},t),o))}catch(B2){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),B2),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=XG({},a)).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yG(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,XG(XG({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function QG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function JG(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};JU(this,e),this.logger=gG.create("formatter"),this.options=t,this.formats={number:eq((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:eq((function(e,t){var n=new Intl.NumberFormat(e,JG(JG({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:eq((function(e,t){var n=new Intl.DateTimeFormat(e,JG({},t));return function(e){return n.format(e)}})),relativetime:eq((function(e,t){var n=new Intl.RelativeTimeFormat(e,JG({},t));return function(e){return n.format(e,t.range||"day")}})),list:eq((function(e,t){var n=new Intl.ListFormat(e,JG({},t));return function(e){return n.format(e)}}))},this.init(t)}return nG(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=eq(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=uG(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=o.formats[a](e,u,JG(JG(JG({},s),r),c))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function nq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rq(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return JU(this,n),i=t.call(this),LG&&mG.call(rG(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=gG.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return nG(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=xG(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=rq(rq({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var c;(c=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(Hhe){a(Hhe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(mG);function aq(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===QU(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===QU(e[2])||"object"===QU(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function sq(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cq(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(JU(this,n),e=t.call(this),LG&&mG.call(rG(e)),e.options=sq(r),e.services={},e.logger=gG,e.modules={external:[]},hq(rG(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),aG(e,rG(e));setTimeout((function(){e.init(r,o)}),0)}return e}return nG(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=aq();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=cq(cq(cq({},r),this.options),sq(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=cq(cq({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?gG.init(o(this.modules.logger),this.options):gG.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=tq);var a=new WG(this.options);this.store=new RG(this.options.resources,this.options);var s=this.services;s.logger=gG,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new YG(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new KG(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new iq(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=vG(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=vG();return e||(e=this.languages),t||(t=this.options.ns),n||(n=dq),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&NG.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=vG();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==QU(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=vG();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=vG();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new WG(aq());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dq,o=cq(cq(cq({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=cq({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new FG(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fq(e,t)}));var pq=fq.createInstance();function gq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mq(e){return mq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mq(e)}function vq(e){var t=function(e,t){if("object"!==mq(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==mq(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mq(t)?t:String(t)}function yq(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Sq.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Sq.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},_q=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=Cq(e,encodeURIComponent(t),o)},Eq=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},Oq=null,Mq=function(){if(null!==Oq)return Oq;try{Oq="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(B2){Oq=!1}return Oq},Tq={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Mq()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Mq()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Aq=null,Iq=function(){if(null!==Aq)return Aq;try{Aq="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(B2){Aq=!1}return Aq},Rq={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Iq()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Iq()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},Nq={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Dq={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},zq={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},Bq={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var jq=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};gq(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=kq(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Pq),this.addDetector(Lq),this.addDetector(Tq),this.addDetector(Rq),this.addDetector(Nq),this.addDetector(Dq),this.addDetector(zq),this.addDetector(Bq)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&yq(t.prototype,n),r&&yq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fq(e){return Fq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fq(e)}jq.type="languageDetector";var Hq=[],Wq=Hq.forEach,Vq=Hq.slice;function $q(e){return Wq.call(Vq.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function Uq(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Fq(XMLHttpRequest))}function Gq(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qq,Yq={exports:{}},Zq={exports:{}};function Xq(){return qq||(qq=1,function(e,t){var n="undefined"!=typeof self?self:o,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(B2){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];w.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(Hhe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(Zq,Zq.exports)),Zq.exports}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==o&&o.fetch?o.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==Gq&&("undefined"==typeof window||void 0===window.document)){var r=n||Xq();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(Yq,Yq.exports);const Kq=Yq.exports,Qq=r({__proto__:null,default:Kq},[Yq.exports]);function Jq(e){return Jq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jq(e)}var eY,tY,nY;"function"==typeof fetch&&(eY="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),Uq()&&("undefined"!=typeof global&&global.XMLHttpRequest?tY=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(tY=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?nY=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(nY=window.ActiveXObject)),eY||!Qq||tY||nY||(eY=Kq||Qq),"function"!=typeof eY&&(eY=void 0);var rY=function(e,t){if(t&&"object"===Jq(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},oY=function(e,t,n){eY(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},iY=!1,aY=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},eY&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=rY(t,e.queryStringParams));var o=$q({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=$q({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},iY?{}:i);try{oY(t,a,r)}catch(B2){if(!i||0===Object.keys(i).length||!B2.message||B2.message.indexOf("not implemented")<0)return r(B2);try{Object.keys(i).forEach((function(e){delete a[e]})),oY(t,a,r),iY=!0}catch(Hhe){r(Hhe)}}}(e,t,n,r):Uq()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===Jq(n)&&(n=rY("",n).slice(1)),e.queryStringParams&&(t=rY(t,e.queryStringParams));try{var o;(o=tY?new tY:new nY("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(B2){console&&console.log(B2)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function sY(e){return sY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sY(e)}function lY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cY(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};lY(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=$q(n,this.options||{},dY()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(B2){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var u=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,u,a,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&cY(t.prototype,n),r&&cY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fY(e){return fY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fY(e)}function pY(e){var t=function(e,t){if("object"!==fY(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fY(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fY(t)?t:String(t)}function gY(e,t,n){return(t=pY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mY(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function wY(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return yY("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):xY(e,t,n)}var kY=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SY={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},CY=function(e){return SY[e]};function _Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function EY(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};LY=EY(EY({},LY),e)}(e.options.react),function(e){PY=e}(e)}},IY=a.exports.createContext(),RY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&TY(t.prototype,n),r&&TY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function NY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=a.exports.useContext(IY)||{},o=r.i18n,i=r.defaultNS,s=n||o||MY();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new RY),!s){yY("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},c=[l,{},!1];return c.t=l,c.i18n={},c.ready=!1,c}s.options.react&&void 0!==s.options.react.wait&&yY("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=BY(BY(BY({},OY()),s.options.react),t),d=u.useSuspense,h=u.keyPrefix,f=e||i||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var p=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return wY(e,s,u)}));function g(){return s.getFixedT(null,"fallback"===u.nsMode?f:f[0],h)}var m=a.exports.useState(g),v=DY(m,2),y=v[0],b=v[1],x=f.join(),w=jY(x),k=a.exports.useRef(!0);a.exports.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&b(g)}return k.current=!0,p||d||bY(s,f,(function(){k.current&&b(g)})),p&&w&&w!==x&&k.current&&b(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){k.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,x]);var S=a.exports.useRef(!0);a.exports.useEffect((function(){k.current&&!S.current&&b(g),S.current=!1}),[s,h]);var C=[y,s,p];if(C.t=y,C.i18n=s,C.ready=p,p)return C;if(!p&&!d)return C;throw new Promise((function(e){bY(s,f,(function(){e()}))}))}pq.use(hY).use(jq).use(AY).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","options","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const HY=AV({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:pq.isInitialized?pq.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=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=pq.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?pq.t("common:statusConnected"):pq.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:o}=t.payload,i={timestamp:n,message:r,level:o||"info"};e.log.push(i)},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=pq.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=pq.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=pq.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:WY,setIsProcessing:VY,addLogEntry:$Y,setShouldShowLogViewer:UY,setIsConnected:GY,setSocketId:qY,setShouldConfirmOnDelete:YY,setOpenAccordions:ZY,setSystemStatus:XY,setCurrentStatus:KY,setSystemConfig:QY,setShouldDisplayGuides:JY,processingCanceled:eZ,errorOccurred:tZ,errorSeen:nZ,setModelList:rZ,setIsCancelable:oZ,modelChangeRequested:iZ,setSaveIntermediatesInterval:aZ,setEnableImageDebugging:sZ,generationRequested:lZ,addToast:cZ,clearToastQueue:uZ,setProcessingIndeterminateTask:dZ,setSearchFolder:hZ,setFoundModels:fZ,setOpenModel:pZ}=HY.actions,gZ=HY.reducer,mZ=(e,t)=>Math.floor(e/t)*t,vZ=(e,t)=>Math.round(e/t)*t,yZ=(e,t,n,r,o,i,a)=>({x:e/2-(n+o/2)*a,y:t/2-(r+i/2)*a}),bZ=(e,t,n,r,o=.95)=>{const i=e*o/n,a=t*o/r;return Math.min(1,Math.min(i,a))},xZ=.95,wZ=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),kZ=e=>{const{width:t,height:n}=e,r={width:t,height:n},o=t/n;let i=t*n,a=448;for(;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=vZ(a/o,64)):o<1&&(r.height=a,r.width=vZ(a*o,64)),i=r.width*r.height}return r},SZ=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],CZ=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],_Z=e=>"line"===e.kind&&"mask"===e.layer,EZ=e=>"image"===e.kind&&"base"===e.layer,PZ=e=>"line"===e.kind,LZ={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},OZ=AV({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:LZ,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter((e=>!_Z(e))),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,o={width:mZ(TU.clamp(n.width,64,512),64),height:mZ(TU.clamp(n.height,64,512),64)},i={x:vZ(n.width/2-o.width/2,64),y:vZ(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState={...LZ,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=bZ(r.width,r.height,n.width,n.height,xZ),s=yZ(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=(r=t.payload,{width:vZ(r.width,64),height:vZ(r.height,64)});var r;if(e.boundingBoxDimensions=n,"auto"===e.boundingBoxScaleMethod){const t=kZ(n);e.scaledBoundingBoxDimensions=t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=wZ(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},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},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;n&&r&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:o,brushSize:i,shouldRestrictStrokesToBox:a}=e;if("move"===n||"colorPicker"===n)return;const s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const c={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(c.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(c),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(PZ);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(TU.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.layerState=LZ,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(EZ),o={width:Math.floor(t),height:Math.floor(n)};if(!r){const t=bZ(o.width,o.height,512,512,xZ),n=yZ(o.width,o.height,0,0,512,512,t),r={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.stageDimensions=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){const t=kZ(r);e.scaledBoundingBoxDimensions=t}return}const{width:i,height:a}=r,s=bZ(t,n,i,a,.95),l=yZ(o.width,o.height,0,0,i,a,s);e.minimumStageScale=s,e.stageScale=s,e.stageCoordinates=wZ(l),e.stageDimensions=o,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(EZ)){const t=bZ(r.width,r.height,512,512,xZ),n=yZ(r.width,r.height,0,0,512,512,t),o={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=o,"auto"===e.boundingBoxScaleMethod){const t=kZ(o);e.scaledBoundingBoxDimensions=t}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:o}}=e,{x:i,y:a,width:s,height:l}=n;if(0!==s&&0!==l){const t=bZ(r,o,s,l,xZ),n=yZ(r,o,i,a,s,l,t);e.stageScale=t,e.stageCoordinates=n}else{const t=bZ(r,o,512,512,xZ),n=yZ(r,o,0,0,512,512,t),i={width:512,height:512};if(e.stageScale=t,e.stageCoordinates=n,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=i,"auto"===e.boundingBoxScaleMethod){const t=kZ(i);e.scaledBoundingBoxDimensions=t}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...LZ.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:o}=e,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){const t={width:mZ(TU.clamp(i,64,512),64),height:mZ(TU.clamp(a,64,512),64)},n={x:vZ(i/2-t.width/2,64),y:vZ(a/2-t.height/2,64)};if(e.boundingBoxDimensions=t,e.boundingBoxCoordinates=n,"auto"===e.boundingBoxScaleMethod){const n=kZ(t);e.scaledBoundingBoxDimensions=n}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){const t=kZ(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=t}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(TU.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:MZ,addFillRect:TZ,addImageToStagingArea:AZ,addLine:IZ,addPointToCurrentLine:RZ,clearCanvasHistory:NZ,clearMask:DZ,commitColorPickerColor:zZ,commitStagingAreaImage:BZ,discardStagedImages:jZ,fitBoundingBoxToStage:FZ,mouseLeftCanvas:HZ,nextStagingAreaImage:WZ,prevStagingAreaImage:VZ,redo:$Z,resetCanvas:UZ,resetCanvasInteractionState:GZ,resetCanvasView:qZ,resizeAndScaleCanvas:YZ,resizeCanvas:ZZ,setBoundingBoxCoordinates:XZ,setBoundingBoxDimensions:KZ,setBoundingBoxPreviewFill:QZ,setBoundingBoxScaleMethod:JZ,setBrushColor:eX,setBrushSize:tX,setCanvasContainerDimensions:nX,setColorPickerColor:rX,setCursorPosition:oX,setDoesCanvasNeedScaling:iX,setInitialCanvasImage:aX,setInpaintReplace:sX,setIsDrawing:lX,setIsMaskEnabled:cX,setIsMouseOverBoundingBox:uX,setIsMoveBoundingBoxKeyHeld:dX,setIsMoveStageKeyHeld:hX,setIsMovingBoundingBox:fX,setIsMovingStage:pX,setIsTransformingBoundingBox:gX,setLayer:mX,setMaskColor:vX,setMergedCanvas:yX,setShouldAutoSave:bX,setShouldCropToBoundingBoxOnSave:xX,setShouldDarkenOutsideBoundingBox:wX,setShouldLockBoundingBox:kX,setShouldPreserveMaskedArea:SX,setShouldShowBoundingBox:CX,setShouldShowBrush:_X,setShouldShowBrushPreview:EX,setShouldShowCanvasDebugInfo:PX,setShouldShowCheckboardTransparency:LX,setShouldShowGrid:OX,setShouldShowIntermediates:MX,setShouldShowStagingImage:TX,setShouldShowStagingOutline:AX,setShouldSnapToGrid:IX,setShouldUseInpaintReplace:RX,setStageCoordinates:NX,setStageScale:DX,setTool:zX,toggleShouldLockBoundingBox:BX,toggleTool:jX,undo:FX,setScaledBoundingBoxDimensions:HX,setShouldRestrictStrokesToBox:WX}=OZ.actions,VX=OZ.reducer,$X=Object.create(null);$X.open="0",$X.close="1",$X.ping="2",$X.pong="3",$X.message="4",$X.upgrade="5",$X.noop="6";const UX=Object.create(null);Object.keys($X).forEach((e=>{UX[$X[e]]=e}));const GX={type:"error",data:"parser error"},qX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),YX="function"==typeof ArrayBuffer,ZX=({type:e,data:t},n,r)=>qX&&t instanceof Blob?n?r(t):XX(t,r):YX&&(t instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer)(t))?n?r(t):XX(new Blob([t]),r):r($X[e]+(t||"")),XX=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},KX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",QX="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e{if("string"!=typeof e)return{type:"message",data:nK(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:tK(e.substring(1),t)};return UX[n]?e.length>1?{type:UX[n],data:e.substring(1)}:{type:UX[n]}:GX},tK=(e,t)=>{if(JX){const n=(e=>{let t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return nK(n,t)}return{base64:!0,data:e}},nK=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,rK=String.fromCharCode(30);function oK(e){if(e)return function(e){for(var t in oK.prototype)e[t]=oK.prototype[t];return e}(e)}oK.prototype.on=oK.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},oK.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},oK.prototype.off=oK.prototype.removeListener=oK.prototype.removeAllListeners=oK.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const sK=setTimeout,lK=clearTimeout;function cK(e,t){t.useNativeTimers?(e.setTimeoutFn=sK.bind(iK),e.clearTimeoutFn=lK.bind(iK)):(e.setTimeoutFn=setTimeout.bind(iK),e.clearTimeoutFn=clearTimeout.bind(iK))}function uK(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}class dK extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class hK extends oK{constructor(e){super(),this.writable=!1,cK(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new dK(e,t,n)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=eK(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pK={};let gK,mK=0,vK=0;function yK(e){let t="";do{t=fK[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function bK(){const e=yK(+new Date);return e!==gK?(mK=0,gK=e):e+"."+yK(mK++)}for(;vK<64;vK++)pK[fK[vK]]=vK;function xK(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let wK=!1;try{wK="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Hhe){}const kK=wK;function SK(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||kK))return new XMLHttpRequest}catch(B2){}if(!t)try{return new(iK[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(B2){}}function CK(){}const _K=null!=new SK({xdomain:!1}).responseType;class EK extends oK{constructor(e,t){super(),cK(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=aK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new SK(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(B2){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(B2){}try{t.setRequestHeader("Accept","*/*")}catch(B2){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(B2){return void this.setTimeoutFn((()=>{this.onError(B2)}),0)}"undefined"!=typeof document&&(this.index=EK.requestsCount++,EK.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=CK,e)try{this.xhr.abort()}catch(B2){}"undefined"!=typeof document&&delete EK.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(EK.requestsCount=0,EK.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",PK);else if("function"==typeof addEventListener){addEventListener("onpagehide"in iK?"pagehide":"unload",PK,!1)}function PK(){for(let e in EK.requests)EK.requests.hasOwnProperty(e)&&EK.requests[e].abort()}const LK="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),OK=iK.WebSocket||iK.MozWebSocket,MK="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const TK={websocket:class extends hK{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=MK?{}:aK(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=MK?new OK(e,t,n):t?new OK(e,t):new OK(e)}catch(Hhe){return this.emitReserved("error",Hhe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.ws.send(e)}catch(B2){}r&&LK((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||(e.b64=1);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!OK}},polling:class extends hK{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=_K&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(rK),r=[];for(let o=0;o{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{ZX(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(rK))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=bK()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=xK(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new EK(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},AK=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RK(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=AK.exec(e||""),i={},a=14;for(;a--;)i[IK[a]]=o[a]||"";return-1!=n&&-1!=r&&(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=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class NK extends oK{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=RK(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=RK(t.host).host),cK(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new TK[e](n)}open(){let e;if(this.opts.rememberUpgrade&&NK.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(B2){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;NK.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;NK.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function a(){i("transport closed")}function s(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",l),t.open()}onOpen(){if(this.readyState="open",NK.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){NK.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||BK&&e instanceof Blob||jK&&e instanceof File}function HK(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t=0&&e.num0;case GK.ACK:case GK.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class YK{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=$K(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ZK=Object.freeze(Object.defineProperty({__proto__:null,protocol:5,get PacketType(){return GK},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==GK.EVENT&&e.type!==GK.ACK||!HK(e)?[this.encodeAsString(e)]:(e.type=e.type===GK.EVENT?GK.BINARY_EVENT:GK.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==GK.BINARY_EVENT&&e.type!==GK.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=WK(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:qK},Symbol.toStringTag,{value:"Module"}));function XK(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const KK=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class QK extends oK{constructor(e,t,n){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[XK(e,"open",this.onopen.bind(this)),XK(e,"packet",this.onpacket.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(KK.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const n={type:GK.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void(this.acks[e]=t);const r=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t{this.io.clearTimeoutFn(r),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:GK.CONNECT,data:e})})):this.packet({type:GK.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case GK.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}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 GK.EVENT:case GK.BINARY_EVENT:this.onevent(e);break;case GK.ACK:case GK.BINARY_ACK:this.onack(e);break;case GK.DISCONNECT:this.ondisconnect();break;case GK.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:GK.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:GK.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}JK.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=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},JK.prototype.reset=function(){this.attempts=0},JK.prototype.setMin=function(e){this.ms=e},JK.prototype.setMax=function(e){this.max=e},JK.prototype.setJitter=function(e){this.jitter=e};class eQ extends oK{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,cK(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new JK({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||ZK;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new NK(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=XK(t,"open",(function(){n.onopen(),e&&e()})),o=XK(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(XK(e,"ping",this.onping.bind(this)),XK(e,"data",this.ondata.bind(this)),XK(e,"error",this.onerror.bind(this)),XK(e,"close",this.onclose.bind(this)),XK(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(B2){this.onclose("parse error",B2)}}ondecoded(e){LK((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n||(n=new QK(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t){if(this.nsps[n].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const tQ={};function nQ(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=RK(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,a=tQ[o]&&i in tQ[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new eQ(r,t):(tQ[o]||(tQ[o]=new eQ(r,t)),s=tQ[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}let rQ;Object.assign(nQ,{Manager:eQ,Socket:QK,io:nQ,connect:nQ});const oQ=new Uint8Array(16);function iQ(){if(!rQ&&(rQ="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rQ))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rQ(oQ)}const aQ=[];for(let e=0;e<256;++e)aQ.push((e+256).toString(16).slice(1));const sQ={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function lQ(e,t,n){if(sQ.randomUUID&&!t&&!e)return sQ.randomUUID();const r=(e=e||{}).random||(e.rng||iQ)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(aQ[e[t+0]]+aQ[e[t+1]]+aQ[e[t+2]]+aQ[e[t+3]]+"-"+aQ[e[t+4]]+aQ[e[t+5]]+"-"+aQ[e[t+6]]+aQ[e[t+7]]+"-"+aQ[e[t+8]]+aQ[e[t+9]]+"-"+aQ[e[t+10]]+aQ[e[t+11]]+aQ[e[t+12]]+aQ[e[t+13]]+aQ[e[t+14]]+aQ[e[t+15]]).toLowerCase()}(r)}var cQ=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,uQ=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,dQ=/[^-+\dA-Z]/g;function hQ(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(fQ[t]||t||fQ.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},c=function(){return e[i()+"FullYear"]()},u=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},h=function(){return e[i()+"Seconds"]()},f=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},g=function(){return vQ(e)},m=function(){return yQ(e)},v={d:function(){return a()},dd:function(){return gQ(a())},ddd:function(){return pQ.dayNames[s()]},DDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()],short:!0})},dddd:function(){return pQ.dayNames[s()+7]},DDDD:function(){return mQ({y:c(),m:l(),d:a(),_:i(),dayName:pQ.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return gQ(l()+1)},mmm:function(){return pQ.monthNames[l()]},mmmm:function(){return pQ.monthNames[l()+12]},yy:function(){return String(c()).slice(2)},yyyy:function(){return gQ(c(),4)},h:function(){return u()%12||12},hh:function(){return gQ(u()%12||12)},H:function(){return u()},HH:function(){return gQ(u())},M:function(){return d()},MM:function(){return gQ(d())},s:function(){return h()},ss:function(){return gQ(h())},l:function(){return gQ(f(),3)},L:function(){return gQ(Math.floor(f()/10))},t:function(){return u()<12?pQ.timeNames[0]:pQ.timeNames[1]},tt:function(){return u()<12?pQ.timeNames[2]:pQ.timeNames[3]},T:function(){return u()<12?pQ.timeNames[4]:pQ.timeNames[5]},TT:function(){return u()<12?pQ.timeNames[6]:pQ.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":bQ(e)},o:function(){return(p()>0?"-":"+")+gQ(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+gQ(Math.floor(Math.abs(p())/60),2)+":"+gQ(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return g()},WW:function(){return gQ(g())},N:function(){return m()}};return t.replace(cQ,(function(e){return e in v?v[e]():e.slice(1,e.length-1)}))}var fQ={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"},pQ={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"]},gQ=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},mQ=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var u=new Date;u.setDate(u[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Ysd":"Yesterday":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},vQ=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},yQ=function(e){var t=e.getDay();return 0===t&&(t=7),t},bQ=function(e){return(String(e).match(uQ)||[""]).pop().replace(dQ,"").replace(/GMT\+0000/g,"UTC")};const xQ=MV("socketio/generateImage"),wQ=MV("socketio/runESRGAN"),kQ=MV("socketio/runFacetool"),SQ=MV("socketio/deleteImage"),CQ=MV("socketio/requestImages"),_Q=MV("socketio/requestNewImages"),EQ=MV("socketio/cancelProcessing"),PQ=MV("socketio/requestSystemConfig"),LQ=MV("socketio/searchForModels"),OQ=MV("socketio/addNewModel"),MQ=MV("socketio/deleteModel"),TQ=MV("socketio/requestModelChange"),AQ=MV("socketio/saveStagingAreaImageToGallery"),IQ=MV("socketio/requestEmptyTempFolder"),RQ=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],NQ=[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],DQ=[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],zQ=[{key:"2x",value:2},{key:"4x",value:4}],BQ=4294967295,jQ=["gfpgan","codeformer"],FQ=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],HQ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var WQ=Math.PI/180;const VQ="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},$Q={_global:VQ,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:e=>$Q.angleDeg?e*WQ: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:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>$Q.DD.isDragging,isDragReady:()=>!!$Q.DD.node,releaseCanvasOnDestroy:!0,document:VQ.document,_injectGlobal(e){VQ.Konva=e}},UQ=e=>{$Q[e.prototype.getClassName()]=e};$Q._injectGlobal($Q);class GQ{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 GQ(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}getMatrix(){return this.m}decompose(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n;let i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=eJ._getRotation(i.rotation),i}}var qQ=Math.PI/180,YQ=180/Math.PI,ZQ="Konva error: ",XQ={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]},KQ=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,QQ=[];const JQ="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},eJ={_isElement:e=>!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e||e>0?1:-1,requestAnimFrame(e){QQ.push(e),1===QQ.length&&JQ((function(){const e=QQ;QQ=[],e.forEach((function(e){e()}))}))},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(B2){}return e},createImageElement:()=>document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=eJ.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in XQ?{r:(t=XQ[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=KQ.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=>(e=e||"black",eJ._namedColorToRBA(e)||eJ._hex3ColorToRGBA(e)||eJ._hex6ColorToRGBA(e)||eJ._rgbColorToRGBA(e)||eJ._rgbaColorToRGBA(e)||eJ._hslColorToRGBA(e)),_namedColorToRBA(e){var t=XQ[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)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]&&4===e.length)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,o=Number(n[1])/100,i=Number(n[2])/100;let a,s,l;if(0===o)return l=255*i,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};a=i<.5?i*(1+o):i+o-i*o;const c=2*i-a,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,l=6*s<1?c+6*(a-c)*s:2*s<1?a:3*s<2?c+(a-c)*(2/3-s)*6:c,u[e]=255*l;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*qQ,radToDeg:e=>e*YQ,_degToRad:e=>(eJ.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),eJ.degToRad(e)),_radToDeg:e=>(eJ.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),eJ.radToDeg(e)),_getRotation:e=>$Q.angleDeg?eJ.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(ZQ+e)},error(e){console.error(ZQ+e)},warn(e){$Q.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&e1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+u*(n-e))-o)*(a-o)+((s=t+u*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine(e,t,n){var r=eJ.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=eJ._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),c=l[0],u=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){$Q.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))}};function tJ(e){return eJ._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||eJ._isBoolean(e)?e:Object.prototype.toString.call(e)}function nJ(e){return e>255?255:e<0?0:Math.round(e)}function rJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function oJ(e){if($Q.isUnminified)return function(t,n){let r=eJ._isNumber(t),o=eJ._isArray(t)&&t.length==e;return r||o||eJ.warn(tJ(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function iJ(){if($Q.isUnminified)return function(e,t){return eJ._isNumber(e)||"auto"===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function aJ(){if($Q.isUnminified)return function(e,t){return eJ._isString(e)||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function sJ(){if($Q.isUnminified)return function(e,t){const n=eJ._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function lJ(){if($Q.isUnminified)return function(e,t){return!0===e||!1===e||eJ.warn(tJ(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var cJ="get",uJ="set";const dJ={addGetterSetter(e,t,n,r,o){dJ.addGetter(e,t,n),dJ.addSetter(e,t,r,o),dJ.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=cJ+eJ._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]||dJ.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var o=uJ+eJ._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,o){var i,a,s=n.length,l=eJ._capitalize,c=cJ+l(t),u=uJ+l(t);e.prototype[c]=function(){var e={};for(i=0;i{this._setAttr(t+l(e),void 0)})),this._fireChangeEvent(t,a,e),o&&o.call(this),this},dJ.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=eJ._capitalize(t),r=uJ+n,o=cJ+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[o]()}},addDeprecatedGetterSetter(e,t,n,r){eJ.error("Adding deprecated "+t);var o=cJ+eJ._capitalize(t),i=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){eJ.error(i);var e=this.attrs[t];return void 0===e?n:e},dJ.addSetter(e,t,r,(function(){eJ.error(i)})),dJ.addOverloadedGetterSetter(e,t)},backCompat(e,t){eJ.each(t,(function(t,n){var r=e.prototype[n],o=cJ+eJ._capitalize(t),i=uJ+eJ._capitalize(t);function a(){r.apply(this,arguments),eJ.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[o]=a,e.prototype[i]=a}))},afterSetFilter(){this._filterUpToDate=!1}};function hJ(e){var t,n,r=[],o=e.length,i=eJ;for(t=0;t"number"==typeof e?Math.floor(e):e))),l+="("+i.join(",")+")")):(l+=r.property,e||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,s,l){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,s,l)}ellipse(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,n=this,r=fJ.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=hJ(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return wJ._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];wJ._dragElements.forEach(((n,r)=>{const{node:o}=n,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=eJ._getFirstPointerId(e));const a=i._changedPointerPositions.find((e=>e.id===n.pointerId));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];wJ._dragElements.forEach((n=>{const{node:r}=n,o=r.getStage();e&&o.setPointersPositions(e);if(!o._changedPointerPositions.find((e=>e.id===n.pointerId)))return;"dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(wJ.justDragged=!0,$Q._mouseListenClick=!1,$Q._touchListenClick=!1,$Q._pointerListenClick=!1,n.dragStatus="stopped");const i=n.node.getLayer()||n.node instanceof $Q.Stage&&n.node;i&&-1===t.indexOf(i)&&t.push(i)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){wJ._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&wJ._dragElements.delete(n)}))}};$Q.isBrowser&&(window.addEventListener("mouseup",wJ._endDragBefore,!0),window.addEventListener("touchend",wJ._endDragBefore,!0),window.addEventListener("mousemove",wJ._drag),window.addEventListener("touchmove",wJ._drag),window.addEventListener("mouseup",wJ._endDragAfter,!1),window.addEventListener("touchend",wJ._endDragAfter,!1));var kJ="absoluteOpacity",SJ="allEventListeners",CJ="absoluteTransform",_J="absoluteScale",EJ="canvas",PJ="listening",LJ="mouseenter",OJ="mouseleave",MJ="Shape",TJ=" ",AJ="stage",IJ="transform",RJ="visible",NJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(TJ);let DJ=1;class zJ{constructor(e){this._id=DJ++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==IJ&&e!==CJ||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===IJ||e===CJ)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){const n=t.map((e=>e+"Change.konva")).join(TJ);this.on(n,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(EJ)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===CJ&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(EJ)){const{scene:e,filter:t,hit:n}=this._cache.get(EJ);eJ.releaseCanvas(e,t,n),this._cache.delete(EJ)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),o=Math.ceil(t.height||n.height),i=t.pixelRatio,a=void 0===t.x?Math.floor(n.x):t.x,s=void 0===t.y?Math.floor(n.y):t.y,l=t.offset||0,c=t.drawBorder||!1,u=t.hitCanvasPixelRatio||1;if(r&&o){a-=l,s-=l;var d=new bJ({pixelRatio:i,width:r+=2*l+1,height:o+=2*l+1}),h=new bJ({pixelRatio:i,width:0,height:0}),f=new xJ({pixelRatio:u,width:r,height:o}),p=d.getContext(),g=f.getContext();return f.isCache=!0,d.isCache=!0,this._cache.delete(EJ),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),p.save(),g.save(),p.translate(-a,-s),g.translate(-a,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(kJ),this._clearSelfAndDescendantCache(_J),this.drawScene(d,this),this.drawHit(f,this),this._isUnderCache=!1,p.restore(),g.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,r,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(EJ,{scene:d,filter:h,hit:f,x:a,y:s}),this._requestDraw(),this}eJ.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(EJ)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var n,r,o,i,a=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=this.getAbsoluteTransform(t);return a.forEach((function(e){var t=s.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:o-n,height:i-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,o=this.filters(),i=this._getCanvasCache(),a=i.scene,s=i.filter,l=s.getContext();if(o){if(!this._filterUpToDate){var c=a.pixelRatio;s.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/c,a.getHeight()/c),t=l.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+eJ._capitalize(t),eJ._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(PJ,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(RJ,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;wJ._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!$Q.hitOnDragEnabled&&r;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 e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges((()=>{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new GQ,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(IJ);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(IJ),this._clearSelfAndDescendantCache(CJ),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={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,e}move(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return eJ.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return eJ.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&eJ.warn("Unexpected value "+e+" 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 t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(kJ,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],eJ.isObject(t)&&!eJ._isPlainObject(t)&&!eJ._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),eJ._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t{try{const n=null==e?void 0:e.callback;n&&delete e.callback,eJ._urlToImage(this.toDataURL(e),(function(e){t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null==n||n(e)}))}catch(Hhe){n(Hhe)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():$Q.dragDistance}_off(e,t,n){var r,o,i,a=this.eventListeners[e];for(r=0;r=0)&&!this.isDragging()){var t=!1;wJ._dragElements.forEach((e=>{this.isAncestorOf(e.node)&&(t=!0)})),t||this._createDragElement(e)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=wJ._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&wJ._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return eJ.haveIntersection(n,this.getClientRect())}static create(e,t){return eJ._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o,i=zJ.prototype.getClassName.call(e),a=e.children;t&&(e.attrs.container=t),$Q[i]||(eJ.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");if(n=new(0,$Q[i])(e.attrs),a)for(r=a.length,o=0;o0}removeChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants((r=>{const o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n){if(t=e(r),t)return!0;if(r.hasChildren()&&(t=r._descendants(e),t))return!0}return!1}toObject(){var e=zJ.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=zJ.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s;const c=n===this;if(l){o.save();var u=this.getAbsoluteTransform(n),d=u.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var h=this.clipX(),f=this.clipY();o.rect(h,f,i,a)}o.clip(),d=u.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}getClientRect(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var u=this.find("Shape"),d=!1,h=0;he.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",m0=e=>{const t=g0(e);return"pointer"===t?$Q.pointerEventsEnabled&&p0.pointer:"touch"===t?p0.touch:"mouse"===t?p0.mouse:void 0};function v0(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&eJ.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const y0=[];class b0 extends jJ{constructor(e){super(v0(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),y0.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{v0(this.attrs)})),this._checkVisibility()}_validateAdd(e){const t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||eJ.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,n=t.length;for(e=0;e-1&&y0.splice(t,1),eJ.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(eJ.warn("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);"),null)}_getPointerById(e){return this._pointerPositions.find((t=>t.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new bJ({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}getIntersection(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){const r=n[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e,...t){if(arguments.length>1){for(var n=0;n5&&eJ.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),$Q.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}getLayers(){return this.children}_bindContentEvents(){$Q.isBrowser&&f0.forEach((([e,t])=>{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=m0(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!wJ.isDragging||$Q.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=m0(e.type),n=g0(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach((o=>{var i=this.getIntersection(o);wJ.justDragged=!1,$Q["_"+n+"ListenClick"]=!0;if(!(i&&i.isListening()))return;$Q.capturePointerEventsEnabled&&i.setPointerCapture(o.id),this[n+"ClickStartShape"]=i,i._fireAndBubble(t.pointerdown,{evt:e,pointerId:o.id}),r=!0;const a=e.type.indexOf("touch")>=0;i.preventDefault()&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=m0(e.type),n=g0(e.type);if(!t)return;if(wJ.isDragging&&wJ.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!wJ.isDragging||$Q.hitOnDragEnabled))return;var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{const s=WJ(a.id)||this.getIntersection(a),l=a.id,c={evt:e,pointerId:l};var u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},c),s),i._fireAndBubble(t.pointerleave,Object.assign({},c),s)),s){if(r[s._id])return;r[s._id]=!0}s&&s.isListening()?(o=!0,u&&(s._fireAndBubble(t.pointerover,Object.assign({},c),i),s._fireAndBubble(t.pointerenter,Object.assign({},c),i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,Object.assign({},c))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=m0(e.type),n=g0(e.type);if(!t)return;this.setPointersPositions(e);const r=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var i={};let a=!1;this._changedPointerPositions.forEach((s=>{const l=WJ(s.id)||this.getIntersection(s);if(l){if(l.releaseCapture(s.id),i[l._id])return;i[l._id]=!0}const c=s.id,u={evt:e,pointerId:c};let d=!1;$Q["_"+n+"InDblClickWindow"]?(d=!0,clearTimeout(this[n+"DblTimeout"])):wJ.justDragged||($Q["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){$Q["_"+n+"InDblClickWindow"]=!1}),$Q.dblClickWindow),l&&l.isListening()?(a=!0,this[n+"ClickEndShape"]=l,l._fireAndBubble(t.pointerup,Object.assign({},u)),$Q["_"+n+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(t.pointerclick,Object.assign({},u)),d&&o&&o===l&&l._fireAndBubble(t.pointerdblclick,Object.assign({},u)))):(this[n+"ClickEndShape"]=null,$Q["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:c}),d&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:c}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),$Q["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(s0,{evt:e}):this._fire(s0,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(h0,{evt:e}):this._fire(h0,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=WJ(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(t0,VJ(e)),GJ(e.pointerId)}_lostpointercapture(e){GJ(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}))):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:eJ._getFirstPointerId(e)}])}_setPointerPosition(e){eJ.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new bJ({width:this.width(),height:this.height()}),this.bufferHitCanvas=new xJ({pixelRatio:1,width:this.width(),height:this.height()}),$Q.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return eJ.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(e){e.batchDraw()})),this}}b0.prototype.nodeType="Stage",UQ(b0),dJ.addGetterSetter(b0,"container");var x0="hasShadow",w0="shadowRGBA",k0="patternImage",S0="linearGradient",C0="radialGradient";let _0;function E0(){return _0||(_0=eJ.createCanvasElement().getContext("2d"),_0)}const P0={};class L0 extends zJ{constructor(e){let t;for(super(e);t=eJ.getRandomColor(),!t||t in P0;);this.colorKey=t,P0[t]=this}getContext(){return eJ.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return eJ.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(x0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(k0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=E0().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new GQ;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate($Q.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(S0,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=E0(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;ithis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return zJ.prototype.destroy.call(this),delete P0[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;const n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;const i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}setStrokeHitEnabled(e){eJ.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+o,a=r.height+o,s=!e.skipShadow&&this.hasShadow(),l=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,u=i+Math.abs(l),d=a+Math.abs(c),h=s&&this.shadowBlur()||0,f={width:u+2*h,height:d+2*h,x:-(o/2+h)+Math.min(l,0)+r.x,y:-(o/2+h)+Math.min(c,0)+r.y};return t?f:this._transformedRect(f,n)}drawScene(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),c=this.hasShadow(),u=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var h=this.getAbsoluteTransform(t).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(t).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){f=this.getAbsoluteTransform(t).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||eJ.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()"),l){i.save();var c=this.getAbsoluteTransform(t).getMatrix();return i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);if(!(this===t)){var u=this.getAbsoluteTransform(t).getMatrix();i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return a.call(this,i,this),i.restore(),this}drawHitFromCache(e=0){var t,n,r,o,i,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,c=l.getContext(),u=l.getWidth(),d=l.getHeight();c.clear(),c.drawImage(s._canvas,0,0,u,d);try{for(r=(n=(t=c.getImageData(0,0,u,d)).data).length,o=eJ._hexToRgb(this.colorKey),i=0;ie?(n[i]=o.r,n[i+1]=o.g,n[i+2]=o.b,n[i+3]=255):n[i+3]=0;c.putImageData(t,0,0)}catch(B2){eJ.error("Unable to draw hit graph from cached scene canvas. "+B2.message)}return this}hasPointerCapture(e){return $J(e,this)}setPointerCapture(e){UJ(e,this)}releaseCapture(e){GJ(e)}}L0.prototype._fillFunc=function(e){e.fill()},L0.prototype._strokeFunc=function(e){e.stroke()},L0.prototype._fillFuncHit=function(e){e.fill()},L0.prototype._strokeFuncHit=function(e){e.stroke()},L0.prototype._centroid=!1,L0.prototype.nodeType="Shape",UQ(L0),L0.prototype.eventListeners={},L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(x0)})),L0.prototype.on.call(L0.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(w0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(k0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(S0)})),L0.prototype.on.call(L0.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(C0)})),dJ.addGetterSetter(L0,"stroke",void 0,sJ()),dJ.addGetterSetter(L0,"strokeWidth",2,rJ()),dJ.addGetterSetter(L0,"fillAfterStrokeEnabled",!1),dJ.addGetterSetter(L0,"hitStrokeWidth","auto",iJ()),dJ.addGetterSetter(L0,"strokeHitEnabled",!0,lJ()),dJ.addGetterSetter(L0,"perfectDrawEnabled",!0,lJ()),dJ.addGetterSetter(L0,"shadowForStrokeEnabled",!0,lJ()),dJ.addGetterSetter(L0,"lineJoin"),dJ.addGetterSetter(L0,"lineCap"),dJ.addGetterSetter(L0,"sceneFunc"),dJ.addGetterSetter(L0,"hitFunc"),dJ.addGetterSetter(L0,"dash"),dJ.addGetterSetter(L0,"dashOffset",0,rJ()),dJ.addGetterSetter(L0,"shadowColor",void 0,aJ()),dJ.addGetterSetter(L0,"shadowBlur",0,rJ()),dJ.addGetterSetter(L0,"shadowOpacity",1,rJ()),dJ.addComponentsGetterSetter(L0,"shadowOffset",["x","y"]),dJ.addGetterSetter(L0,"shadowOffsetX",0,rJ()),dJ.addGetterSetter(L0,"shadowOffsetY",0,rJ()),dJ.addGetterSetter(L0,"fillPatternImage"),dJ.addGetterSetter(L0,"fill",void 0,sJ()),dJ.addGetterSetter(L0,"fillPatternX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternY",0,rJ()),dJ.addGetterSetter(L0,"fillLinearGradientColorStops"),dJ.addGetterSetter(L0,"strokeLinearGradientColorStops"),dJ.addGetterSetter(L0,"fillRadialGradientStartRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientEndRadius",0),dJ.addGetterSetter(L0,"fillRadialGradientColorStops"),dJ.addGetterSetter(L0,"fillPatternRepeat","repeat"),dJ.addGetterSetter(L0,"fillEnabled",!0),dJ.addGetterSetter(L0,"strokeEnabled",!0),dJ.addGetterSetter(L0,"shadowEnabled",!0),dJ.addGetterSetter(L0,"dashEnabled",!0),dJ.addGetterSetter(L0,"strokeScaleEnabled",!0),dJ.addGetterSetter(L0,"fillPriority","color"),dJ.addComponentsGetterSetter(L0,"fillPatternOffset",["x","y"]),dJ.addGetterSetter(L0,"fillPatternOffsetX",0,rJ()),dJ.addGetterSetter(L0,"fillPatternOffsetY",0,rJ()),dJ.addComponentsGetterSetter(L0,"fillPatternScale",["x","y"]),dJ.addGetterSetter(L0,"fillPatternScaleX",1,rJ()),dJ.addGetterSetter(L0,"fillPatternScaleY",1,rJ()),dJ.addComponentsGetterSetter(L0,"fillLinearGradientStartPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientStartPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillLinearGradientEndPoint",["x","y"]),dJ.addComponentsGetterSetter(L0,"strokeLinearGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointX",0),dJ.addGetterSetter(L0,"fillLinearGradientEndPointY",0),dJ.addGetterSetter(L0,"strokeLinearGradientEndPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientStartPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientStartPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientStartPointY",0),dJ.addComponentsGetterSetter(L0,"fillRadialGradientEndPoint",["x","y"]),dJ.addGetterSetter(L0,"fillRadialGradientEndPointX",0),dJ.addGetterSetter(L0,"fillRadialGradientEndPointY",0),dJ.addGetterSetter(L0,"fillPatternRotation",0),dJ.backCompat(L0,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var O0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],M0=O0.length;class T0 extends jJ{constructor(e){super(e),this.canvas=new bJ,this.hitCanvas=new xJ({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0?{antialiased:!0}:{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),jJ.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),jJ.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return eJ.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return eJ.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}T0.prototype.nodeType="Layer",UQ(T0),dJ.addGetterSetter(T0,"imageSmoothingEnabled",!0),dJ.addGetterSetter(T0,"clearBeforeDraw",!0),dJ.addGetterSetter(T0,"hitGraphEnabled",!0,lJ());class A0 extends T0{constructor(e){super(e),this.listening(!1),eJ.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}A0.prototype.nodeType="FastLayer",UQ(A0);class I0 extends jJ{_validateAdd(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&eJ.throw("You may only add groups and shapes to groups.")}}I0.prototype.nodeType="Group",UQ(I0);var R0=VQ.performance&&VQ.performance.now?function(){return VQ.performance.now()}:function(){return(new Date).getTime()};class N0{constructor(e,t){this.id=N0.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:R0(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class F0{constructor(e){var t,n,r=this,o=e.node,i=o._id,a=e.easing||H0.Linear,s=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=z0++;var l=o.getLayer()||(o instanceof $Q.Stage?o.getLayers():null);for(n in l||eJ.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new N0((function(){r.tween.onEnterFrame()}),l),this.tween=new j0(n,(function(e){r._tweenFunc(e)}),a,0,1,1e3*t,s),this._addListeners(),F0.attrs[i]||(F0.attrs[i]={}),F0.attrs[i][this._id]||(F0.attrs[i][this._id]={}),F0.tweens[i]||(F0.tweens[i]={}),e)void 0===D0[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,o,i,a,s,l,c,u=this.node,d=u._id;if((o=F0.tweens[d][e])&&delete F0.attrs[d][o][e],n=u.getAttr(e),eJ._isArray(t))if(r=[],a=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=eJ._prepareArrayForTween(n,t,u.closed())):(s=t,t=eJ._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=F0.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.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(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=F0.tweens[t];for(e in this.pause(),r)delete F0.tweens[t][e];delete F0.attrs[t][n]}}F0.attrs={},F0.tweens={},zJ.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new F0(e).play()};const H0={BackEaseIn(e,t,n,r){var o=1.70158;return n*(e/=r)*e*((o+1)*e-o)+t},BackEaseOut(e,t,n,r){var o=1.70158;return n*((e=e/r-1)*e*((o+1)*e+o)+1)+t},BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-H0.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},W0=eJ._assign($Q,{Util:eJ,Transform:GQ,Node:zJ,Container:jJ,Stage:b0,stages:y0,Layer:T0,FastLayer:A0,Group:I0,DD:wJ,Shape:L0,shapes:P0,Animation:N0,Tween:F0,Easings:H0,Context:pJ,Canvas:yJ});class V0 extends L0{_sceneFunc(e){var t=$Q.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=$Q.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),a=Math.sin(Math.min(r,Math.PI/2)),s=o*(o>0?e:t),l=i*(i>0?e:t),c=a*(a>0?t:e);return{x:s,y:n?-1*c:l,width:1*t-s,height:c-l}}}function $0(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),c=a*s/(s+l),u=a*l/(s+l);return[n-c*(o-e),r-c*(i-t),n+u*(o-e),r+u*(i-t)]}function U0(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);rc?l:c,g=l>c?1:l/c,m=l>c?c/l:1;e.translate(a,s),e.rotate(h),e.scale(g,m),e.arc(0,0,p,u,u+d,1-f),e.scale(1/g,1/m),e.rotate(-h),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var n=t.points[4],r=t.points[5],o=t.points[4]+r,i=Math.PI/180;if(Math.abs(n-o)o;r-=i){const n=q0.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);e.push(n.x,n.y)}else for(let r=n+i;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var o=this.dataArray[n],i=o.points;switch(o.command){case"L":return q0.getPointOnLine(e,o.start.x,o.start.y,i[0],i[1]);case"C":return q0.getPointOnCubicBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3],i[4],i[5]);case"Q":return q0.getPointOnQuadraticBezier(e/o.pathLength,o.start.x,o.start.y,i[0],i[1],i[2],i[3]);case"A":var a=i[0],s=i[1],l=i[2],c=i[3],u=i[4],d=i[5],h=i[6];return u+=d*e/o.pathLength,q0.getPointOnEllipticalArc(a,s,l,c,u,h)}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(f[0]);){var v,y,b,x,w,k,S,C,_,E,P=null,L=[],O=l,M=c;switch(h){case"l":l+=f.shift(),c+=f.shift(),P="L",L.push(l,c);break;case"L":l=f.shift(),c=f.shift(),L.push(l,c);break;case"m":var T=f.shift(),A=f.shift();if(l+=T,c+=A,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+T,c=a[I].points[1]+A;break}L.push(l,c),h="l";break;case"M":l=f.shift(),c=f.shift(),P="M",L.push(l,c),h="L";break;case"h":l+=f.shift(),P="L",L.push(l,c);break;case"H":l=f.shift(),P="L",L.push(l,c);break;case"v":c+=f.shift(),P="L",L.push(l,c);break;case"V":c=f.shift(),P="L",L.push(l,c);break;case"C":L.push(f.shift(),f.shift(),f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"c":L.push(l+f.shift(),c+f.shift(),l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"S":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,f.shift(),f.shift()),l=f.shift(),c=f.shift(),P="C",L.push(l,c);break;case"s":y=l,b=c,"C"===(v=a[a.length-1]).command&&(y=l+(l-v.points[2]),b=c+(c-v.points[3])),L.push(y,b,l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="C",L.push(l,c);break;case"Q":L.push(f.shift(),f.shift()),l=f.shift(),c=f.shift(),L.push(l,c);break;case"q":L.push(l+f.shift(),c+f.shift()),l+=f.shift(),c+=f.shift(),P="Q",L.push(l,c);break;case"T":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l=f.shift(),c=f.shift(),P="Q",L.push(y,b,l,c);break;case"t":y=l,b=c,"Q"===(v=a[a.length-1]).command&&(y=l+(l-v.points[0]),b=c+(c-v.points[1])),l+=f.shift(),c+=f.shift(),P="Q",L.push(y,b,l,c);break;case"A":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l=f.shift(),c=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k);break;case"a":x=f.shift(),w=f.shift(),k=f.shift(),S=f.shift(),C=f.shift(),_=l,E=c,l+=f.shift(),c+=f.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,c,S,C,x,w,k)}a.push({command:P||h,points:L,start:{x:O,y:M},pathLength:this.calcLength(O,M,P||h,L)})}"z"!==h&&"Z"!==h||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){var o,i,a,s,l=q0;switch(n){case"L":return l.getLineLength(e,t,r[0],r[1]);case"C":for(o=0,i=l.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),s=.01;s<=1;s+=.01)a=l.getPointOnCubicBezier(s,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"Q":for(o=0,i=l.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),s=.01;s<=1;s+=.01)a=l.getPointOnQuadraticBezier(s,e,t,r[0],r[1],r[2],r[3]),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case"A":o=0;var c=r[4],u=r[5],d=r[4]+u,h=Math.PI/180;if(Math.abs(c-d)d;s-=h)a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),o+=l.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=c+h;s1&&(a*=Math.sqrt(h),s*=Math.sqrt(h));var f=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(u*u))/(a*a*(d*d)+s*s*(u*u)));o===i&&(f*=-1),isNaN(f)&&(f=0);var p=f*a*d/s,g=f*-s*u/a,m=(e+n)/2+Math.cos(c)*p-Math.sin(c)*g,v=(t+r)/2+Math.sin(c)*p+Math.cos(c)*g,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},x=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[m,v,a,s,w,C,c,i]}}q0.prototype.className="Path",q0.prototype._attrsAffectingSize=["data"],UQ(q0),dJ.addGetterSetter(q0,"data");class Y0 extends G0{_sceneFunc(e){super._sceneFunc(e);var t=2*Math.PI,n=this.points(),r=n,o=0!==this.tension()&&n.length>4;o&&(r=this.getTensionPoints());var i,a,s=this.pointerLength(),l=n.length;if(o){const e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[l-2],n[l-1]],t=q0.calcLength(r[r.length-4],r[r.length-3],"C",e),o=q0.getPointOnQuadraticBezier(Math.min(1,1-s/t),e[0],e[1],e[2],e[3],e[4],e[5]);i=n[l-2]-o.x,a=n[l-1]-o.y}else i=n[l-2]-n[l-4],a=n[l-1]-n[l-3];var c=(Math.atan2(a,i)+t)%t,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[l-2],n[l-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),o?(i=(r[0]+r[2])/2-n[0],a=(r[1]+r[3])/2-n[1]):(i=n[2]-n[0],a=n[3]-n[1]),e.rotate((Math.atan2(-a,-i)+t)%t),e.moveTo(0,0),e.lineTo(-s,u/2),e.lineTo(-s,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}Y0.prototype.className="Arrow",UQ(Y0),dJ.addGetterSetter(Y0,"pointerLength",10,rJ()),dJ.addGetterSetter(Y0,"pointerWidth",10,rJ()),dJ.addGetterSetter(Y0,"pointerAtBeginning",!1),dJ.addGetterSetter(Y0,"pointerAtEnding",!0);class Z0 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Z0.prototype._centroid=!0,Z0.prototype.className="Circle",Z0.prototype._attrsAffectingSize=["radius"],UQ(Z0),dJ.addGetterSetter(Z0,"radius",0,rJ());class X0 extends L0{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}X0.prototype.className="Ellipse",X0.prototype._centroid=!0,X0.prototype._attrsAffectingSize=["radiusX","radiusY"],UQ(X0),dJ.addComponentsGetterSetter(X0,"radius",["x","y"]),dJ.addGetterSetter(X0,"radiusX",0,rJ()),dJ.addGetterSetter(X0,"radiusY",0,rJ());class K0 extends L0{constructor(e){super(e),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),n=this.getHeight(),r=this.attrs.image;let o;if(r){const e=this.attrs.cropWidth,i=this.attrs.cropHeight;o=e&&i?[r,this.cropX(),this.cropY(),e,i,0,0,t,n]:[r,0,0,t,n]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,o)}_hitFunc(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}getHeight(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}static fromURL(e,t,n=null){var r=eJ.createImageElement();r.onload=function(){var e=new K0({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}K0.prototype.className="Image",UQ(K0),dJ.addGetterSetter(K0,"image"),dJ.addComponentsGetterSetter(K0,"crop",["x","y","width","height"]),dJ.addGetterSetter(K0,"cropX",0,rJ()),dJ.addGetterSetter(K0,"cropY",0,rJ()),dJ.addGetterSetter(K0,"cropWidth",0,rJ()),dJ.addGetterSetter(K0,"cropHeight",0,rJ());var Q0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],J0="up",e1="right",t1="down",n1="left",r1=Q0.length;class o1 extends I0{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t,n=this,r=function(){n._sync()};for(t=0;t{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}s1.prototype.className="RegularPolygon",s1.prototype._centroid=!0,s1.prototype._attrsAffectingSize=["radius"],UQ(s1),dJ.addGetterSetter(s1,"radius",0,rJ()),dJ.addGetterSetter(s1,"sides",0,rJ());var l1=2*Math.PI;class c1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,l1,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),l1,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}c1.prototype.className="Ring",c1.prototype._centroid=!0,c1.prototype._attrsAffectingSize=["innerRadius","outerRadius"],UQ(c1),dJ.addGetterSetter(c1,"innerRadius",0,rJ()),dJ.addGetterSetter(c1,"outerRadius",0,rJ());class u1 extends L0{constructor(e){super(e),this._updated=!0,this.anim=new N0((()=>{var e=this._updated;return this._updated=!1,e})),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(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+0],s=o[r+1],l=o[r+2],c=o[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,l,c),e.closePath(),e.fillStrokeShape(this)),u)if(i){var d=i[t],h=2*n;e.drawImage(u,a,s,l,c,d[h+0],d[h+1],l,c)}else e.drawImage(u,a,s,l,c,0,0,l,c)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[r+2],s=o[r+3];if(e.beginPath(),i){var l=i[t],c=2*n;e.rect(l[c+0],l[c+1],a,s)}else e.rect(0,0,a,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e1&&(m+=a)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=eJ._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===p1||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===p1||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return eJ.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n=S1(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}_getContextFont(){return this.fontStyle()+b1+this.fontVariant()+b1+(this.fontSize()+"px ")+this.fontFamily().split(",").map((e=>{const t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e})).join(", ")}_addTextLine(e){this.align()===g1&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return S1().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==p1&&void 0!==o,s=i!==p1&&void 0!==i,l=this.padding(),c=o-2*l,u=i-2*l,d=0,h=this.wrap(),f="char"!==h&&h!==x1,p=this.ellipsis();this.textArr=[],S1().font=this._getContextFont();for(var g=p?this._getTextWidth("…"):0,m=0,v=e.length;mc)for(;y.length>0;){for(var x=0,w=y.length,k="",S=0;x>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+g;E<=c?(x=C+1,k=_,S=E):w=C}if(!k)break;if(f){var P,L=y[k.length];(P=(L===b1||"-"===L)&&S<=c?k.length:Math.max(k.lastIndexOf(b1),k.lastIndexOf("-"))+1)>0&&(x=P,k=k.slice(0,x),S=this._getTextWidth(k))}if(k=k.trimRight(),this._addTextLine(k),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(x)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=c){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&mu)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==p1&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==x1)||o&&e+n>i}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==p1&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var c,u,d,h=h1(this.text()),f=this.text().split(" ").length-1,p=-1,g=0,m=function(){g=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(c={x:t[n].points[0],y:t[n].points[1]})}return{}},v=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/f);var s=0,l=0;for(u=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var h=s;void 0===d;)(d=m())&&h+d.pathLengtho?u=q0.getPointOnLine(o,c.x,c.y,d.points[0],d.points[1],c.x,c.y):d=void 0;break;case"A":var v=d.points[4],y=d.points[5],b=d.points[4]+y;0===g?g=v+1e-8:o>s?g+=Math.PI/180*y/Math.abs(y):g-=Math.PI/360*y/Math.abs(y),(y<0&&g=0&&g>b)&&(g=b,p=!0),u=q0.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,d.points[6]);break;case"C":0===g?g=o>d.pathLength?1e-8:o/d.pathLength:o>s?g+=(o-s)/d.pathLength/2:g=Math.max(g-(s-o)/d.pathLength/2,0),g>1&&(g=1,p=!0),u=q0.getPointOnCubicBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===g?g=o/d.pathLength:o>s?g+=(o-s)/d.pathLength:g-=(s-o)/d.pathLength,g>1&&(g=1,p=!0),u=q0.getPointOnQuadraticBezier(g,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==u&&(s=q0.getLineLength(c.x,c.y,u.x,u.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;be+`.${O1}`)).join(" "),T1="nodesRect",A1=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],I1={"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 R1="ontouchstart"in $Q._global;var N1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function D1(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),o=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:o})}function z1(e,t){const n=function(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)}}(e);return D1(e,t,n)}class B1 extends I0{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(M1,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return eJ.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return O1+this._id}setNodes(e=[]){return this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{const t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(A1.map((e=>e+`.${this._getEventNamespace()}`)).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on(`dragmove.${this._getEventNamespace()}`,(n=>{if(!t)return;const r=e.getAbsolutePosition(),o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{if(t===e)return;if(t.isDragging())return;const r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n)})),t=null}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(T1),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(T1,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y;const l=($Q.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return D1({x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l},-$Q.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[];this.nodes().map((t=>{const n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],o=t.getAbsoluteTransform();r.forEach((function(t){var n=o.point(t);e.push(n)}))}));const t=new GQ;var n,r,o,i;t.rotate(-$Q.getAngle(this.rotation())),e.forEach((function(e){var a=t.point(e);void 0===n&&(n=o=a.x,r=i=a.y),n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x),i=Math.max(i,a.y)})),t.invert();const a=t.point({x:n,y:r});return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:$Q.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(),N1.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new a1({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:R1?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=$Q.getAngle(this.rotation()),r=function(e,t){if("rotater"===e)return"crosshair";t+=eJ.degToRad(I1[e]||0);var n=(eJ.radToDeg(t)%360+360)%360;return eJ._inRange(n,337.5,360)||eJ._inRange(n,0,22.5)?"ns-resize":eJ._inRange(n,22.5,67.5)?"nesw-resize":eJ._inRange(n,67.5,112.5)?"ew-resize":eJ._inRange(n,112.5,157.5)?"nwse-resize":eJ._inRange(n,157.5,202.5)?"ns-resize":eJ._inRange(n,202.5,247.5)?"nesw-resize":eJ._inRange(n,247.5,292.5)?"ew-resize":eJ._inRange(n,292.5,337.5)?"nwse-resize":(eJ.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,n);t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new L0({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*eJ._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(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 i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);const a=i.getPointerPosition();let s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);const c=o.getAbsolutePosition();if(l.x!==c.x||l.y!==c.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(u){var h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(h.y-o.y(),2));var f=this.findOne(".top-left").x()>h.x?-1:1,p=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-h.x,2)+Math.pow(h.y-o.y(),2));f=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*f,n=r*this.sin*p,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var g=o.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(u){h=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-o.x(),2)+Math.pow(o.y()-h.y,2));f=h.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();if(eJ._inRange(e.width,2*-this.padding()-1,1))return void this.update();if(eJ._inRange(e.height,2*-this.padding()-1,1))return void this.update();const r=this.flipEnabled();var o=new GQ;if(o.rotate($Q.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const t=o.point({x:2*-this.padding(),y:0});if(e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const t=o.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding(),!r)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const t=o.point({x:0,y:2*-this.padding()});if(e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const t=o.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding(),!r)return void this.update()}if(this.boundBoxFunc()){const t=this.boundBoxFunc()(n,e);t?e=t:eJ.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,a=new GQ;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/i,n.height/i);const s=new GQ;s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.width/i,e.height/i);const l=s.multiply(a.invert());this._nodes.forEach((e=>{var n;const r=e.getParent().getAbsoluteTransform(),o=e.getTransform().copy();o.translate(e.offsetX(),e.offsetY());const i=new GQ;i.multiply(r.copy().invert()).multiply(l).multiply(r).multiply(o);const a=i.decompose();e.setAttrs(a),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(n=e.getLayer())||void 0===n||n.batchDraw()})),this.rotation(eJ._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(eJ._getRotation(t.rotation));var n=t.width,r=t.height,o=this.enabledAnchors(),i=this.resizeEnabled(),a=this.padding(),s=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+a,offsetY:s/2+a,visible:i&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+a,visible:i&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-a,offsetY:s/2+a,visible:i&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+a,visible:i&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-a,visible:i&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-a,visible:i&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-a,offsetY:s/2-a,visible:i&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*eJ._sign(r)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),I0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return zJ.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}B1.prototype.className="Transformer",UQ(B1),dJ.addGetterSetter(B1,"enabledAnchors",N1,(function(e){return e instanceof Array||eJ.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===N1.indexOf(e)&&eJ.warn("Unknown anchor name: "+e+". Available names are: "+N1.join(", "))})),e||[]})),dJ.addGetterSetter(B1,"flipEnabled",!0,lJ()),dJ.addGetterSetter(B1,"resizeEnabled",!0),dJ.addGetterSetter(B1,"anchorSize",10,rJ()),dJ.addGetterSetter(B1,"rotateEnabled",!0),dJ.addGetterSetter(B1,"rotationSnaps",[]),dJ.addGetterSetter(B1,"rotateAnchorOffset",50,rJ()),dJ.addGetterSetter(B1,"rotationSnapTolerance",5,rJ()),dJ.addGetterSetter(B1,"borderEnabled",!0),dJ.addGetterSetter(B1,"anchorStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"anchorStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"anchorFill","white"),dJ.addGetterSetter(B1,"anchorCornerRadius",0,rJ()),dJ.addGetterSetter(B1,"borderStroke","rgb(0, 161, 255)"),dJ.addGetterSetter(B1,"borderStrokeWidth",1,rJ()),dJ.addGetterSetter(B1,"borderDash"),dJ.addGetterSetter(B1,"keepRatio",!0),dJ.addGetterSetter(B1,"centeredScaling",!1),dJ.addGetterSetter(B1,"ignoreStroke",!1),dJ.addGetterSetter(B1,"padding",0,rJ()),dJ.addGetterSetter(B1,"node"),dJ.addGetterSetter(B1,"nodes"),dJ.addGetterSetter(B1,"boundBoxFunc"),dJ.addGetterSetter(B1,"anchorDragBoundFunc"),dJ.addGetterSetter(B1,"shouldOverdrawWholeArea",!1),dJ.addGetterSetter(B1,"useSingleNodeRotation",!0),dJ.backCompat(B1,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class j1 extends L0{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,$Q.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function F1(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}j1.prototype.className="Wedge",j1.prototype._centroid=!0,j1.prototype._attrsAffectingSize=["radius"],UQ(j1),dJ.addGetterSetter(j1,"radius",0,rJ()),dJ.addGetterSetter(j1,"angle",0,rJ()),dJ.addGetterSetter(j1,"clockwise",!1),dJ.backCompat(j1,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var H1=[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],W1=[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];dJ.addGetterSetter(zJ,"blurRadius",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"brightness",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"contrast",0,rJ(),dJ.afterSetFilter);function V1(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}dJ.addGetterSetter(zJ,"embossStrength",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossWhiteLevel",.5,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossDirection","top-left",null,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"embossBlend",!1,null,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"enhance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"luminance",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"hue",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"saturation",0,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"value",0,rJ(),dJ.afterSetFilter);function $1(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function U1(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}dJ.addGetterSetter(zJ,"kaleidoscopePower",2,rJ(),dJ.afterSetFilter),dJ.addGetterSetter(zJ,"kaleidoscopeAngle",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"threshold",0,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"noise",.2,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"pixelSize",8,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"levels",.5,rJ(),dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter);dJ.addGetterSetter(zJ,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),dJ.addGetterSetter(zJ,"blue",0,nJ,dJ.afterSetFilter),dJ.addGetterSetter(zJ,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));dJ.addGetterSetter(zJ,"threshold",.5,rJ(),dJ.afterSetFilter);const G1=W0.Util._assign(W0,{Arc:V0,Arrow:Y0,Circle:Z0,Ellipse:X0,Image:K0,Label:o1,Tag:i1,Line:G0,Path:q0,Rect:a1,RegularPolygon:s1,Ring:c1,Sprite:u1,Star:d1,Text:C1,TextPath:L1,Transformer:B1,Wedge:j1,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,c,u,d,h,f,p,g,m,v,y,b,x,w,k,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,M=P-1,T=L-1,A=t+1,I=A*(A+1)/2,R=new F1,N=null,D=R,z=null,B=null,j=H1[t],F=W1[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(c*j>>F)*C,E[s+1]=(u*j>>F)*C,E[s+2]=(d*j>>F)*C):E[s]=E[s+1]=E[s+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(c*j>>F)*C,E[i+1]=(u*j>>F)*C,E[i+2]=(d*j>>F)*C):E[i]=E[i+1]=E[i+2]=0,c-=f,u-=p,d-=g,h-=m,f-=z.r,p-=z.g,g-=z.b,m-=z.a,i=n+((i=r+A)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,c=e.height,u=4*l,d=c;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:eJ.error("Unknown emboss direction: "+r)}do{var h=(d-1)*u,f=i;d+f<1&&(f=0),d+f>c&&(f=0);var p=(d-1+f)*l*4,g=l;do{var m=h+4*(g-1),v=a;g+v<1&&(v=0),g+v>l&&(v=0);var y=p+4*(g-1+v),b=s[m]-s[y],x=s[m+1]-s[y+1],w=s[m+2]-s[y+2],k=b,S=k>0?k:-k;if((x>0?x:-x)>S&&(k=x),(w>0?w:-w)>S&&(k=w),k*=t,o){var C=s[m]+k,_=s[m+1]+k,E=s[m+2]+k;s[m]=C>255?255:C<0?0:C,s[m+1]=_>255?255:_<0?0:_,s[m+2]=E>255?255:E<0?0:E}else{var P=n-k;P<0?P=0:P>255&&(P=255),s[m]=s[m+1]=s[m+2]=P}}while(--g)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,c=i[1],u=c,d=i[2],h=d,f=this.enhance();if(0!==f){for(o=0;ol&&(l=t),(n=i[o+1])u&&(u=n),(r=i[o+2])h&&(h=r);var p,g,m,v,y,b,x,w,k;for(l===s&&(l=255,s=0),u===c&&(u=255,c=0),h===d&&(h=255,d=0),f>0?(g=l+f*(255-l),m=s-f*(s-0),y=u+f*(255-u),b=c-f*(c-0),w=h+f*(255-h),k=d-f*(d-0)):(g=l+f*(l-(p=.5*(l+s))),m=s+f*(s-p),y=u+f*(u-(v=.5*(u+c))),b=c+f*(c-v),w=h+f*(h-(x=.5*(h+d))),k=d+f*(d-x)),o=0;ov?a:v;var y,b,x,w,k=u,S=c,C=360/S*Math.PI/180;for(b=0;bu&&(b=y,x=0,w=-1),n=0;nb?l:b;var x,w,k,S=h,C=d,_=n.polarRotation||0;for(o=0;o=0&&f=0&&p=0&&f=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&f=0&&p=m))for(n=u;n=v||(o+=x[(r=4*(m*n+t))+0],i+=x[r+1],a+=x[r+2],s+=x[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=m))for(n=u;n=v||(x[(r=4*(m*n+t))+0]=o,x[r+1]=i,x[r+2]=a,x[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),c>127&&(c=255-c),u>127&&(u=255-u),t[s]=l,t[s+1]=c,t[s+2]=u}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;tq1,X1=()=>Y1,K1=e=>{const t=Z1(),{generationMode:n,optionsState:r,canvasState:o,systemState:i}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:c,height:u,hiresFix:d,img2imgStrength:h,infillMethod:f,initialImage:p,iterations:g,perlin:m,prompt:v,sampler:y,seamBlur:b,seamless:x,seamSize:w,seamSteps:k,seamStrength:S,seed:C,seedWeights:_,shouldFitToWidthHeight:E,shouldGenerateVariations:P,shouldRandomizeSeed:L,shouldRunESRGAN:O,shouldRunFacetool:M,steps:T,threshold:A,tileSize:I,upscalingLevel:R,upscalingStrength:N,variationAmount:D,width:z}=r,{shouldDisplayInProgressType:B,saveIntermediatesInterval:j,enableImageDebugging:F}=i,H={prompt:v,iterations:g,steps:T,cfg_scale:a,threshold:A,perlin:m,height:u,width:z,sampler_name:y,seed:C,progress_images:"full-res"===B,progress_latents:"latents"===B,save_intermediates:j,generation_mode:n,init_mask:""};let W=!1,V=!1;if(H.seed=L?HQ(0,BQ):C,["txt2img","img2img"].includes(n)&&(H.seamless=x,H.hires_fix=d,O&&(W={level:R,strength:N}),M&&(V={type:c,strength:l},"codeformer"===c&&(V.codeformer_fidelity=s))),"img2img"===n&&p&&(H.init_img="string"==typeof p?p:p.url,H.strength=h,H.fit=E),"unifiedCanvas"===n&&t){const{layerState:{objects:e},boundingBoxCoordinates:n,boundingBoxDimensions:r,inpaintReplace:i,shouldUseInpaintReplace:a,stageScale:s,isMaskEnabled:l,shouldPreserveMaskedArea:c,boundingBoxScaleMethod:u,scaledBoundingBoxDimensions:d}=o,p={...n,...r},g=((e,t)=>{const{width:n,height:r}=t,o=document.createElement("div"),i=new G1.Stage({container:o,width:n,height:r}),a=new G1.Layer,s=new G1.Layer;a.add(new G1.Rect({...t,fill:"white"})),e.forEach((e=>s.add(new G1.Line({points:e.points,stroke:"black",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"})))),i.add(a),i.add(s);const l=i.toDataURL({...t});return o.remove(),l})(l?e.filter(_Z):[],p);H.init_mask=g,H.fit=!1,H.strength=h,H.invert_mask=c,a&&(H.inpaint_replace=i),H.bounding_box=p;const m=t.scale();t.scale({x:1/s,y:1/s});const v=t.getAbsolutePosition(),y=t.toDataURL({x:p.x+v.x,y:p.y+v.y,width:p.width,height:p.height});F&&(e=>{const t=window.open("");t&&e.forEach((e=>{const n=new Image;n.src=e.base64,t.document.write(e.caption),t.document.write("
"),t.document.write(n.outerHTML),t.document.write("

")}))})([{base64:g,caption:"mask sent as init_mask"},{base64:y,caption:"image sent as init_img"}]),t.scale(m),H.init_img=y,H.progress_images=!1,"none"!==u&&(H.inpaint_width=d.width,H.inpaint_height=d.height),H.seam_size=w,H.seam_blur=b,H.seam_strength=S,H.seam_steps=k,H.tile_size=I,H.infill_method=f,H.force_outpaint=!1}return P?(H.variation_amount=D,_&&(H.with_variations=(e=>{const t=e.split(",").map((e=>e.split(":")));return t.map((e=>[parseInt(e[0]),parseFloat(e[1])]))})(_))):H.variation_amount=0,F&&(H.enable_image_debugging=F),{generationParameters:H,esrganParameters:W,facetoolParameters:V}},Q1=()=>{const{origin:e}=new URL(window.location.href),t=nQ(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return e=>r=>o=>{const{onConnect:i,onDisconnect:a,onError:s,onPostprocessingResult:l,onGenerationResult:c,onIntermediateResult:u,onProgressUpdate:d,onGalleryImages:h,onProcessingCanceled:f,onImageDeleted:p,onSystemConfig:g,onModelChanged:m,onFoundModels:v,onNewModelAdded:y,onModelDeleted:b,onModelChangeFailed:x,onTempFolderEmptied:w}=(e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(GY(!0)),t(KY(pq.t("common:statusConnected"))),t(PQ());const e=n().gallery;e.categories.result.latest_mtime?t(_Q("result")):t(CQ("result")),e.categories.user.latest_mtime?t(_Q("user")):t(CQ("user"))}catch(B2){console.error(B2)}},onDisconnect:()=>{try{t(GY(!1)),t(KY(pq.t("common:statusDisconnected"))),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(B2){console.error(B2)}},onGenerationResult:e=>{try{const r=n(),{shouldLoopback:o,activeTab:i}=r.options,{boundingBox:a,generationMode:s,...l}=e,c={uuid:lQ(),...l};if(["txt2img","img2img"].includes(s)&&t(IU({category:"result",image:{...c,category:"result"}})),"unifiedCanvas"===s&&e.boundingBox){const{boundingBox:n}=e;t(AZ({image:{...c,category:"temp"},boundingBox:n})),r.canvas.shouldAutoSave&&t(IU({image:{...c,category:"result"},category:"result"}))}o&&"img2img"===P$[i]&&t(G$(c)),t(RU()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onIntermediateResult:e=>{try{t(BU({uuid:lQ(),...e,category:"result"})),e.isBase64||t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image generated: ${e.url}`}))}catch(B2){console.error(B2)}},onPostprocessingResult:e=>{try{t(IU({category:"result",image:{uuid:lQ(),...e,category:"result"}})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Postprocessed: ${e.url}`}))}catch(B2){console.error(B2)}},onProgressUpdate:e=>{try{t(VY(!0)),t(XY(e))}catch(B2){console.error(B2)}},onError:e=>{const{message:n,additionalData:r}=e;try{t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Server error: ${n}`,level:"error"})),t(tZ()),t(RU())}catch(B2){console.error(B2)}},onGalleryImages:e=>{const{images:n,areMoreImagesAvailable:r,category:o}=e,i=n.map((e=>({uuid:lQ(),...e})));t(zU({images:i,areMoreImagesAvailable:r,category:o})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Loaded ${n.length} images`}))},onProcessingCanceled:()=>{t(eZ());const{intermediateImage:e}=n().gallery;e&&(e.isBase64||(t(IU({category:"result",image:e})),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Intermediate image saved: ${e.url}`}))),t(RU())),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:e=>{const{url:r}=e;t(NU(e));const{initialImage:o,maskPath:i}=n().options;o!==r&&o?.url!==r||t(M$()),i===r&&t(Z$("")),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image deleted: ${r}`}))},onSystemConfig:e=>{t(QY(e)),e.infill_methods.includes("patchmatch")||t(U$(e.infill_methods[0]))},onFoundModels:e=>{const{search_folder:n,found_models:r}=e;t(hZ(n)),t(fZ(r))},onNewModelAdded:e=>{const{new_model_name:n,model_list:r,update:o}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model Added: ${n}`,level:"info"})),t(cZ({title:o?`${pq.t("modelmanager:modelUpdated")}: ${n}`:`${pq.t("modelmanager:modelAdded")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:e=>{const{deleted_model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`${pq.t("modelmanager:modelAdded")}: ${n}`,level:"info"})),t(cZ({title:`${pq.t("modelmanager:modelEntryDeleted")}: ${n}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(KY(pq.t("common:statusModelChanged"))),t(VY(!1)),t(oZ(!0)),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model changed: ${n}`,level:"info"}))},onModelChangeFailed:e=>{const{model_name:n,model_list:r}=e;t(rZ(r)),t(VY(!1)),t(oZ(!0)),t(tZ()),t($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Model change failed: ${n}`,level:"error"}))},onTempFolderEmptied:()=>{t(cZ({title:pq.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}})(e),{emitGenerateImage:k,emitRunESRGAN:S,emitRunFacetool:C,emitDeleteImage:_,emitRequestImages:E,emitRequestNewImages:P,emitCancelProcessing:L,emitRequestSystemConfig:O,emitSearchForModels:M,emitAddNewModel:T,emitDeleteModel:A,emitRequestModelChange:I,emitSaveStagingAreaImageToGallery:R,emitRequestEmptyTempFolder:N}=((e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:e=>{n(VY(!0));const o=r(),{options:i,system:a,canvas:s}=o,l={generationMode:e,optionsState:i,canvasState:s,systemState:a};n(lZ());const{generationParameters:c,esrganParameters:u,facetoolParameters:d}=K1(l);t.emit("generateImage",c,u,d),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...c,...u,...d})}`}))},emitRunESRGAN:e=>{n(VY(!0));const o=r().options,{upscalingLevel:i,upscalingStrength:a}=o,s={upscale:[i,a]};t.emit("runPostprocessing",e,{type:"esrgan",...s}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:e.url,...s})}`}))},emitRunFacetool:e=>{n(VY(!0));const o=r().options,{facetoolType:i,facetoolStrength:a,codeformerFidelity:s}=o,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,{type:i,...l}),n($Y({timestamp:hQ(new Date,"isoDateTime"),message:`Face restoration (${i}) requested: ${JSON.stringify({file:e.url,...l})}`}))},emitDeleteImage:e=>{const{url:r,uuid:o,category:i,thumbnail:a}=e;n(NU(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:e=>{const n=r().gallery,{earliest_mtime:o}=n.categories[e];t.emit("requestImages",e,o)},emitRequestNewImages:e=>{const n=r().gallery,{latest_mtime:o}=n.categories[e];t.emit("requestLatestImages",e,o)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:e=>{t.emit("searchForModels",e)},emitAddNewModel:e=>{t.emit("addNewModel",e)},emitDeleteModel:e=>{t.emit("deleteModel",e)},emitRequestModelChange:e=>{n(iZ()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:e=>{t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}})(e,t);switch(n||(t.on("connect",(()=>i())),t.on("disconnect",(()=>a())),t.on("error",(e=>s(e))),t.on("generationResult",(e=>c(e))),t.on("postprocessingResult",(e=>l(e))),t.on("intermediateResult",(e=>u(e))),t.on("progressUpdate",(e=>d(e))),t.on("galleryImages",(e=>h(e))),t.on("processingCanceled",(()=>{f()})),t.on("imageDeleted",(e=>{p(e)})),t.on("systemConfig",(e=>{g(e)})),t.on("foundModels",(e=>{v(e)})),t.on("newModelAdded",(e=>{y(e)})),t.on("modelDeleted",(e=>{b(e)})),t.on("modelChanged",(e=>{m(e)})),t.on("modelChangeFailed",(e=>{x(e)})),t.on("tempFolderEmptied",(()=>{w()})),n=!0),o.type){case"socketio/generateImage":k(o.payload);break;case"socketio/runESRGAN":S(o.payload);break;case"socketio/runFacetool":C(o.payload);break;case"socketio/deleteImage":_(o.payload);break;case"socketio/requestImages":E(o.payload);break;case"socketio/requestNewImages":P(o.payload);break;case"socketio/cancelProcessing":L();break;case"socketio/requestSystemConfig":O();break;case"socketio/searchForModels":M(o.payload);break;case"socketio/addNewModel":T(o.payload);break;case"socketio/deleteModel":A(o.payload);break;case"socketio/requestModelChange":I(o.payload);break;case"socketio/saveStagingAreaImageToGallery":R(o.payload);break;case"socketio/requestEmptyTempFolder":N()}r(o)}},J1=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((e=>`canvas.${e}`)),e2=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((e=>`system.${e}`)),t2=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((e=>`gallery.${e}`)),n2=nV({options:OU,gallery:KU,system:gZ,canvas:VX}),r2=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?ZV:e.stateReconciler,o=e.getStoredState||QV,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,c=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(u,d){var h=u||{},f=h._persist,p=o$(h,["_persist"]);if(d.type===VV){var g=!1,m=function(t,n){g||(d.rehydrate(e.key,t,n),g=!0)};if(i&&setTimeout((function(){!g&&m(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=XV(e)),f)return n$({},t(p,d),{_persist:f});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)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 d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){m(e)}),(function(e){m(void 0,e)}))}),(function(e){m(void 0,e)})),n$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===$V)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:jV).concat(e.key);return t.removeItem(n,e$)}(e)),n$({},t(p,d),{_persist:f});if(d.type===FV)return d.result(a&&a.flush()),n$({},t(p,d),{_persist:f});if(d.type===WV)l=!0;else if(d.type===HV){if(s)return n$({},p,{_persist:n$({},f,{rehydrated:!0})});if(d.key===e.key){var v=t(p,d),y=d.payload,b=n$({},!1!==r&&void 0!==y?r(y,u,v,e):v,{_persist:n$({},f,{rehydrated:!0})});return c(b)}}if(!f)return t(u,d);var x=t(p,d);return x===p?u:c(n$({},x,{_persist:f}))}}(x$.getPersistConfig({key:"root",storage:y$,rootReducer:n2,blacklist:[...J1,...e2,...t2],debounce:300}),n2),o2=function(e){var t,n=OV(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,c=void 0===l||l,u=r.preloadedState,d=void 0===u?void 0:u,h=r.enhancers,f=void 0===h?void 0:h;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=nV(i)}var p=s;"function"==typeof p&&(p=p(n));var g=oV.apply(void 0,p),m=rV;c&&(m=EV(CV({trace:!1},"object"==typeof c&&c)));var v=[g];return Array.isArray(f)?v=mV([g],f):"function"==typeof f&&(v=f(v)),tV(t,d,m.apply(void 0,v))}({reducer:r2,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Q1()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var i2={exports:{}},a2={},s2=a.exports;var l2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},c2=s2.useState,u2=s2.useEffect,d2=s2.useLayoutEffect,h2=s2.useDebugValue;function f2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!l2(e,n)}catch(nue){return!0}}var p2="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=c2({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return d2((function(){o.value=n,o.getSnapshot=t,f2(o)&&i({inst:o})}),[e,n,t]),u2((function(){return f2(o)&&i({inst:o}),e((function(){f2(o)&&i({inst:o})}))}),[e]),h2(n),n};a2.useSyncExternalStore=void 0!==s2.useSyncExternalStore?s2.useSyncExternalStore:p2,function(e){e.exports=a2}(i2);var g2={exports:{}},m2={},v2=a.exports,y2=i2.exports;var b2="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},x2=y2.useSyncExternalStore,w2=v2.useRef,k2=v2.useEffect,S2=v2.useMemo,C2=v2.useDebugValue;m2.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=w2(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=S2((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,b2(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var s=x2(e,i[0],i[1]);return k2((function(){a.hasValue=!0,a.value=s}),[s]),C2(s),s},function(e){e.exports=m2}(g2);let _2=function(e){e()};const E2=()=>_2,P2=a.exports.createContext(null);function L2(){return a.exports.useContext(P2)}let O2=()=>{throw new Error("uSES not initialized!")};const M2=(e,t)=>e===t;function T2(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(e,n=M2){const{store:r,subscription:o,getServerState:i}=t(),s=O2(o.addNestedSub,r.getState,i||r.getState,e,n);return a.exports.useDebugValue(s),s}}const A2=T2();var I2,R2={},N2=Symbol.for("react.element"),D2=Symbol.for("react.portal"),z2=Symbol.for("react.fragment"),B2=Symbol.for("react.strict_mode"),j2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),H2=Symbol.for("react.context"),W2=Symbol.for("react.server_context"),V2=Symbol.for("react.forward_ref"),$2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),G2=Symbol.for("react.memo"),q2=Symbol.for("react.lazy"),Y2=Symbol.for("react.offscreen");function Z2(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N2:switch(e=e.type){case z2:case j2:case B2:case $2:case U2:return e;default:switch(e=e&&e.$$typeof){case W2:case H2:case V2:case q2:case G2:case F2:return e;default:return t}}case D2:return t}}}I2=Symbol.for("react.module.reference"),R2.ContextConsumer=H2,R2.ContextProvider=F2,R2.Element=N2,R2.ForwardRef=V2,R2.Fragment=z2,R2.Lazy=q2,R2.Memo=G2,R2.Portal=D2,R2.Profiler=j2,R2.StrictMode=B2,R2.Suspense=$2,R2.SuspenseList=U2,R2.isAsyncMode=function(){return!1},R2.isConcurrentMode=function(){return!1},R2.isContextConsumer=function(e){return Z2(e)===H2},R2.isContextProvider=function(e){return Z2(e)===F2},R2.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N2},R2.isForwardRef=function(e){return Z2(e)===V2},R2.isFragment=function(e){return Z2(e)===z2},R2.isLazy=function(e){return Z2(e)===q2},R2.isMemo=function(e){return Z2(e)===G2},R2.isPortal=function(e){return Z2(e)===D2},R2.isProfiler=function(e){return Z2(e)===j2},R2.isStrictMode=function(e){return Z2(e)===B2},R2.isSuspense=function(e){return Z2(e)===$2},R2.isSuspenseList=function(e){return Z2(e)===U2},R2.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===z2||e===j2||e===B2||e===$2||e===U2||e===Y2||"object"==typeof e&&null!==e&&(e.$$typeof===q2||e.$$typeof===G2||e.$$typeof===F2||e.$$typeof===H2||e.$$typeof===V2||e.$$typeof===I2||void 0!==e.getModuleId)},R2.typeOf=Z2,function(e){e.exports=R2}({exports:{}});const X2={notify(){},get:()=>[]};function K2(e,t){let n,r=X2;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=E2();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=X2)},getListeners:()=>r};return a}const Q2=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?a.exports.useLayoutEffect:a.exports.useEffect;function J2({store:e,context:t,children:n,serverState:r}){const o=a.exports.useMemo((()=>{const t=K2(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=a.exports.useMemo((()=>e.getState()),[e]);Q2((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);return ld((t||P2).Provider,{value:o,children:n})}function e5(e=P2){const t=e===P2?L2:()=>a.exports.useContext(e);return function(){const{store:e}=t();return e}}const t5=e5();function n5(e=P2){const t=e===P2?t5:e5(e);return function(){return t().dispatch}}const r5=n5();var o5;function i5(e){return i5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i5(e)}function a5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s5(e,t){for(var n=0;n{O2=e})(g2.exports.useSyncExternalStoreWithSelector),o5=$.exports.unstable_batchedUpdates,_2=o5;var f5=function(e){function t(){var e,n;a5(this,t);for(var r=arguments.length,o=new Array(r),i=0;ild(CI,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:ld(hT,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),m5=r5,v5=A2,y5=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),b5=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=v5(y5),o=t?Math.round(100*t/n):0;return ld(eF,{value:o,isIndeterminate:e&&!r,className:"progress-bar"})};var x5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w5=H.createContext&&H.createContext(x5),k5=globalThis&&globalThis.__assign||function(){return k5=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:o,asCheckbox:i,isChecked:a,...s}=e;return ld(YH,{label:n,hasArrow:!0,...o,...o?.placement?{placement:o.placement}:{placement:"top"},children:ld(zT,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":i,"data-selected":void 0!==a?a:void 0,...s})})}));function S3(e){const{title:t,hotkey:n,description:r}=e;return cd("div",{className:"hotkey-modal-item",children:[cd("div",{className:"hotkey-info",children:[ld("p",{className:"hotkey-title",children:t}),r&&ld("p",{className:"hotkey-description",children:r})]}),ld("div",{className:"hotkey-key",children:n})]})}function C3({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY(),i=[{title:o("hotkeys:invoke.title"),desc:o("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys:cancel.title"),desc:o("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys:focusPrompt.title"),desc:o("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys:toggleOptions.title"),desc:o("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys:pinOptions.title"),desc:o("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys:toggleViewer.title"),desc:o("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys:toggleGallery.title"),desc:o("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys:maximizeWorkSpace.title"),desc:o("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys:changeTabs.title"),desc:o("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys:consoleToggle.title"),desc:o("hotkeys:consoleToggle.desc"),hotkey:"`"}],s=[{title:o("hotkeys:setPrompt.title"),desc:o("hotkeys:setPrompt.desc"),hotkey:"P"},{title:o("hotkeys:setSeed.title"),desc:o("hotkeys:setSeed.desc"),hotkey:"S"},{title:o("hotkeys:setParameters.title"),desc:o("hotkeys:setParameters.desc"),hotkey:"A"},{title:o("hotkeys:restoreFaces.title"),desc:o("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys:upscale.title"),desc:o("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys:showInfo.title"),desc:o("hotkeys:showInfo.desc"),hotkey:"I"},{title:o("hotkeys:sendToImageToImage.title"),desc:o("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys:deleteImage.title"),desc:o("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys:closePanels.title"),desc:o("hotkeys:closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys:previousImage.title"),desc:o("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextImage.title"),desc:o("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:toggleGalleryPin.title"),desc:o("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys:increaseGalleryThumbSize.title"),desc:o("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys:decreaseGalleryThumbSize.title"),desc:o("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],c=[{title:o("hotkeys:selectBrush.title"),desc:o("hotkeys:selectBrush.desc"),hotkey:"B"},{title:o("hotkeys:selectEraser.title"),desc:o("hotkeys:selectEraser.desc"),hotkey:"E"},{title:o("hotkeys:decreaseBrushSize.title"),desc:o("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys:increaseBrushSize.title"),desc:o("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys:decreaseBrushOpacity.title"),desc:o("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys:increaseBrushOpacity.title"),desc:o("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys:moveTool.title"),desc:o("hotkeys:moveTool.desc"),hotkey:"V"},{title:o("hotkeys:fillBoundingBox.title"),desc:o("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys:eraseBoundingBox.title"),desc:o("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys:colorPicker.title"),desc:o("hotkeys:colorPicker.desc"),hotkey:"C"},{title:o("hotkeys:toggleSnap.title"),desc:o("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys:quickToggleMove.title"),desc:o("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys:toggleLayer.title"),desc:o("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys:clearMask.title"),desc:o("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys:hideMask.title"),desc:o("hotkeys:hideMask.desc"),hotkey:"H"},{title:o("hotkeys:showHideBoundingBox.title"),desc:o("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys:mergeVisible.title"),desc:o("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys:saveToGallery.title"),desc:o("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys:copyToClipboard.title"),desc:o("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys:downloadImage.title"),desc:o("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys:undoStroke.title"),desc:o("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys:redoStroke.title"),desc:o("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys:resetView.title"),desc:o("hotkeys:resetView.desc"),hotkey:"R"},{title:o("hotkeys:previousStagingImage.title"),desc:o("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys:nextStagingImage.title"),desc:o("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys:acceptStagingImage.title"),desc:o("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=e=>{const t=[];return e.forEach(((e,n)=>{t.push(ld(S3,{title:e.title,description:e.desc,hotkey:e.hotkey},n))})),ld("div",{className:"hotkey-modal-category",children:t})};return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,children:[ld(GB,{}),cd(WB,{className:" modal hotkeys-modal",children:[ld(DB,{className:"modal-close-btn"}),ld("h1",{children:"Keyboard Shorcuts"}),ld("div",{className:"hotkeys-modal-items",children:cd(uT,{allowMultiple:!0,children:[cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:appHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(i)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:generalHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(s)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:galleryHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(l)})]}),cd(lT,{children:[cd(nT,{className:"hotkeys-modal-button",children:[ld("h2",{children:o("hotkeys:unifiedCanvasHotkeys")}),ld(sT,{})]}),ld(cT,{children:u(c)})]})]})})]})]})]})}const _3=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:i,styleClass:a,...s}=e;return cd(GT,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...o,children:[ld(eA,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...i,children:t}),ld(nH,{className:"invokeai__switch-root",...s})]})},E3=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:i,size:a="sm",fontSize:s="sm",styleClass:l,...c}=e;return cd(GT,{isDisabled:n,className:`invokeai__select ${l}`,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.cancelBubble=!0},children:[t&&ld(eA,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),ld(YH,{label:o,...i,children:ld(rF,{className:"invokeai__select-picker",fontSize:s,size:a,...c,children:r.map((e=>"string"==typeof e||"number"==typeof e?ld("option",{value:e,className:"invokeai__select-option",children:e},e):ld("option",{value:e.value,className:"invokeai__select-option",children:e.key},e.value)))})})]})},P3=/^-?(0\.)?\.?$/,L3=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:o=!1,showStepper:i=!0,width:s,textAlign:l,isInvalid:c,value:u,onChange:d,min:h,max:f,isInteger:p=!0,formControlProps:g,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:b,...x}=e,[w,k]=a.exports.useState(String(u));a.exports.useEffect((()=>{w.match(P3)||u===Number(w)||k(String(u))}),[u,w]);return ld(YH,{...b,children:cd(GT,{isDisabled:o,isInvalid:c,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&ld(eA,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...m,children:t}),cd(fj,{className:"invokeai__number-input-root",value:w,min:h,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:e=>{k(e),e.match(P3)||d(p?Math.floor(Number(e)):Number(e))},onBlur:e=>{const t=TU.clamp(p?Math.floor(Number(e.target.value)):Number(e.target.value),h,f);k(String(t)),d(t)},width:s,...x,children:[ld(gj,{className:"invokeai__number-input-field",textAlign:l,...v}),i&&cd("div",{className:"invokeai__number-input-stepper",children:[ld(yj,{...y,className:"invokeai__number-input-stepper-button"}),ld(vj,{...y,className:"invokeai__number-input-stepper-button"})]})]})]})})},O3=e=>e.system,M3=e=>e.system.toastQueue,T3=uV((e=>e.options),(e=>P$[e.activeTab]),{memoizeOptions:{equalityCheck:TU.isEqual}});uV((e=>e.options),(e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});const A3=e=>e.options,I3=uV([O3,A3],((e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:i,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:TU.map(i,((e,t)=>t)),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),R3=({children:e})=>{const t=m5(),{t:n}=FY(),r=v5((e=>e.options.steps)),{isOpen:o,onOpen:i,onClose:s}=QA(),{isOpen:l,onOpen:c,onClose:u}=QA(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:f,saveIntermediatesInterval:p,enableImageDebugging:g,shouldUseCanvasBetaLayout:m}=v5(I3);return cd(sd,{children:[a.exports.cloneElement(e,{onClick:i}),cd(RB,{isOpen:o,onClose:s,size:"lg",children:[ld(GB,{}),cd(WB,{className:"modal settings-modal",children:[ld($B,{className:"settings-modal-header",children:n("common:settingsLabel")}),ld(DB,{className:"modal-close-btn"}),cd(NB,{className:"settings-modal-content",children:[cd("div",{className:"settings-modal-items",children:[cd("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[ld(E3,{label:n("settings:displayInProgress"),validValues:FQ,value:d,onChange:e=>t(WY(e.target.value))}),"full-res"===d&&ld(L3,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:e=>{e>r&&(e=r),e<1&&(e=1),t(aZ(e))},value:p,width:"auto",textAlign:"center"})]}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:e=>t(YY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:f,onChange:e=>t(JY(e.target.checked))}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:m,onChange:e=>t(PU(e.target.checked))})]}),cd("div",{className:"settings-modal-items",children:[ld("h2",{style:{fontWeight:"bold"},children:"Developer"}),ld(_3,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:g,onChange:e=>t(sZ(e.target.checked))})]}),cd("div",{className:"settings-modal-reset",children:[ld(LI,{size:"md",children:n("settings:resetWebUI")}),ld(RT,{colorScheme:"red",onClick:()=>{p5.purge().then((()=>{s(),c()}))},children:n("settings:resetWebUI")}),ld(VI,{children:n("settings:resetWebUIDesc1")}),ld(VI,{children:n("settings:resetWebUIDesc2")})]})]}),ld(VB,{children:ld(RT,{onClick:s,className:"modal-close-btn",children:n("common:close")})})]})]}),cd(RB,{closeOnOverlayClick:!1,isOpen:l,onClose:u,isCentered:!0,children:[ld(GB,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),ld(WB,{children:ld(NB,{pb:6,pt:6,children:ld(CI,{justifyContent:"center",children:ld(VI,{fontSize:"lg",children:ld(VI,{children:n("settings:resetComplete")})})})})})]})]})},N3=uV((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:MU.exports.isEqual}}),D3=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:i,wasErrorSeen:a}=v5(N3),s=m5(),{t:l}=FY();let c;c=e&&!i?"status-good":"status-bad";let u=o;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(u)&&(c="status-working"),u&&t&&r>1&&(u=l(u)+` (${n}/${r})`);return ld(YH,{label:i&&!a?"Click to clear, check logs for details":void 0,children:ld(VI,{cursor:i&&!a?"pointer":"initial",onClick:()=>{!i&&a||s(nZ())},className:`status ${c}`,children:l(u)})})},z3=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:o=!0,...i}=e;return cd(Aj,{...i,children:[ld(Wj,{children:t}),cd(Fj,{className:`invokeai__popover-content ${r}`,children:[o&&ld(Ij,{className:"invokeai__popover-arrow"}),n]})]})},B3=ok(((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,styleClass:i,...a}=e;return ld(YH,{label:r,...o,children:ld(RT,{ref:t,className:["invokeai__button",i].join(" "),...a,children:n})})}));function j3(){const{t:e}=FY(),{setColorMode:t,colorMode:n}=dd(),r=m5(),o=v5((e=>e.options.currentTheme)),i={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};a.exports.useEffect((()=>{n!==o&&t(o)}),[t,n,o]);return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(o3,{})}),children:ld(WI,{align:"stretch",children:(()=>{const e=[];return Object.keys(i).forEach((t=>{e.push(ld(B3,{style:{width:"6rem"},leftIcon:o===t?ld(z5,{}):void 0,size:"sm",onClick:()=>(e=>{r(j$(e))})(t),children:i[t]},t))})),e})()})})}const F3=uV([O3],(e=>{const{isProcessing:t,model_list:n}=e,r=TU.map(n,((e,t)=>t)),o=TU.reduce(n,((e,t,n)=>("active"===t.status&&(e=n),e)),"");return{models:r,activeModel:o,isProcessing:t,activeDesc:n[o].description}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),H3=()=>{const e=m5(),{models:t,activeModel:n,isProcessing:r,activeDesc:o}=v5(F3);return ld(CI,{style:{paddingLeft:"0.3rem"},children:ld(E3,{style:{fontSize:"0.8rem"},tooltip:o,isDisabled:r,value:n,validValues:t,onChange:t=>{e(TQ(t.target.value))}})})};function W3(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:o="sm",width:i,size:a="sm",isInvalid:s,...l}=e;return cd(GT,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[""!==t&&ld(eA,{fontSize:o,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),ld(eI,{...l,className:"input-entry",size:a,width:i})]})}var V3=Array.isArray,$3=Object.keys,U3=Object.prototype.hasOwnProperty,G3="undefined"!=typeof Element;function q3(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,o,i=V3(e),a=V3(t);if(i&&a){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!q3(e[n],t[n]))return!1;return!0}if(i!=a)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!=u)return!1;if(c&&u)return e.toString()==t.toString();var d=$3(e);if((r=d.length)!==$3(t).length)return!1;for(n=r;0!=n--;)if(!U3.call(t,d[n]))return!1;if(G3&&e instanceof Element&&t instanceof Element)return e===t;for(n=r;0!=n--;)if(!("_owner"===(o=d[n])&&e.$$typeof||q3(e[o],t[o])))return!1;return!0}return e!=e&&t!=t}var Y3=function(e,t){try{return q3(e,t)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}},Z3=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===X3}(e)}(e)};var X3="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function K3(e,t){return!1!==t.clone&&t.isMergeableObject(e)?J3((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Q3(e,t,n){return e.concat(t).map((function(e){return K3(e,n)}))}function J3(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Q3,n.isMergeableObject=n.isMergeableObject||Z3;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=K3(e[t],n)})),Object.keys(t).forEach((function(o){n.isMergeableObject(t[o])&&e[o]?r[o]=J3(e[o],t[o],n):r[o]=K3(t[o],n)})),r}(e,t,n):K3(t,n)}J3.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return J3(e,n,t)}),{})};var e4=J3;const t4="object"==typeof global&&global&&global.Object===Object&&global;var n4="object"==typeof self&&self&&self.Object===Object&&self;const r4=t4||n4||Function("return this")();const o4=r4.Symbol;var i4=Object.prototype,a4=i4.hasOwnProperty,s4=i4.toString,l4=o4?o4.toStringTag:void 0;var c4=Object.prototype.toString;var u4=o4?o4.toStringTag:void 0;function d4(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u4&&u4 in Object(e)?function(e){var t=a4.call(e,l4),n=e[l4];try{e[l4]=void 0;var r=!0}catch(B2){}var o=s4.call(e);return r&&(t?e[l4]=n:delete e[l4]),o}(e):function(e){return c4.call(e)}(e)}function h4(e,t){return function(n){return e(t(n))}}const f4=h4(Object.getPrototypeOf,Object);function p4(e){return null!=e&&"object"==typeof e}var g4=Function.prototype,m4=Object.prototype,v4=g4.toString,y4=m4.hasOwnProperty,b4=v4.call(Object);function x4(e){if(!p4(e)||"[object Object]"!=d4(e))return!1;var t=f4(e);if(null===t)return!0;var n=y4.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&v4.call(n)==b4}function w4(e,t){return e===t||e!=e&&t!=t}function k4(e,t){for(var n=e.length;n--;)if(w4(e[n][0],t))return n;return-1}var S4=Array.prototype.splice;function C4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},C4.prototype.set=function(e,t){var n=this.__data__,r=k4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function E4(e){if(!_4(e))return!1;var t=d4(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}const P4=r4["__core-js_shared__"];var L4,O4=(L4=/[^.]+$/.exec(P4&&P4.keys&&P4.keys.IE_PROTO||""))?"Symbol(src)_1."+L4:"";var M4=Function.prototype.toString;function T4(e){if(null!=e){try{return M4.call(e)}catch(B2){}try{return e+""}catch(B2){}}return""}var A4=/^\[object .+?Constructor\]$/,I4=Function.prototype,R4=Object.prototype,N4=I4.toString,D4=R4.hasOwnProperty,z4=RegExp("^"+N4.call(D4).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B4(e){return!(!_4(e)||(t=e,O4&&O4 in t))&&(E4(e)?z4:A4).test(T4(e));var t}function j4(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B4(n)?n:void 0}const F4=j4(r4,"Map");const H4=j4(Object,"create");var W4=Object.prototype.hasOwnProperty;var V4=Object.prototype.hasOwnProperty;function $4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var f6={};function p6(e){return function(t){return e(t)}}f6["[object Float32Array]"]=f6["[object Float64Array]"]=f6["[object Int8Array]"]=f6["[object Int16Array]"]=f6["[object Int32Array]"]=f6["[object Uint8Array]"]=f6["[object Uint8ClampedArray]"]=f6["[object Uint16Array]"]=f6["[object Uint32Array]"]=!0,f6["[object Arguments]"]=f6["[object Array]"]=f6["[object ArrayBuffer]"]=f6["[object Boolean]"]=f6["[object DataView]"]=f6["[object Date]"]=f6["[object Error]"]=f6["[object Function]"]=f6["[object Map]"]=f6["[object Number]"]=f6["[object Object]"]=f6["[object RegExp]"]=f6["[object Set]"]=f6["[object String]"]=f6["[object WeakMap]"]=!1;var g6="object"==typeof t&&t&&!t.nodeType&&t,m6=g6&&"object"==typeof n&&n&&!n.nodeType&&n,v6=m6&&m6.exports===g6&&t4.process,y6=function(){try{var e=m6&&m6.require&&m6.require("util").types;return e||v6&&v6.binding&&v6.binding("util")}catch(B2){}}();const b6=y6;var x6=b6&&b6.isTypedArray,w6=x6?p6(x6):function(e){return p4(e)&&h6(e.length)&&!!f6[d4(e)]};const k6=w6;var S6=Object.prototype.hasOwnProperty;function C6(e,t){var n=i6(e),r=!n&&o6(e),o=!n&&!r&&c6(e),i=!n&&!r&&!o&&k6(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function q7(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Y7=function(e){return Array.isArray(e)&&0===e.length},Z7=function(e){return"function"==typeof e},X7=function(e){return null!==e&&"object"==typeof e},K7=function(e){return String(Math.floor(Number(e)))===e},Q7=function(e){return"[object String]"===Object.prototype.toString.call(e)},J7=function(e){return 0===a.exports.Children.count(e)},e9=function(e){return X7(e)&&Z7(e.then)};function t9(e,t,n,r){void 0===r&&(r=0);for(var o=V7(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function r9(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;t9(t,a.path)||(t=n9(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),_=a.exports.useCallback((function(e,t){return new Promise((function(n){return n(b.current[e].validate(t))}))}),[]),E=a.exports.useCallback((function(e){var t=Object.keys(b.current).filter((function(e){return Z7(b.current[e].validate)})),n=t.length>0?t.map((function(t){return _(t,t9(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=n9(e,t[r],n)),e}),{})}))}),[_]),P=a.exports.useCallback((function(e){return Promise.all([E(e),f.validationSchema?C(e):{},f.validate?S(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return e4.all([t,n,r],{arrayMerge:f9})}))}),[f.validate,f.validationSchema,E,S,C]),L=g9((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),P(e).then((function(e){return y.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));a.exports.useEffect((function(){s&&!0===y.current&&Y3(p.current,f.initialValues)&&L(p.current)}),[s,L]);var O=a.exports.useCallback((function(e){var t=e&&e.values?e.values:p.current,n=e&&e.errors?e.errors:g.current?g.current:f.initialErrors||{},r=e&&e.touched?e.touched:m.current?m.current:f.initialTouched||{},o=e&&e.status?e.status:v.current?v.current:f.initialStatus;p.current=t,g.current=n,m.current=r,v.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);e9(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);a.exports.useEffect((function(){!0!==y.current||Y3(p.current,f.initialValues)||(u&&(p.current=f.initialValues,O()),s&&L(p.current))}),[u,f.initialValues,O,s,L]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(g.current,f.initialErrors)&&(g.current=f.initialErrors||l9,k({type:"SET_ERRORS",payload:f.initialErrors||l9}))}),[u,f.initialErrors]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(m.current,f.initialTouched)&&(m.current=f.initialTouched||c9,k({type:"SET_TOUCHED",payload:f.initialTouched||c9}))}),[u,f.initialTouched]),a.exports.useEffect((function(){u&&!0===y.current&&!Y3(v.current,f.initialStatus)&&(v.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var M=g9((function(e){if(b.current[e]&&Z7(b.current[e].validate)){var t=t9(w.values,e),n=b.current[e].validate(t);return e9(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),C(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),T=a.exports.useCallback((function(e,t){var n=t.validate;b.current[e]={validate:n}}),[]),A=a.exports.useCallback((function(e){delete b.current[e]}),[]),I=g9((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?L(w.values):Promise.resolve()})),R=a.exports.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),N=g9((function(e,t){var r=Z7(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?L(r):Promise.resolve()})),D=a.exports.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),z=g9((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?L(n9(w.values,e,t)):Promise.resolve()})),B=a.exports.useCallback((function(e,t){var n,r=t,o=e;if(!Q7(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,c=i.value,u=i.checked,d=(i.outerHTML,i.options),h=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(t9(w.values,r),u,c):d&&h?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):c}r&&z(r,o)}),[z,w.values]),j=g9((function(e){if(Q7(e))return function(t){return B(t,e)};B(e)})),F=g9((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?L(w.values):Promise.resolve()})),H=a.exports.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));F(i,!0)}),[F]),W=g9((function(e){if(Q7(e))return function(t){return H(t,e)};H(e)})),V=a.exports.useCallback((function(e){Z7(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),$=a.exports.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=a.exports.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=g9((function(){return k({type:"SUBMIT_ATTEMPT"}),L().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return y.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(y.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(y.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:O,validateForm:L,validateField:M,setErrors:R,setFieldError:D,setFieldTouched:F,setFieldValue:z,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,setFormikState:V,submitForm:G},Z=g9((function(){return d(w.values,Y)})),X=g9((function(e){e&&e.preventDefault&&Z7(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Z7(e.stopPropagation)&&e.stopPropagation(),O()})),K=a.exports.useCallback((function(e){return{value:t9(w.values,e),error:t9(w.errors,e),touched:!!t9(w.touched,e),initialValue:t9(p.current,e),initialTouched:!!t9(m.current,e),initialError:t9(g.current,e)}}),[w.errors,w.touched,w.values]),Q=a.exports.useCallback((function(e){return{setValue:function(t,n){return z(e,t,n)},setTouched:function(t,n){return F(e,t,n)},setError:function(t){return D(e,t)}}}),[z,F,D]),J=a.exports.useCallback((function(e){var t=X7(e),n=t?e.name:e,r=t9(w.values,n),o={name:n,value:r,onChange:j,onBlur:W};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[W,j,w.values]),ee=a.exports.useMemo((function(){return!Y3(p.current,w.values)}),[p.current,w.values]),te=a.exports.useMemo((function(){return void 0!==l?ee?w.errors&&0===Object.keys(w.errors).length:!1!==l&&Z7(l)?l(f):l:w.errors&&0===Object.keys(w.errors).length}),[l,ee,w.errors,f]);return U7({},w,{initialValues:p.current,initialErrors:g.current,initialTouched:m.current,initialStatus:v.current,handleBlur:W,handleChange:j,handleReset:X,handleSubmit:q,resetForm:O,setErrors:R,setFormikState:V,setFieldTouched:F,setFieldValue:z,setFieldError:D,setStatus:$,setSubmitting:U,setTouched:I,setValues:N,submitForm:G,validateForm:L,validateField:M,isValid:te,dirty:ee,unregisterField:A,registerField:T,getFieldProps:J,getFieldMeta:K,getFieldHelpers:Q,validateOnBlur:o,validateOnChange:n,validateOnMount:s})}function d9(e){var t=u9(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return a.exports.useImperativeHandle(i,(function(){return t})),a.exports.createElement(i9,{value:t},n?a.exports.createElement(n,t):o?o(t):r?Z7(r)?r(t):J7(r)?null:a.exports.Children.only(r):null)}function h9(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||x4(e)?h9(e):""!==e?e:void 0})):x4(e[r])?t[r]=h9(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function f9(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?e4(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=e4(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var p9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?a.exports.useLayoutEffect:a.exports.useEffect;function g9(e){var t=a.exports.useRef(e);return p9((function(){t.current=e})),a.exports.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(U7({},e,{length:t+1}))}return[]},b9=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=n9(n.values,i,e(t9(n.values,i))),l=r?o(t9(n.errors,i)):void 0,c=t?a(t9(n.touched,i)):void 0;return Y7(l)&&(l=void 0),Y7(c)&&(c=void 0),U7({},n,{values:s,errors:r?n9(n.errors,i,l):n.errors,touched:t?n9(n.touched,i,c):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(y9(t),[$7(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return v9(n,e,t)}),(function(t){return v9(t,e,null)}),(function(t){return v9(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=y9(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(q7(n)),n.pop=n.pop.bind(q7(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Y3(t9(e.formik.values,e.name),t9(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?y9(n):[];return t||(t=r[e]),Z7(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,s=U7({},e,{form:G7(t.formik,["validate","validationSchema"]),name:i});return n?a.exports.createElement(n,s):r?r(s):o?"function"==typeof o?o(s):J7(o)?null:a.exports.Children.only(o):null},r}(a.exports.Component);b9.defaultProps={validateOnChange:!0};const x9=uV([O3],(e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function w9(){const{openModel:e,model_list:t}=v5(x9),n=v5((e=>e.system.isProcessing)),r=m5(),{t:o}=FY(),[i,s]=a.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});a.exports.useEffect((()=>{if(e){const n=TU.pickBy(t,((t,n)=>TU.isEqual(n,e)));s({name:e,description:n[e]?.description,config:n[e]?.config,weights:n[e]?.weights,vae:n[e]?.vae,width:n[e]?.width,height:n[e]?.height,default:n[e]?.default})}}),[t,e]);return e?cd(CI,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[ld(CI,{alignItems:"center",children:ld(VI,{fontSize:"lg",fontWeight:"bold",children:e})}),ld(CI,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:ld(d9,{enableReinitialize:!0,initialValues:i,onSubmit:e=>{r(OQ(e))},children:({handleSubmit:e,errors:t,touched:r})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",alignItems:"start",children:[cd(GT,{isInvalid:!!t.description&&r.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"lg"}),t.description&&r.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&r.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"lg"}),t.config&&r.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&r.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"lg"}),t.weights&&r.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&r.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"lg"}),t.vae&&r.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&r.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&r.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&r.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&r.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelmanager:updateModel")})]})})})})]}):ld(CI,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:ld(VI,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const k9=e=>{const{label:t,styleClass:n,...r}=e;return ld(TA,{className:`invokeai__checkbox ${n}`,...r,children:t})};function S9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function C9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function _9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function E9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function P9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function L9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function O9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function M9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function T9(e){return _5({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 A9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function I9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function R9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function N9(e){return _5({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const D9=uV([O3],(e=>{const{model_list:t}=e,n=[];return TU.forEach(t,(e=>{n.push(e.weights)})),n}));function z9(){const{t:e}=FY();return ld(mI,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function B9({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=v5(D9);return cd(mI,{position:"relative",children:[r.includes(e.location)?ld(z9,{}):null,ld(k9,{value:e.name,label:ld(sd,{children:cd(WI,{alignItems:"start",children:[ld("p",{style:{fontWeight:"bold"},children:e.name}),ld("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:e=>{t.includes(e.target.value)?n(TU.remove(t,(t=>t!==e.target.value))):n([...t,e.target.value])},padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function j9(){const e=m5(),{t:t}=FY(),n=v5((e=>e.system.searchFolder)),r=v5((e=>e.system.foundModels)),o=v5(D9),i=v5((e=>e.options.shouldShowExistingModelsInSearch)),a=v5((e=>e.system.isProcessing)),[s,l]=H.useState([]);return cd(sd,{children:[n?cd(CI,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),ld("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),ld(k3,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:ld(T9,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(LQ(n))}),ld(k3,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:ld(a3,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:()=>{e(hZ(null)),e(fZ(null)),l([])}})]}):ld(d9,{initialValues:{checkpointFolder:""},onSubmit:t=>{(t=>{e(LQ(t.checkpointFolder))})(t)},children:({handleSubmit:e})=>ld("form",{onSubmit:e,children:cd(HI,{columnGap:"0.5rem",children:[ld(GT,{isRequired:!0,width:"max-content",children:ld(m9,{as:W3,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),ld(k3,{icon:ld(S9,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&cd(CI,{flexDirection:"column",rowGap:"1rem",children:[cd(CI,{justifyContent:"space-between",alignItems:"center",children:[cd("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),cd("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),cd(CI,{columnGap:"0.5rem",justifyContent:"space-between",children:[cd(CI,{columnGap:"0.5rem",children:[ld(B3,{isDisabled:s.length===r.length,onClick:()=>{l([]),r&&r.forEach((e=>{o.includes(e.location)||l((t=>[...t,e.name]))}))},children:t("modelmanager:selectAll")}),ld(B3,{isDisabled:0===s.length,onClick:()=>{l([])},children:t("modelmanager:deselectAll")}),ld(k9,{label:t("modelmanager:showExisting"),isChecked:i,onChange:()=>e(LU(!i))})]}),ld(B3,{isDisabled:0===s.length,onClick:()=>{const t=r?.filter((e=>s.includes(e.name)));t?.forEach((t=>{const n={name:t.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:t.location,vae:"",width:512,height:512,default:!1};e(OQ(n))})),l([])},backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),cd(CI,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?0===s.length&&ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):ld(VI,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),(()=>{const e=[],t=[];return r&&r.forEach(((n,r)=>{o.includes(n.location)?t.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r)):e.push(ld(B9,{model:n,modelsToAdd:s,setModelsToAdd:l},r))})),cd(sd,{children:[e,i&&t]})})()]})]})]})}function F9(){const{isOpen:e,onOpen:t,onClose:n}=QA(),r=m5(),{t:o}=FY(),i=v5((e=>e.system.isProcessing));function a(e){let t;return function(e){return/\\s/g.test(e)}(e)&&(t=o("modelmanager:cannotUseSpaces")),t}const[s,l]=H.useState(!1);return cd(sd,{children:[ld(B3,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:cd(CI,{columnGap:"0.5rem",alignItems:"center",children:[ld(a3,{}),o("modelmanager:addNew")]})}),cd(RB,{isOpen:e,onClose:()=>{n()},size:"3xl",closeOnOverlayClick:!1,children:[ld(GB,{}),cd(WB,{className:"modal add-model-modal",children:[ld($B,{children:o("modelmanager:addNewModel")}),ld(DB,{}),cd(NB,{className:"add-model-modal-body",children:[ld(j9,{}),ld(k9,{label:o("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&ld(d9,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},onSubmit:e=>{r(OQ(e)),n()},children:({handleSubmit:e,errors:t,touched:n})=>ld("form",{onSubmit:e,children:cd(WI,{rowGap:"0.5rem",children:[ld(VI,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:o("modelmanager:manual")}),cd(GT,{isInvalid:!!t.name&&n.name,isRequired:!0,children:[ld(eA,{htmlFor:"name",fontSize:"sm",children:o("modelmanager:name")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"name",name:"name",type:"text",validate:a,width:"2xl"}),t.name&&n.name?ld(QT,{children:t.name}):ld(qT,{margin:0,children:o("modelmanager:nameValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.description&&n.description,isRequired:!0,children:[ld(eA,{htmlFor:"description",fontSize:"sm",children:o("modelmanager:description")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"description",name:"description",type:"text",width:"2xl"}),t.description&&n.description?ld(QT,{children:t.description}):ld(qT,{margin:0,children:o("modelmanager:descriptionValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.config&&n.config,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:config")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"config",name:"config",type:"text",width:"2xl"}),t.config&&n.config?ld(QT,{children:t.config}):ld(qT,{margin:0,children:o("modelmanager:configValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.weights&&n.weights,isRequired:!0,children:[ld(eA,{htmlFor:"config",fontSize:"sm",children:o("modelmanager:modelLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"weights",name:"weights",type:"text",width:"2xl"}),t.weights&&n.weights?ld(QT,{children:t.weights}):ld(qT,{margin:0,children:o("modelmanager:modelLocationValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.vae&&n.vae,children:[ld(eA,{htmlFor:"vae",fontSize:"sm",children:o("modelmanager:vaeLocation")}),cd(WI,{alignItems:"start",children:[ld(m9,{as:W3,id:"vae",name:"vae",type:"text",width:"2xl"}),t.vae&&n.vae?ld(QT,{children:t.vae}):ld(qT,{margin:0,children:o("modelmanager:vaeLocationValidationMsg")})]})]}),cd(HI,{width:"100%",children:[cd(GT,{isInvalid:!!t.width&&n.width,children:[ld(eA,{htmlFor:"width",fontSize:"sm",children:o("modelmanager:width")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"width",name:"width",children:({field:e,form:t})=>ld(L3,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:t.values.width,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.width&&n.width?ld(QT,{children:t.width}):ld(qT,{margin:0,children:o("modelmanager:widthValidationMsg")})]})]}),cd(GT,{isInvalid:!!t.height&&n.height,children:[ld(eA,{htmlFor:"height",fontSize:"sm",children:o("modelmanager:height")}),cd(WI,{alignItems:"start",children:[ld(m9,{id:"height",name:"height",children:({field:e,form:t})=>ld(L3,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:t.values.height,onChange:n=>t.setFieldValue(e.name,Number(n))})}),t.height&&n.height?ld(QT,{children:t.height}):ld(qT,{margin:0,children:o("modelmanager:heightValidationMsg")})]})]})]}),ld(B3,{type:"submit",className:"modal-close-btn",isLoading:i,children:o("modelmanager:addModel")})]})})})]})]})]})]})}Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"SunIcon",path:cd("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[ld("circle",{cx:"12",cy:"12",r:"5"}),ld("path",{d:"M12 1v2"}),ld("path",{d:"M12 21v2"}),ld("path",{d:"M4.22 4.22l1.42 1.42"}),ld("path",{d:"M18.36 18.36l1.42 1.42"}),ld("path",{d:"M1 12h2"}),ld("path",{d:"M21 12h2"}),ld("path",{d:"M4.22 19.78l1.42-1.42"}),ld("path",{d:"M18.36 5.64l1.42-1.42"})]})}),Sk({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"}),Sk({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"ViewIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("circle",{cx:"12",cy:"12",r:"2"})]})}),Sk({displayName:"ViewOffIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"});var H9=Sk({displayName:"DeleteIcon",path:ld("g",{fill:"currentColor",children:ld("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"})})});Sk({displayName:"RepeatIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"RepeatClockIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})});var W9=Sk({displayName:"EditIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),ld("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});Sk({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),Sk({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),Sk({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),Sk({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Sk({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),Sk({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),Sk({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),Sk({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"}),Sk({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var V9=Sk({displayName:"ExternalLinkIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),ld("path",{d:"M15 3h6v6"}),ld("path",{d:"M10 14L21 3"})]})});Sk({displayName:"LinkIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"PlusSquareIcon",path:cd("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[ld("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),ld("path",{d:"M12 8v8"}),ld("path",{d:"M8 12h8"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"TimeIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowRightIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({displayName:"ArrowLeftIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"EmailIcon",path:cd("g",{fill:"currentColor",children:[ld("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"}),ld("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"})]})}),Sk({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"}),Sk({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"}),Sk({displayName:"SpinnerIcon",path:cd(sd,{children:[ld("defs",{children:cd("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[ld("stop",{stopColor:"currentColor",offset:"0%"}),ld("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),cd("g",{transform:"translate(2)",fill:"none",children:[ld("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),ld("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),ld("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})}),Sk({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"}),Sk({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:ld("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"})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"InfoOutlineIcon",path:cd("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[ld("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),ld("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),ld("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})}),Sk({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"}),Sk({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"}),Sk({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"}),Sk({displayName:"QuestionOutlineIcon",path:cd("g",{stroke:"currentColor",strokeWidth:"1.5",children:[ld("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"}),ld("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),ld("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})}),Sk({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"}),Sk({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"}),Sk({viewBox:"0 0 14 14",path:ld("g",{fill:"currentColor",children:ld("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})}),Sk({displayName:"MinusIcon",path:ld("g",{fill:"currentColor",children:ld("rect",{height:"4",width:"20",x:"2",y:"10"})})}),Sk({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"});const $9=ok(((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:i,children:s,title:l,triggerComponent:c}=e,{isOpen:u,onOpen:d,onClose:h}=QA(),f=a.exports.useRef(null);return cd(sd,{children:[a.exports.cloneElement(c,{onClick:d,ref:t}),ld(qB,{isOpen:u,leastDestructiveRef:f,onClose:h,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:l}),ld(NB,{children:s}),cd(VB,{children:[ld(RT,{ref:f,onClick:()=>{i&&i(),h()},className:"modal-close-btn",children:o}),ld(RT,{colorScheme:"red",onClick:()=>{r(),h()},ml:3,children:n})]})]})})})]})}));function U9(e){const{isProcessing:t,isConnected:n}=v5((e=>e.system)),r=v5((e=>e.system.openModel)),{t:o}=FY(),i=m5(),{name:a,status:s,description:l}=e,c=()=>{i(pZ(a))};return cd(CI,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[ld(mI,{onClick:c,cursor:"pointer",children:ld(YH,{label:l,hasArrow:!0,placement:"bottom",children:ld(VI,{fontWeight:"bold",children:a})})}),ld(zI,{onClick:c,cursor:"pointer"}),cd(CI,{gap:2,alignItems:"center",children:[ld(VI,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),ld(RT,{size:"sm",onClick:()=>{i(TQ(a))},isDisabled:"active"===s||t||!n,className:"modal-close-btn",children:o("modelmanager:load")}),ld(k3,{icon:ld(W9,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===s||t||!n,className:" modal-close-btn"}),ld($9,{title:o("modelmanager:deleteModel"),acceptCallback:()=>{i(MQ(a)),i(pZ(null))},acceptButtonText:o("modelmanager:delete"),triggerComponent:ld(k3,{icon:ld(H9,{}),size:"sm","aria-label":o("modelmanager:deleteConfig"),isDisabled:"active"===s||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:cd(CI,{rowGap:"1rem",flexDirection:"column",children:[ld("p",{style:{fontWeight:"bold"},children:o("modelmanager:deleteMsg1")}),ld("p",{style:{color:"var(--text-color-secondary"},children:o("modelmanager:deleteMsg2")})]})})]})]})}const G9=uV((e=>e.system),(e=>{const t=TU.map(e.model_list,((e,t)=>({name:t,...e}))),n=t.find((e=>"active"===e.status));return{models:t,activeModel:n}})),q9=()=>{const{models:e}=v5(G9),[t,n]=a.exports.useState(""),{t:r}=FY(),o=TU.debounce((e=>{n(e.target.value)}),400);return cd(CI,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[cd(CI,{justifyContent:"space-between",children:[ld(VI,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),ld(F9,{})]}),ld(W3,{onChange:o,label:r("modelmanager:search")}),ld(CI,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:(()=>{const n=[],r=[];return e.forEach(((e,o)=>{e.name.startsWith(t)&&r.push(ld(U9,{name:e.name,status:e.status,description:e.description},o)),n.push(ld(U9,{name:e.name,status:e.status,description:e.description},o))})),""!==t?r:n})()})]})};function Y9({children:e}){const{isOpen:t,onOpen:n,onClose:r}=QA(),{t:o}=FY();return cd(sd,{children:[a.exports.cloneElement(e,{onClick:n}),cd(RB,{isOpen:t,onClose:r,size:"6xl",children:[ld(GB,{}),cd(WB,{className:" modal",children:[ld(DB,{className:"modal-close-btn"}),ld($B,{children:o("modelmanager:modelManager")}),cd(CI,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[ld(q9,{}),ld(w9,{})]})]})]})]})}function Z9(){const{t:e,i18n:t}=FY(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")};return ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:ld(J5,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:ld(WI,{children:(()=>{const e=[];return Object.keys(n).forEach((r=>{e.push(ld(B3,{"data-selected":localStorage.getItem("i18nextLng")===r,onClick:()=>t.changeLanguage(r),className:"modal-close-btn lang-select-btn","aria-label":n[r],tooltip:n[r],size:"sm",minWidth:"200px",children:n[r]},r))})),e})()})})}const X9=()=>{const{t:e}=FY();return cd("div",{className:"site-header",children:[cd("div",{className:"site-header-left-side",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),cd("div",{className:"site-header-right-side",children:[ld(D3,{}),ld(H3,{}),ld(Y9,{children:ld(k3,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(H5,{})})}),ld(C3,{children:ld(k3,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:ld(Q5,{})})}),ld(j3,{}),ld(Z9,{}),ld(k3,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:ld(D5,{})})}),ld(k3,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:ld(L5,{})})}),ld(k3,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:ld(MI,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:ld(P5,{})})}),ld(R3,{children:ld(k3,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:ld(_9,{})})})]})]})};var K9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q9=globalThis&&globalThis.__assign||function(){return Q9=Object.assign||function(e){for(var t,n=1,r=arguments.length;n()=>(t||e((t={exports:{}}).exports,t),t.exports),C8=(e,t,n)=>(n=null!=e?v8(w8(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of x8(t))!k8.call(e,o)&&o!==n&&y8(e,o,{get:()=>t[o],enumerable:!(r=b8(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:y8(n,"default",{value:e,enumerable:!0}),e)),_8=S8(((e,t)=>{t.exports=function(){this.__data__=[],this.size=0}})),E8=S8(((e,t)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}})),P8=S8(((e,t)=>{var n=E8();t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}})),L8=S8(((e,t)=>{var n=P8(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=n(t,e);return!(o<0)&&(o==t.length-1?t.pop():r.call(t,o,1),--this.size,!0)}})),O8=S8(((e,t)=>{var n=P8();t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}})),M8=S8(((e,t)=>{var n=P8();t.exports=function(e){return n(this.__data__,e)>-1}})),T8=S8(((e,t)=>{var n=P8();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),A8=S8(((e,t)=>{var n=_8(),r=L8(),o=O8(),i=M8(),a=T8();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8();t.exports=function(){this.__data__=new n,this.size=0}})),R8=S8(((e,t)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}})),N8=S8(((e,t)=>{t.exports=function(e){return this.__data__.get(e)}})),D8=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),z8=S8(((e,t)=>{var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n})),B8=S8(((e,t)=>{var n=z8(),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();t.exports=o})),j8=S8(((e,t)=>{var n=B8().Symbol;t.exports=n})),F8=S8(((e,t)=>{var n=j8(),r=Object.prototype,o=r.hasOwnProperty,i=r.toString,a=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch{}var s=i.call(e);return r&&(t?e[a]=n:delete e[a]),s}})),H8=S8(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}})),W8=S8(((e,t)=>{var n=j8(),r=F8(),o=H8(),i=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):o(e)}})),V8=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}})),$8=S8(((e,t)=>{var n=W8(),r=V8();t.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}})),U8=S8(((e,t)=>{var n=B8()["__core-js_shared__"];t.exports=n})),G8=S8(((e,t)=>{var n=U8(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();t.exports=function(e){return!!r&&r in e}})),q8=S8(((e,t)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch{}try{return e+""}catch{}}return""}})),Y8=S8(((e,t)=>{var n=$8(),r=G8(),o=V8(),i=q8(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||r(e))&&(n(e)?d:a).test(i(e))}})),Z8=S8(((e,t)=>{t.exports=function(e,t){return e?.[t]}})),X8=S8(((e,t)=>{var n=Y8(),r=Z8();t.exports=function(e,t){var o=r(e,t);return n(o)?o:void 0}})),K8=S8(((e,t)=>{var n=X8()(B8(),"Map");t.exports=n})),Q8=S8(((e,t)=>{var n=X8()(Object,"create");t.exports=n})),J8=S8(((e,t)=>{var n=Q8();t.exports=function(){this.__data__=n?n(null):{},this.size=0}})),eee=S8(((e,t)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}})),tee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return r.call(t,e)?t[e]:void 0}})),nee=S8(((e,t)=>{var n=Q8(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:r.call(t,e)}})),ree=S8(((e,t)=>{var n=Q8();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}})),oee=S8(((e,t)=>{var n=J8(),r=eee(),o=tee(),i=nee(),a=ree();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=oee(),r=A8(),o=K8();t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||r),string:new n}}})),aee=S8(((e,t)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}})),see=S8(((e,t)=>{var n=aee();t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}})),lee=S8(((e,t)=>{var n=see();t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}})),cee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).get(e)}})),uee=S8(((e,t)=>{var n=see();t.exports=function(e){return n(this,e).has(e)}})),dee=S8(((e,t)=>{var n=see();t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}})),hee=S8(((e,t)=>{var n=iee(),r=lee(),o=cee(),i=uee(),a=dee();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var n=A8(),r=K8(),o=hee();t.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}})),pee=S8(((e,t)=>{var n=A8(),r=I8(),o=R8(),i=N8(),a=D8(),s=fee();function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,t.exports=l})),gee=S8(((e,t)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}})),mee=S8(((e,t)=>{t.exports=function(e){return this.__data__.has(e)}})),vee=S8(((e,t)=>{var n=hee(),r=gee(),o=mee();function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{t.exports=function(e,t){return e.has(t)}})),xee=S8(((e,t)=>{var n=vee(),r=yee(),o=bee();t.exports=function(e,t,i,a,s,l){var c=1&i,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p{var n=B8().Uint8Array;t.exports=n})),kee=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}})),See=S8(((e,t)=>{t.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}})),Cee=S8(((e,t)=>{var n=j8(),r=wee(),o=E8(),i=xee(),a=kee(),s=See(),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,n,l,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&l;if(f||(f=s),e.size!=t.size&&!p)return!1;var g=h.get(e);if(g)return g==t;l|=2,h.set(e,t);var m=i(f(e),f(t),l,u,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}})),_ee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n{var n=Array.isArray;t.exports=n})),Pee=S8(((e,t)=>{var n=_ee(),r=Eee();t.exports=function(e,t,o){var i=t(e);return r(e)?i:n(i,o(e))}})),Lee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n{t.exports=function(){return[]}})),Mee=S8(((e,t)=>{var n=Lee(),r=Oee(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return o.call(e,t)})))}:r;t.exports=a})),Tee=S8(((e,t)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n{t.exports=function(e){return null!=e&&"object"==typeof e}})),Iee=S8(((e,t)=>{var n=W8(),r=Aee();t.exports=function(e){return r(e)&&"[object Arguments]"==n(e)}})),Ree=S8(((e,t)=>{var n=Iee(),r=Aee(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return r(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s})),Nee=S8(((e,t)=>{t.exports=function(){return!1}})),Dee=S8(((e,t)=>{var n=B8(),r=Nee(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s})),zee=S8(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=t??9007199254740991)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}})),jee=S8(((e,t)=>{var n=W8(),r=Bee(),o=Aee(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),Fee=S8(((e,t)=>{t.exports=function(e){return function(t){return e(t)}}})),Hee=S8(((e,t)=>{var n=z8(),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch{}}();t.exports=a})),Wee=S8(((e,t)=>{var n=jee(),r=Fee(),o=Hee(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Vee=S8(((e,t)=>{var n=Tee(),r=Ree(),o=Eee(),i=Dee(),a=zee(),s=Wee(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),u=!c&&r(e),d=!c&&!u&&i(e),h=!c&&!u&&!d&&s(e),f=c||u||d||h,p=f?n(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&(!f||!("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}})),$ee=S8(((e,t)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),Uee=S8(((e,t)=>{t.exports=function(e,t){return function(n){return e(t(n))}}})),Gee=S8(((e,t)=>{var n=Uee()(Object.keys,Object);t.exports=n})),qee=S8(((e,t)=>{var n=$ee(),r=Gee(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),Yee=S8(((e,t)=>{var n=$8(),r=Bee();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),Zee=S8(((e,t)=>{var n=Vee(),r=qee(),o=Yee();t.exports=function(e){return o(e)?n(e):r(e)}})),Xee=S8(((e,t)=>{var n=Pee(),r=Mee(),o=Zee();t.exports=function(e){return n(e,o,r)}})),Kee=S8(((e,t)=>{var n=Xee(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var d=u;d--;){var h=c[d];if(!(l?h in t:r.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++d{var n=X8()(B8(),"DataView");t.exports=n})),Jee=S8(((e,t)=>{var n=X8()(B8(),"Promise");t.exports=n})),ete=S8(((e,t)=>{var n=X8()(B8(),"Set");t.exports=n})),tte=S8(((e,t)=>{var n=X8()(B8(),"WeakMap");t.exports=n})),nte=S8(((e,t)=>{var n=Qee(),r=K8(),o=Jee(),i=ete(),a=tte(),s=W8(),l=q8(),c="[object Map]",u="[object Promise]",d="[object Set]",h="[object WeakMap]",f="[object DataView]",p=l(n),g=l(r),m=l(o),v=l(i),y=l(a),b=s;(n&&b(new n(new ArrayBuffer(1)))!=f||r&&b(new r)!=c||o&&b(o.resolve())!=u||i&&b(new i)!=d||a&&b(new a)!=h)&&(b=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case p:return f;case g:return c;case m:return u;case v:return d;case y:return h}return t}),t.exports=b})),rte=S8(((e,t)=>{var n=pee(),r=xee(),o=Cee(),i=Kee(),a=nte(),s=Eee(),l=Dee(),c=Wee(),u="[object Arguments]",d="[object Array]",h="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,p,g,m,v){var y=s(e),b=s(t),x=y?d:a(e),w=b?d:a(t),k=(x=x==u?h:x)==h,S=(w=w==u?h:w)==h,C=x==w;if(C&&l(e)){if(!l(t))return!1;y=!0,k=!1}if(C&&!k)return v||(v=new n),y||c(e)?r(e,t,p,g,m,v):o(e,t,x,p,g,m,v);if(!(1&p)){var _=k&&f.call(e,"__wrapped__"),E=S&&f.call(t,"__wrapped__");if(_||E){var P=_?e.value():e,L=E?t.value():t;return v||(v=new n),m(P,L,p,g,v)}}return!!C&&(v||(v=new n),i(e,t,p,g,m,v))}})),ote=S8(((e,t)=>{var n=rte(),r=Aee();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!r(t)&&!r(o)?t!=t&&o!=o:n(t,o,i,a,e,s))}})),ite=S8(((e,t)=>{var n=ote();t.exports=function(e,t){return n(e,t)}})),ate=["ctrl","shift","alt","meta","mod"],ste={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function lte(e,t=","){return"string"==typeof e?e.split(t):e}function cte(e,t="+"){let n=e.toLocaleLowerCase().split(t).map((e=>e.trim())).map((e=>ste[e]||e)),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((e=>!ate.includes(e)));return{...r,keys:o}}function ute({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some((e=>e.toLowerCase()===n.toLowerCase()))):Boolean(n&&t&&!0===t)}var dte=a.exports.createContext(void 0),hte=a.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),fte=C8(ite());var pte=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function gte(e,t,n,r){let o=a.exports.useRef(null),{current:i}=a.exports.useRef(new Set),s=n instanceof Array?r instanceof Array?void 0:r:n,l=n instanceof Array?n:r instanceof Array?r:[],c=a.exports.useCallback(t,[...l]),u=function(e){let t=a.exports.useRef(void 0);return(0,fte.default)(t.current,e)||(t.current=e),t.current}(s),{enabledScopes:d}=a.exports.useContext(hte),h=a.exports.useContext(dte);return a.exports.useLayoutEffect((()=>{if(!1===u?.enabled||!function(e,t){return 0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):!t||e.some((e=>t.includes(e)))||e.includes("*")}(d,u?.scopes))return;let t=t=>{if(!function(e){return ute(e,["input","textarea","select"])}(t)||ute(t,u?.enableOnFormTags)){if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void pte(t);t.target?.isContentEditable&&!u?.enableOnContentEditable||lte(e,u?.splitKey).forEach((e=>{let n=cte(e,u?.combinationKey);if(((e,t,n)=>{let{alt:r,ctrl:o,meta:i,mod:a,shift:s,keys:l}=t,{altKey:c,ctrlKey:u,metaKey:d,shiftKey:h,key:f,code:p}=e,g=p.toLowerCase().replace("key",""),m=f.toLowerCase();if(c!==r&&"alt"!==m||h!==s&&"shift"!==m)return!1;if(a){if(!d&&!u)return!1}else if(d!==i&&"meta"!==g||u!==o&&"ctrl"!==g)return!1;return!(!l||1!==l.length||!l.includes(m)&&!l.includes(g))||(l?l.every((e=>n.has(e))):!l)})(t,n,i)||n.keys?.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,n,u?.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,n,u?.enabled))return void pte(t);c(t,n)}}))}},n=e=>{i.add(e.key.toLowerCase()),(void 0===u?.keydown&&!0!==u?.keyup||u?.keydown)&&t(e)},r=e=>{"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),u?.keyup&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.addHotkey(cte(e,u?.combinationKey)))),()=>{(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),h&<e(e,u?.splitKey).forEach((e=>h.removeHotkey(cte(e,u?.combinationKey))))}}),[e,c,u,d]),o}C8(ite());var mte=new Set;window.addEventListener("DOMContentLoaded",(()=>{document.addEventListener("keydown",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>mte.add(cte(e))))}(e.key)})),document.addEventListener("keyup",(e=>{!function(e){(Array.isArray(e)?e:[e]).forEach((e=>{let t=cte(e);for(let n of mte)n.keys?.every((e=>t.keys?.includes(e)))&&mte.delete(n)}))}(e.key)}))}));const vte=uV((e=>e.system),(e=>e.log),{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),yte=uV((e=>e.system),(e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),bte=()=>{const e=m5(),t=v5(vte),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=v5(yte),[i,s]=a.exports.useState(!0),l=a.exports.useRef(null);a.exports.useLayoutEffect((()=>{null!==l.current&&i&&(l.current.scrollTop=l.current.scrollHeight)}),[i,t,n]);gte("`",(()=>{e(UY(!n))}),[n]),gte("esc",(()=>{e(UY(!1))}));return cd(sd,{children:[n&&ld(m8,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:ld("div",{className:"console",ref:l,onScroll:()=>{l.current&&i&&l.current.scrollTop{const{timestamp:n,message:r,level:o}=e;return cd("div",{className:`console-entry console-${o}-color`,children:[cd("p",{className:"console-timestamp",children:[n,":"]}),ld("p",{className:"console-message",children:r})]},t)}))})}),n&&ld(YH,{hasArrow:!0,label:i?"Autoscroll On":"Autoscroll Off",children:ld(zT,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":i,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:ld(O5,{}),onClick:()=>s(!i)})}),ld(YH,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:ld(zT,{className:"console-toggle-icon-button","data-error-seen":r||!o,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:ld(n?n3:B5,{}),onClick:()=>{e(nZ()),e(UY(!n))}})})]})};function xte(){const{t:e}=FY();return cd("div",{className:"work-in-progress nodes-work-in-progress",children:[ld("h1",{children:e("common:nodes")}),ld("p",{children:e("common:nodesDesc")})]})}const wte=()=>{const{t:e}=FY();return cd("div",{className:"work-in-progress post-processing-work-in-progress",children:[ld("h1",{children:e("common:postProcessing")}),ld("p",{children:e("common:postProcessDesc1")}),ld("p",{children:e("common:postProcessDesc2")}),ld("p",{children:e("common:postProcessDesc3")})]})},kte=Sk({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:ld("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"})})}),Ste=Sk({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),Cte=Sk({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:ld("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"})}),_te=Sk({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:ld("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:ld("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 Ete=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Ete||{});const Pte=e=>{const t=(()=>{const{t:e}=FY();return a.exports.useMemo((()=>({0:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},1:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},2:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},3:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},4:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},5:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},6:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},7:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},8:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},9:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},10:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}})),[e])})();return t[e]},Lte=uV((e=>e.options),(e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ote=uV((e=>e.system),(e=>({isGFPGANAvailable:e.isGFPGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Mte=()=>{const e=m5(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=v5(Lte),{isGFPGANAvailable:o}=v5(Ote),{t:i}=FY();return cd(CI,{direction:"column",gap:2,children:[ld(E3,{label:i("options:type"),validValues:jQ.concat(),value:n,onChange:t=>e(H$(t.target.value))}),ld(L3,{isDisabled:!o,label:i("options:strength"),step:.05,min:0,max:1,onChange:t=>e(F$(t)),value:t,width:"90px",isInteger:!1}),"codeformer"===n&&ld(L3,{isDisabled:!o,label:i("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:t=>e(B$(t)),value:r,width:"90px",isInteger:!1})]})};function Tte(){const e=v5((e=>e.system.isGFPGANAvailable)),t=v5((e=>e.options.shouldRunFacetool)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(gU(e.target.checked))})}function Ate(){const e=m5(),t=v5((e=>e.options.shouldFitToWidthHeight)),{t:n}=FY();return ld(_3,{label:n("options:imageFit"),isChecked:t,onChange:t=>e(lU(t.target.checked))})}function Ite(e){const[t,n]=a.exports.useState(!1),{label:r,value:o,min:i=1,max:s=100,step:l=1,onChange:c,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:f=0,sliderMarkRightOffset:p=-7,withInput:g=!1,isInteger:m=!1,inputWidth:v="5.5rem",inputReadOnly:y=!0,withReset:b=!1,hideTooltip:x=!1,isCompact:w=!1,handleReset:k,isResetDisabled:S,isSliderDisabled:C,isInputDisabled:_,styleClass:E,sliderFormControlProps:P,sliderFormLabelProps:L,sliderMarkProps:O,sliderTrackProps:M,sliderThumbProps:T,sliderNumberInputProps:A,sliderNumberInputFieldProps:I,sliderNumberInputStepperProps:R,sliderTooltipProps:N,sliderIAIIconButtonProps:D,...z}=e,[B,j]=a.exports.useState(String(o)),F=a.exports.useMemo((()=>A?.max?A.max:s),[s,A?.max]);a.exports.useEffect((()=>{String(o)!==B&&""!==B&&j(String(o))}),[o,B,j]);const H=e=>{j(String(e)),c(Number(e))};return cd(GT,{className:E?`invokeai__slider-component ${E}`:"invokeai__slider-component","data-markers":h,style:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...P,children:[ld(eA,{className:"invokeai__slider-component-label",...L,children:r}),cd(HI,{w:"100%",gap:2,alignItems:"center",children:[cd(ZF,{"aria-label":r,value:o,min:i,max:s,step:l,onChange:H,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:C,width:u,...z,children:[h&&cd(sd,{children:[ld(JF,{value:i,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:f,...O,children:i}),ld(JF,{value:s,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:p,...O,children:s})]}),ld(KF,{className:"invokeai__slider_track",...M,children:ld(QF,{className:"invokeai__slider_track-filled"})}),ld(YH,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${o}${d}`,hidden:x,...N,children:ld(XF,{className:"invokeai__slider-thumb",...T})})]}),g&&cd(fj,{min:i,max:F,step:l,value:B,onChange:H,onBlur:e=>{const t=TU.clamp(m?Math.floor(Number(e.target.value)):Number(e.target.value),i,F);j(String(t)),c(t)},className:"invokeai__slider-number-field",isDisabled:_,...A,children:[ld(gj,{className:"invokeai__slider-number-input",width:v,minWidth:v,readOnly:y,...I}),cd(pj,{...R,children:[ld(yj,{className:"invokeai__slider-number-stepper"}),ld(vj,{className:"invokeai__slider-number-stepper"})]})]}),b&&ld(k3,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:ld(T9,{}),onClick:()=>{k&&k()},isDisabled:S,...D})]})]})}function Rte(e){const{t:t}=FY(),{label:n=`${t("options:strength")}`,styleClass:r}=e,o=v5((e=>e.options.img2imgStrength)),i=m5();return ld(Ite,{label:n,step:.01,min:.01,max:.99,onChange:e=>i($$(e)),value:o,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i($$(.75))}})}const Nte=()=>{const e=m5(),t=v5((e=>e.options.seamless)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:t=>e(nU(t.target.checked))})})},Dte=()=>ld(CI,{gap:2,direction:"column",children:ld(Nte,{})});function zte(){const e=m5(),{t:t}=FY(),n=v5((e=>e.options.shouldRandomizeSeed));return ld(_3,{label:t("options:randomizeSeed"),isChecked:n,onChange:t=>e(fU(t.target.checked))})}function Bte(){const e=v5((e=>e.options.seed)),t=v5((e=>e.options.shouldRandomizeSeed)),n=v5((e=>e.options.shouldGenerateVariations)),{t:r}=FY(),o=m5();return ld(L3,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:0,max:BQ,isDisabled:t,isInvalid:e<0&&n,onChange:e=>o(aU(e)),value:e,width:"auto"})}function jte(){const e=m5(),t=v5((e=>e.options.shouldRandomizeSeed)),{t:n}=FY();return ld(RT,{size:"sm",isDisabled:t,onClick:()=>e(aU(HQ(0,BQ))),padding:"0 1.5rem",children:ld("p",{children:n("options:shuffle")})})}function Fte(){const e=m5(),t=v5((e=>e.options.threshold)),{t:n}=FY();return ld(L3,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:t=>e(wU(t)),value:t,isInteger:!1})}function Hte(){const e=m5(),t=v5((e=>e.options.perlin)),{t:n}=FY();return ld(L3,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:t=>e(Q$(t)),value:t,isInteger:!1})}const Wte=()=>cd(CI,{gap:2,direction:"column",children:[ld(zte,{}),cd(CI,{gap:2,children:[ld(Bte,{}),ld(jte,{})]}),ld(CI,{gap:2,children:ld(Fte,{})}),ld(CI,{gap:2,children:ld(Hte,{})})]}),Vte=uV((e=>e.options),(e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),$te=uV((e=>e.system),(e=>({isESRGANAvailable:e.isESRGANAvailable})),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Ute=()=>{const e=m5(),{upscalingLevel:t,upscalingStrength:n}=v5(Vte),{isESRGANAvailable:r}=v5($te),{t:o}=FY();return cd("div",{className:"upscale-options",children:[ld(E3,{isDisabled:!r,label:o("options:scale"),value:t,onChange:t=>e(SU(Number(t.target.value))),validValues:zQ}),ld(L3,{isDisabled:!r,label:o("options:strength"),step:.05,min:0,max:1,onChange:t=>e(CU(t)),value:n,isInteger:!1})]})};function Gte(){const e=v5((e=>e.system.isESRGANAvailable)),t=v5((e=>e.options.shouldRunESRGAN)),n=m5();return ld(_3,{isDisabled:!e,isChecked:t,onChange:e=>n(pU(e.target.checked))})}function qte(){const e=v5((e=>e.options.shouldGenerateVariations)),t=m5();return ld(_3,{isChecked:e,width:"auto",onChange:e=>t(cU(e.target.checked))})}function Yte(){const e=v5((e=>e.options.seedWeights)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(W3,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(_$(e)||""===e),isDisabled:!t,onChange:e=>r(sU(e.target.value))})}function Zte(){const e=v5((e=>e.options.variationAmount)),t=v5((e=>e.options.shouldGenerateVariations)),{t:n}=FY(),r=m5();return ld(L3,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:e=>r(_U(e)),isInteger:!1})}const Xte=()=>cd(CI,{gap:2,direction:"column",children:[ld(Zte,{}),ld(Yte,{})]});function Kte(){const e=m5(),t=v5((e=>e.options.cfgScale)),{t:n}=FY();return ld(L3,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:t=>e(z$(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function Qte(){const e=v5((e=>e.options.height)),t=v5(T3),n=m5(),{t:r}=FY();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:r("options:height"),value:e,flexGrow:1,onChange:e=>n(W$(Number(e.target.value))),validValues:DQ,styleClass:"main-option-block"})}const Jte=uV([e=>e.options],(e=>{const{iterations:t}=e;return{iterations:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function ene(){const e=m5(),{iterations:t}=v5(Jte),{t:n}=FY();return ld(L3,{label:n("options:images"),step:1,min:1,max:9999,onChange:t=>e(Y$(t)),value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function tne(){const e=v5((e=>e.options.sampler)),t=m5(),{t:n}=FY();return ld(E3,{label:n("options:sampler"),value:e,onChange:e=>t(eU(e.target.value)),validValues:RQ,styleClass:"main-option-block"})}function nne(){const e=m5(),t=v5((e=>e.options.steps)),{t:n}=FY();return ld(L3,{label:n("options:steps"),min:1,max:9999,step:1,onChange:t=>e(xU(t)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function rne(){const e=v5((e=>e.options.width)),t=v5(T3),{t:n}=FY(),r=m5();return ld(E3,{isDisabled:"unifiedCanvas"===t,label:n("options:width"),value:e,flexGrow:1,onChange:e=>r(EU(Number(e.target.value))),validValues:NQ,styleClass:"main-option-block"})}function one(){return ld("div",{className:"main-options",children:cd("div",{className:"main-options-list",children:[cd("div",{className:"main-options-row",children:[ld(ene,{}),ld(nne,{}),ld(Kte,{})]}),cd("div",{className:"main-options-row",children:[ld(rne,{}),ld(Qte,{}),ld(tne,{})]})]})})}const ine=uV((e=>e.system),(e=>e.shouldDisplayGuides)),ane=({children:e,feature:t})=>{const n=v5(ine),{text:r}=Pte(t);return n?cd(Aj,{trigger:"hover",children:[ld(Wj,{children:ld(mI,{children:e})}),cd(Fj,{className:"guide-popover-content",maxWidth:"400px",onClick:e=>e.preventDefault(),cursor:"initial",children:[ld(Ij,{className:"guide-popover-arrow"}),ld("div",{className:"guide-popover-guide-content",children:r})]})]}):null},sne=ok((({feature:e,icon:t=C9},n)=>ld(ane,{feature:e,children:ld(mI,{ref:n,children:ld(kk,{marginBottom:"-.15rem",as:t})})})));function lne(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return cd(lT,{className:"advanced-settings-item",children:[ld(nT,{className:"advanced-settings-header",children:cd(CI,{width:"100%",gap:"0.5rem",align:"center",children:[ld(mI,{flexGrow:1,textAlign:"left",children:t}),o,n&&ld(sne,{feature:n}),ld(sT,{})]})}),ld(cT,{className:"advanced-settings-panel",children:r})]})}const cne=e=>{const{accordionInfo:t}=e,n=v5((e=>e.system.openAccordions)),r=m5();return ld(uT,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:e=>r(ZY(e)),className:"advanced-settings",children:(()=>{const e=[];return t&&Object.keys(t).forEach((n=>{const{header:r,feature:o,content:i,additionalHeaderComponents:a}=t[n];e.push(ld(lne,{header:r,feature:o,content:i,additionalHeaderComponents:a},n))})),e})()})},une=e=>e.canvas,dne=uV([une,T3,O3],((e,t,n)=>e.layerState.stagingArea.images.length>0||"unifiedCanvas"===t&&n.isProcessing)),hne=e=>e.canvas.layerState.objects.find(EZ),fne=uV([e=>e.options,e=>e.system,hne,T3],((e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:i,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:c,isConnected:u}=t;let d=!0;const h=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,h.push("Missing prompt")),"img2img"!==r||s||(d=!1,h.push("No initial image selected")),c&&(d=!1,h.push("System Busy")),u||(d=!1,h.push("System Disconnected")),i&&(!_$(a)&&""!==a||-1===l)&&(d=!1,h.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:h}}),{memoizeOptions:{equalityCheck:TU.isEqual,resultEqualityCheck:TU.isEqual}});function pne(e){const{iconButton:t=!1,...n}=e,r=m5(),{isReady:o}=v5(fne),i=v5(T3),a=()=>{r(xQ(i))},{t:s}=FY();return gte(["ctrl+enter","meta+enter"],(()=>{r(xQ(i))}),{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,i]),ld("div",{style:{flexGrow:4},children:t?ld(k3,{"aria-label":s("options:invoke"),type:"submit",icon:ld(i3,{}),isDisabled:!o,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):ld(B3,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!o,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const gne=uV((e=>e.system),(e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function mne(e){const{...t}=e,n=m5(),{isProcessing:r,isConnected:o,isCancelable:i}=v5(gne),a=()=>n(EQ()),{t:s}=FY();return gte("shift+x",(()=>{(o||r)&&i&&a()}),[o,r,i]),ld(k3,{icon:ld(O9,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!o||!r||!i,onClick:a,styleClass:"cancel-btn",...t})}const vne=uV((e=>e.options),(e=>e.shouldLoopback)),yne=()=>{const e=m5(),t=v5(vne),{t:n}=FY();return ld(k3,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:ld(l3,{}),onClick:()=>{e(dU(!t))}})},bne=()=>{const e=v5(T3);return cd("div",{className:"process-buttons",children:[ld(pne,{}),"img2img"===e&&ld(yne,{}),ld(mne,{})]})},xne=uV([e=>e.options,T3],((e,t)=>({prompt:e.prompt,activeTabName:t})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),wne=()=>{const e=m5(),{prompt:t,activeTabName:n}=v5(xne),{isReady:r}=v5(fne),o=a.exports.useRef(null),{t:i}=FY();gte("alt+a",(()=>{o.current?.focus()}),[]);return ld("div",{className:"prompt-bar",children:ld(GT,{isInvalid:0===t.length||Boolean(t.match(/^[\s\r\n]+$/)),children:ld(_H,{id:"prompt",name:"prompt",placeholder:i("options:promptPlaceholder"),size:"lg",value:t,onChange:t=>{e(J$(t.target.value))},onKeyDown:t=>{"Enter"===t.key&&!1===t.shiftKey&&r&&(t.preventDefault(),e(xQ(n)))},resize:"vertical",height:30,ref:o,_placeholder:{color:"var(--text-color-secondary)"}})})})};function kne(e){return _5({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 Sne(e){return _5({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function Cne(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const _ne=!1,Ene=H.createContext(null);var Pne=function(e){return e.scrollTop},Lne="unmounted",One="exited",Mne="entering",Tne="entered",Ane="exiting",Ine=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=One,r.appearStatus=Mne):o=Tne:o=t.unmountOnExit||t.mountOnEnter?Lne:One,r.state={status:o},r.nextCallback=null,r}DD(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Lne?{status:One}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Mne&&n!==Tne&&(t=Mne):n!==Mne&&n!==Tne||(t=Ane)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Mne){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this);n&&Pne(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===One&&this.setState({status:Lne})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[Zu.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||_ne?this.safeSetState({status:Tne},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Mne},(function(){t.props.onEntering(i,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:Tne},(function(){t.props.onEntered(i,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Zu.findDOMNode(this);t&&!_ne?(this.props.onExit(r),this.safeSetState({status:Ane},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:One},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:One},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Zu.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Lne)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=gD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ld(Ene.Provider,{value:null,children:"function"==typeof n?n(e,r):H.cloneElement(H.Children.only(n),r)})},t}(H.Component);function Rne(){}Ine.contextType=Ene,Ine.propTypes={},Ine.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rne,onEntering:Rne,onEntered:Rne,onExit:Rne,onExiting:Rne,onExited:Rne},Ine.UNMOUNTED=Lne,Ine.EXITED=One,Ine.ENTERING=Mne,Ine.ENTERED=Tne,Ine.EXITING=Ane;const Nne=Ine;var Dne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r}))},zne=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Cne(n.className,r):n.setAttribute("class",Cne(n.className&&n.className.baseVal||"",r)));var n,r}))},Bne=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oe.options),(e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Hne=e=>{const t=m5(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:o}=v5(Fne),i=a.exports.useRef(null),s=a.exports.useRef(null),l=a.exports.useRef(null),{children:c}=e;gte("o",(()=>{t(vU(!n)),o&&setTimeout((()=>t(iX(!0))),400)}),[n,o]),gte("esc",(()=>{t(vU(!1))}),{enabled:()=>!o,preventDefault:!0},[o]),gte("shift+o",(()=>{h(),t(iX(!0))}),[o]);const u=a.exports.useCallback((()=>{o||(t(X$(s.current?s.current.scrollTop:0)),t(vU(!1)),t(uU(!1)))}),[t,o]),d=()=>{l.current&&window.clearTimeout(l.current)},h=()=>{t(hU(!o)),t(iX(!0))};return a.exports.useEffect((()=>{function e(e){i.current&&!i.current.contains(e.target)&&u()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[u]),ld(jne,{nodeRef:i,in:n||r&&!o,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:ld("div",{className:"options-panel-wrapper","data-pinned":o,tabIndex:1,ref:i,onMouseEnter:o?void 0:d,onMouseOver:o?void 0:d,style:{borderRight:o?"":"0.3rem solid var(--tab-list-text-inactive)"},children:ld("div",{className:"options-panel-margin",children:cd("div",{className:"options-panel",ref:s,onMouseLeave:e=>{e.target!==s.current?d():!o&&(l.current=window.setTimeout((()=>u()),500))},children:[ld(YH,{label:"Pin Options Panel",children:ld("div",{className:"options-panel-pin-button","data-selected":o,onClick:h,children:ld(o?kne:Sne,{})})}),!o&&cd("div",{className:"invoke-ai-logo-wrapper",children:[ld("img",{src:w3,alt:"invoke-ai-logo"}),cd("h1",{children:["invoke ",ld("strong",{children:"ai"})]})]}),c]})})})})};function Wne(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Dte,{})}},n=m5(),r=v5(T3);return a.exports.useEffect((()=>{if("img2img"===r){(()=>n(V$(!1)))()}}),[r,n]),cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(Ate,{}),ld(cne,{accordionInfo:t})]})}const Vne=a.exports.createContext(null),$ne=e=>{const{styleClass:t}=e,n=a.exports.useContext(Vne);return ld("div",{className:`image-uploader-button-outer ${t}`,onClick:()=>{n&&n()},children:cd("div",{className:"image-upload-button",children:[ld(y3,{}),ld(LI,{size:"lg",children:"Click or Drag and Drop"})]})})},Une=uV((e=>e.system),(e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Gne=a.exports.forwardRef((({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:i}=QA(),s=m5(),{shouldConfirmOnDelete:l,isConnected:c,isProcessing:u}=v5(Une),d=a.exports.useRef(null),h=()=>{c&&!u&&e&&s(SQ(e)),i()};gte("delete",(()=>{l?o():h()}),[e,l]);return cd(sd,{children:[a.exports.cloneElement(t,{onClick:e?e=>{e.stopPropagation(),l?o():h()}:void 0,ref:n}),ld(qB,{isOpen:r,leastDestructiveRef:d,onClose:i,children:ld(GB,{children:cd(YB,{className:"modal",children:[ld($B,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),ld(NB,{children:cd(CI,{direction:"column",gap:5,children:[ld(VI,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),ld(GT,{children:cd(CI,{alignItems:"center",children:[ld(eA,{mb:0,children:"Don't ask me again"}),ld(nH,{checked:!l,onChange:e=>s(YY(!e.target.checked))})]})})]})}),cd(VB,{children:[ld(RT,{ref:d,onClick:i,className:"modal-close-btn",children:"Cancel"}),ld(RT,{colorScheme:"red",onClick:h,ml:3,children:"Delete"})]})]})})})]})})),qne=uV([e=>e.system,e=>e.options,e=>e.gallery,T3],((e,t,n,r)=>{const{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:c,shouldShowImageDetails:u,isLightBoxOpen:d}=t,{intermediateImage:h,currentImage:f}=n;return{isProcessing:o,isConnected:i,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:c,shouldDisableToolbarButtons:Boolean(h)||!f,currentImage:f,shouldShowImageDetails:u,activeTabName:r,isLightBoxOpen:d}}),{memoizeOptions:{resultEqualityCheck:MU.exports.isEqual}}),Yne=()=>{const e=m5(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:o,upscalingLevel:i,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:c,isLightBoxOpen:u,activeTabName:d}=v5(qne),h=zH(),{t:f}=FY(),p=()=>{c&&(u&&e(q$(!1)),e(G$(c)),e(I$("img2img")))};gte("shift+i",(()=>{c?(p(),h({title:f("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:imageNotLoaded"),description:f("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const g=()=>{c&&(c.metadata&&e(N$(c.metadata)),"img2img"===c.metadata?.image.type?e(I$("img2img")):"txt2img"===c.metadata?.image.type&&e(I$("txt2img")))};gte("a",(()=>{["txt2img","img2img"].includes(c?.metadata?.image?.type)?(g(),h({title:f("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:parametersNotSet"),description:f("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const m=()=>{c?.metadata&&e(aU(c.metadata.image.seed))};gte("s",(()=>{c?.metadata?.image?.seed?(m(),h({title:f("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:seedNotSet"),description:f("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const v=()=>c?.metadata?.image?.prompt&&e(J$(c.metadata.image.prompt));gte("p",(()=>{c?.metadata?.image?.prompt?(v(),h({title:f("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):h({title:f("toast:promptNotSet"),description:f("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[c]);const y=()=>{c&&e(wQ(c))};gte("Shift+U",(()=>{o&&!s&&n&&!t&&i?y():h({title:f("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[c,o,s,n,t,i]);const b=()=>{c&&e(kQ(c))};gte("Shift+R",(()=>{r&&!s&&n&&!t&&a?b():h({title:f("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[c,r,s,n,t,a]);const x=()=>e(mU(!l));gte("i",(()=>{c?x():h({title:f("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[c,l]);return cd("div",{className:"current-image-options",children:[cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{"aria-label":`${f("options:sendTo")}...`,icon:ld(h3,{})}),children:cd("div",{className:"current-image-send-to-popover",children:[ld(B3,{size:"sm",onClick:p,leftIcon:ld(f3,{}),children:f("options:sendToImg2Img")}),ld(B3,{size:"sm",onClick:()=>{c&&(u&&e(q$(!1)),e(aX(c)),e(iX(!0)),"unifiedCanvas"!==d&&e(I$("unifiedCanvas")),h({title:f("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:ld(f3,{}),children:f("options:sendToUnifiedCanvas")}),ld(B3,{size:"sm",onClick:()=>{navigator.clipboard.writeText(c?window.location.toString()+c.url:"").then((()=>{h({title:f("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:ld(j5,{}),children:f("options:copyImageToLink")}),ld(B3,{leftIcon:ld(W5,{}),size:"sm",children:ld(MI,{download:!0,href:c?.url,children:f("options:downloadImage")})})]})}),ld(k3,{icon:ld(U5,{}),tooltip:u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"aria-label":u?`${f("options:closeViewer")} (Z)`:`${f("options:openInViewer")} (Z)`,"data-selected":u,onClick:()=>{e(q$(!u))}})]}),cd(DT,{isAttached:!0,children:[ld(k3,{icon:ld(s3,{}),tooltip:`${f("options:usePrompt")} (P)`,"aria-label":`${f("options:usePrompt")} (P)`,isDisabled:!c?.metadata?.image?.prompt,onClick:v}),ld(k3,{icon:ld(d3,{}),tooltip:`${f("options:useSeed")} (S)`,"aria-label":`${f("options:useSeed")} (S)`,isDisabled:!c?.metadata?.image?.seed,onClick:m}),ld(k3,{icon:ld(N5,{}),tooltip:`${f("options:useAll")} (A)`,"aria-label":`${f("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),onClick:g})]}),cd(DT,{isAttached:!0,children:[ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld(X5,{}),"aria-label":f("options:restoreFaces")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Mte,{}),ld(B3,{isDisabled:!(r&&c&&n&&!t&&a),onClick:b,children:f("options:restoreFaces")})]})}),ld(z3,{trigger:"hover",triggerComponent:ld(k3,{icon:ld($5,{}),"aria-label":f("options:upscale")}),children:cd("div",{className:"current-image-postprocessing-popover",children:[ld(Ute,{}),ld(B3,{isDisabled:!(o&&c&&n&&!t&&i),onClick:y,children:f("options:upscaleImage")})]})})]}),ld(DT,{isAttached:!0,children:ld(k3,{icon:ld(B5,{}),tooltip:`${f("options:info")} (I)`,"aria-label":`${f("options:info")} (I)`,"data-selected":l,onClick:x})}),ld(Gne,{image:c,children:ld(k3,{icon:ld(m3,{}),tooltip:`${f("options:deleteImage")} (Del)`,"aria-label":`${f("options:deleteImage")} (Del)`,isDisabled:!c||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function Zne(e){return _5({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 Xne=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:i=!1})=>cd(CI,{gap:2,children:[n&&ld(YH,{label:`Recall ${e}`,children:ld(zT,{"aria-label":"Use this parameter",icon:ld(Zne,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),i&&ld(YH,{label:`Copy ${e}`,children:ld(zT,{"aria-label":`Copy ${e}`,icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),cd(CI,{direction:o?"column":"row",children:[cd(VI,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?cd(MI,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",ld(V9,{mx:"2px"})]}):ld(VI,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),Kne=a.exports.memo((({image:e,styleClass:t})=>{const n=m5();gte("esc",(()=>{n(mU(!1))}));const r=e?.metadata?.image||{},o=e?.dreamPrompt,{cfg_scale:i,fit:a,height:s,hires_fix:l,init_image_path:c,mask_image_path:u,orig_path:d,perlin:h,postprocessing:f,prompt:p,sampler:g,scale:m,seamless:v,seed:y,steps:b,strength:x,threshold:w,type:k,variations:S,width:C}=r,_=JSON.stringify(e.metadata,null,2);return ld("div",{className:`image-metadata-viewer ${t}`,children:cd(CI,{gap:1,direction:"column",width:"100%",children:[cd(CI,{gap:2,children:[ld(VI,{fontWeight:"semibold",children:"File:"}),cd(MI,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,ld(V9,{mx:"2px"})]})]}),Object.keys(r).length>0?cd(sd,{children:[k&&ld(Xne,{label:"Generation type",value:k}),e.metadata?.model_weights&&ld(Xne,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(k)&&ld(Xne,{label:"Original image",value:d}),"gfpgan"===k&&void 0!==x&&ld(Xne,{label:"Fix faces strength",value:x,onClick:()=>n(F$(x))}),"esrgan"===k&&void 0!==m&&ld(Xne,{label:"Upscaling scale",value:m,onClick:()=>n(SU(m))}),"esrgan"===k&&void 0!==x&&ld(Xne,{label:"Upscaling strength",value:x,onClick:()=>n(CU(x))}),p&&ld(Xne,{label:"Prompt",labelPosition:"top",value:C$(p),onClick:()=>n(J$(p))}),void 0!==y&&ld(Xne,{label:"Seed",value:y,onClick:()=>n(aU(y))}),void 0!==w&&ld(Xne,{label:"Noise Threshold",value:w,onClick:()=>n(wU(w))}),void 0!==h&&ld(Xne,{label:"Perlin Noise",value:h,onClick:()=>n(Q$(h))}),g&&ld(Xne,{label:"Sampler",value:g,onClick:()=>n(eU(g))}),b&&ld(Xne,{label:"Steps",value:b,onClick:()=>n(xU(b))}),void 0!==i&&ld(Xne,{label:"CFG scale",value:i,onClick:()=>n(z$(i))}),S&&S.length>0&&ld(Xne,{label:"Seed-weight pairs",value:E$(S),onClick:()=>n(sU(E$(S)))}),v&&ld(Xne,{label:"Seamless",value:v,onClick:()=>n(nU(v))}),l&&ld(Xne,{label:"High Resolution Optimization",value:l,onClick:()=>n(V$(l))}),C&&ld(Xne,{label:"Width",value:C,onClick:()=>n(EU(C))}),s&&ld(Xne,{label:"Height",value:s,onClick:()=>n(W$(s))}),c&&ld(Xne,{label:"Initial image",value:c,isLink:!0,onClick:()=>n(G$(c))}),u&&ld(Xne,{label:"Mask image",value:u,isLink:!0,onClick:()=>n(Z$(u))}),"img2img"===k&&x&&ld(Xne,{label:"Image to image strength",value:x,onClick:()=>n($$(x))}),a&&ld(Xne,{label:"Image to image fit",value:a,onClick:()=>n(lU(a))}),f&&f.length>0&&cd(sd,{children:[ld(LI,{size:"sm",children:"Postprocessing"}),f.map(((e,t)=>{if("esrgan"===e.type){const{scale:r,strength:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Upscale (ESRGAN)`}),ld(Xne,{label:"Scale",value:r,onClick:()=>n(SU(r))}),ld(Xne,{label:"Strength",value:o,onClick:()=>n(CU(o))})]},t)}if("gfpgan"===e.type){const{strength:r}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (GFPGAN)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("gfpgan"))}})]},t)}if("codeformer"===e.type){const{strength:r,fidelity:o}=e;return cd(CI,{pl:"2rem",gap:1,direction:"column",children:[ld(VI,{size:"md",children:`${t+1}: Face restoration (Codeformer)`}),ld(Xne,{label:"Strength",value:r,onClick:()=>{n(F$(r)),n(H$("codeformer"))}}),o&&ld(Xne,{label:"Fidelity",value:o,onClick:()=>{n(B$(o)),n(H$("codeformer"))}})]},t)}}))]}),o&&ld(Xne,{withCopy:!0,label:"Dream Prompt",value:o}),cd(CI,{gap:2,direction:"column",children:[cd(CI,{gap:2,children:[ld(YH,{label:"Copy metadata JSON",children:ld(zT,{"aria-label":"Copy metadata JSON",icon:ld(j5,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(_)})}),ld(VI,{fontWeight:"semibold",children:"Metadata JSON:"})]}),ld("div",{className:"image-json-viewer",children:ld("pre",{children:_})})]})]}):ld(bI,{width:"100%",pt:10,children:ld(VI,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),((e,t)=>e.image.uuid===t.image.uuid)),Qne=uV([e=>e.gallery,e=>e.options],((e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex((t=>t.uuid===e?.currentImage?.uuid)),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function Jne(){const e=m5(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:o,isIntermediate:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return cd("div",{className:"current-image-preview",children:[o&&ld(ET,{src:o.url,width:o.width,height:o.height,style:{imageRendering:i?"pixelated":"initial"}}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!t&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!n&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),r&&o&&ld(Kne,{image:o,styleClass:"current-image-metadata"})]})}const ere=uV([e=>e.gallery,e=>e.options,T3],((e,t,n)=>{const{currentImage:r,intermediateImage:o}=e,{shouldShowImageDetails:i}=t;return{activeTabName:n,shouldShowImageDetails:i,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),tre=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=v5(ere);return ld("div",{className:"current-image-area","data-tab-name":t,children:e?cd(sd,{children:[ld(Yne,{}),ld(Jne,{})]}):ld("div",{className:"current-image-display-placeholder",children:ld(L9,{})})})},nre=()=>{const e=a.exports.useContext(Vne);return ld(k3,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:ld(y3,{}),onClick:e||void 0})};function rre(){const e=v5((e=>e.options.initialImage)),{t:t}=FY(),n=m5(),r=zH();return cd(sd,{children:[cd("div",{className:"init-image-preview-header",children:[ld("h2",{children:t("options:initialImage")}),ld(nre,{})]}),e&&ld("div",{className:"init-image-preview",children:ld(ET,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(M$())}})})]})}const ore=()=>{const e=v5((e=>e.options.initialImage)),{currentImage:t}=v5((e=>e.gallery));return cd("div",{className:"workarea-split-view",children:[ld("div",{className:"workarea-split-view-left",children:e?ld("div",{className:"image-to-image-area",children:ld(rre,{})}):ld($ne,{})}),t&&ld("div",{className:"workarea-split-view-right",children:ld(tre,{})})]})};function ire(e){return _5({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 are(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function sre(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>a.exports.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return a.exports.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=a.exports.createContext(r),i=n.length;function s(t){const{scope:n,children:r,...s}=t,l=(null==n?void 0:n[e][i])||o,c=a.exports.useMemo((()=>s),Object.values(s));return a.exports.createElement(l.Provider,{value:c},r)}return n=[...n,r],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||o,c=a.exports.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},lre(r,...t)]}function lre(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return a.exports.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function cre(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function ure(...e){return a.exports.useCallback(cre(...e),e)}const dre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e,o=a.exports.Children.toArray(n),i=o.find(pre);if(i){const e=i.props.children,n=o.map((t=>t===i?a.exports.Children.count(e)>1?a.exports.Children.only(null):a.exports.isValidElement(e)?e.props.children:null:t));return a.exports.createElement(hre,vp({},r,{ref:t}),a.exports.isValidElement(e)?a.exports.cloneElement(e,void 0,n):null)}return a.exports.createElement(hre,vp({},r,{ref:t}),n)}));dre.displayName="Slot";const hre=a.exports.forwardRef(((e,t)=>{const{children:n,...r}=e;return a.exports.isValidElement(n)?a.exports.cloneElement(n,{...gre(r,n.props),ref:cre(t,n.ref)}):a.exports.Children.count(n)>1?a.exports.Children.only(null):null}));hre.displayName="SlotClone";const fre=({children:e})=>a.exports.createElement(a.exports.Fragment,null,e);function pre(e){return a.exports.isValidElement(e)&&e.type===fre}function gre(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]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const mre=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=a.exports.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?dre:t;return a.exports.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),a.exports.createElement(i,vp({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function vre(e,t){e&&$.exports.flushSync((()=>e.dispatchEvent(t)))}function yre(e){const t=e+"CollectionProvider",[n,r]=sre(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=e+"CollectionItemSlot",l="data-radix-collection-item";return[{Provider:e=>{const{scope:t,children:n}=e,r=H.useRef(null),i=H.useRef(new Map).current;return H.createElement(o,{scope:t,itemMap:i,collectionRef:r},n)},Slot:H.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=ure(t,i(a,n).collectionRef);return H.createElement(dre,{ref:o},r)})),ItemSlot:H.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,a=H.useRef(null),c=ure(t,a),u=i(s,n);return H.useEffect((()=>(u.itemMap.set(a,{ref:a,...o}),()=>{u.itemMap.delete(a)}))),H.createElement(dre,{[l]:"",ref:c},r)}))},function(t){const n=i(e+"CollectionConsumer",t),r=H.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${l}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}const bre=a.exports.createContext(void 0);function xre(e){const t=a.exports.useContext(bre);return e||t||"ltr"}function wre(e){const t=a.exports.useRef(e);return a.exports.useEffect((()=>{t.current=e})),a.exports.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const kre="dismissableLayer.update",Sre="dismissableLayer.pointerDownOutside",Cre="dismissableLayer.focusOutside";let _re;const Ere=a.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pre=a.exports.forwardRef(((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=a.exports.useContext(Ere),[h,f]=a.exports.useState(null),p=null!==(n=null==h?void 0:h.ownerDocument)&&void 0!==n?n:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,g]=a.exports.useState({}),m=ure(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,k=x>=b,S=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1),o=a.exports.useRef((()=>{}));return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){const i={originalEvent:e};function a(){Ore(Sre,n,i,{discrete:!0})}"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));k&&!n&&(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e),r=a.exports.useRef(!1);return a.exports.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Ore(Cre,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const n=wre(e);a.exports.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[n,t])}((e=>{x===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),a.exports.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(_re=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Lre(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_re)}}),[h,p,r,d]),a.exports.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Lre())}),[h,d]),a.exports.useEffect((()=>{const e=()=>g({});return document.addEventListener(kre,e),()=>document.removeEventListener(kre,e)}),[]),a.exports.createElement(mre.div,vp({},u,{ref:m,style:{pointerEvents:w?k?"auto":"none":void 0,...e.style},onFocusCapture:are(e.onFocusCapture,C.onFocusCapture),onBlurCapture:are(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:are(e.onPointerDownCapture,S.onPointerDownCapture)}))}));function Lre(){const e=new CustomEvent(kre);document.dispatchEvent(e)}function Ore(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?vre(o,i):o.dispatchEvent(i)}let Mre=0;function Tre(){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 Are="focusScope.autoFocusOnMount",Ire="focusScope.autoFocusOnUnmount",Rre={bubbles:!1,cancelable:!0},Nre=a.exports.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=a.exports.useState(null),u=wre(o),d=wre(i),h=a.exports.useRef(null),f=ure(t,(e=>c(e))),p=a.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.exports.useEffect((()=>{if(r){function e(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:jre(h.current,{select:!0})}function t(e){!p.paused&&l&&(l.contains(e.relatedTarget)||jre(h.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,l,p.paused]),a.exports.useEffect((()=>{if(l){Fre.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Are,Rre);l.addEventListener(Are,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jre(r,{select:t}),document.activeElement!==n)return}((e=Dre(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&jre(l))}return()=>{l.removeEventListener(Are,u),setTimeout((()=>{const e=new CustomEvent(Ire,Rre);l.addEventListener(Ire,d),l.dispatchEvent(e),e.defaultPrevented||jre(null!=t?t:document.body,{select:!0}),l.removeEventListener(Ire,d),Fre.remove(p)}),0)}}var e}),[l,u,d,p]);const g=a.exports.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=Dre(e),n=zre(t,e),r=zre(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&jre(i,{select:!0})):(e.preventDefault(),n&&jre(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return a.exports.createElement(mre.div,vp({tabIndex:-1},s,{ref:f,onKeyDown:g}))}));function Dre(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zre(e,t){for(const n of e)if(!Bre(n,{upTo:t}))return n}function Bre(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function jre(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Fre=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Hre(e,t),e.unshift(t)},remove(t){var n;e=Hre(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function Hre(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const Wre=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?a.exports.useLayoutEffect:()=>{},Vre=W["useId".toString()]||(()=>{});let $re=0;function Ure(e){return e.split("-")[0]}function Gre(e){return e.split("-")[1]}function qre(e){return["top","bottom"].includes(Ure(e))?"x":"y"}function Yre(e){return"y"===e?"height":"width"}function Zre(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,s=qre(t),l=Yre(s),c=r[l]/2-o[l]/2,u="x"===s;let d;switch(Ure(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-o.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Gre(t)){case"start":d[s]-=c*(n&&u?-1:1);break;case"end":d[s]+=c*(n&&u?-1:1)}return d}function Xre(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kre(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qre(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=t,p=Xre(f),g=s[h?"floating"===d?"reference":"floating":d],m=Kre(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v=Kre(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),strategy:l}):a[d]);return{top:m.top-v.top+p.top,bottom:v.bottom-m.bottom+p.bottom,left:m.left-v.left+p.left,right:v.right-m.right+p.right}}const Jre=Math.min,eoe=Math.max;function toe(e,t,n){return eoe(e,Jre(t,n))}const noe=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:s,platform:l}=t;if(null==n)return{};const c=Xre(r),u={x:o,y:i},d=qre(a),h=Gre(a),f=Yre(d),p=await l.getDimensions(n),g="y"===d?"top":"left",m="y"===d?"bottom":"right",v=s.reference[f]+s.reference[d]-u[d]-s.floating[f],y=u[d]-s.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[f]);const w=v/2-y/2,k=c[g],S=x-p[f]-c[m],C=x/2-p[f]/2+w,_=toe(k,C,S),E=("start"===h?c[g]:c[m])>0&&C!==_&&s.reference[f]<=s.floating[f];return{[d]:u[d]-(E?Croe[e]))}const ioe={start:"end",end:"start"};function aoe(e){return e.replace(/start|end/g,(e=>ioe[e]))}const soe=["top","right","bottom","left"];const loe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",flipAlignment:f=!0,...p}=e,g=Ure(r),m=d||(g===a||!f?[ooe(a)]:function(e){const t=ooe(e);return[aoe(e),t,aoe(t)]}(a)),v=[a,...m],y=await Qre(t,p),b=[];let x=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(y[g]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=Gre(e),o=qre(e),i=Yre(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ooe(a)),{main:a,cross:ooe(a)}}(r,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));b.push(y[e],y[t])}if(x=[...x,{placement:r,overflows:b}],!b.every((e=>e<=0))){var w,k;const e=(null!=(w=null==(k=o.flip)?void 0:k.index)?w:0)+1,t=v[e];if(t)return{data:{index:e,overflows:x},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var S;const e=null==(S=x.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:S[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};function coe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uoe(e){return soe.some((t=>e[t]>=0))}const doe=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:r}=e;switch(t){case"referenceHidden":{const t=coe(await Qre(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:uoe(t)}}}case"escaped":{const t=coe(await Qre(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:uoe(t)}}}default:return{}}}}};const hoe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Ure(n),s=Gre(n),l="x"===qre(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function foe(e){return"x"===e?"y":"x"}const poe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:r},u=await Qre(t,l),d=qre(Ure(o)),h=foe(d);let f=c[d],p=c[h];if(i){const e="y"===d?"bottom":"right";f=toe(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===h?"bottom":"right";p=toe(p+u["y"===h?"top":"left"],p,p-u[e])}const g=s.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},goe=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:r},d=qre(o),h=foe(d);let f=u[d],p=u[h];const g="function"==typeof s?s({...i,placement:o}):s,m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+m.mainAxis,n=i.reference[d]+i.reference[e]-m.mainAxis;fn&&(f=n)}if(c){var v,y,b,x;const e="y"===d?"width":"height",t=["top","left"].includes(Ure(o)),n=i.reference[h]-i.floating[e]+(t&&null!=(v=null==(y=a.offset)?void 0:y[h])?v:0)+(t?0:m.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:null!=(b=null==(x=a.offset)?void 0:x[h])?b:0)-(t?m.crossAxis:0);pr&&(p=r)}return{[d]:f,[h]:p}}}};function moe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function voe(e){if(null==e)return window;if(!moe(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function yoe(e){return voe(e).getComputedStyle(e)}function boe(e){return moe(e)?"":e?(e.nodeName||"").toLowerCase():""}function xoe(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function woe(e){return e instanceof voe(e).HTMLElement}function koe(e){return e instanceof voe(e).Element}function Soe(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof voe(e).ShadowRoot||e instanceof ShadowRoot}function Coe(e){const{overflow:t,overflowX:n,overflowY:r}=yoe(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function _oe(e){return["table","td","th"].includes(boe(e))}function Eoe(e){const t=/firefox/i.test(xoe()),n=yoe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function Poe(){return!/^((?!chrome|android).)*safari/i.test(xoe())}const Loe=Math.min,Ooe=Math.max,Moe=Math.round;function Toe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let l=1,c=1;t&&woe(e)&&(l=e.offsetWidth>0&&Moe(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Moe(s.height)/e.offsetHeight||1);const u=koe(e)?voe(e):window,d=!Poe()&&n,h=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/l,f=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,p=s.width/l,g=s.height/c;return{width:p,height:g,top:f,right:h+p,bottom:f+g,left:h,x:h,y:f}}function Aoe(e){return((function(e){return e instanceof voe(e).Node}(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ioe(e){return koe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Roe(e){return Toe(Aoe(e)).left+Ioe(e).scrollLeft}function Noe(e,t,n){const r=woe(t),o=Aoe(t),i=Toe(e,r&&function(e){const t=Toe(e);return Moe(t.width)!==e.offsetWidth||Moe(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==boe(t)||Coe(o))&&(a=Ioe(t)),woe(t)){const e=Toe(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Roe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Doe(e){return"html"===boe(e)?e:e.assignedSlot||e.parentNode||(Soe(e)?e.host:null)||Aoe(e)}function zoe(e){return woe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Boe(e){const t=voe(e);let n=zoe(e);for(;n&&_oe(n)&&"static"===getComputedStyle(n).position;)n=zoe(n);return n&&("html"===boe(n)||"body"===boe(n)&&"static"===getComputedStyle(n).position&&!Eoe(n))?t:n||function(e){let t=Doe(e);for(Soe(t)&&(t=t.host);woe(t)&&!["html","body"].includes(boe(t));){if(Eoe(t))return t;t=t.parentNode}return null}(e)||t}function joe(e){if(woe(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Toe(e);return{width:t.width,height:t.height}}function Foe(e){const t=Doe(e);return["html","body","#document"].includes(boe(t))?e.ownerDocument.body:woe(t)&&Coe(t)?t:Foe(t)}function Hoe(e,t){var n;void 0===t&&(t=[]);const r=Foe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=voe(r),a=o?[i].concat(i.visualViewport||[],Coe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Hoe(a))}function Woe(e,t,n){return"viewport"===t?Kre(function(e,t){const n=voe(e),r=Aoe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Poe();(e||!e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):koe(t)?function(e,t){const n=Toe(e,!1,"fixed"===t),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}}(t,n):Kre(function(e){var t;const n=Aoe(e),r=Ioe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ooe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ooe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Roe(e);const l=-r.scrollTop;return"rtl"===yoe(o||n).direction&&(s+=Ooe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(Aoe(e)))}function Voe(e){const t=Hoe(e),n=["absolute","fixed"].includes(yoe(e).position)&&woe(e)?Boe(e):e;return koe(n)?t.filter((e=>koe(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Soe(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==boe(e))):[]}const $oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Voe(t):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Woe(t,n,o);return e.top=Ooe(r.top,e.top),e.right=Loe(r.right,e.right),e.bottom=Loe(r.bottom,e.bottom),e.left=Ooe(r.left,e.left),e}),Woe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=woe(n),i=Aoe(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==boe(n)||Coe(i))&&(a=Ioe(n)),woe(n))){const e=Toe(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:koe,getDimensions:joe,getOffsetParent:Boe,getDocumentElement:Aoe,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Noe(t,Boe(n),r),floating:{...joe(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===yoe(e).direction};function Uoe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=o&&!s,c=i&&!s,u=l||c?[...koe(e)?Hoe(e):[],...Hoe(t)]:[];u.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)}));let d,h=null;if(a){let r=!0;h=new ResizeObserver((()=>{r||n(),r=!1})),koe(e)&&!s&&h.observe(e),h.observe(t)}let f=s?Toe(e):null;return s&&function t(){const r=Toe(e);!f||r.x===f.x&&r.y===f.y&&r.width===f.width&&r.height===f.height||n();f=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(d)}}const Goe=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=Zre(l,r,s),d=r,h={},f=0;for(let p=0;p{t.current=e})),t}(o),c=a.exports.useRef(null),[u,d]=a.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,f]=a.exports.useState(t);Yoe(null==h?void 0:h.map((e=>{let{options:t}=e;return t})),null==t?void 0:t.map((e=>{let{options:t}=e;return t})))||f(t);const p=a.exports.useCallback((()=>{i.current&&s.current&&Goe(i.current,s.current,{middleware:h,placement:n,strategy:r}).then((e=>{g.current&&$.exports.flushSync((()=>{d(e)}))}))}),[h,n,r]);qoe((()=>{g.current&&p()}),[p]);const g=a.exports.useRef(!1);qoe((()=>(g.current=!0,()=>{g.current=!1})),[]);const m=a.exports.useCallback((()=>{if("function"==typeof c.current&&(c.current(),c.current=null),i.current&&s.current)if(l.current){const e=l.current(i.current,s.current,p);c.current=e}else p()}),[p,l]),v=a.exports.useCallback((e=>{i.current=e,m()}),[m]),y=a.exports.useCallback((e=>{s.current=e,m()}),[m]),b=a.exports.useMemo((()=>({reference:i,floating:s})),[]);return a.exports.useMemo((()=>({...u,update:p,refs:b,reference:v,floating:y})),[u,p,b,v,y])}const Xoe=e=>{const{element:t,padding:n}=e;return{name:"arrow",options:e,fn:e=>function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?noe({element:t.current,padding:n}).fn(e):{}:t?noe({element:t,padding:n}).fn(e):{}}};const Koe="Popper",[Qoe,Joe]=sre(Koe),[eie,tie]=Qoe(Koe),nie=a.exports.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=tie("PopperAnchor",n),s=a.exports.useRef(null),l=ure(t,s);return a.exports.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:a.exports.createElement(mre.div,vp({},o,{ref:l}))})),rie="PopperContent",[oie,iie]=Qoe(rie),[aie,sie]=Qoe(rie,{hasParent:!1,positionUpdateFns:new Set}),lie=a.exports.forwardRef(((e,t)=>{var n,r,o,i,s,l,c,u;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:p="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:x=!1,avoidCollisions:w=!0,...k}=e,S=tie(rie,d),[C,_]=a.exports.useState(null),E=ure(t,(e=>_(e))),[P,L]=a.exports.useState(null),O=function(e){const[t,n]=a.exports.useState(void 0);return Wre((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(P),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,A=h+("center"!==p?"-"+p:""),I="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},R=Array.isArray(v)?v:[v],N=R.length>0,D={padding:I,boundary:R.filter(uie),altBoundary:N},{reference:z,floating:B,strategy:j,x:F,y:H,placement:W,middlewareData:V,update:$}=Zoe({strategy:"fixed",placement:A,whileElementsMounted:Uoe,middleware:[hoe({mainAxis:f+T,alignmentAxis:g}),w?poe({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?goe():void 0,...D}):void 0,P?Xoe({element:P,padding:m}):void 0,w?loe({...D}):void 0,die({arrowWidth:M,arrowHeight:T}),x?doe({strategy:"referenceHidden"}):void 0].filter(cie)});Wre((()=>{z(S.anchor)}),[z,S.anchor]);const U=null!==F&&null!==H,[G,q]=hie(W),Y=null===(o=V.arrow)||void 0===o?void 0:o.x,Z=null===(i=V.arrow)||void 0===i?void 0:i.y,X=0!==(null===(s=V.arrow)||void 0===s?void 0:s.centerOffset),[K,Q]=a.exports.useState();Wre((()=>{C&&Q(window.getComputedStyle(C).zIndex)}),[C]);const{hasParent:J,positionUpdateFns:ee}=sie(rie,d),te=!J;a.exports.useLayoutEffect((()=>{if(!te)return ee.add($),()=>{ee.delete($)}}),[te,ee,$]),a.exports.useLayoutEffect((()=>{te&&U&&Array.from(ee).reverse().forEach((e=>requestAnimationFrame(e)))}),[te,U,ee]);const ne={"data-side":G,"data-align":q,...k,ref:E,style:{...k.style,animation:U?void 0:"none",opacity:null!==(l=V.hide)&&void 0!==l&&l.referenceHidden?0:void 0}};return a.exports.createElement("div",{ref:B,"data-radix-popper-content-wrapper":"",style:{position:j,left:0,top:0,transform:U?`translate3d(${Math.round(F)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null===(c=V.transformOrigin)||void 0===c?void 0:c.x,null===(u=V.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},a.exports.createElement(oie,{scope:d,placedSide:G,onArrowChange:L,arrowX:Y,arrowY:Z,shouldHideArrow:X},te?a.exports.createElement(aie,{scope:d,hasParent:!0,positionUpdateFns:ee},a.exports.createElement(mre.div,ne)):a.exports.createElement(mre.div,ne)))}));function cie(e){return void 0!==e}function uie(e){return null!==e}const die=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,u=0!==(null===(n=c.arrow)||void 0===n?void 0:n.centerOffset),d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[f,p]=hie(s),g={start:"0%",center:"50%",end:"100%"}[p],m=(null!==(r=null===(o=c.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,v=(null!==(i=null===(a=c.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+h/2;let y="",b="";return"bottom"===f?(y=u?g:`${m}px`,b=-h+"px"):"top"===f?(y=u?g:`${m}px`,b=`${l.floating.height+h}px`):"right"===f?(y=-h+"px",b=u?g:`${v}px`):"left"===f&&(y=`${l.floating.width+h}px`,b=u?g:`${v}px`),{data:{x:y,y:b}}}});function hie(e){const[t,n="center"]=e.split("-");return[t,n]}const fie=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.exports.useState(null);return a.exports.createElement(eie,{scope:t,anchor:r,onAnchorChange:o},n)},pie=nie,gie=lie;const mie=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.exports.useState(),r=a.exports.useRef({}),o=a.exports.useRef(e),i=a.exports.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.exports.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.exports.useEffect((()=>{const e=vie(r.current);i.current="mounted"===l?e:"none"}),[l]),Wre((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=vie(t);if(e)c("MOUNT");else if("none"===a||"none"===(null==t?void 0:t.display))c("UNMOUNT");else{c(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),Wre((()=>{if(t){const e=e=>{const n=vie(r.current).includes(e.animationName);e.target===t&&n&&$.exports.flushSync((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=vie(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.exports.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):a.exports.Children.only(n),i=ure(r.ref,o.ref);return"function"==typeof n||r.isPresent?a.exports.cloneElement(o,{ref:i}):null};function vie(e){return(null==e?void 0:e.animationName)||"none"}function yie({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=a.exports.useState(e),[r]=n,o=a.exports.useRef(r),i=wre(t);return a.exports.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,l=wre(n),c=a.exports.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l]);return[s,c]}mie.displayName="Presence";const bie="rovingFocusGroup.onEntryFocus",xie={bubbles:!1,cancelable:!0},wie="RovingFocusGroup",[kie,Sie,Cie]=yre(wie),[_ie,Eie]=sre(wie,[Cie]),[Pie,Lie]=_ie(wie),Oie=a.exports.forwardRef(((e,t)=>a.exports.createElement(kie.Provider,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(kie.Slot,{scope:e.__scopeRovingFocusGroup},a.exports.createElement(Mie,vp({},e,{ref:t})))))),Mie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,...d}=e,h=a.exports.useRef(null),f=ure(t,h),p=xre(i),[g=null,m]=yie({prop:s,defaultProp:l,onChange:c}),[v,y]=a.exports.useState(!1),b=wre(u),x=Sie(n),w=a.exports.useRef(!1),[k,S]=a.exports.useState(0);return a.exports.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(bie,b),()=>e.removeEventListener(bie,b)}),[b]),a.exports.createElement(Pie,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:a.exports.useCallback((e=>m(e)),[m]),onItemShiftTab:a.exports.useCallback((()=>y(!0)),[]),onFocusableItemAdd:a.exports.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:a.exports.useCallback((()=>S((e=>e-1))),[])},a.exports.createElement(mre.div,vp({tabIndex:v||0===k?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...e.style},onMouseDown:are(e.onMouseDown,(()=>{w.current=!0})),onFocus:are(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!v){const t=new CustomEvent(bie,xie);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));Iie([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)))}}w.current=!1})),onBlur:are(e.onBlur,(()=>y(!1)))})))})),Tie=a.exports.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,...i}=e,s=function(e){const[t,n]=a.exports.useState(Vre());return Wre((()=>{e||n((e=>null!=e?e:String($re++)))}),[e]),e||(t?`radix-${t}`:"")}(),l=Lie("RovingFocusGroupItem",n),c=l.currentTabStopId===s,u=Sie(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return a.exports.useEffect((()=>{if(r)return d(),()=>h()}),[r,d,h]),a.exports.createElement(kie.ItemSlot,{scope:n,id:s,focusable:r,active:o},a.exports.createElement(mre.span,vp({tabIndex:c?0:-1,"data-orientation":l.orientation},i,{ref:t,onMouseDown:are(e.onMouseDown,(e=>{r?l.onItemFocus(s):e.preventDefault()})),onFocus:are(e.onFocus,(()=>l.onItemFocus(s))),onKeyDown:are(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Aie[r]}(e,l.orientation,l.dir);if(void 0!==t){e.preventDefault();let o=u().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=l.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>Iie(o)))}var n,r}))})))})),Aie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Iie(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}const Rie=Oie,Nie=Tie,Die=["Enter"," "],zie=["ArrowUp","PageDown","End"],Bie=["ArrowDown","PageUp","Home",...zie],jie="Menu",[Fie,Hie,Wie]=yre(jie),[Vie,$ie]=sre(jie,[Wie,Joe,Eie]),Uie=Joe(),Gie=Eie(),[qie,Yie]=Vie(jie),[Zie,Xie]=Vie(jie),Kie=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=Uie(n);return a.exports.createElement(pie,vp({},o,r,{ref:t}))})),[Qie,Jie]=Vie("MenuPortal",{forceMount:void 0}),eae="MenuContent",[tae,nae]=Vie(eae),rae=a.exports.forwardRef(((e,t)=>{const n=Jie(eae,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Yie(eae,e.__scopeMenu),s=Xie(eae,e.__scopeMenu);return a.exports.createElement(Fie.Provider,{scope:e.__scopeMenu},a.exports.createElement(mie,{present:r||i.open},a.exports.createElement(Fie.Slot,{scope:e.__scopeMenu},s.modal?a.exports.createElement(oae,vp({},o,{ref:t})):a.exports.createElement(iae,vp({},o,{ref:t})))))})),oae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu),r=a.exports.useRef(null),o=ure(t,r);return a.exports.useEffect((()=>{const e=r.current;if(e)return pD(e)}),[]),a.exports.createElement(aae,vp({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:are(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))})),iae=a.exports.forwardRef(((e,t)=>{const n=Yie(eae,e.__scopeMenu);return a.exports.createElement(aae,vp({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))})),aae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:p,...g}=e,m=Yie(eae,n),v=Xie(eae,n),y=Uie(n),b=Gie(n),x=Hie(n),[w,k]=a.exports.useState(null),S=a.exports.useRef(null),C=ure(t,S,m.onContentChange),_=a.exports.useRef(0),E=a.exports.useRef(""),P=a.exports.useRef(0),L=a.exports.useRef(null),O=a.exports.useRef("right"),M=a.exports.useRef(0),T=p?_B:a.exports.Fragment,A=p?{as:dre,allowPinchZoom:!0}:void 0,I=e=>{var t,n;const r=E.current+e,o=x().filter((e=>!e.disabled)),i=document.activeElement,a=null===(t=o.find((e=>e.ref.current===i)))||void 0===t?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,a),l=null===(n=o.find((e=>e.textValue===s)))||void 0===n?void 0:n.ref.current;!function e(t){E.current=t,window.clearTimeout(_.current),""!==t&&(_.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};a.exports.useEffect((()=>()=>window.clearTimeout(_.current)),[]),a.exports.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:Tre()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:Tre()),Mre++,()=>{1===Mre&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Mre--}}),[]);const R=a.exports.useCallback((e=>{var t,n;return O.current===(null===(t=L.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null===(n=L.current)||void 0===n?void 0:n.area)}),[]);return a.exports.createElement(tae,{scope:n,searchRef:E,onItemEnter:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:a.exports.useCallback((e=>{var t;R(e)||(null===(t=S.current)||void 0===t||t.focus(),k(null))}),[R]),onTriggerLeave:a.exports.useCallback((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:P,onPointerGraceIntentChange:a.exports.useCallback((e=>{L.current=e}),[])},a.exports.createElement(T,A,a.exports.createElement(Nre,{asChild:!0,trapped:o,onMountAutoFocus:are(i,(e=>{var t;e.preventDefault(),null===(t=S.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},a.exports.createElement(Pre,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f},a.exports.createElement(Rie,vp({asChild:!0},b,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:e=>{v.isUsingKeyboardRef.current||e.preventDefault()}}),a.exports.createElement(gie,vp({role:"menu","aria-orientation":"vertical","data-state":(N=m.open,N?"open":"closed"),"data-radix-menu-content":"",dir:v.dir},y,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:are(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&I(e.key));const o=S.current;if(e.target!==o)return;if(!Bie.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));zie.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:are(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(_.current),E.current="")})),onPointerMove:are(e.onPointerMove,dae((e=>{const t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>M.current?"right":"left";O.current=t,M.current=e.clientX}})))})))))));var N})),sae="MenuItem",lae="menu.itemSelect",cae=a.exports.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=a.exports.useRef(null),s=Xie(sae,e.__scopeMenu),l=nae(sae,e.__scopeMenu),c=ure(t,i),u=a.exports.useRef(!1);return a.exports.createElement(uae,vp({},o,{ref:c,disabled:n,onClick:are(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(lae,{bubbles:!0,cancelable:!0});e.addEventListener(lae,(e=>null==r?void 0:r(e)),{once:!0}),vre(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),u.current=!0},onPointerUp:are(e.onPointerUp,(e=>{var t;u.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:are(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||Die.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),uae=a.exports.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=nae(sae,n),l=Gie(n),c=a.exports.useRef(null),u=ure(t,c),[d,h]=a.exports.useState(!1),[f,p]=a.exports.useState("");return a.exports.useEffect((()=>{const e=c.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[i.children]),a.exports.createElement(Fie.ItemSlot,{scope:n,disabled:r,textValue:null!=o?o:f},a.exports.createElement(Nie,vp({asChild:!0},l,{focusable:!r}),a.exports.createElement(mre.div,vp({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:are(e.onPointerMove,dae((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus()}}))),onPointerLeave:are(e.onPointerLeave,dae((e=>s.onItemLeave(e)))),onFocus:are(e.onFocus,(()=>h(!0))),onBlur:are(e.onBlur,(()=>h(!1)))}))))}));Vie("MenuRadioGroup",{value:void 0,onValueChange:()=>{}});Vie("MenuItemIndicator",{checked:!1});function dae(e){return t=>"mouse"===t.pointerType?e(t):void 0}Vie("MenuSub");const hae=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=Uie(t),[c,u]=a.exports.useState(null),d=a.exports.useRef(!1),h=wre(i),f=xre(o);return a.exports.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),a.exports.createElement(fie,l,a.exports.createElement(qie,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u},a.exports.createElement(Zie,{scope:t,onClose:a.exports.useCallback((()=>h(!1)),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},fae=Kie,pae=rae,gae=cae,mae="ContextMenu",[vae,yae]=sre(mae,[$ie]),bae=$ie(),[xae,wae]=vae(mae);function kae(e){return t=>"mouse"!==t.pointerType?e(t):void 0}const Sae=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:i=!0}=e,[s,l]=a.exports.useState(!1),c=bae(t),u=wre(r),d=a.exports.useCallback((e=>{l(e),u(e)}),[u]);return a.exports.createElement(xae,{scope:t,open:s,onOpenChange:d,modal:i},a.exports.createElement(hae,vp({},c,{dir:o,open:s,onOpenChange:d,modal:i}),n))},Cae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuTrigger",n),i=bae(n),s=a.exports.useRef({x:0,y:0}),l=a.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),c=a.exports.useRef(0),u=a.exports.useCallback((()=>window.clearTimeout(c.current)),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return a.exports.useEffect((()=>u),[u]),a.exports.createElement(a.exports.Fragment,null,a.exports.createElement(fae,vp({},i,{virtualRef:l})),a.exports.createElement(mre.span,vp({"data-state":o.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:are(e.onContextMenu,(e=>{u(),d(e),e.preventDefault()})),onPointerDown:are(e.onPointerDown,kae((e=>{u(),c.current=window.setTimeout((()=>d(e)),700)}))),onPointerMove:are(e.onPointerMove,kae(u)),onPointerCancel:are(e.onPointerCancel,kae(u)),onPointerUp:are(e.onPointerUp,kae(u))})))})),_ae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=wae("ContextMenuContent",n),i=bae(n),s=a.exports.useRef(!1);return a.exports.createElement(pae,vp({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&s.current&&t.preventDefault(),s.current=!1},onInteractOutside:t=>{var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)"}}))})),Eae=a.exports.forwardRef(((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=bae(n);return a.exports.createElement(gae,vp({},o,r,{ref:t}))})),Pae=uV([e=>e.gallery,e=>e.options,dne,T3],((e,t,n,r)=>{const{categories:o,currentCategory:i,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,galleryWidth:p,shouldUseSingleGalleryColumn:g}=e,{isLightBoxOpen:m}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:c,galleryImageMinimumWidth:u,galleryImageObjectFit:d,galleryGridTemplateColumns:g?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:h,shouldAutoSwitchToNewImages:f,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightBoxOpen:m,isStaging:n,shouldEnableResize:!(m||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:g}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Lae=uV([e=>e.options,e=>e.gallery,e=>e.system,T3],((e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen})),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Oae=a.exports.memo((e=>{const t=m5(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:i,isLightBoxOpen:s,shouldUseSingleGalleryColumn:l}=v5(Lae),{image:c,isSelected:u}=e,{url:d,thumbnail:h,uuid:f,metadata:p}=c,[g,m]=a.exports.useState(!1),v=zH(),{t:y}=FY();return cd(Sae,{onOpenChange:e=>{t(GU(e))},children:[ld(Cae,{children:cd(mI,{position:"relative",className:"hoverable-image",onMouseOver:()=>m(!0),onMouseOut:()=>m(!1),userSelect:"none",draggable:!0,onDragStart:e=>{e.dataTransfer.setData("invokeai/imageUuid",f),e.dataTransfer.effectAllowed="move"},children:[ld(ET,{className:"hoverable-image-image",objectFit:l?"contain":r,rounded:"md",src:h||d,loading:"lazy"}),ld("div",{className:"hoverable-image-content",onClick:()=>t(DU(c)),children:u&&ld(kk,{width:"50%",height:"50%",as:z5,className:"hoverable-image-check"})}),g&&o>=64&&ld("div",{className:"hoverable-image-delete-button",children:ld(Gne,{image:c,children:ld(zT,{"aria-label":y("options:deleteImage"),icon:ld(g3,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!i})})})]},f)}),cd(_ae,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:e=>{e.detail.originalEvent.preventDefault()},children:[ld(Eae,{onClickCapture:()=>{t(q$(!0)),t(DU(c))},children:y("options:openInViewer")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(J$(c.metadata.image.prompt)),v({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.prompt,children:y("options:usePrompt")}),ld(Eae,{onClickCapture:()=>{c.metadata&&t(aU(c.metadata.image.seed)),v({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===c?.metadata?.image?.seed,children:y("options:useSeed")}),ld(Eae,{onClickCapture:()=>{p&&t(D$(p)),v({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(c?.metadata?.image?.type),children:y("options:useAll")}),ld(Eae,{onClickCapture:async()=>{if(p?.image?.init_image_path){if((await fetch(p.image.init_image_path)).ok)return t(I$("img2img")),t(R$(p)),void v({title:y("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0})}v({title:y("toast:initialImageNotSet"),description:y("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},disabled:"img2img"!==c?.metadata?.image?.type,children:y("options:useInitImg")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(G$(c)),"img2img"!==n&&t(I$("img2img")),v({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToImg2Img")}),ld(Eae,{onClickCapture:()=>{s&&t(q$(!1)),t(aX(c)),t(YZ()),"unifiedCanvas"!==n&&t(I$("unifiedCanvas")),v({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:y("options:sendToUnifiedCanvas")}),ld(Eae,{"data-warning":!0,children:ld(Gne,{image:c,children:ld("p",{children:y("options:deleteImage")})})})]})]})}),((e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected)),Mae=320,Tae={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Aae(){const e=m5(),{t:t}=FY(),{images:n,currentCategory:r,currentImageUuid:o,shouldPinGallery:i,shouldShowGallery:s,galleryScrollPosition:l,galleryImageMinimumWidth:c,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:p,areMoreImagesAvailable:g,galleryWidth:m,isLightBoxOpen:v,isStaging:y,shouldEnableResize:b,shouldUseSingleGalleryColumn:x}=v5(Pae),{galleryMinWidth:w,galleryMaxWidth:k}=v?{galleryMinWidth:400,galleryMaxWidth:400}:Tae[d],[S,C]=a.exports.useState(m>=Mae),[_,E]=a.exports.useState(!1),[P,L]=a.exports.useState(0),O=a.exports.useRef(null),M=a.exports.useRef(null),T=a.exports.useRef(null);a.exports.useEffect((()=>{m>=Mae&&C(!1)}),[m]);const A=()=>{e(HU(!i)),e(iX(!0))},I=()=>{e(WU(!0)),i&&e(iX(!0))},R=a.exports.useCallback((()=>{e(WU(!1)),e(GU(!1)),e(VU(M.current?M.current.scrollTop:0)),setTimeout((()=>i&&e(iX(!0))),400)}),[e,i]),N=()=>{T.current&&window.clearTimeout(T.current)};gte("g",(()=>{s?R():I()}),[s,i]),gte("left",(()=>{e(FU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("right",(()=>{e(jU())}),{enabled:!y||"unifiedCanvas"!==d},[y]),gte("shift+g",(()=>{A()}),[i]),gte("esc",(()=>{e(WU(!1))}),{enabled:()=>!i,preventDefault:!0},[i]);return gte("shift+up",(()=>{if(c<256){const t=TU.clamp(c+32,32,256);e($U(t))}}),[c]),gte("shift+down",(()=>{if(c>32){const t=TU.clamp(c-32,32,256);e($U(t))}}),[c]),a.exports.useEffect((()=>{M.current&&(M.current.scrollTop=l)}),[l,s]),a.exports.useEffect((()=>{function e(e){i||!O.current||O.current.contains(e.target)||R()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[R,i]),ld(jne,{nodeRef:O,in:s||f,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:cd("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:O,onMouseLeave:i?void 0:()=>{f||(T.current=window.setTimeout((()=>R()),500))},onMouseEnter:i?void 0:N,onMouseOver:i?void 0:N,children:[cd(m8,{minWidth:w,maxWidth:i?k:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:m,height:i?"100%":"100vh"},onResizeStart:(e,t,n)=>{L(n.clientHeight),n.style.height=`${n.clientHeight}px`,i&&(n.style.position="fixed",n.style.right="1rem",E(!0))},onResizeStop:(t,n,r,o)=>{const a=i?TU.clamp(Number(m)+o.width,w,Number(k)):Number(m)+o.width;e(ZU(a)),r.removeAttribute("data-resize-alert"),i&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",i?"100%":"100vh"),E(!1),e(iX(!0)))},onResize:(t,n,r,o)=>{const a=TU.clamp(Number(m)+o.width,w,Number(i?k:.95*window.innerWidth));a>=Mae&&!S?C(!0):aa-40&&e($U(a-40)),i&&(a>=k?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height=`${P}px`},children:[cd("div",{className:"image-gallery-header",children:[ld(DT,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:cd(sd,S?{children:[ld(B3,{size:"sm","data-selected":"result"===r,onClick:()=>e(YU("result")),children:t("gallery:generations")}),ld(B3,{size:"sm","data-selected":"user"===r,onClick:()=>e(YU("user")),children:t("gallery:uploads")})]}:{children:[ld(k3,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===r,icon:ld(K5,{}),onClick:()=>e(YU("result"))}),ld(k3,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===r,icon:ld(b3,{}),onClick:()=>e(YU("user"))})]})}),cd("div",{className:"image-gallery-header-right-icons",children:[ld(z3,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:ld(k3,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:ld(x3,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:cd("div",{className:"image-gallery-settings-popover",children:[cd("div",{children:[ld(Ite,{value:c,onChange:t=>{e($U(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),ld(k3,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e($U(64)),icon:ld(T9,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),ld("div",{children:ld(k9,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===h,onChange:()=>e(UU("contain"===h?"cover":"contain"))})}),ld("div",{children:ld(k9,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:t=>e(qU(t.target.checked))})}),ld("div",{children:ld(k9,{label:t("gallery:singleColumnLayout"),isChecked:x,onChange:t=>e(XU(t.target.checked))})})]})}),ld(k3,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:A,icon:ld(i?kne:Sne,{})})]})]}),ld("div",{className:"image-gallery-container",ref:M,children:n.length||g?cd(sd,{children:[ld("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map((e=>{const{uuid:t}=e;return ld(Oae,{image:e,isSelected:o===t},t)}))}),ld(RT,{onClick:()=>{e(CQ(r))},isDisabled:!g,className:"image-gallery-load-more-btn",children:t(g?"gallery:loadMore":"gallery:allImagesLoaded")})]}):cd("div",{className:"image-gallery-container-placeholder",children:[ld(P9,{}),ld("p",{children:t("gallery:noImagesInGallery")})]})})]}),_&&ld("div",{style:{width:m+"px",height:"100%"}})]})})}const Iae=uV((e=>e.gallery),(e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images}))),Rae=uV([e=>e.options,T3],((e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),Nae=e=>{const t=m5(),{optionsPanel:n,children:r,styleClass:o}=e,{activeTabName:i,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=v5(Rae),c=(()=>{const{resultImages:e,userImages:t}=v5(Iae);return n=>{const r=e.find((e=>e.uuid===n));if(r)return r;return t.find((e=>e.uuid===n))||void 0}})();return ld("div",{className:o?`workarea-wrapper ${o}`:"workarea-wrapper",children:cd("div",{className:"workarea-main",children:[n,cd("div",{className:"workarea-children-wrapper",onDrop:e=>{const n=e.dataTransfer.getData("invokeai/imageUuid"),r=c(n);r&&("img2img"===i?t(G$(r)):"unifiedCanvas"===i&&t(aX(r)))},children:[r,l&&ld(YH,{label:"Toggle Split View",children:ld("div",{className:"workarea-split-button","data-selected":a,onClick:()=>{t(bU(!a)),t(iX(!0))},children:ld(ire,{})})})]}),!s&&ld(Aae,{})]})})};function Dae(){return ld(Nae,{optionsPanel:ld(Wne,{}),children:ld(ore,{})})}const zae=()=>{const e=m5(),t=v5((e=>e.options.hiresFix)),{t:n}=FY();return ld(CI,{gap:2,direction:"column",children:ld(_3,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:t=>e(V$(t.target.checked))})})},Bae=()=>cd(CI,{gap:2,direction:"column",children:[ld(Nte,{}),ld(zae,{})]});function jae(){const{t:e}=FY(),t={seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:Ete.FACE_CORRECTION,content:ld(Mte,{}),additionalHeaderComponents:ld(Tte,{})},upscale:{header:`${e("options:upscaling")}`,feature:Ete.UPSCALE,content:ld(Ute,{}),additionalHeaderComponents:ld(Gte,{})},other:{header:`${e("options:otherOptions")}`,feature:Ete.OTHER,content:ld(Bae,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(cne,{accordionInfo:t})]})}const Fae=()=>ld("div",{className:"workarea-single-view",children:ld("div",{className:"text-to-image-area",children:ld(tre,{})})});function Hae(){return ld(Nae,{optionsPanel:ld(jae,{}),children:ld(Fae,{})})}var Wae=function(e,t){return Wae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Wae(e,t)};var Vae=function(){return Vae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Kae(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?i(t.scale,t.positionX,t.positionY):Xae(e,r,n,(function(e){i(s+u*e,l+d*e,c+h*e)}))}}var Qae=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Jae=function(e,t){var n=Qae(e,t);return e.bounds=n,n};function ese(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=o,h=i),{x:tse(e,s-d,c+d,r),y:tse(t,l-h,u+h,r)}}var tse=function(e,t,n,r){return Uae(r?en?n:e:e,2)};function nse(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):ese(l-t*u,c-n*u,o,i,0,0,null)}function rse(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var ose=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!Tse(i,n)},ise=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var ase=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function sse(e,t,n,r,o,i,a,s,l,c){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:ui?i:u}return r?t:tse(e,i,a,o)}function lse(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-r.x,d=t.y-r.y,h=u/c,f=d/c,p=l-o,g=u*u+d*d,m=Math.sqrt(g)/p;e.velocity={velocityX:h,velocityY:f,total:m}}e.lastMousePosition=t,e.velocityTime=l}}function cse(e,t){var n=e.transformState.scale;Zae(e),Jae(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function use(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,c=o.positionY;if(!r)return{x:l,y:c};var u=t-r.x,d=n-r.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=ase(e,i),d=ase(e,a);lse(e,{x:l,y:c}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(a&&t!==u&&n!==d&&s){var h=ese(t,n,s,i,r,o,a),f=h.x,p=h.y;e.setTransformState(c,f,p)}}(e,l,c,u,d)}}function dse(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,f=r.limitToBounds,p=r.alignmentAnimation,g=r.zoomAnimation,m=r.panning,v=m.lockAxisY,y=m.lockAxisX,b=g.animationType,x=p.sizeX,w=p.sizeY,k=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,k),_=ase(e,x),E=ase(e,w),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=c+P,M=u-P,T=d+L,A=h-L,I=e.transformState,R=(new Date).getTime();Xae(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/k,g=1-(0,qae[p.animationType])(Math.min(1,l)),m=1-t,b=o+a*m,x=i+s*m,w=sse(b,I.positionX,o,y,f,u,c,M,O,g),S=sse(x,I.positionY,i,v,f,h,d,A,T,g);o===b&&i===x||e.setTransformState(r,w,S)}))}}(e):hse(e)}}function hse(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,c=o.animationType;if(!(i||td||nf||rd?c.offsetWidth:e.setup.minPositionX||0,r>f?c.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=v.x,b=v.y;return{scale:o,positionX:g?y:n,positionY:m?b:r}}}(e);u&&Kae(e,u,l,c)}}function fse(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||r>=a;if((r>=1||s)&&hse(e),!h&&o&&e.mounted){var f=pse(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);f&&Kae(e,f,u,d)}}function pse(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=rse(Uae(t,2),i,a,0,!1),c=nse(e,n,r,l,Jae(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}var gse={previousScale:1,scale:1,positionX:0,positionY:0},mse=Vae(Vae({},gse),{setComponents:function(){},contextInstance:null}),vse={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},yse=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:gse.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:gse.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:gse.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:gse.positionY}},bse=function(e){var t=Vae({},vse);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==vse[n]&&r){var o=Object.prototype.toString.call(vse[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Vae(Vae({},vse[n]),e[n]):a?$ae($ae([],vse[n]),e[n]):e[n]}})),t},xse=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n);return rse(Uae(c,3),s,a,l,!1)};function wse(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!i)return console.error("No WrapperComponent found");var u=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-c)/s,h=pse(e,xse(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,r,o)}function kse(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=yse(e.props),s=e.transformState,l=s.scale,c=s.positionX,u=s.positionY;if(o){var d=Qae(e,a.scale),h=ese(a.positionX,a.positionY,d,i,0,0,o),f={scale:a.scale,positionX:h.x,positionY:h.y};l===a.scale&&c===a.positionX&&u===a.positionY||Kae(e,f,t,n)}}var Sse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,1,t,n,r)}},Cse=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),wse(e,-1,t,n,r)}},_se=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?c:r};Kae(e,h,o,i)}}},Ese=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),kse(e,t,n)}},Pse=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=Rse(t||o.scale,i,a);Kae(e,s,n,r)}}},Lse=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Zae(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return gse;var l=r.getBoundingClientRect(),c=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),u=c.x,d=c.y,h=t.offsetWidth,f=t.offsetHeight,p=r.offsetWidth/h,g=r.offsetHeight/f,m=rse(n||Math.min(p,g),a,s,0,!1),v=(l.width-h*m)/2,y=(l.height-f*m)/2,b=ese((l.left-u)*m+v,(l.top-d)*m+y,Qae(e,m),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:m}}(e,a,n);Kae(e,s,r,o)}}},Ose=function(e){return{instance:e,state:e.transformState,zoomIn:Sse(e),zoomOut:Cse(e),setTransform:_se(e),resetTransform:Ese(e),centerView:Pse(e),zoomToElement:Lse(e)}};function Mse(){try{return{get passive(){return!0,!1}}}catch(Hhe){return!1}}var Tse=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Ase=function(e){e&&clearTimeout(e)},Ise=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},Rse=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Nse=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||r||!c)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!Tse(c,a)))};function Dse(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var zse=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!Tse(a,o)},Bse=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},jse=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},Fse=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Zae(e),Gae(Ose(e),t,r),Gae(Ose(e),t,o))},Hse=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=u.size,f=u.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var g=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),m=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=i+t*(i-i*n)*n;if(o)return f;var p=!r&&!h;return rse(Uae(f,3),c,l,d,p)}(e,g,p,!t.ctrlKey);if(s!==m){var v=Jae(e,m),y=Dse(t,i,s),b=l&&(f||0===h||c),x=nse(e,y.x,y.y,m,v,b),w=x.x,k=x.y;e.previousWheelEvent=t,e.setTransformState(m,w,k),Gae(Ose(e),t,r),Gae(Ose(e),t,o)}},Wse=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Ase(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(fse(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Ase(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Gae(Ose(e),t,r),Gae(Ose(e),t,o))}),160))},Vse=function(e,t){var n=jse(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Zae(e)},$se=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,c=l.disabled,u=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Uae(o[0].clientX-r.left,5),a=Uae(o[0].clientY-r.top,5);return{x:(i+Uae(o[1].clientX-r.left,5))/2/t,y:(a+Uae(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var h=jse(t),f=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,c=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:rse(Uae(t/r*n,2),a,i,l,!c)}(e,h);if(f!==o){var p=Jae(e,f),g=a&&(c||0===u||s),m=nse(e,d.x,d.y,f,p,g),v=m.x,y=m.y;e.pinchMidpoint=d,e.lastDistance=h,e.setTransformState(f,v,y)}}}},Use=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,fse(e,null==t?void 0:t.x,null==t?void 0:t.y)};function Gse(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return kse(e,a,s);var l=e.transformState.scale,c=e.contentComponent;if(!c)return console.error("No ContentComponent found");var u=xse(e,"zoomOut"===o?-1:1,i),d=Dse(t,c,l),h=pse(e,u,d.x,d.y);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Kae(e,h,a,s)}}var qse=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,c=null==o?void 0:o.contains(l),u=n&&l&&c&&!a;return!!u&&(!Tse(l,s)&&!!u)},Yse=H.createContext(mse),Zse=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=yse(t.props),t.setup=bse(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=Mse();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Nse(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Fse(t,e),Hse(t,e),Wse(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||ose(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Zae(t),cse(t,e),Gae(Ose(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||ise(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),use(t,e.clientX,e.clientY),Gae(Ose(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(dse(t),Gae(Ose(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||zse(t,e)&&(Vse(t,e),Zae(t),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Bse(t)&&(e.preventDefault(),e.stopPropagation(),$se(t,e),Gae(Ose(t),e,o),Gae(Ose(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Use(t),Gae(Ose(t),e,r),Gae(Ose(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&ose(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Zae(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Zae(t),cse(t,e),Gae(Ose(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!ise(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];use(t,o.clientX,o.clientY),Gae(Ose(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||qse(t,e)&&Gse(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Jae(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,Gae(Ose(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Rse(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Ise(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(Ose(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Wae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=Mse();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=Mse();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Zae(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Jae(this,this.transformState.scale),this.setup=bse(this.props))},t.prototype.render=function(){var e=Ose(this),t=this.props.children,n="function"==typeof t?t(e):t;return ld(Yse.Provider,{value:Vae(Vae({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:n})},t}(a.exports.Component),Xse=H.forwardRef((function(e,t){var n=a.exports.useState(null),r=n[0],o=n[1];return a.exports.useImperativeHandle(t,(function(){return r}),[r]),ld(Zse,{...Vae({},e,{setRef:o})})}));var Kse="transform-component-module_wrapper__1_Fgj",Qse="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Jse=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,s=e.wrapperStyle,l=e.contentStyle,c=a.exports.useContext(Yse).setComponents,u=a.exports.useRef(null),d=a.exports.useRef(null);return a.exports.useEffect((function(){var e=u.current,t=d.current;null!==e&&null!==t&&c&&c(e,t)}),[]),ld("div",{ref:u,className:"react-transform-wrapper "+Kse+" "+r,style:s,children:ld("div",{ref:d,className:"react-transform-component "+Qse+" "+i,style:l,children:t})})};function ele({image:e,alt:t,ref:n,styleClass:r}){const[o,i]=a.exports.useState(0),[s,l]=a.exports.useState(!1),c=()=>{i(-3===o?0:o-1)},u=()=>{i(3===o?0:o+1)},d=()=>{l(!s)};return ld(Xse,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:a,zoomOut:h,resetTransform:f,centerView:p})=>cd(sd,{children:[cd("div",{className:"lightbox-image-options",children:[ld(k3,{icon:ld(R9,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>a(),fontSize:20}),ld(k3,{icon:ld(N9,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>h(),fontSize:20}),ld(k3,{icon:ld(A9,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:c,fontSize:20}),ld(k3,{icon:ld(I9,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),ld(k3,{icon:ld(E9,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),ld(k3,{icon:ld(T9,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{f(),i(0),l(!1)},fontSize:20})]}),ld(Jse,{wrapperStyle:{width:"100%",height:"100%"},children:ld("img",{style:{transform:`rotate(${90*o}deg) scaleX(${s?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>p(1,0,"easeOut")})})]})})}function tle(){const e=m5(),t=v5((e=>e.options.isLightBoxOpen)),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:o,isOnLastImage:i}=v5(Qne),[s,l]=a.exports.useState(!1),c=()=>{l(!0)},u=()=>{l(!1)};return gte("Esc",(()=>{t&&e(q$(!1))}),[t]),cd("div",{className:"lightbox-container",children:[ld(k3,{icon:ld(M9,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(q$(!1))},fontSize:20}),cd("div",{className:"lightbox-display-container",children:[cd("div",{className:"lightbox-preview-wrapper",children:[ld(Yne,{}),!r&&cd("div",{className:"current-image-next-prev-buttons",children:[ld("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!o&&ld(zT,{"aria-label":"Previous image",icon:ld(M5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(FU())}})}),ld("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:u,children:s&&!i&&ld(zT,{"aria-label":"Next image",icon:ld(T5,{className:"next-prev-button"}),variant:"unstyled",onClick:()=>{e(jU())}})})]}),n&&cd(sd,{children:[ld(ele,{image:n.url,styleClass:"lightbox-image"}),r&&ld(Kne,{image:n})]})]}),ld(Aae,{})]})]})}const nle=uV([A3],(e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),rle=()=>{const e=m5(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:o}=v5(nle),{t:i}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{sliderMarkRightOffset:-6,label:i("options:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:t=>{e(rU(t))},handleReset:()=>e(rU(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:t=>{e(tU(t))},handleReset:()=>{e(tU(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-7,label:i("options:seamStrength"),min:.01,max:.99,step:.01,value:r,onChange:t=>{e(iU(t))},handleReset:()=>{e(iU(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),ld(Ite,{sliderMarkRightOffset:-4,label:i("options:seamSteps"),min:1,max:32,sliderNumberInputProps:{max:100},value:o,onChange:t=>{e(oU(t))},handleReset:()=>{e(oU(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},ole=uV(une,(e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),ile=()=>{const e=m5(),{boundingBoxDimensions:t}=v5(ole),{t:n}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(Ite,{label:n("options:width"),min:64,max:1024,step:64,value:t.width,onChange:n=>{e(KZ({...t,width:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{label:n("options:height"),min:64,max:1024,step:64,value:t.height,onChange:n=>{e(KZ({...t,height:Math.floor(n)}))},handleReset:()=>{e(KZ({...t,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},ale=uV(une,(e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}});function sle(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=v5(ale),n=m5(),{t:r}=FY();return cd(CI,{alignItems:"center",columnGap:"1rem",children:[ld(Ite,{label:r("options:inpaintReplace"),value:e,onChange:e=>{n(sX(e))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(sX(1)),isResetDisabled:!t}),ld(_3,{isChecked:t,onChange:e=>n(RX(e.target.checked)),marginTop:"1.25rem"})]})}const lle=uV([A3,O3,une],((e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:i}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:TU.isEqual}}),cle=()=>{const e=m5(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:i,scaledBoundingBoxDimensions:a}=v5(lle),{t:s}=FY();return cd(CI,{direction:"column",gap:"1rem",children:[ld(E3,{label:s("options:scaleBeforeProcessing"),validValues:CZ,value:o,onChange:t=>{e(JZ(t.target.value))}}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:t=>{e(HX({...a,width:Math.floor(t)}))},handleReset:()=>{e(HX({...a,width:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(Ite,{isInputDisabled:!i,isResetDisabled:!i,isSliderDisabled:!i,label:s("options:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:t=>{e(HX({...a,height:Math.floor(t)}))},handleReset:()=>{e(HX({...a,height:Math.floor(512)}))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),ld(sle,{}),ld(E3,{label:s("options:infillMethod"),value:n,validValues:r,onChange:t=>e(U$(t.target.value))}),ld(Ite,{isInputDisabled:"tile"!==n,isResetDisabled:"tile"!==n,isSliderDisabled:"tile"!==n,sliderMarkRightOffset:-4,label:s("options:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:t=>{e(kU(t))},handleReset:()=>{e(kU(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function ule(){const{t:e}=FY(),t={boundingBox:{header:`${e("options:boundingBoxHeader")}`,feature:Ete.BOUNDING_BOX,content:ld(ile,{})},seamCorrection:{header:`${e("options:seamCorrectionHeader")}`,feature:Ete.SEAM_CORRECTION,content:ld(rle,{})},infillAndScaling:{header:`${e("options:infillScalingHeader")}`,feature:Ete.INFILL_AND_SCALING,content:ld(cle,{})},seed:{header:`${e("options:seed")}`,feature:Ete.SEED,content:ld(Wte,{})},variations:{header:`${e("options:variations")}`,feature:Ete.VARIATIONS,content:ld(Xte,{}),additionalHeaderComponents:ld(qte,{})}};return cd(Hne,{children:[ld(wne,{}),ld(bne,{}),ld(one,{}),ld(Rte,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),ld(cne,{accordionInfo:t})]})}const dle=uV(une,hne,T3,((e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}})),hle=()=>{const e=m5(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=v5(dle),i=a.exports.useRef(null);return a.exports.useLayoutEffect((()=>{window.setTimeout((()=>{if(!i.current)return;const{clientWidth:t,clientHeight:n}=i.current;e(nX({width:t,height:n})),e(o?ZZ():YZ()),e(iX(!1))}),0)}),[e,r,t,n,o]),ld("div",{ref:i,className:"inpainting-canvas-area",children:ld(hT,{thickness:"2px",speed:"1s",size:"xl"})})};var fle={exports:{}},ple=function(e){var t={},n=a.exports,r=G.exports,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}var it=Object.prototype.hasOwnProperty,at=[],st=-1;function lt(e){return{current:e}}function ct(e){0>st||(e.current=at[st],at[st]=null,st--)}function ut(e,t){st++,at[st]=e.current,e.current=t}var dt={},ht=lt(dt),ft=lt(!1),pt=dt;function gt(e,t){var n=e.type.contextTypes;if(!n)return dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return null!=(e=e.childContextTypes)}function vt(){ct(ft),ct(ht)}function yt(e,t,n){if(ht.current!==dt)throw Error(i(168));ut(ht,t),ut(ft,n)}function bt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,C(e)||"Unknown",a));return o({},n,r)}function xt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dt,pt=ht.current,ut(ht,e),ut(ft,ft.current),!0}function wt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=bt(e,t,pt),r.__reactInternalMemoizedMergedChildContext=e,ct(ft),ct(ht),ut(ht,e)):ct(ft),ut(ft,n)}var kt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(St(e)/Ct|0)|0},St=Math.log,Ct=Math.LN2;var _t=64,Et=4194304;function Pt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=Pt(s):0!==(i&=a)&&(r=Pt(i))}else 0!==(a=n&~o)?r=Pt(a):0!==i&&(r=Pt(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-kt(t)]=n}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<>=a,o-=a,cn=1<<32-kt(t)+o|n<h?(f=d,d=null):f=d.sibling;var p=m(o,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(o,d),vn&&dn(o,h),c;if(null===d){for(;hf?(p=h,h=null):p=h.sibling;var b=m(o,h,y.value,c);if(null===b){null===h&&(h=p);break}e&&h&&null===b.alternate&&t(o,h),s=a(b,s,f),null===d?u=b:d.sibling=b,d=b,h=p}if(y.done)return n(o,h),vn&&dn(o,f),u;if(null===h){for(;!y.done;f++,y=l.next())null!==(y=g(o,y.value,c))&&(s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return vn&&dn(o,f),u}for(h=r(o,h);!y.done;f++,y=l.next())null!==(y=v(h,o,f,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?f:y.key),s=a(y,s,f),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach((function(e){return t(o,e)})),vn&&dn(o,f),u}return function e(r,i,a,d){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:e:{for(var h=a.key,f=i;null!==f;){if(f.key===h){if((h=a.type)===u){if(7===f.tag){n(r,f.sibling),(i=o(f,a.props.children)).return=r,r=i;break e}}else if(f.elementType===h||"object"==typeof h&&null!==h&&h.$$typeof===b&&dr(h)===f.type){n(r,f.sibling),(i=o(f,a.props)).ref=cr(r,f,a),i.return=r,r=i;break e}n(r,f);break}t(r,f),f=f.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=hs(a.type,a.key,a.props,null,r.mode,d)).ref=cr(r,i,a),d.return=r,r=d)}return s(r);case c:e:{for(f=a.key;null!==i;){if(i.key===f){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=ms(a,r.mode,d)).return=r,r=i}return s(r);case b:return e(r,i,(f=a._init)(a._payload),d)}if(A(a))return y(r,i,a,d);if(k(a))return x(r,i,a,d);ur(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=gs(a,r.mode,d)).return=r,r=i),s(r)):n(r,i)}}var fr=hr(!0),pr=hr(!1),gr={},mr=lt(gr),vr=lt(gr),yr=lt(gr);function br(e){if(e===gr)throw Error(i(174));return e}function xr(e,t){ut(yr,t),ut(vr,e),ut(mr,gr),e=R(t),ct(mr),ut(mr,e)}function wr(){ct(mr),ct(vr),ct(yr)}function kr(e){var t=br(yr.current),n=br(mr.current);n!==(t=N(n,e.type,t))&&(ut(vr,e),ut(mr,t))}function Sr(e){vr.current===e&&(ct(mr),ct(vr))}var Cr=lt(0);function _r(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ze(n)||Be(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Er=[];function Pr(){for(var e=0;en?n:4,e(!0);var r=Or.transition;Or.transition={};try{e(!1),t()}finally{Nt=n,Or.transition=r}}function vo(){return Vr().memoizedState}function yo(e,t,n){var r=Ra(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xo(e))wo(t,n);else if(null!==(n=Un(e,t,n,r))){Na(n,e,r,Ia()),ko(n,t,r)}}function bo(e,t,n){var r=Ra(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Yt(s,a)){var l=t.interleaved;return null===l?(o.next=o,$n(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(V2){}null!==(n=Un(e,t,o,r))&&(Na(n,e,r,o=Ia()),ko(n,t,r))}}function xo(e){var t=e.alternate;return e===Tr||null!==t&&t===Tr}function wo(e,t){Nr=Rr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Rt(e,n)}}var So={readContext:Wn,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},Co={readContext:Wn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:Wn,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ro(4194308,4,co.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?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=yo.bind(null,Tr,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:eo,useDebugValue:ho,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=eo(!1),t=e[0];return e=mo.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tr,o=Wr();if(vn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===aa)throw Error(i(349));0!=(30&Mr)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,io(Kr.bind(null,r,a,e),[e]),r.flags|=2048,to(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Wr(),t=aa.identifierPrefix;if(vn){var n=un;t=":"+t+"R"+(n=(cn&~(1<<32-kt(cn)-1)).toString(32)+n),0<(n=Dr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=zr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_o={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Ur,useRef:no,useState:function(){return Ur($r)},useDebugValue:ho,useDeferredValue:function(e){return go(Vr(),Ar.memoizedState,e)},useTransition:function(){return[Ur($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1},Eo={readContext:Wn,useCallback:fo,useContext:Wn,useEffect:ao,useImperativeHandle:uo,useInsertionEffect:so,useLayoutEffect:lo,useMemo:po,useReducer:Gr,useRef:no,useState:function(){return Gr($r)},useDebugValue:ho,useDeferredValue:function(e){var t=Vr();return null===Ar?t.memoizedState=e:go(t,Ar.memoizedState,e)},useTransition:function(){return[Gr($r)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:vo,unstable_isNewReconciler:!1};function Po(e,t){try{var n="",r=t;do{n+=Tn(r),r=r.return}while(r);var o=n}catch(nue){o="\nError generating stack: "+nue.message+"\n"+nue.stack}return{value:e,source:t,stack:o,digest:null}}function Lo(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Oo(e,t){try{console.error(t.value)}catch(Jce){setTimeout((function(){throw Jce}))}}var Mo="function"==typeof WeakMap?WeakMap:Map;function To(e,t,n){(n=Xn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Sa||(Sa=!0,Ca=r),Oo(0,t)},n}function Ao(e,t,n){(n=Xn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Oo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Oo(0,t),"function"!=typeof r&&(null===_a?_a=new Set([this]):_a.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Io(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Mo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=rs.bind(null,e,t,n),t.then(e,e))}function Ro(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function No(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Xn(-1,1)).tag=2,Kn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Do=s.ReactCurrentOwner,zo=!1;function Bo(e,t,n,r){t.child=null===e?pr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=Fr(e,t,n,r,i,o),n=Hr(),null===e||zo?(vn&&n&&fn(t),t.flags|=1,Bo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Fo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=hs(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Ho(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Mn)(a,r)&&e.ref===t.ref)return li(e,t,o)}return t.flags|=1,(e=ds(i,r)).ref=t.ref,e.return=t,t.child=e}function Ho(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Mn(i,r)&&e.ref===t.ref){if(zo=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,li(e,t,o);0!=(131072&e.flags)&&(zo=!0)}}return $o(e,t,n,r,o)}function Wo(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ua,ca),ca|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ua,ca),ca|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,ut(ua,ca),ca|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,ut(ua,ca),ca|=r;return Bo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,n,r,o){var i=mt(n)?pt:ht.current;return i=gt(t,i),Hn(t,o),n=Fr(e,t,n,r,i,o),r=Hr(),null===e||zo?(vn&&r&&fn(t),t.flags|=1,Bo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,li(e,t,o))}function Uo(e,t,n,r,o){if(mt(n)){var i=!0;xt(t)}else i=!1;if(Hn(t,o),null===t.stateNode)si(e,t),ar(t,n,r),lr(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Wn(c):c=gt(t,c=mt(n)?pt:ht.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&sr(t,a,r,c),qn=!1;var h=t.memoizedState;a.state=h,er(t,r,a,o),l=t.memoizedState,s!==r||h!==l||ft.current||qn?("function"==typeof u&&(rr(t,n,u,r),l=t.memoizedState),(s=qn||ir(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Zn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:An(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Wn(l):l=gt(t,l=mt(n)?pt:ht.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&sr(t,a,r,l),qn=!1,h=t.memoizedState,a.state=h,er(t,r,a,o);var p=t.memoizedState;s!==d||h!==p||ft.current||qn?("function"==typeof f&&(rr(t,n,f,r),p=t.memoizedState),(c=qn||ir(t,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&wt(t,n,!1),li(e,t,i);r=t.stateNode,Do.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):Bo(e,t,s,i),t.memoizedState=r.state,o&&wt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?yt(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yt(0,t.context,!1),xr(e,t.containerInfo)}function Yo(e,t,n,r,o){return Pn(),Ln(o),t.flags|=256,Bo(e,t,n,r),t.child}var Zo,Xo,Ko,Qo,Jo={dehydrated:null,treeContext:null,retryLane:0};function ei(e){return{baseLanes:e,cachePool:null,transitions:null}}function ti(e,t,n){var r,o=t.pendingProps,a=Cr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),ut(Cr,1&a),null===e)return Sn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:Be(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=ps(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ei(n),t.memoizedState=Jo,e):ni(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ri(e,t,s,r=Lo(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=ps({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=ei(s),t.memoizedState=Jo,a);if(0==(1&t.mode))return ri(e,t,s,null);if(Be(o))return r=je(o).digest,a=Error(i(419)),r=Lo(a,r,void 0),ri(e,t,s,r);if(n=0!=(s&e.childLanes),zo||n){if(null!==(r=aa)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Gn(e,o),Na(r,e,o,-1))}return qa(),ri(e,t,s,r=Lo(Error(i(421))))}return ze(o)?(t.flags|=128,t.child=e.child,t=is.bind(null,e),Fe(o,t),null):(e=a.treeContext,K&&(mn=$e(o),gn=t,vn=!0,bn=null,yn=!1,null!==e&&(an[sn++]=cn,an[sn++]=un,an[sn++]=ln,cn=e.id,un=e.overflow,ln=t)),t=ni(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null):(o=ds(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=ds(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?ei(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Jo,o}return e=(s=e.child).sibling,o=ds(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ni(e,t){return(t=ps({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ri(e,t,n,r){return null!==r&&Ln(r),fr(t,e.child,null,n),(e=ni(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function oi(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Fn(e.return,t,n)}function ii(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ai(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Bo(e,t,r.children,n),0!=(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oi(e,n,t);else if(19===e.tag)oi(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ut(Cr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===_r(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ii(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===_r(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ii(t,!0,n,null,i);break;case"together":ii(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function li(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=ds(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ds(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ci(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Z)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},Ko=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=br(mr.current);n=H(i,n,e,r,o,a),(t.updateQueue=n)&&ci(t)}},Qo=function(e,t,n,r){n!==r&&ci(t)};else if(X){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var di=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),Oe(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Ie(i,o.memoizedProps,o)),Oe(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),di(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Le(e);di(r,t,!1,!1),n.pendingChildren=r,ci(t),Me(e,r)}},Ko=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=br(mr.current),c=null;a!==r&&(c=H(s,n,a,r,o,l)),e&&null===c?t.stateNode=i:(i=Pe(i,c,n,a,r,t,e,s),F(i,n,r,o,l)&&ci(t),t.stateNode=i,e?ci(t):Zo(i,t,!1,!1))}},Qo=function(e,t,n,r){n!==r?(e=br(yr.current),n=br(mr.current),t.stateNode=V(r,e,n,t),ci(t)):t.stateNode=e.stateNode}}else Xo=function(){},Ko=function(){},Qo=function(){};function hi(e,t){if(!vn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pi(e,t,n){var r=t.pendingProps;switch(pn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return mt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),ct(ft),ct(ht),Pr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(_n(t)?ci(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==bn&&(ja(bn),bn=null))),Xo(e,t),fi(t),null;case 5:Sr(t),n=br(yr.current);var o=t.type;if(null!==e&&null!=t.stateNode)Ko(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=br(mr.current),_n(t)){if(!K)throw Error(i(175));e=Ue(t.stateNode,t.type,t.memoizedProps,n,e,t,!yn),t.updateQueue=e,null!==e&&ci(t)}else{var a=B(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,F(a,o,r,n,e)&&ci(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=br(yr.current),n=br(mr.current),_n(t)){if(!K)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ge(e,n,t,!yn))&&null!==(o=gn))switch(o.tag){case 3:et(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:tt(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&ci(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(ct(Cr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(vn&&null!==mn&&0!=(1&t.mode)&&0==(128&t.flags))En(),Pn(),t.flags|=98560,o=!1;else if(o=_n(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!K)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));qe(o,t)}else Pn(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==bn&&(ja(bn),bn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Cr.current)?0===da&&(da=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&J(t.stateNode.containerInfo),fi(t),null;case 10:return jn(t.type._context),fi(t),null;case 19:if(ct(Cr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)hi(o,!1);else{if(0!==da||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=_r(e))){for(t.flags|=128,hi(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return ut(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==o.tail&&Ht()>ba&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=_r(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),hi(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!vn)return fi(t),null}else 2*Ht()-o.renderingStartTime>ba&&1073741824!==n&&(t.flags|=128,r=!0,hi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,e=Cr.current,ut(Cr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&ca)&&(fi(t),Z&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function gi(e,t){switch(pn(t),t.tag){case 1:return mt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),ct(ft),ct(ht),Pr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Sr(t),null;case 13:if(ct(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));Pn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ct(Cr),null;case 4:return wr(),null;case 10:return jn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var mi=!1,vi=!1,yi="function"==typeof WeakSet?WeakSet:Set,bi=null;function xi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(oue){ns(e,t,oue)}else n.current=null}function wi(e,t,n){try{n()}catch(oue){ns(e,t,oue)}}var ki=!1;function Si(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Ci(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 _i(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=I(n);else e=n;"function"==typeof t?t(e):t.current=e}}function Ei(e){var t=e.alternate;null!==t&&(e.alternate=null,Ei(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&te(t)),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 Pi(e){return 5===e.tag||3===e.tag||4===e.tag}function Li(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Pi(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ye(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}function Mi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):he(n,e);else if(4!==r&&null!==(e=e.child))for(Mi(e,t,n),e=e.sibling;null!==e;)Mi(e,t,n),e=e.sibling}var Ti=null,Ai=!1;function Ii(e,t,n){for(n=n.child;null!==n;)Ri(e,t,n),n=n.sibling}function Ri(e,t,n){if(qt&&"function"==typeof qt.onCommitFiberUnmount)try{qt.onCommitFiberUnmount(Gt,n)}catch(iue){}switch(n.tag){case 5:vi||xi(n,t);case 6:if(Z){var r=Ti,o=Ai;Ti=null,Ii(e,t,n),Ai=o,null!==(Ti=r)&&(Ai?xe(Ti,n.stateNode):be(Ti,n.stateNode))}else Ii(e,t,n);break;case 18:Z&&null!==Ti&&(Ai?Qe(Ti,n.stateNode):Ke(Ti,n.stateNode));break;case 4:Z?(r=Ti,o=Ai,Ti=n.stateNode.containerInfo,Ai=!0,Ii(e,t,n),Ti=r,Ai=o):(X&&(r=n.stateNode.containerInfo,o=Le(r),Te(r,o)),Ii(e,t,n));break;case 0:case 11:case 14:case 15:if(!vi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ii(e,t,n);break;case 1:if(!vi&&(xi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(iue){ns(n,t,iue)}Ii(e,t,n);break;case 21:Ii(e,t,n);break;case 22:1&n.mode?(vi=(r=vi)||null!==n.memoizedState,Ii(e,t,n),vi=r):Ii(e,t,n);break;default:Ii(e,t,n)}}function Ni(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new yi),t.forEach((function(t){var r=as.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Di(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Qi(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Ji(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Ht()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ta(r/1960))-r)){e.timeoutHandle=$(Ja.bind(null,e,va,xa),r);break}Ja(e,va,xa);break;default:throw Error(i(329))}}}return Da(e,Ht()),e.callbackNode===n?za.bind(null,e):null}function Ba(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&($a(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=va,va=n,null!==t&&ja(t)),e}function ja(e){null===va?va=e:va.push.apply(va,e)}function Fa(e,t){for(t&=~ga,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Pa)var r=!1;else{if(e=Pa,Pa=null,La=0,0!=(6&ia))throw Error(i(331));var o=ia;for(ia|=4,bi=e.current;null!==bi;){var a=bi,s=a.child;if(0!=(16&bi.flags)){var l=a.deletions;if(null!==l){for(var c=0;cHt()-ya?$a(e,0):ga|=n),Da(e,t)}function os(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Et,0==(130023424&(Et<<=1))&&(Et=4194304)));var n=Ia();null!==(e=Gn(e,t))&&(It(e,t,n),Da(e,n))}function is(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),os(e,n)}function as(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),os(e,n)}function ss(e,t){return zt(e,t)}function ls(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 cs(e,t,n,r){return new ls(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function ds(e,t){var n=e.alternate;return null===n?((n=cs(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case d:s=8,o|=8;break;case h:return(e=cs(12,n,t,2|o)).elementType=h,e.lanes=a,e;case m:return(e=cs(13,n,t,o)).elementType=m,e.lanes=a,e;case v:return(e=cs(19,n,t,o)).elementType=v,e.lanes=a,e;case x:return ps(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:s=10;break e;case p:s=9;break e;case g:s=11;break e;case y:s=14;break e;case b:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=cs(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=cs(7,e,r,t)).lanes=n,e}function ps(e,t,n,r){return(e=cs(22,e,r,t)).elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function gs(e,t,n){return(e=cs(6,e,null,t)).lanes=n,e}function ms(e,t,n){return(t=cs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,K&&(this.mutableSourceEagerHydrationData=null)}function ys(e,t,n,r,o,i,a,s,l){return e=new vs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=cs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yn(i),e}function bs(e){if(!e)return dt;e:{if(_(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(mt(n))return bt(e,n,t)}return t}function xs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=L(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=u&&a>=h&&o<=d&&s<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||fs)){h>a&&(c.height+=h-a,c.y=a),fo)){u>r&&(c.width+=u-r,c.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?I(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Ss,findFiberByHostInstance:e.findFiberByHostInstance||Cs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Gt=t.inject(e),qt=t}catch(Jce){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(i(363));e=ea(e,t);var o=de(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Nt;try{return Nt=e,t()}finally{Nt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ia(),a=Ra(o);return n=bs(n),null===t.context?t.context=n:t.pendingContext=n,(t=Xn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Kn(o,t,a))&&(Na(e,o,a,i),Qn(e,o,a)),a},t}; /** * @license React * react-reconciler.production.min.js diff --git a/frontend/dist/assets/index.dca51560.js b/frontend/dist/assets/index.726ca2dc.js similarity index 83% rename from frontend/dist/assets/index.dca51560.js rename to frontend/dist/assets/index.726ca2dc.js index ede6f94277..acfa5f1f0b 100644 --- a/frontend/dist/assets/index.dca51560.js +++ b/frontend/dist/assets/index.726ca2dc.js @@ -476,7 +476,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iP=Symbol.for("react.element"),oP=Symbol.for("react.portal"),Ex=Symbol.for("react.fragment"),Px=Symbol.for("react.strict_mode"),Tx=Symbol.for("react.profiler"),Lx=Symbol.for("react.provider"),Ax=Symbol.for("react.context"),t8e=Symbol.for("react.server_context"),Ox=Symbol.for("react.forward_ref"),Mx=Symbol.for("react.suspense"),Rx=Symbol.for("react.suspense_list"),Ix=Symbol.for("react.memo"),Dx=Symbol.for("react.lazy"),n8e=Symbol.for("react.offscreen"),LG;LG=Symbol.for("react.module.reference");function vs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iP:switch(e=e.type,e){case Ex:case Tx:case Px:case Mx:case Rx:return e;default:switch(e=e&&e.$$typeof,e){case t8e:case Ax:case Ox:case Dx:case Ix:case Lx:return e;default:return t}}case oP:return t}}}Bn.ContextConsumer=Ax;Bn.ContextProvider=Lx;Bn.Element=iP;Bn.ForwardRef=Ox;Bn.Fragment=Ex;Bn.Lazy=Dx;Bn.Memo=Ix;Bn.Portal=oP;Bn.Profiler=Tx;Bn.StrictMode=Px;Bn.Suspense=Mx;Bn.SuspenseList=Rx;Bn.isAsyncMode=function(){return!1};Bn.isConcurrentMode=function(){return!1};Bn.isContextConsumer=function(e){return vs(e)===Ax};Bn.isContextProvider=function(e){return vs(e)===Lx};Bn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iP};Bn.isForwardRef=function(e){return vs(e)===Ox};Bn.isFragment=function(e){return vs(e)===Ex};Bn.isLazy=function(e){return vs(e)===Dx};Bn.isMemo=function(e){return vs(e)===Ix};Bn.isPortal=function(e){return vs(e)===oP};Bn.isProfiler=function(e){return vs(e)===Tx};Bn.isStrictMode=function(e){return vs(e)===Px};Bn.isSuspense=function(e){return vs(e)===Mx};Bn.isSuspenseList=function(e){return vs(e)===Rx};Bn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ex||e===Tx||e===Px||e===Mx||e===Rx||e===n8e||typeof e=="object"&&e!==null&&(e.$$typeof===Dx||e.$$typeof===Ix||e.$$typeof===Lx||e.$$typeof===Ax||e.$$typeof===Ox||e.$$typeof===LG||e.getModuleId!==void 0)};Bn.typeOf=vs;(function(e){e.exports=Bn})(e8e);function r8e(){const e=Y9e();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 YI={notify(){},get:()=>[]};function i8e(e,t){let n,r=YI;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=r8e())}function u(){n&&(n(),n=void 0,r.clear(),r=YI)}const f={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return f}const o8e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a8e=o8e?C.exports.useLayoutEffect:C.exports.useEffect;function s8e({store:e,context:t,children:n,serverState:r}){const i=C.exports.useMemo(()=>{const s=i8e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=C.exports.useMemo(()=>e.getState(),[e]);return a8e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),y((t||nf).Provider,{value:i,children:n})}function AG(e=nf){const t=e===nf?PG:()=>C.exports.useContext(e);return function(){const{store:r}=t();return r}}const l8e=AG();function u8e(e=nf){const t=e===nf?l8e:AG(e);return function(){return t().dispatch}}const c8e=u8e();X9e(_G.exports.useSyncExternalStoreWithSelector);q9e(pu.exports.unstable_batchedUpdates);function O4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O4=function(n){return typeof n}:O4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},O4(e)}function d8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;ny(at,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y(by,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),Be=c8e,ve=J9e,g8e=lt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),m8e=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ve(g8e),i=t?Math.round(t*100/n):0;return y(LV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};var RG={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ZI=oe.createContext&&oe.createContext(RG),Wd=globalThis&&globalThis.__assign||function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y(so,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y(fs,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function q8e(e){const{title:t,hotkey:n,description:r}=e;return K("div",{className:"hotkey-modal-item",children:[K("div",{className:"hotkey-info",children:[y("p",{className:"hotkey-title",children:t}),r&&y("p",{className:"hotkey-description",children:r})]}),y("div",{className:"hotkey-key",children:n})]})}function Y8e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=f=>{const p=[];return f.forEach((m,v)=>{p.push(y(q8e,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y("div",{className:"hotkey-modal-category",children:p})};return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,children:[y(Jd,{}),K(ep,{className:" modal hotkeys-modal",children:[y(Cy,{className:"modal-close-btn"}),y("h1",{children:"Keyboard Shorcuts"}),y("div",{className:"hotkeys-modal-items",children:K(Nk,{allowMultiple:!0,children:[K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:appHotkeys")}),y(ng,{})]}),y(ig,{children:u(o)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:generalHotkeys")}),y(ng,{})]}),y(ig,{children:u(a)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:galleryHotkeys")}),y(ng,{})]}),y(ig,{children:u(s)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y(ng,{})]}),y(ig,{children:u(l)})]})]})})]})]})]})}const os=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return K(Ir,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y(ti,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y(kE,{className:"invokeai__switch-root",...s})]})},nl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return K(Ir,{isDisabled:n,className:`invokeai__select ${l}`,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},children:[t&&y(ti,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y(so,{label:i,...o,children:y(OV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(f=>typeof f=="string"||typeof f=="number"?y("option",{value:f,className:"invokeai__select-option",children:f},f):y("option",{value:f.value,className:"invokeai__select-option",children:f.key},f.value))})})]})},JI=/^-?(0\.)?\.?$/,Eo=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:f,min:p,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:E,numberInputStepperProps:k,tooltipProps:_,...T}=e,[A,R]=C.exports.useState(String(u));C.exports.useEffect(()=>{!A.match(JI)&&u!==Number(A)&&R(String(u))},[u,A]);const I=B=>{R(B),B.match(JI)||f(v?Math.floor(Number(B)):Number(B))},D=B=>{const z=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),p,m);R(String(z)),f(z)};return y(so,{..._,children:K(Ir,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y(ti,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),K(gE,{className:"invokeai__number-input-root",value:A,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[y(mE,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&K("div",{className:"invokeai__number-input-stepper",children:[y(yE,{...k,className:"invokeai__number-input-stepper-button"}),y(vE,{...k,className:"invokeai__number-input-stepper-button"})]})]})]})})},al=e=>e.system,K8e=e=>e.system.toastQueue,_r=lt(e=>e.options,e=>zE[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});lt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const dP=e=>e.options,X8e=lt([al,dP],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,f)=>f),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Z8e=({children:e})=>{const t=Be(),{t:n}=Ke(),r=ve(_=>_.options.steps),{isOpen:i,onOpen:o,onClose:a}=Qh(),{isOpen:s,onOpen:l,onClose:u}=Qh(),{shouldDisplayInProgressType:f,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=ve(X8e),E=()=>{MG.purge().then(()=>{a(),l()})},k=_=>{_>r&&(_=r),_<1&&(_=1),t(dwe(_))};return K(fn,{children:[C.exports.cloneElement(e,{onClick:o}),K(Qd,{isOpen:i,onClose:a,size:"lg",children:[y(Jd,{}),K(ep,{className:"modal settings-modal",children:[y(S1,{className:"settings-modal-header",children:n("common:settingsLabel")}),y(Cy,{className:"modal-close-btn"}),K(t1,{className:"settings-modal-content",children:[K("div",{className:"settings-modal-items",children:[K("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y(nl,{label:n("settings:displayInProgress"),validValues:aCe,value:f,onChange:_=>t(iwe(_.target.value))}),f==="full-res"&&y(Eo,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:k,value:v,width:"auto",textAlign:"center"})]}),y(os,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:p,onChange:_=>t(eW(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(lwe(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(cSe(_.target.checked))})]}),K("div",{className:"settings-modal-items",children:[y("h2",{style:{fontWeight:"bold"},children:"Developer"}),y(os,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(fwe(_.target.checked))})]}),K("div",{className:"settings-modal-reset",children:[y(Hh,{size:"md",children:n("settings:resetWebUI")}),y(ds,{colorScheme:"red",onClick:E,children:n("settings:resetWebUI")}),y(yr,{children:n("settings:resetWebUIDesc1")}),y(yr,{children:n("settings:resetWebUIDesc2")})]})]}),y(cx,{children:y(ds,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),K(Qd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y(Jd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y(ep,{children:y(t1,{pb:6,pt:6,children:y(at,{justifyContent:"center",children:y(yr,{fontSize:"lg",children:y(yr,{children:n("settings:resetComplete")})})})})})]})]})},Q8e=lt(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:gi.exports.isEqual}}),J8e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ve(Q8e),s=Be(),{t:l}=Ke();let u;e&&!o?u="status-good":u="status-bad";let f=i;return[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(f)&&(u="status-working"),f&&t&&r>1&&(f+=` (${n}/${r})`),y(so,{label:o&&!a?"Click to clear, check logs for details":void 0,children:y(yr,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(tW())},className:`status ${u}`,children:l(f)})})},Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return K(bE,{...o,children:[y(wE,{children:t}),K(xE,{className:`invokeai__popover-content ${r}`,children:[i&&y(SE,{className:"invokeai__popover-arrow"}),n]})]})},qr=Oe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y(so,{label:r,...i,children:y(ds,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function e_e(){const{t:e}=Ke(),{setColorMode:t,colorMode:n}=uy(),r=Be(),i=ve(l=>l.options.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};C.exports.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(Q5e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y(qr,{style:{width:"6rem"},leftIcon:i===u?y(aP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(B8e,{})}),children:y(pi,{align:"stretch",children:s()})})}const t_e=lt([al],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),n_e=()=>{const e=Be(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ve(t_e);return y(at,{style:{paddingLeft:"0.3rem"},children:y(nl,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e(BW(a.target.value))}})})};function rs(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return K(Ir,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y(ti,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y(Uk,{...l,className:"input-entry",size:a,width:o})]})}var eD=Array.isArray,tD=Object.keys,r_e=Object.prototype.hasOwnProperty,i_e=typeof Element<"u";function w8(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=eD(e),r=eD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!w8(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var p=tD(e);if(o=p.length,o!==tD(t).length)return!1;for(i=o;i--!==0;)if(!r_e.call(t,p[i]))return!1;if(i_e&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!w8(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Sd=function(t,n){try{return w8(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},o_e=function(t){return a_e(t)&&!s_e(t)};function a_e(e){return!!e&&typeof e=="object"}function s_e(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||c_e(e)}var l_e=typeof Symbol=="function"&&Symbol.for,u_e=l_e?Symbol.for("react.element"):60103;function c_e(e){return e.$$typeof===u_e}function d_e(e){return Array.isArray(e)?[]:{}}function q5(e,t){return t.clone!==!1&&t.isMergeableObject(e)?J2(d_e(e),e,t):e}function f_e(e,t,n){return e.concat(t).map(function(r){return q5(r,n)})}function h_e(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=q5(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=q5(t[i],n):r[i]=J2(e[i],t[i],n)}),r}function J2(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||f_e,n.isMergeableObject=n.isMergeableObject||o_e;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):h_e(e,t,n):q5(t,n)}J2.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return J2(r,i,n)},{})};var C8=J2,p_e=typeof global=="object"&&global&&global.Object===Object&&global;const GG=p_e;var g_e=typeof self=="object"&&self&&self.Object===Object&&self,m_e=GG||g_e||Function("return this")();const Su=m_e;var v_e=Su.Symbol;const rf=v_e;var qG=Object.prototype,y_e=qG.hasOwnProperty,b_e=qG.toString,cv=rf?rf.toStringTag:void 0;function S_e(e){var t=y_e.call(e,cv),n=e[cv];try{e[cv]=void 0;var r=!0}catch(o){}var i=b_e.call(e);return r&&(t?e[cv]=n:delete e[cv]),i}var x_e=Object.prototype,w_e=x_e.toString;function C_e(e){return w_e.call(e)}var __e="[object Null]",k_e="[object Undefined]",nD=rf?rf.toStringTag:void 0;function bp(e){return e==null?e===void 0?k_e:__e:nD&&nD in Object(e)?S_e(e):C_e(e)}function YG(e,t){return function(n){return e(t(n))}}var E_e=YG(Object.getPrototypeOf,Object);const fP=E_e;function Sp(e){return e!=null&&typeof e=="object"}var P_e="[object Object]",T_e=Function.prototype,L_e=Object.prototype,KG=T_e.toString,A_e=L_e.hasOwnProperty,O_e=KG.call(Object);function rD(e){if(!Sp(e)||bp(e)!=P_e)return!1;var t=fP(e);if(t===null)return!0;var n=A_e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&KG.call(n)==O_e}function M_e(){this.__data__=[],this.size=0}function XG(e,t){return e===t||e!==e&&t!==t}function Bx(e,t){for(var n=e.length;n--;)if(XG(e[n][0],t))return n;return-1}var R_e=Array.prototype,I_e=R_e.splice;function D_e(e){var t=this.__data__,n=Bx(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():I_e.call(t,n,1),--this.size,!0}function N_e(e){var t=this.__data__,n=Bx(t,e);return n<0?void 0:t[n][1]}function B_e(e){return Bx(this.__data__,e)>-1}function $_e(e,t){var n=this.__data__,r=Bx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Wke}var Gke="[object Arguments]",qke="[object Array]",Yke="[object Boolean]",Kke="[object Date]",Xke="[object Error]",Zke="[object Function]",Qke="[object Map]",Jke="[object Number]",eEe="[object Object]",tEe="[object RegExp]",nEe="[object Set]",rEe="[object String]",iEe="[object WeakMap]",oEe="[object ArrayBuffer]",aEe="[object DataView]",sEe="[object Float32Array]",lEe="[object Float64Array]",uEe="[object Int8Array]",cEe="[object Int16Array]",dEe="[object Int32Array]",fEe="[object Uint8Array]",hEe="[object Uint8ClampedArray]",pEe="[object Uint16Array]",gEe="[object Uint32Array]",ir={};ir[sEe]=ir[lEe]=ir[uEe]=ir[cEe]=ir[dEe]=ir[fEe]=ir[hEe]=ir[pEe]=ir[gEe]=!0;ir[Gke]=ir[qke]=ir[oEe]=ir[Yke]=ir[aEe]=ir[Kke]=ir[Xke]=ir[Zke]=ir[Qke]=ir[Jke]=ir[eEe]=ir[tEe]=ir[nEe]=ir[rEe]=ir[iEe]=!1;function mEe(e){return Sp(e)&&rq(e.length)&&!!ir[bp(e)]}function hP(e){return function(t){return e(t)}}var iq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,o2=iq&&typeof module=="object"&&module&&!module.nodeType&&module,vEe=o2&&o2.exports===iq,EC=vEe&&GG.process,yEe=function(){try{var e=o2&&o2.require&&o2.require("util").types;return e||EC&&EC.binding&&EC.binding("util")}catch(t){}}();const i1=yEe;var uD=i1&&i1.isTypedArray,bEe=uD?hP(uD):mEe;const SEe=bEe;var xEe=Object.prototype,wEe=xEe.hasOwnProperty;function oq(e,t){var n=Ny(e),r=!n&&Nke(e),i=!n&&!r&&nq(e),o=!n&&!r&&!i&&SEe(e),a=n||r||i||o,s=a?Oke(e.length,String):[],l=s.length;for(var u in e)(t||wEe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uke(u,l)))&&s.push(u);return s}var CEe=Object.prototype;function pP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CEe;return e===n}var _Ee=YG(Object.keys,Object);const kEe=_Ee;var EEe=Object.prototype,PEe=EEe.hasOwnProperty;function TEe(e){if(!pP(e))return kEe(e);var t=[];for(var n in Object(e))PEe.call(e,n)&&n!="constructor"&&t.push(n);return t}function aq(e){return e!=null&&rq(e.length)&&!ZG(e)}function gP(e){return aq(e)?oq(e):TEe(e)}function LEe(e,t){return e&&Fx(t,gP(t),e)}function AEe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OEe=Object.prototype,MEe=OEe.hasOwnProperty;function REe(e){if(!Dy(e))return AEe(e);var t=pP(e),n=[];for(var r in e)r=="constructor"&&(t||!MEe.call(e,r))||n.push(r);return n}function mP(e){return aq(e)?oq(e,!0):REe(e)}function IEe(e,t){return e&&Fx(t,mP(t),e)}var sq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cD=sq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=cD&&cD.exports===sq,dD=DEe?Su.Buffer:void 0,fD=dD?dD.allocUnsafe:void 0;function NEe(e,t){if(t)return e.slice();var n=e.length,r=fD?fD(n):new e.constructor(n);return e.copy(r),r}function lq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function TD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var LD=function(t){return Array.isArray(t)&&t.length===0},Vo=function(t){return typeof t=="function"},zx=function(t){return t!==null&&typeof t=="object"},ITe=function(t){return String(Math.floor(Number(t)))===t},PC=function(t){return Object.prototype.toString.call(t)==="[object String]"},bq=function(t){return C.exports.Children.count(t)===0},TC=function(t){return zx(t)&&Vo(t.then)};function Hi(e,t,n,r){r===void 0&&(r=0);for(var i=yq(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function Sq(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Xe){return B(Xe,Hi(ue,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(We).then(function(Xe){return Xe.reduce(function(Ce,Ne,kt){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(Ce=au(Ce,Ie[kt],Ne)),Ce},{})})},[B]),j=C.exports.useCallback(function(ue){return Promise.all([z(ue),m.validationSchema?D(ue):{},m.validate?I(ue):{}]).then(function(Ie){var We=Ie[0],Xe=Ie[1],Ce=Ie[2],Ne=C8.all([We,Xe,Ce],{arrayMerge:zTe});return Ne})},[m.validate,m.validationSchema,z,I,D]),Y=Xa(function(ue){return ue===void 0&&(ue=A.values),R({type:"SET_ISVALIDATING",payload:!0}),j(ue).then(function(Ie){return k.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ie})),Ie})});C.exports.useEffect(function(){a&&k.current===!0&&Sd(v.current,m.initialValues)&&Y(v.current)},[a,Y]);var te=C.exports.useCallback(function(ue){var Ie=ue&&ue.values?ue.values:v.current,We=ue&&ue.errors?ue.errors:b.current?b.current:m.initialErrors||{},Xe=ue&&ue.touched?ue.touched:x.current?x.current:m.initialTouched||{},Ce=ue&&ue.status?ue.status:E.current?E.current:m.initialStatus;v.current=Ie,b.current=We,x.current=Xe,E.current=Ce;var Ne=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!ue&&!!ue.isSubmitting,errors:We,touched:Xe,status:Ce,values:Ie,isValidating:!!ue&&!!ue.isValidating,submitCount:!!ue&&!!ue.submitCount&&typeof ue.submitCount=="number"?ue.submitCount:0}})};if(m.onReset){var kt=m.onReset(A.values,dt);TC(kt)?kt.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);C.exports.useEffect(function(){k.current===!0&&!Sd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&Y(v.current))},[u,m.initialValues,te,a,Y]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,R({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(x.current,m.initialTouched)&&(x.current=m.initialTouched||Nb,R({type:"SET_TOUCHED",payload:m.initialTouched||Nb}))},[u,m.initialTouched]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(E.current,m.initialStatus)&&(E.current=m.initialStatus,R({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ue){if(_.current[ue]&&Vo(_.current[ue].validate)){var Ie=Hi(A.values,ue),We=_.current[ue].validate(Ie);return TC(We)?(R({type:"SET_ISVALIDATING",payload:!0}),We.then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:ue,value:We}}),Promise.resolve(We))}else if(m.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ue).then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe[ue]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=C.exports.useCallback(function(ue,Ie){var We=Ie.validate;_.current[ue]={validate:We}},[]),V=C.exports.useCallback(function(ue){delete _.current[ue]},[]),J=Xa(function(ue,Ie){R({type:"SET_TOUCHED",payload:ue});var We=Ie===void 0?i:Ie;return We?Y(A.values):Promise.resolve()}),Z=C.exports.useCallback(function(ue){R({type:"SET_ERRORS",payload:ue})},[]),U=Xa(function(ue,Ie){var We=Vo(ue)?ue(A.values):ue;R({type:"SET_VALUES",payload:We});var Xe=Ie===void 0?n:Ie;return Xe?Y(We):Promise.resolve()}),X=C.exports.useCallback(function(ue,Ie){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Ie}})},[]),le=Xa(function(ue,Ie,We){R({type:"SET_FIELD_VALUE",payload:{field:ue,value:Ie}});var Xe=We===void 0?n:We;return Xe?Y(au(A.values,ue,Ie)):Promise.resolve()}),fe=C.exports.useCallback(function(ue,Ie){var We=Ie,Xe=ue,Ce;if(!PC(ue)){ue.persist&&ue.persist();var Ne=ue.target?ue.target:ue.currentTarget,kt=Ne.type,Nt=Ne.name,Te=Ne.id,Et=Ne.value,Ut=Ne.checked,Ve=Ne.outerHTML,ft=Ne.options,un=Ne.multiple;We=Ie||Nt||Te,Xe=/number|range/.test(kt)?(Ce=parseFloat(Et),isNaN(Ce)?"":Ce):/checkbox/.test(kt)?HTe(Hi(A.values,We),Ut,Et):ft&&un?jTe(ft):Et}We&&le(We,Xe)},[le,A.values]),Se=Xa(function(ue){if(PC(ue))return function(Ie){return fe(Ie,ue)};fe(ue)}),Ae=Xa(function(ue,Ie,We){Ie===void 0&&(Ie=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:ue,value:Ie}});var Xe=We===void 0?i:We;return Xe?Y(A.values):Promise.resolve()}),be=C.exports.useCallback(function(ue,Ie){ue.persist&&ue.persist();var We=ue.target,Xe=We.name,Ce=We.id,Ne=We.outerHTML,kt=Ie||Xe||Ce;Ae(kt,!0)},[Ae]),ke=Xa(function(ue){if(PC(ue))return function(Ie){return be(Ie,ue)};be(ue)}),De=C.exports.useCallback(function(ue){Vo(ue)?R({type:"SET_FORMIK_STATE",payload:ue}):R({type:"SET_FORMIK_STATE",payload:function(){return ue}})},[]),Je=C.exports.useCallback(function(ue){R({type:"SET_STATUS",payload:ue})},[]),Ye=C.exports.useCallback(function(ue){R({type:"SET_ISSUBMITTING",payload:ue})},[]),mt=Xa(function(){return R({type:"SUBMIT_ATTEMPT"}),Y().then(function(ue){var Ie=ue instanceof Error,We=!Ie&&Object.keys(ue).length===0;if(We){var Xe;try{if(Xe=vt(),Xe===void 0)return}catch(Ce){throw Ce}return Promise.resolve(Xe).then(function(Ce){return k.current&&R({type:"SUBMIT_SUCCESS"}),Ce}).catch(function(Ce){if(k.current)throw R({type:"SUBMIT_FAILURE"}),Ce})}else if(k.current&&(R({type:"SUBMIT_FAILURE"}),Ie))throw ue})}),_t=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),mt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),dt={resetForm:te,validateForm:Y,validateField:G,setErrors:Z,setFieldError:X,setFieldTouched:Ae,setFieldValue:le,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,setFormikState:De,submitForm:mt},vt=Xa(function(){return f(A.values,dt)}),xt=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),te()}),Le=C.exports.useCallback(function(ue){return{value:Hi(A.values,ue),error:Hi(A.errors,ue),touched:!!Hi(A.touched,ue),initialValue:Hi(v.current,ue),initialTouched:!!Hi(x.current,ue),initialError:Hi(b.current,ue)}},[A.errors,A.touched,A.values]),ut=C.exports.useCallback(function(ue){return{setValue:function(We,Xe){return le(ue,We,Xe)},setTouched:function(We,Xe){return Ae(ue,We,Xe)},setError:function(We){return X(ue,We)}}},[le,Ae,X]),Rt=C.exports.useCallback(function(ue){var Ie=zx(ue),We=Ie?ue.name:ue,Xe=Hi(A.values,We),Ce={name:We,value:Xe,onChange:Se,onBlur:ke};if(Ie){var Ne=ue.type,kt=ue.value,Nt=ue.as,Te=ue.multiple;Ne==="checkbox"?kt===void 0?Ce.checked=!!Xe:(Ce.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(kt)),Ce.value=kt):Ne==="radio"?(Ce.checked=Xe===kt,Ce.value=kt):Nt==="select"&&Te&&(Ce.value=Ce.value||[],Ce.multiple=!0)}return Ce},[ke,Se,A.values]),ot=C.exports.useMemo(function(){return!Sd(v.current,A.values)},[v.current,A.values]),Ct=C.exports.useMemo(function(){return typeof s<"u"?ot?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Vo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ot,A.errors,m]),ln=Wn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:x.current,initialStatus:E.current,handleBlur:ke,handleChange:Se,handleReset:xt,handleSubmit:_t,resetForm:te,setErrors:Z,setFormikState:De,setFieldTouched:Ae,setFieldValue:le,setFieldError:X,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,submitForm:mt,validateForm:Y,validateField:G,isValid:Ct,dirty:ot,unregisterField:V,registerField:$,getFieldProps:Rt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return ln}function wP(e){var t=BTe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return C.exports.useImperativeHandle(o,function(){return t}),C.exports.createElement(DTe,{value:t},n?C.exports.createElement(n,t):i?i(t):r?Vo(r)?r(t):bq(r)?null:C.exports.Children.only(r):null)}function $Te(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Hi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function FTe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=T8(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function T8(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||rD(i)?T8(i):i!==""?i:void 0}):rD(e[r])?t[r]=T8(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function zTe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?C8(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=C8(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function jTe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function HTe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var VTe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function Xa(e){var t=C.exports.useRef(e);return VTe(function(){t.current=e}),C.exports.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Wn({},t,{length:n+1}))}else return[]},YTe=function(e){RTe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,f=l.formik.setFormikState;f(function(p){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(p.values,u,o(Hi(p.values,u))),x=s?m(Hi(p.errors,u)):void 0,E=a?v(Hi(p.touched,u)):void 0;return LD(x)&&(x=void 0),LD(E)&&(E=void 0),Wn({},p,{values:b,errors:s?au(p.errors,u,x):p.errors,touched:a?au(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(o1(a),[MTe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return GTe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return WTe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return LC(s,o,a)},function(s){return LC(s,o,null)},function(s){return LC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return qTe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(TD(i)),i.pop=i.pop.bind(TD(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Hi(i.formik.values,i.name),Hi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?o1(a):[];return o||(o=s[i]),Vo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,f=o.formik,p=Ih(f,["validate","validationSchema"]),m=Wn({},i,{form:p,name:u});return a?C.exports.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):bq(l)?null:C.exports.Children.only(l):null},t}(C.exports.Component);YTe.defaultProps={validateOnChange:!0};const KTe=lt([al],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),AD=64,OD=2048;function XTe(){const{openModel:e,model_list:t}=ve(KTe),n=ve(l=>l.system.isProcessing),r=Be(),{t:i}=Ke(),[o,a]=C.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});C.exports.useEffect(()=>{var l,u,f,p,m,v,b;if(e){const x=He.pickBy(t,(E,k)=>He.isEqual(k,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(f=x[e])==null?void 0:f.weights,vae:(p=x[e])==null?void 0:p.vae,width:(m=x[e])==null?void 0:m.width,height:(v=x[e])==null?void 0:v.height,default:(b=x[e])==null?void 0:b.default})}},[t,e]);const s=l=>{r(XE(l))};return e?K(at,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y(at,{alignItems:"center",children:y(yr,{fontSize:"lg",fontWeight:"bold",children:e})}),y(at,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y(wP,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:f})=>y("form",{onSubmit:l,children:K(pi,{rowGap:"0.5rem",alignItems:"start",children:[K(Ir,{isInvalid:!!u.description&&f.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"lg"}),!!u.description&&f.description?y(Wo,{children:u.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.config&&f.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"lg"}),!!u.config&&f.config?y(Wo,{children:u.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.weights&&f.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"lg"}),!!u.weights&&f.weights?y(Wo,{children:u.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.vae&&f.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"lg"}),!!u.vae&&f.vae?y(Wo,{children:u.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!u.width&&f.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:p,form:m})=>y(Eo,{id:"width",name:"width",min:AD,max:OD,step:64,value:m.values.width,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.width&&f.width?y(Wo,{children:u.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.height&&f.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:p,form:m})=>y(Eo,{id:"height",name:"height",min:AD,max:OD,step:64,value:m.values.height,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.height&&f.height?y(Wo,{children:u.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y(at,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y(yr,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Qn=e=>{const{label:t,styleClass:n,...r}=e;return y(Vj,{className:`invokeai__checkbox ${n}`,...r,children:t})};function ZTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function QTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function JTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function eLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function wq(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function tLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function nLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function rLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function Hx(e){return yt({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 iLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function oLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function aLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function sLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const Cq=lt([al],e=>{const{model_list:t}=e,n=[];return He.forEach(t,r=>{n.push(r.weights)}),n});function lLe(){const{t:e}=Ke();return y(rl,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function MD({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=ve(Cq),i=o=>{t.includes(o.target.value)?n(He.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return K(rl,{position:"relative",children:[r.includes(e.location)?y(lLe,{}):null,y(Qn,{value:e.name,label:y(fn,{children:K(pi,{alignItems:"start",children:[y("p",{style:{fontWeight:"bold"},children:e.name}),y("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function uLe(){const e=Be(),{t}=Ke(),n=ve(x=>x.system.searchFolder),r=ve(x=>x.system.foundModels),i=ve(Cq),o=ve(x=>x.options.shouldShowExistingModelsInSearch),a=ve(x=>x.system.isProcessing),[s,l]=oe.useState([]),u=()=>{e(nW(null)),e(rW(null)),l([])},f=x=>{e(kI(x.checkpointFolder))},p=()=>{l([]),r&&r.forEach(x=>{i.includes(x.location)||l(E=>[...E,x.name])})},m=()=>{l([])},v=()=>{const x=r==null?void 0:r.filter(E=>s.includes(E.name));x==null||x.forEach(E=>{const k={name:E.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:E.location,vae:"",width:512,height:512,default:!1};e(XE(k))}),l([])},b=()=>{const x=[],E=[];return r&&r.forEach((k,_)=>{i.includes(k.location)?E.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_)):x.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_))}),K(fn,{children:[x,o&&E]})};return K(fn,{children:[n?K(at,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y(Qe,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y(Hx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(kI(n))}),y(Qe,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y(wP,{initialValues:{checkpointFolder:""},onSubmit:x=>{f(x)},children:({handleSubmit:x})=>y("form",{onSubmit:x,children:K(Sy,{columnGap:"0.5rem",children:[y(Ir,{isRequired:!0,width:"max-content",children:y(qo,{as:rs,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y(Qe,{icon:y(ZTe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&K(at,{flexDirection:"column",rowGap:"1rem",children:[K(at,{justifyContent:"space-between",alignItems:"center",children:[K("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),K("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),K(at,{columnGap:"0.5rem",justifyContent:"space-between",children:[K(at,{columnGap:"0.5rem",children:[y(qr,{isDisabled:s.length===r.length,onClick:p,children:t("modelmanager:selectAll")}),y(qr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y(Qn,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(dSe(!o))})]}),y(qr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),K(at,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const RD=64,ID=2048;function cLe(){const{isOpen:e,onOpen:t,onClose:n}=Qh(),r=Be(),{t:i}=Ke(),o=ve(v=>v.system.isProcessing);function a(v){return/\\s/g.test(v)}function s(v){let b;return a(v)&&(b=i("modelmanager:cannotUseSpaces")),b}const l={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},u=v=>{r(XE(v)),n()},f=()=>{n()},[p,m]=oe.useState(!1);return K(fn,{children:[y(qr,{"aria-label":i("modelmanager:addNewModel"),tooltip:i("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:K(at,{columnGap:"0.5rem",alignItems:"center",children:[y(Iy,{}),i("modelmanager:addNew")]})}),K(Qd,{isOpen:e,onClose:f,size:"3xl",closeOnOverlayClick:!1,children:[y(Jd,{}),K(ep,{className:"modal add-model-modal",children:[y(S1,{children:i("modelmanager:addNewModel")}),y(Cy,{}),K(t1,{className:"add-model-modal-body",children:[y(uLe,{}),y(Qn,{label:i("modelmanager:addManually"),isChecked:p,onChange:()=>m(!p)}),p&&y(wP,{initialValues:l,onSubmit:u,children:({handleSubmit:v,errors:b,touched:x})=>y("form",{onSubmit:v,children:K(pi,{rowGap:"0.5rem",children:[y(yr,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:i("modelmanager:manual")}),K(Ir,{isInvalid:!!b.name&&x.name,isRequired:!0,children:[y(ti,{htmlFor:"name",fontSize:"sm",children:i("modelmanager:name")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"name",name:"name",type:"text",validate:s,width:"2xl"}),!!b.name&&x.name?y(Wo,{children:b.name}):y(Uo,{margin:0,children:i("modelmanager:nameValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.description&&x.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"2xl"}),!!b.description&&x.description?y(Wo,{children:b.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.config&&x.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"2xl"}),!!b.config&&x.config?y(Wo,{children:b.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.weights&&x.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"2xl"}),!!b.weights&&x.weights?y(Wo,{children:b.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.vae&&x.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"2xl"}),!!b.vae&&x.vae?y(Wo,{children:b.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!b.width&&x.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:E,form:k})=>y(Eo,{id:"width",name:"width",min:RD,max:ID,step:64,width:"90%",value:k.values.width,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.width&&x.width?y(Wo,{children:b.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.height&&x.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:E,form:k})=>y(Eo,{id:"height",name:"height",min:RD,max:ID,width:"90%",step:64,value:k.values.height,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.height&&x.height?y(Wo,{children:b.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:o,children:i("modelmanager:addModel")})]})})})]})]})]})]})}bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"SunIcon",path:K("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[y("circle",{cx:"12",cy:"12",r:"5"}),y("path",{d:"M12 1v2"}),y("path",{d:"M12 21v2"}),y("path",{d:"M4.22 4.22l1.42 1.42"}),y("path",{d:"M18.36 18.36l1.42 1.42"}),y("path",{d:"M1 12h2"}),y("path",{d:"M21 12h2"}),y("path",{d:"M4.22 19.78l1.42-1.42"}),y("path",{d:"M18.36 5.64l1.42-1.42"})]})});bt({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"});bt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"ViewIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("circle",{cx:"12",cy:"12",r:"2"})]})});bt({displayName:"ViewOffIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});var dLe=bt({displayName:"DeleteIcon",path:y("g",{fill:"currentColor",children:y("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"})})});bt({displayName:"RepeatIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"RepeatClockIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});var fLe=bt({displayName:"EditIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),y("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});bt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});bt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});bt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});bt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});bt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});bt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});bt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});bt({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"});bt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var _q=bt({displayName:"ExternalLinkIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),y("path",{d:"M15 3h6v6"}),y("path",{d:"M10 14L21 3"})]})});bt({displayName:"LinkIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"PlusSquareIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),y("path",{d:"M12 8v8"}),y("path",{d:"M8 12h8"})]})});bt({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"});bt({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"});bt({displayName:"TimeIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowRightIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowLeftIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"EmailIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({displayName:"SpinnerIcon",path:K(fn,{children:[y("defs",{children:K("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[y("stop",{stopColor:"currentColor",offset:"0%"}),y("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),K("g",{transform:"translate(2)",fill:"none",children:[y("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),y("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),y("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});bt({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"});bt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({displayName:"InfoOutlineIcon",path:K("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[y("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),y("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),y("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});bt({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"});bt({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"});bt({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"});bt({displayName:"QuestionOutlineIcon",path:K("g",{stroke:"currentColor",strokeWidth:"1.5",children:[y("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"}),y("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),y("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});bt({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"});bt({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"});bt({viewBox:"0 0 14 14",path:y("g",{fill:"currentColor",children:y("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});bt({displayName:"MinusIcon",path:y("g",{fill:"currentColor",children:y("rect",{height:"4",width:"20",x:"2",y:"10"})})});bt({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"});const CP=Oe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:f,onClose:p}=Qh(),m=C.exports.useRef(null),v=()=>{r(),p()},b=()=>{o&&o(),p()};return K(fn,{children:[C.exports.cloneElement(l,{onClick:f,ref:t}),y(xV,{isOpen:u,leastDestructiveRef:m,onClose:p,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:s}),y(t1,{children:a}),K(cx,{children:[y(ds,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y(ds,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})});function DD(e){const{isProcessing:t,isConnected:n}=ve(v=>v.system),r=ve(v=>v.system.openModel),{t:i}=Ke(),o=Be(),{name:a,status:s,description:l}=e,u=()=>{o(BW(a))},f=()=>{o(lI(a))},p=()=>{o(Z6e(a)),o(lI(null))};return K(at,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y(rl,{onClick:f,cursor:"pointer",children:y(so,{label:l,hasArrow:!0,placement:"bottom",children:y(yr,{fontWeight:"bold",children:a})})}),y(rH,{onClick:f,cursor:"pointer"}),K(at,{gap:2,alignItems:"center",children:[y(yr,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),y(ds,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y(Qe,{icon:y(fLe,{}),size:"sm",onClick:f,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y(CP,{title:i("modelmanager:deleteModel"),acceptCallback:p,acceptButtonText:i("modelmanager:delete"),triggerComponent:y(Qe,{icon:y(dLe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:K(at,{rowGap:"1rem",flexDirection:"column",children:[y("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const hLe=lt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),pLe=()=>{const{models:e}=ve(hLe),[t,n]=C.exports.useState(""),{t:r}=Ke(),i=He.debounce(a=>{n(a.target.value)},400),o=()=>{const a=[],s=[];return e.forEach((l,u)=>{l.name.startsWith(t)&&s.push(y(DD,{name:l.name,status:l.status,description:l.description},u)),a.push(y(DD,{name:l.name,status:l.status,description:l.description},u))}),t!==""?s:a};return K(at,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[K(at,{justifyContent:"space-between",children:[y(yr,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),y(cLe,{})]}),y(rs,{onChange:i,label:r("modelmanager:search")}),y(at,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:o()})]})};function gLe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke();return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,size:"6xl",children:[y(Jd,{}),K(ep,{className:" modal",children:[y(Cy,{className:"modal-close-btn"}),y(S1,{children:i("modelmanager:modelManager")}),K(at,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y(pLe,{}),y(XTe,{})]})]})]})]})}function mLe(){const{t:e,i18n:t}=Ke(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y(qr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y(I8e,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y(pi,{children:r()})})}const vLe=()=>{const{t:e}=Ke();return K("div",{className:"site-header",children:[K("div",{className:"site-header-left-side",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),K("div",{className:"site-header-right-side",children:[y(J8e,{}),y(n_e,{}),y(gLe,{children:y(Qe,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(E8e,{})})}),y(Y8e,{children:y(Qe,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(R8e,{})})}),y(e_e,{}),y(mLe,{}),y(Qe,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y(k8e,{})})}),y(Qe,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y(S8e,{})})}),y(Qe,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y(b8e,{})})}),y(Z8e,{children:y(Qe,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y(JTe,{})})})]})]})};var yLe=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)}}(),Jr=globalThis&&globalThis.__assign||function(){return Jr=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)}},kLe=["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"],zD="__resizable_base__",kq=function(e){xLe(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(zD):o.className+=zD,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||wLe},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(),u=Number(n.state[s].toString().replace("px","")),f=u/l[s]*100;return f+"%"}return AC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?AC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?AC(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&&N0("left",o),s=i&&N0("top",o),l,u;if(this.props.bounds==="parent"){var f=this.parentNode;f&&(l=a?this.resizableRight-this.parentLeft:f.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:f.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=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),u=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,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var E=(m-b)*this.ratio+x,k=(v-b)*this.ratio+x,_=(f-x)/this.ratio+b,T=(p-x)/this.ratio+b,A=Math.max(f,E),R=Math.min(p,k),I=Math.max(m,_),D=Math.min(v,T);n=$b(n,A,R),r=$b(r,I,D)}else n=$b(n,f,p),r=$b(r,m,v);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,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&CLe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Fb(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 u=this.parentNode;if(u){var f=this.window.getComputedStyle(u).flexDirection;this.flexDir=f.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Fl(Fl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Fb(n))try{n.preventDefault(),n.stopPropagation()}catch(V){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Fb(n)?n.touches[0].clientX:n.clientX,f=Fb(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,v=p.original,b=p.width,x=p.height,E=this.getParentSize(),k=_Le(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=k.maxWidth,a=k.maxHeight,s=k.minWidth,l=k.minHeight;var _=this.calculateNewSizeFromDirection(u,f),T=_.newHeight,A=_.newWidth,R=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=FD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=FD(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(A,T,{width:R.maxWidth,height:R.maxHeight},{width:s,height:l});if(A=I.newWidth,T=I.newHeight,this.props.grid){var D=$D(A,this.props.grid[0]),B=$D(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(B-T)<=z?B:T}var j={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var Y=A/E.width*100;A=Y+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var Y=T/E.height*100;T=Y+"%"}else if(x.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(x.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),pu.exports.flushSync(function(){r.setState($)}),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:Fl(Fl({},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,u=r.handleComponent;if(!i)return null;var f=Object.keys(i).map(function(p){return i[p]!==!1?y(SLe,{direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p],children:u&&u[p]?u[p]:null},p):null});return y("div",{className:l,style:s,children:f})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return kLe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Fl(Fl(Fl({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 K(o,{...Fl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&y("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}(C.exports.PureComponent),ELe=Object.create,Eq=Object.defineProperty,PLe=Object.getOwnPropertyDescriptor,TLe=Object.getOwnPropertyNames,LLe=Object.getPrototypeOf,ALe=Object.prototype.hasOwnProperty,Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),OLe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TLe(t))!ALe.call(e,i)&&i!==n&&Eq(e,i,{get:()=>t[i],enumerable:!(r=PLe(t,i))||r.enumerable});return e},Pq=(e,t,n)=>(n=e!=null?ELe(LLe(e)):{},OLe(t||!e||!e.__esModule?Eq(n,"default",{value:e,enumerable:!0}):n,e)),MLe=Ue((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),Tq=Ue((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Vx=Ue((e,t)=>{var n=Tq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),RLe=Ue((e,t)=>{var n=Vx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),ILe=Ue((e,t)=>{var n=Vx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),DLe=Ue((e,t)=>{var n=Vx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),NLe=Ue((e,t)=>{var n=Vx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Ux=Ue((e,t)=>{var n=MLe(),r=RLe(),i=ILe(),o=DLe(),a=NLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux();function r(){this.__data__=new n,this.size=0}t.exports=r}),$Le=Ue((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),FLe=Ue((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),zLe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),Lq=Ue((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),bc=Ue((e,t)=>{var n=Lq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=Ue((e,t)=>{var n=bc(),r=n.Symbol;t.exports=r}),jLe=Ue((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),f=l[a];try{l[a]=void 0;var p=!0}catch(v){}var m=o.call(l);return p&&(u?l[a]=f:delete l[a]),m}t.exports=s}),HLe=Ue((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Wx=Ue((e,t)=>{var n=_P(),r=jLe(),i=HLe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),Aq=Ue((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),Oq=Ue((e,t)=>{var n=Wx(),r=Aq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var f=n(u);return f==o||f==a||f==i||f==s}t.exports=l}),VLe=Ue((e,t)=>{var n=bc(),r=n["__core-js_shared__"];t.exports=r}),ULe=Ue((e,t)=>{var n=VLe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),Mq=Ue((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),WLe=Ue((e,t)=>{var n=Oq(),r=ULe(),i=Aq(),o=Mq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,f=l.toString,p=u.hasOwnProperty,m=RegExp("^"+f.call(p).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=v}),GLe=Ue((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Ue((e,t)=>{var n=WLe(),r=GLe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Map");t.exports=i}),Gx=Ue((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),qLe=Ue((e,t)=>{var n=Gx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),YLe=Ue((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),KLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),XLe=Ue((e,t)=>{var n=Gx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ZLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),QLe=Ue((e,t)=>{var n=qLe(),r=YLe(),i=KLe(),o=XLe(),a=ZLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=QLe(),r=Ux(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),eAe=Ue((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),qx=Ue((e,t)=>{var n=eAe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),tAe=Ue((e,t)=>{var n=qx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),nAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).get(i)}t.exports=r}),rAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).has(i)}t.exports=r}),iAe=Ue((e,t)=>{var n=qx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),Rq=Ue((e,t)=>{var n=JLe(),r=tAe(),i=nAe(),o=rAe(),a=iAe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux(),r=kP(),i=Rq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var f=u.__data__;if(!r||f.length{var n=Ux(),r=BLe(),i=$Le(),o=FLe(),a=zLe(),s=oAe();function l(u){var f=this.__data__=new n(u);this.size=f.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),sAe=Ue((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),lAe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),uAe=Ue((e,t)=>{var n=Rq(),r=sAe(),i=lAe();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),Iq=Ue((e,t)=>{var n=uAe(),r=cAe(),i=dAe(),o=1,a=2;function s(l,u,f,p,m,v){var b=f&o,x=l.length,E=u.length;if(x!=E&&!(b&&E>x))return!1;var k=v.get(l),_=v.get(u);if(k&&_)return k==u&&_==l;var T=-1,A=!0,R=f&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=bc(),r=n.Uint8Array;t.exports=r}),hAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),pAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),gAe=Ue((e,t)=>{var n=_P(),r=fAe(),i=Tq(),o=Iq(),a=hAe(),s=pAe(),l=1,u=2,f="[object Boolean]",p="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",x="[object RegExp]",E="[object Set]",k="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",R=n?n.prototype:void 0,I=R?R.valueOf:void 0;function D(B,z,j,Y,te,G,$){switch(j){case A:if(B.byteLength!=z.byteLength||B.byteOffset!=z.byteOffset)return!1;B=B.buffer,z=z.buffer;case T:return!(B.byteLength!=z.byteLength||!G(new r(B),new r(z)));case f:case p:case b:return i(+B,+z);case m:return B.name==z.name&&B.message==z.message;case x:case k:return B==z+"";case v:var V=a;case E:var J=Y&l;if(V||(V=s),B.size!=z.size&&!J)return!1;var Z=$.get(B);if(Z)return Z==z;Y|=u,$.set(B,z);var U=o(V(B),V(z),Y,te,G,$);return $.delete(B),U;case _:if(I)return I.call(B)==I.call(z)}return!1}t.exports=D}),mAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),vAe=Ue((e,t)=>{var n=mAe(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),yAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),SAe=Ue((e,t)=>{var n=yAe(),r=bAe(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),xAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),wAe=Ue((e,t)=>{var n=Wx(),r=Yx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),CAe=Ue((e,t)=>{var n=wAe(),r=Yx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),_Ae=Ue((e,t)=>{function n(){return!1}t.exports=n}),Dq=Ue((e,t)=>{var n=bc(),r=_Ae(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),kAe=Ue((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),EAe=Ue((e,t)=>{var n=Wx(),r=Nq(),i=Yx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",x="[object Set]",E="[object String]",k="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",Y="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[R]=G[I]=G[D]=G[B]=G[z]=G[j]=G[Y]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[T]=G[l]=G[u]=G[f]=G[p]=G[m]=G[v]=G[b]=G[x]=G[E]=G[k]=!1;function $(V){return i(V)&&r(V.length)&&!!G[n(V)]}t.exports=$}),PAe=Ue((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),TAe=Ue((e,t)=>{var n=Lq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),Bq=Ue((e,t)=>{var n=EAe(),r=PAe(),i=TAe(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),LAe=Ue((e,t)=>{var n=xAe(),r=CAe(),i=EP(),o=Dq(),a=kAe(),s=Bq(),l=Object.prototype,u=l.hasOwnProperty;function f(p,m){var v=i(p),b=!v&&r(p),x=!v&&!b&&o(p),E=!v&&!b&&!x&&s(p),k=v||b||x||E,_=k?n(p.length,String):[],T=_.length;for(var A in p)(m||u.call(p,A))&&!(k&&(A=="length"||x&&(A=="offset"||A=="parent")||E&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=f}),AAe=Ue((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),OAe=Ue((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),MAe=Ue((e,t)=>{var n=OAe(),r=n(Object.keys,Object);t.exports=r}),RAe=Ue((e,t)=>{var n=AAe(),r=MAe(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),IAe=Ue((e,t)=>{var n=Oq(),r=Nq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),DAe=Ue((e,t)=>{var n=LAe(),r=RAe(),i=IAe();function o(a){return i(a)?n(a):r(a)}t.exports=o}),NAe=Ue((e,t)=>{var n=vAe(),r=SAe(),i=DAe();function o(a){return n(a,i,r)}t.exports=o}),BAe=Ue((e,t)=>{var n=NAe(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,f,p,m){var v=u&r,b=n(s),x=b.length,E=n(l),k=E.length;if(x!=k&&!v)return!1;for(var _=x;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),R=m.get(l);if(A&&R)return A==l&&R==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=bc(),i=n(r,"DataView");t.exports=i}),FAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Promise");t.exports=i}),zAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Set");t.exports=i}),jAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"WeakMap");t.exports=i}),HAe=Ue((e,t)=>{var n=$Ae(),r=kP(),i=FAe(),o=zAe(),a=jAe(),s=Wx(),l=Mq(),u="[object Map]",f="[object Object]",p="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",x=l(n),E=l(r),k=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=p||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(R){var I=s(R),D=I==f?R.constructor:void 0,B=D?l(D):"";if(B)switch(B){case x:return b;case E:return u;case k:return p;case _:return m;case T:return v}return I}),t.exports=A}),VAe=Ue((e,t)=>{var n=aAe(),r=Iq(),i=gAe(),o=BAe(),a=HAe(),s=EP(),l=Dq(),u=Bq(),f=1,p="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function E(k,_,T,A,R,I){var D=s(k),B=s(_),z=D?m:a(k),j=B?m:a(_);z=z==p?v:z,j=j==p?v:j;var Y=z==v,te=j==v,G=z==j;if(G&&l(k)){if(!l(_))return!1;D=!0,Y=!1}if(G&&!Y)return I||(I=new n),D||u(k)?r(k,_,T,A,R,I):i(k,_,z,T,A,R,I);if(!(T&f)){var $=Y&&x.call(k,"__wrapped__"),V=te&&x.call(_,"__wrapped__");if($||V){var J=$?k.value():k,Z=V?_.value():_;return I||(I=new n),R(J,Z,T,A,I)}}return G?(I||(I=new n),o(k,_,T,A,R,I)):!1}t.exports=E}),UAe=Ue((e,t)=>{var n=VAe(),r=Yx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),$q=Ue((e,t)=>{var n=UAe();function r(i,o){return n(i,o)}t.exports=r}),WAe=["ctrl","shift","alt","meta","mod"],GAe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function OC(e,t=","){return typeof e=="string"?e.split(t):e}function s2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>GAe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!WAe.includes(o));return{...r,keys:i}}function qAe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function YAe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function KAe(e){return Fq(e,["input","textarea","select"])}function Fq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function XAe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var ZAe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:f,metaKey:p,shiftKey:m,key:v,code:b}=e,x=b.toLowerCase().replace("key",""),E=v.toLowerCase();if(u!==r&&E!=="alt"||m!==s&&E!=="shift")return!1;if(a){if(!p&&!f)return!1}else if(p!==o&&x!=="meta"||f!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(E)||l.includes(x))?!0:l?l.every(k=>n.has(k)):!l},QAe=C.exports.createContext(void 0),JAe=()=>C.exports.useContext(QAe),eOe=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),tOe=()=>C.exports.useContext(eOe),nOe=Pq($q());function rOe(e){let t=C.exports.useRef(void 0);return(0,nOe.default)(t.current,e)||(t.current=e),t.current}var jD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ze(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=rOe(a),{enabledScopes:f}=tOe(),p=JAe();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!XAe(f,u==null?void 0:u.scopes))return;let m=x=>{var E;if(!(KAe(x)&&!Fq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){jD(x);return}((E=x.target)==null?void 0:E.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||OC(e,u==null?void 0:u.splitKey).forEach(k=>{var T;let _=s2(k,u==null?void 0:u.combinationKey);if(ZAe(x,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(qAe(x,_,u==null?void 0:u.preventDefault),!YAe(x,_,u==null?void 0:u.enabled)){jD(x);return}l(x,_)}})}},v=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.addHotkey(s2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.removeHotkey(s2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,f]),i}Pq($q());var L8=new Set;function iOe(e){(Array.isArray(e)?e:[e]).forEach(t=>L8.add(s2(t)))}function oOe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=s2(t);for(let i of L8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&L8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{iOe(e.key)}),document.addEventListener("keyup",e=>{oOe(e.key)})});const aOe=lt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),sOe=lt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),lOe=()=>{const e=Be(),t=ve(aOe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ve(sOe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(tW()),e(dC(!n))};return Ze("`",()=>{e(dC(!n))},[n]),Ze("esc",()=>{e(dC(!1))}),K(fn,{children:[n&&y(kq,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:y("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=f;return K("div",{className:`console-entry console-${b}-color`,children:[K("p",{className:"console-timestamp",children:[m,":"]}),y("p",{className:"console-message",children:v})]},p)})})}),n&&y(so,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y(fs,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y(x8e,{}),onClick:()=>a(!o)})}),y(so,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y(fs,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y(N8e,{}):y($G,{}),onClick:l})})]})};function uOe(){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)})}function cOe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:nodes")}),y("p",{children:e("common:nodesDesc")})]})}const dOe=()=>{const{t:e}=Ke();return K("div",{className:"work-in-progress post-processing-work-in-progress",children:[y("h1",{children:e("common:postProcessing")}),y("p",{children:e("common:postProcessDesc1")}),y("p",{children:e("common:postProcessDesc2")}),y("p",{children:e("common:postProcessDesc3")})]})},fOe=bt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y("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"})})}),hOe=bt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y("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"})}),pOe=bt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y("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"})}),gOe=bt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y("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 oo=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const mOe=()=>{const{t:e}=Ke();return C.exports.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},vOe=e=>mOe()[e],yOe=lt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),bOe=lt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),PP=()=>{const e=Be(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ve(yOe),{isGFPGANAvailable:i}=ve(bOe),o=u=>e(w4(u)),a=u=>e(CU(u)),s=u=>e(C4(u.target.value)),{t:l}=Ke();return K(at,{direction:"column",gap:2,children:[y(nl,{label:l("options:type"),validValues:oCe.concat(),value:n,onChange:s}),y(Eo,{isDisabled:!i,label:l("options:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y(Eo,{isDisabled:!i,label:l("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function zq(){const e=ve(i=>i.system.isGFPGANAvailable),t=ve(i=>i.options.shouldRunFacetool),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(sSe(i.target.checked))})}function SOe(){const e=Be(),t=ve(i=>i.options.shouldFitToWidthHeight),n=i=>e(OU(i.target.checked)),{t:r}=Ke();return y(os,{label:r("options:imageFit"),isChecked:t,onChange:n})}function Zo(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:f="",withSliderMarks:p=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:x=!1,inputWidth:E="5rem",inputReadOnly:k=!0,withReset:_=!1,hideTooltip:T=!1,isCompact:A=!1,handleReset:R,isResetDisabled:I,isSliderDisabled:D,isInputDisabled:B,styleClass:z,sliderFormControlProps:j,sliderFormLabelProps:Y,sliderMarkProps:te,sliderTrackProps:G,sliderThumbProps:$,sliderNumberInputProps:V,sliderNumberInputFieldProps:J,sliderNumberInputStepperProps:Z,sliderTooltipProps:U,sliderIAIIconButtonProps:X,...le}=e,[fe,Se]=C.exports.useState(String(i)),Ae=C.exports.useMemo(()=>V!=null&&V.max?V.max:a,[a,V==null?void 0:V.max]);C.exports.useEffect(()=>{String(i)!==fe&&fe!==""&&Se(String(i))},[i,fe,Se]);const be=Je=>{const Ye=He.clamp(x?Math.floor(Number(Je.target.value)):Number(Je.target.value),o,Ae);Se(String(Ye)),l(Ye)},ke=Je=>{Se(String(Je)),l(Number(Je))},De=()=>{!R||R()};return K(Ir,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":p,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...j,children:[y(ti,{className:"invokeai__slider-component-label",...Y,children:r}),K(Sy,{w:"100%",gap:2,alignItems:"center",children:[K(_E,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ke,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...le,children:[p&&K(fn,{children:[y($9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y($9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y(HV,{className:"invokeai__slider_track",...G,children:y(VV,{className:"invokeai__slider_track-filled"})}),y(so,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${f}`,hidden:T,...U,children:y(jV,{className:"invokeai__slider-thumb",...$})})]}),b&&K(gE,{min:o,max:Ae,step:s,value:fe,onChange:ke,onBlur:be,className:"invokeai__slider-number-field",isDisabled:B,...V,children:[y(mE,{className:"invokeai__slider-number-input",width:E,readOnly:k,...J}),K(_V,{...Z,children:[y(yE,{className:"invokeai__slider-number-stepper"}),y(vE,{className:"invokeai__slider-number-stepper"})]})]}),_&&y(Qe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y(Hx,{}),onClick:De,isDisabled:I,...X})]})]})}function jq(e){const{t}=Ke(),{label:n=`${t("options:strength")}`,styleClass:r}=e,i=ve(l=>l.options.img2imgStrength),o=Be();return y(Zo,{label:n,step:.01,min:.01,max:.99,onChange:l=>o(Y9(l)),value:i,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Y9(.75))}})}const Hq=()=>{const e=Be(),t=ve(i=>i.options.seamless),n=i=>e(LU(i.target.checked)),{t:r}=Ke();return y(at,{gap:2,direction:"column",children:y(os,{label:r("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},xOe=()=>y(at,{gap:2,direction:"column",children:y(Hq,{})});function wOe(){const e=Be(),{t}=Ke(),n=ve(i=>i.options.shouldRandomizeSeed),r=i=>e(oSe(i.target.checked));return y(os,{label:t("options:randomizeSeed"),isChecked:n,onChange:r})}function COe(){const e=ve(a=>a.options.seed),t=ve(a=>a.options.shouldRandomizeSeed),n=ve(a=>a.options.shouldGenerateVariations),{t:r}=Ke(),i=Be(),o=a=>i(Ly(a));return y(Eo,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:ZE,max:QE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function _Oe(){const e=Be(),t=ve(i=>i.options.shouldRandomizeSeed),{t:n}=Ke();return y(ds,{size:"sm",isDisabled:t,onClick:()=>e(Ly($W(ZE,QE))),padding:"0 1.5rem",children:y("p",{children:n("options:shuffle")})})}function kOe(){const e=Be(),t=ve(i=>i.options.threshold),{t:n}=Ke(),r=i=>e(IU(i));return y(Eo,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}function EOe(){const e=Be(),t=ve(i=>i.options.perlin),{t:n}=Ke(),r=i=>e(PU(i));return y(Eo,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}const TP=()=>K(at,{gap:2,direction:"column",children:[y(wOe,{}),K(at,{gap:2,children:[y(COe,{}),y(_Oe,{})]}),y(at,{gap:2,children:y(kOe,{})}),y(at,{gap:2,children:y(EOe,{})})]}),POe=lt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),TOe=lt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),LP=()=>{const e=Be(),{upscalingLevel:t,upscalingStrength:n}=ve(POe),{isESRGANAvailable:r}=ve(TOe),{t:i}=Ke(),o=s=>e(K9(Number(s.target.value))),a=s=>e(X9(s));return K("div",{className:"upscale-options",children:[y(nl,{isDisabled:!r,label:i("options:scale"),value:t,onChange:o,validValues:iCe}),y(Eo,{isDisabled:!r,label:i("options:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};function Vq(){const e=ve(i=>i.system.isESRGANAvailable),t=ve(i=>i.options.shouldRunESRGAN),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(aSe(i.target.checked))})}function AP(){const e=ve(r=>r.options.shouldGenerateVariations),t=Be();return y(os,{isChecked:e,width:"auto",onChange:r=>t(tSe(r.target.checked))})}function LOe(){const e=ve(o=>o.options.seedWeights),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(AU(o.target.value));return y(rs,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(FE(e)||e===""),isDisabled:!t,onChange:i})}function AOe(){const e=ve(o=>o.options.variationAmount),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(uSe(o));return y(Eo,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const OP=()=>K(at,{gap:2,direction:"column",children:[y(AOe,{}),y(LOe,{})]});function OOe(){const e=Be(),t=ve(i=>i.options.cfgScale),{t:n}=Ke(),r=i=>e(wU(i));return y(Eo,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function MOe(){const e=ve(o=>o.options.height),t=ve(_r),n=Be(),{t:r}=Ke(),i=o=>n(_U(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:r("options:height"),value:e,flexGrow:1,onChange:i,validValues:rCe,styleClass:"main-option-block"})}const ROe=lt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function IOe(){const e=Be(),{iterations:t}=ve(ROe),{t:n}=Ke(),r=i=>e(J5e(i));return y(Eo,{label:n("options:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function DOe(){const e=ve(i=>i.options.sampler),t=Be(),{t:n}=Ke(),r=i=>t(TU(i.target.value));return y(nl,{label:n("options:sampler"),value:e,onChange:r,validValues:tCe,styleClass:"main-option-block"})}function NOe(){const e=Be(),t=ve(i=>i.options.steps),{t:n}=Ke(),r=i=>e(RU(i));return y(Eo,{label:n("options:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function BOe(){const e=ve(o=>o.options.width),t=ve(_r),{t:n}=Ke(),r=Be(),i=o=>r(DU(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:n("options:width"),value:e,flexGrow:1,onChange:i,validValues:nCe,styleClass:"main-option-block"})}function MP(){return y("div",{className:"main-options",children:K("div",{className:"main-options-list",children:[K("div",{className:"main-options-row",children:[y(IOe,{}),y(NOe,{}),y(OOe,{})]}),K("div",{className:"main-options-row",children:[y(BOe,{}),y(MOe,{}),y(DOe,{})]})]})})}const $Oe=lt(e=>e.system,e=>e.shouldDisplayGuides),FOe=({children:e,feature:t})=>{const n=ve($Oe),{text:r}=vOe(t);return n?K(bE,{trigger:"hover",children:[y(wE,{children:y(rl,{children:e})}),K(xE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y(SE,{className:"guide-popover-arrow"}),y("div",{className:"guide-popover-guide-content",children:r})]})]}):null},zOe=Oe(({feature:e,icon:t=QTe},n)=>y(FOe,{feature:e,children:y(rl,{ref:n,children:y($a,{marginBottom:"-.15rem",as:t})})}));function jOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return K(rg,{className:"advanced-settings-item",children:[y(tg,{className:"advanced-settings-header",children:K(at,{width:"100%",gap:"0.5rem",align:"center",children:[y(rl,{flexGrow:1,textAlign:"left",children:t}),i,n&&y(zOe,{feature:n}),y(ng,{})]})}),y(ig,{className:"advanced-settings-panel",children:r})]})}const RP=e=>{const{accordionInfo:t}=e,n=ve(a=>a.system.openAccordions),r=Be();return y(Nk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(owe(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:f,additionalHeaderComponents:p}=t[s];a.push(y(jOe,{header:l,feature:u,content:f,additionalHeaderComponents:p},s))}),a})()})},rn=e=>e.canvas,kr=lt([rn,_r,al],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Uq=e=>e.canvas.layerState.objects.find(H5),Wq=lt([e=>e.options,e=>e.system,Uq,_r],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:f}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),f||(p=!1,m.push("System Disconnected")),o&&(!(FE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}});function IP(e){const{iconButton:t=!1,...n}=e,r=Be(),{isReady:i}=ve(Wq),o=ve(_r),a=()=>{r(u8(o))},{t:s}=Ke();return Ze(["ctrl+enter","meta+enter"],()=>{r(u8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y("div",{style:{flexGrow:4},children:t?y(Qe,{"aria-label":s("options:invoke"),type:"submit",icon:y($8e,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):y(qr,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const HOe=lt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function DP(e){const{...t}=e,n=Be(),{isProcessing:r,isConnected:i,isCancelable:o}=ve(HOe),a=()=>n(K6e()),{t:s}=Ke();return Ze("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y(Qe,{icon:y(nLe,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const VOe=lt(e=>e.options,e=>e.shouldLoopback),UOe=()=>{const e=Be(),t=ve(VOe),{t:n}=Ke();return y(Qe,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y(z8e,{}),onClick:()=>{e(rSe(!t))}})},NP=()=>{const e=ve(_r);return K("div",{className:"process-buttons",children:[y(IP,{}),e==="img2img"&&y(UOe,{}),y(DP,{})]})},WOe=lt([e=>e.options,_r],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BP=()=>{const e=Be(),{prompt:t,activeTabName:n}=ve(WOe),{isReady:r}=ve(Wq),i=C.exports.useRef(null),{t:o}=Ke(),a=l=>{e(mx(l.target.value))};Ze("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(u8(n)))};return y("div",{className:"prompt-bar",children:y(Ir,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y(ZV,{id:"prompt",name:"prompt",placeholder:o("options:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function Gq(e){return yt({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 qq(e){return yt({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function GOe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function qOe(e,t){e.classList?e.classList.add(t):GOe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function HD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function YOe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=HD(e.className,t):e.setAttribute("class",HD(e.className&&e.className.baseVal||"",t))}const VD={disabled:!1},Yq=oe.createContext(null);var Kq=function(t){return t.scrollTop},Av="unmounted",Sh="exited",xh="entering",z0="entered",A8="exiting",Sc=function(e){oE(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=Sh,o.appearStatus=xh):l=z0:r.unmountOnExit||r.mountOnEnter?l=Av:l=Sh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Av?{status:Sh}: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!==xh&&a!==z0&&(o=xh):(a===xh||a===z0)&&(o=A8)}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===xh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:W3.findDOMNode(this);a&&Kq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Sh&&this.setState({status:Av})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[W3.findDOMNode(this),s],u=l[0],f=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||VD.disabled){this.safeSetState({status:z0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:xh},function(){o.props.onEntering(u,f),o.onTransitionEnd(m,function(){o.safeSetState({status:z0},function(){o.props.onEntered(u,f)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:W3.findDOMNode(this);if(!o||VD.disabled){this.safeSetState({status:Sh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:A8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Sh},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:W3.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],u=l[0],f=l[1];this.props.addEndListener(u,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Av)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=nE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return y(Yq.Provider,{value:null,children:typeof a=="function"?a(i,s):oe.cloneElement(oe.Children.only(a),s)})},t}(oe.Component);Sc.contextType=Yq;Sc.propTypes={};function B0(){}Sc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:B0,onEntering:B0,onEntered:B0,onExit:B0,onExiting:B0,onExited:B0};Sc.UNMOUNTED=Av;Sc.EXITED=Sh;Sc.ENTERING=xh;Sc.ENTERED=z0;Sc.EXITING=A8;const KOe=Sc;var XOe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return qOe(t,r)})},MC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return YOe(t,r)})},$P=function(e){oE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ae.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),FP=e=>{const t=Be(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ve(ZOe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ze("o",()=>{t(Ju(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Ze("esc",()=>{t(Ju(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ze("shift+o",()=>{m(),t(vi(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(eSe(a.current?a.current.scrollTop:0)),t(Ju(!1)),t(nSe(!1)))},[t,i]),f=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(iSe(!i)),t(vi(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y(Xq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:y("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y("div",{className:"options-panel-margin",children:K("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?p():!i&&f()},children:[y(so,{label:"Pin Options Panel",children:y("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?y(Gq,{}):y(qq,{})})}),!i&&K("div",{className:"invoke-ai-logo-wrapper",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),l]})})})})};function QOe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(xOe,{})}},n=Be(),r=ve(_r);return C.exports.useEffect(()=>{r==="img2img"&&n(jE(!1))},[r,n]),K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(SOe,{}),y(RP,{accordionInfo:t})]})}const zP=C.exports.createContext(null),JOe=e=>{const{styleClass:t}=e,n=C.exports.useContext(zP),r=()=>{n&&n()};return y("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:K("div",{className:"image-upload-button",children:[y(Nx,{}),y(Hh,{size:"lg",children:"Click or Drag and Drop"})]})})},eMe=lt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),O8=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Qh(),a=Be(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ve(eMe),f=C.exports.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Y6e(e)),o()};Ze("delete",()=>{s?i():m()},[e,s]);const v=b=>a(eW(!b.target.checked));return K(fn,{children:[C.exports.cloneElement(t,{onClick:e?p:void 0,ref:n}),y(xV,{isOpen:r,leastDestructiveRef:f,onClose:o,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y(t1,{children:K(at,{direction:"column",gap:5,children:[y(yr,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y(Ir,{children:K(at,{alignItems:"center",children:[y(ti,{mb:0,children:"Don't ask me again"}),y(kE,{checked:!s,onChange:v})]})})]})}),K(cx,{children:[y(ds,{ref:f,onClick:o,className:"modal-close-btn",children:"Cancel"}),y(ds,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),tMe=lt([e=>e.system,e=>e.options,e=>e.gallery,_r],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:f,isLightBoxOpen:p}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:f,activeTabName:r,isLightBoxOpen:p}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Zq=()=>{var B,z,j,Y,te,G;const e=Be(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:f,activeTabName:p}=ve(tMe),m=Ty(),{t:v}=Ke(),b=()=>{!u||(f&&e(Qu(!1)),e(C1(u)),e(Go("img2img")))},x=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Ze("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var $,V;!u||(u.metadata&&e(X5e(u.metadata)),(($=u.metadata)==null?void 0:$.image.type)==="img2img"?e(Go("img2img")):((V=u.metadata)==null?void 0:V.image.type)==="txt2img"&&e(Go("txt2img")))};Ze("a",()=>{var $,V;["txt2img","img2img"].includes((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Ly(u.metadata.image.seed))};Ze("s",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var $,V;return((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.prompt)&&e(mx(u.metadata.image.prompt))};Ze("p",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.prompt?(_(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{u&&e(G6e(u))};Ze("Shift+U",()=>{i&&!s&&n&&!t&&o?T():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const A=()=>{u&&e(q6e(u))};Ze("Shift+R",()=>{r&&!s&&n&&!t&&a?A():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(MU(!l)),I=()=>{!u||(f&&e(Qu(!1)),e(Sx(u)),e(vi(!0)),p!=="unifiedCanvas"&&e(Go("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Ze("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const D=()=>{e(Qu(!f))};return K("div",{className:"current-image-options",children:[K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":`${v("options:sendTo")}...`,icon:y(V8e,{})}),children:K("div",{className:"current-image-send-to-popover",children:[y(qr,{size:"sm",onClick:b,leftIcon:y(QI,{}),children:v("options:sendToImg2Img")}),y(qr,{size:"sm",onClick:I,leftIcon:y(QI,{}),children:v("options:sendToUnifiedCanvas")}),y(qr,{size:"sm",onClick:x,leftIcon:y(Ry,{}),children:v("options:copyImageToLink")}),y(qr,{leftIcon:y(sP,{}),size:"sm",children:y(Vh,{download:!0,href:u==null?void 0:u.url,children:v("options:downloadImage")})})]})}),y(Qe,{icon:y(T8e,{}),tooltip:f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"aria-label":f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"data-selected":f,onClick:D})]}),K(io,{isAttached:!0,children:[y(Qe,{icon:y(F8e,{}),tooltip:`${v("options:usePrompt")} (P)`,"aria-label":`${v("options:usePrompt")} (P)`,isDisabled:!((z=(B=u==null?void 0:u.metadata)==null?void 0:B.image)!=null&&z.prompt),onClick:_}),y(Qe,{icon:y(H8e,{}),tooltip:`${v("options:useSeed")} (S)`,"aria-label":`${v("options:useSeed")} (S)`,isDisabled:!((Y=(j=u==null?void 0:u.metadata)==null?void 0:j.image)!=null&&Y.seed),onClick:k}),y(Qe,{icon:y(_8e,{}),tooltip:`${v("options:useAll")} (A)`,"aria-label":`${v("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((G=(te=u==null?void 0:u.metadata)==null?void 0:te.image)==null?void 0:G.type),onClick:E})]}),K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(O8e,{}),"aria-label":v("options:restoreFaces")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(PP,{}),y(qr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:A,children:v("options:restoreFaces")})]})}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(P8e,{}),"aria-label":v("options:upscale")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(LP,{}),y(qr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:T,children:v("options:upscaleImage")})]})})]}),y(io,{isAttached:!0,children:y(Qe,{icon:y($G,{}),tooltip:`${v("options:info")} (I)`,"aria-label":`${v("options:info")} (I)`,"data-selected":l,onClick:R})}),y(O8,{image:u,children:y(Qe,{icon:y(yp,{}),tooltip:`${v("options:deleteImage")} (Del)`,"aria-label":`${v("options:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function nMe(e){return yt({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 $n=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>K(at,{gap:2,children:[n&&y(so,{label:`Recall ${e}`,children:y(fs,{"aria-label":"Use this parameter",icon:y(nMe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y(so,{label:`Copy ${e}`,children:y(fs,{"aria-label":`Copy ${e}`,icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),K(at,{direction:i?"column":"row",children:[K(yr,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?K(Vh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y(_q,{mx:"2px"})]}):y(yr,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),rMe=(e,t)=>e.image.uuid===t.image.uuid,Qq=C.exports.memo(({image:e,styleClass:t})=>{var j,Y;const n=Be();Ze("esc",()=>{n(MU(!1))});const r=((j=e==null?void 0:e.metadata)==null?void 0:j.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:f,orig_path:p,perlin:m,postprocessing:v,prompt:b,sampler:x,scale:E,seamless:k,seed:_,steps:T,strength:A,threshold:R,type:I,variations:D,width:B}=r,z=JSON.stringify(e.metadata,null,2);return y("div",{className:`image-metadata-viewer ${t}`,children:K(at,{gap:1,direction:"column",width:"100%",children:[K(at,{gap:2,children:[y(yr,{fontWeight:"semibold",children:"File:"}),K(Vh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y(_q,{mx:"2px"})]})]}),Object.keys(r).length>0?K(fn,{children:[I&&y($n,{label:"Generation type",value:I}),((Y=e.metadata)==null?void 0:Y.model_weights)&&y($n,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&y($n,{label:"Original image",value:p}),I==="gfpgan"&&A!==void 0&&y($n,{label:"Fix faces strength",value:A,onClick:()=>n(w4(A))}),I==="esrgan"&&E!==void 0&&y($n,{label:"Upscaling scale",value:E,onClick:()=>n(K9(E))}),I==="esrgan"&&A!==void 0&&y($n,{label:"Upscaling strength",value:A,onClick:()=>n(X9(A))}),b&&y($n,{label:"Prompt",labelPosition:"top",value:x4(b),onClick:()=>n(mx(b))}),_!==void 0&&y($n,{label:"Seed",value:_,onClick:()=>n(Ly(_))}),R!==void 0&&y($n,{label:"Noise Threshold",value:R,onClick:()=>n(IU(R))}),m!==void 0&&y($n,{label:"Perlin Noise",value:m,onClick:()=>n(PU(m))}),x&&y($n,{label:"Sampler",value:x,onClick:()=>n(TU(x))}),T&&y($n,{label:"Steps",value:T,onClick:()=>n(RU(T))}),o!==void 0&&y($n,{label:"CFG scale",value:o,onClick:()=>n(wU(o))}),D&&D.length>0&&y($n,{label:"Seed-weight pairs",value:N5(D),onClick:()=>n(AU(N5(D)))}),k&&y($n,{label:"Seamless",value:k,onClick:()=>n(LU(k))}),l&&y($n,{label:"High Resolution Optimization",value:l,onClick:()=>n(jE(l))}),B&&y($n,{label:"Width",value:B,onClick:()=>n(DU(B))}),s&&y($n,{label:"Height",value:s,onClick:()=>n(_U(s))}),u&&y($n,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(C1(u))}),f&&y($n,{label:"Mask image",value:f,isLink:!0,onClick:()=>n(EU(f))}),I==="img2img"&&A&&y($n,{label:"Image to image strength",value:A,onClick:()=>n(Y9(A))}),a&&y($n,{label:"Image to image fit",value:a,onClick:()=>n(OU(a))}),v&&v.length>0&&K(fn,{children:[y(Hh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y($n,{label:"Scale",value:$,onClick:()=>n(K9($))}),y($n,{label:"Strength",value:V,onClick:()=>n(X9(V))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("codeformer"))}}),V&&y($n,{label:"Fidelity",value:V,onClick:()=>{n(CU(V)),n(C4("codeformer"))}})]},G)}})]}),i&&y($n,{withCopy:!0,label:"Dream Prompt",value:i}),K(at,{gap:2,direction:"column",children:[K(at,{gap:2,children:[y(so,{label:"Copy metadata JSON",children:y(fs,{"aria-label":"Copy metadata JSON",icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y(yr,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y("div",{className:"image-json-viewer",children:y("pre",{children:z})})]})]}):y(eH,{width:"100%",pt:10,children:y(yr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},rMe),Jq=lt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var f;return u.uuid===((f=e==null?void 0:e.currentImage)==null?void 0:f.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function iMe(){const e=Be(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return K("div",{className:"current-image-preview",children:[i&&y(nx,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&y(Qq,{image:i,styleClass:"current-image-metadata"})]})}const oMe=lt([e=>e.gallery,e=>e.options,_r],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ve(oMe);return y("div",{className:"current-image-area","data-tab-name":t,children:e?K(fn,{children:[y(Zq,{}),y(iMe,{})]}):y("div",{className:"current-image-display-placeholder",children:y(tLe,{})})})},aMe=()=>{const e=C.exports.useContext(zP);return y(Qe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y(Nx,{}),onClick:e||void 0})};function sMe(){const e=ve(o=>o.options.initialImage),{t}=Ke(),n=Be(),r=Ty(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(xU())};return K(fn,{children:[K("div",{className:"init-image-preview-header",children:[y("h2",{children:t("options:initialImage")}),y(aMe,{})]}),e&&y("div",{className:"init-image-preview",children:y(nx,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const lMe=()=>{const e=ve(r=>r.options.initialImage),{currentImage:t}=ve(r=>r.gallery);return K("div",{className:"workarea-split-view",children:[y("div",{className:"workarea-split-view-left",children:e?y("div",{className:"image-to-image-area",children:y(sMe,{})}):y(JOe,{})}),t&&y("div",{className:"workarea-split-view-right",children:y(eY,{})})]})};function uMe(e){return yt({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 tr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function By(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(p){const{scope:m,children:v,...b}=p,x=(m==null?void 0:m[e][l])||s,E=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(x.Provider,{value:E},v)}function f(p,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,f]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,cMe(i,...t)]}function cMe(...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:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function dMe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tY(...e){return t=>e.forEach(n=>dMe(n,t))}function gs(...e){return C.exports.useCallback(tY(...e),e)}const ny=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(hMe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(M8,Dn({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(M8,Dn({},r,{ref:t}),n)});ny.displayName="Slot";const M8=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...pMe(r,n.props),ref:tY(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});M8.displayName="SlotClone";const fMe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function hMe(e){return C.exports.isValidElement(e)&&e.type===fMe}function pMe(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 gMe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],uc=gMe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ny:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,Dn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nY(e,t){e&&pu.exports.flushSync(()=>e.dispatchEvent(t))}function rY(e){const t=e+"CollectionProvider",[n,r]=By(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:x}=v,E=oe.useRef(null),k=oe.useRef(new Map).current;return oe.createElement(i,{scope:b,itemMap:k,collectionRef:E},x)},s=e+"CollectionSlot",l=oe.forwardRef((v,b)=>{const{scope:x,children:E}=v,k=o(s,x),_=gs(b,k.collectionRef);return oe.createElement(ny,{ref:_},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",p=oe.forwardRef((v,b)=>{const{scope:x,children:E,...k}=v,_=oe.useRef(null),T=gs(b,_),A=o(u,x);return oe.useEffect(()=>(A.itemMap.set(_,{ref:_,...k}),()=>void A.itemMap.delete(_))),oe.createElement(ny,{[f]:"",ref:T},E)});function m(v){const b=o(e+"CollectionConsumer",v);return oe.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>k.indexOf(A.ref.current)-k.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const mMe=C.exports.createContext(void 0);function iY(e){const t=C.exports.useContext(mMe);return e||t||"ltr"}function fu(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function vMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const R8="dismissableLayer.update",yMe="dismissableLayer.pointerDownOutside",bMe="dismissableLayer.focusOutside";let UD;const SMe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xMe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,f=C.exports.useContext(SMe),[p,m]=C.exports.useState(null),v=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),x=gs(t,B=>m(B)),E=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),T=p?E.indexOf(p):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,R=T>=_,I=wMe(B=>{const z=B.target,j=[...f.branches].some(Y=>Y.contains(z));!R||j||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=CMe(B=>{const z=B.target;[...f.branches].some(Y=>Y.contains(z))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return vMe(B=>{T===f.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!p)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),WD(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=UD)}},[p,v,r,f]),C.exports.useEffect(()=>()=>{!p||(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),WD())},[p,f]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(R8,B),()=>document.removeEventListener(R8,B)},[]),C.exports.createElement(uc.div,Dn({},u,{ref:x,style:{pointerEvents:A?R?"auto":"none":void 0,...e.style},onFocusCapture:tr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:tr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:tr(e.onPointerDownCapture,I.onPointerDownCapture)}))});function wMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){oY(yMe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 CMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&oY(bMe,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 WD(){const e=new CustomEvent(R8);document.dispatchEvent(e)}function oY(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?nY(i,o):i.dispatchEvent(o)}let RC=0;function _Me(){C.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:GD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GD()),RC++,()=>{RC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),RC--}},[])}function GD(){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 IC="focusScope.autoFocusOnMount",DC="focusScope.autoFocusOnUnmount",qD={bubbles:!1,cancelable:!0},kMe=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=fu(i),f=fu(o),p=C.exports.useRef(null),m=gs(t,x=>l(x)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let x=function(k){if(v.paused||!s)return;const _=k.target;s.contains(_)?p.current=_:wh(p.current,{select:!0})},E=function(k){v.paused||!s||s.contains(k.relatedTarget)||wh(p.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){KD.add(v);const x=document.activeElement;if(!s.contains(x)){const k=new CustomEvent(IC,qD);s.addEventListener(IC,u),s.dispatchEvent(k),k.defaultPrevented||(EMe(OMe(aY(s)),{select:!0}),document.activeElement===x&&wh(s))}return()=>{s.removeEventListener(IC,u),setTimeout(()=>{const k=new CustomEvent(DC,qD);s.addEventListener(DC,f),s.dispatchEvent(k),k.defaultPrevented||wh(x!=null?x:document.body,{select:!0}),s.removeEventListener(DC,f),KD.remove(v)},0)}}},[s,u,f,v]);const b=C.exports.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(E&&k){const _=x.currentTarget,[T,A]=PMe(_);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),n&&wh(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),n&&wh(A,{select:!0})):k===_&&x.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(uc.div,Dn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function EMe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wh(r,{select:t}),document.activeElement!==n)return}function PMe(e){const t=aY(e),n=YD(t,e),r=YD(t.reverse(),e);return[n,r]}function aY(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 YD(e,t){for(const n of e)if(!TMe(n,{upTo:t}))return n}function TMe(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 LMe(e){return e instanceof HTMLInputElement&&"select"in e}function wh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LMe(e)&&t&&e.select()}}const KD=AMe();function AMe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XD(e,t),e.unshift(t)},remove(t){var n;e=XD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function XD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OMe(e){return e.filter(t=>t.tagName!=="A")}const a1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},MMe=jC["useId".toString()]||(()=>{});let RMe=0;function IMe(e){const[t,n]=C.exports.useState(MMe());return a1(()=>{e||n(r=>r!=null?r:String(RMe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function Kx(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function jP(e){return e==="y"?"height":"width"}function ZD(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=A1(t),l=jP(s),u=r[l]/2-i[l]/2,f=L1(t),p=s==="x";let m;switch(f){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(Kx(t)){case"start":m[s]-=u*(n&&p?-1:1);break;case"end":m[s]+=u*(n&&p?-1:1);break}return m}const DMe=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:u,y:f}=ZD(l,r,s),p=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=sY(r),f={x:i,y:o},p=A1(a),m=Kx(a),v=jP(p),b=await l.getDimensions(n),x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",k=s.reference[v]+s.reference[p]-f[p]-s.floating[v],_=f[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const R=k/2-_/2,I=u[x],D=A-b[v]-u[E],B=A/2-b[v]/2+R,z=I8(I,B,D),te=(m==="start"?u[x]:u[E])>0&&B!==z&&s.reference[v]<=s.floating[v]?BFMe[t])}function zMe(e,t,n){n===void 0&&(n=!1);const r=Kx(e),i=A1(e),o=jP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=X5(a)),{main:a,cross:X5(a)}}const jMe={start:"end",end:"start"};function JD(e){return e.replace(/start|end/g,t=>jMe[t])}const HMe=["top","right","bottom","left"];function VMe(e){const t=X5(e);return[JD(e),t,JD(t)]}const UMe=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:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,x=L1(r),k=p||(x===a||!v?[X5(a)]:VMe(a)),_=[a,...k],T=await K5(t,b),A=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&A.push(T[x]),f){const{main:z,cross:j}=zMe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));A.push(T[z],T[j])}if(R=[...R,{placement:r,overflows:A}],!A.every(z=>z<=0)){var I,D;const z=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,j=_[z];if(j)return{data:{index:z,overflows:R},reset:{placement:j}};let Y="bottom";switch(m){case"bestFit":{var B;const te=(B=R.map(G=>[G,G.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((G,$)=>G[1]-$[1])[0])==null?void 0:B[0].placement;te&&(Y=te);break}case"initialPlacement":Y=a;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function eN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tN(e){return HMe.some(t=>e[t]>=0)}const WMe=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 K5(r,{...n,elementContext:"reference"}),a=eN(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tN(a)}}}case"escaped":{const o=await K5(r,{...n,altBoundary:!0}),a=eN(o,i.floating);return{data:{escapedOffsets:a,escaped:tN(a)}}}default:return{}}}}};async function GMe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=Kx(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,f=o&&l?-1:1,p=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const qMe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await GMe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function lY(e){return e==="x"?"y":"x"}const YMe=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:k,y:_}=E;return{x:k,y:_}}},...l}=e,u={x:n,y:r},f=await K5(t,l),p=A1(L1(i)),m=lY(p);let v=u[p],b=u[m];if(o){const E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",_=v+f[E],T=v-f[k];v=I8(_,v,T)}if(a){const E=m==="y"?"top":"left",k=m==="y"?"bottom":"right",_=b+f[E],T=b-f[k];b=I8(_,b,T)}const x=s.fn({...t,[p]:v,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},KMe=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:u=!0}=e,f={x:n,y:r},p=A1(i),m=lY(p);let v=f[p],b=f[m];const x=typeof s=="function"?s({...o,placement:i}):s,E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const R=p==="y"?"height":"width",I=o.reference[p]-o.floating[R]+E.mainAxis,D=o.reference[p]+o.reference[R]-E.mainAxis;vD&&(v=D)}if(u){var k,_,T,A;const R=p==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[R]+(I&&(k=(_=a.offset)==null?void 0:_[m])!=null?k:0)+(I?0:E.crossAxis),B=o.reference[m]+o.reference[R]+(I?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(I?E.crossAxis:0);bB&&(b=B)}return{[p]:v,[m]:b}}}};function uY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function xc(e){if(e==null)return window;if(!uY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function $y(e){return xc(e).getComputedStyle(e)}function cc(e){return uY(e)?"":e?(e.nodeName||"").toLowerCase():""}function cY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function hu(e){return e instanceof xc(e).HTMLElement}function of(e){return e instanceof xc(e).Element}function XMe(e){return e instanceof xc(e).Node}function HP(e){if(typeof ShadowRoot>"u")return!1;const t=xc(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xx(e){const{overflow:t,overflowX:n,overflowY:r}=$y(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZMe(e){return["table","td","th"].includes(cc(e))}function dY(e){const t=/firefox/i.test(cY()),n=$y(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 fY(){return!/^((?!chrome|android).)*safari/i.test(cY())}const nN=Math.min,l2=Math.max,Z5=Math.round;function dc(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,u=1;t&&hu(e)&&(l=e.offsetWidth>0&&Z5(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Z5(s.height)/e.offsetHeight||1);const f=of(e)?xc(e):window,p=!fY()&&n,m=(s.left+(p&&(r=(i=f.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(p&&(o=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:v,right:m+b,bottom:v+x,left:m,x:m,y:v}}function bf(e){return((XMe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zx(e){return of(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hY(e){return dc(bf(e)).left+Zx(e).scrollLeft}function QMe(e){const t=dc(e);return Z5(t.width)!==e.offsetWidth||Z5(t.height)!==e.offsetHeight}function JMe(e,t,n){const r=hu(t),i=bf(t),o=dc(e,r&&QMe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((cc(t)!=="body"||Xx(i))&&(a=Zx(t)),hu(t)){const l=dc(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=hY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function pY(e){return cc(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||bf(e)}function rN(e){return!hu(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function eRe(e){let t=pY(e);for(HP(t)&&(t=t.host);hu(t)&&!["html","body"].includes(cc(t));){if(dY(t))return t;t=t.parentNode}return null}function D8(e){const t=xc(e);let n=rN(e);for(;n&&ZMe(n)&&getComputedStyle(n).position==="static";)n=rN(n);return n&&(cc(n)==="html"||cc(n)==="body"&&getComputedStyle(n).position==="static"&&!dY(n))?t:n||eRe(e)||t}function iN(e){if(hu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=dc(e);return{width:t.width,height:t.height}}function tRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=hu(n),o=bf(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((cc(n)!=="body"||Xx(o))&&(a=Zx(n)),hu(n))){const l=dc(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 nRe(e,t){const n=xc(e),r=bf(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=fY();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function rRe(e){var t;const n=bf(e),r=Zx(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=l2(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=l2(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+hY(e);const l=-r.scrollTop;return $y(i||n).direction==="rtl"&&(s+=l2(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function gY(e){const t=pY(e);return["html","body","#document"].includes(cc(t))?e.ownerDocument.body:hu(t)&&Xx(t)?t:gY(t)}function Q5(e,t){var n;t===void 0&&(t=[]);const r=gY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xc(r),a=i?[o].concat(o.visualViewport||[],Xx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Q5(a))}function iRe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&HP(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function oRe(e,t){const n=dc(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 oN(e,t,n){return t==="viewport"?Y5(nRe(e,n)):of(t)?oRe(t,n):Y5(rRe(bf(e)))}function aRe(e){const t=Q5(e),r=["absolute","fixed"].includes($y(e).position)&&hu(e)?D8(e):e;return of(r)?t.filter(i=>of(i)&&iRe(i,r)&&cc(i)!=="body"):[]}function sRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?aRe(t):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const p=oN(t,f,i);return u.top=l2(p.top,u.top),u.right=nN(p.right,u.right),u.bottom=nN(p.bottom,u.bottom),u.left=l2(p.left,u.left),u},oN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const lRe={getClippingRect:sRe,convertOffsetParentRelativeRectToViewportRelativeRect:tRe,isElement:of,getDimensions:iN,getOffsetParent:D8,getDocumentElement:bf,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JMe(t,D8(n),r),floating:{...iN(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>$y(e).direction==="rtl"};function uRe(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,u=o&&!s,f=l||u?[...of(e)?Q5(e):[],...Q5(t)]:[];f.forEach(x=>{l&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});let p=null;if(a){let x=!0;p=new ResizeObserver(()=>{x||n(),x=!1}),of(e)&&!s&&p.observe(e),p.observe(t)}let m,v=s?dc(e):null;s&&b();function b(){const x=dc(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,m=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(E=>{l&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),(x=p)==null||x.disconnect(),p=null,s&&cancelAnimationFrame(m)}}const cRe=(e,t,n)=>DMe(e,t,{platform:lRe,...n});var N8=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function B8(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(!B8(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)&&!B8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function dRe(e){const t=C.exports.useRef(e);return N8(()=>{t.current=e}),t}function fRe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=dRe(i),l=C.exports.useRef(null),[u,f]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=C.exports.useState(t);B8(p==null?void 0:p.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||cRe(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&pu.exports.flushSync(()=>{f(T)})})},[p,n,r]);N8(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);N8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=C.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,v);l.current=T}else v()},[v,s]),E=C.exports.useCallback(T=>{o.current=T,x()},[x]),k=C.exports.useCallback(T=>{a.current=T,x()},[x]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:E,floating:k}),[u,v,_,E,k])}const hRe=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?QD({element:t.current,padding:n}).fn(i):{}:t?QD({element:t,padding:n}).fn(i):{}}}};function pRe(e){const[t,n]=C.exports.useState(void 0);return a1(()=>{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,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.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 mY="Popper",[VP,vY]=By(mY),[gRe,yY]=VP(mY),mRe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(gRe,{scope:t,anchor:r,onAnchorChange:i},n)},vRe="PopperAnchor",yRe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=yY(vRe,n),a=C.exports.useRef(null),s=gs(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(uc.div,Dn({},i,{ref:s}))}),J5="PopperContent",[bRe,Hze]=VP(J5),[SRe,xRe]=VP(J5,{hasParent:!1,positionUpdateFns:new Set}),wRe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:E=[],collisionPadding:k=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...R}=e,I=yY(J5,f),[D,B]=C.exports.useState(null),z=gs(t,ue=>B(ue)),[j,Y]=C.exports.useState(null),te=pRe(j),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,V=p+(v!=="center"?"-"+v:""),J=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},Z=Array.isArray(E)?E:[E],U=Z.length>0,X={padding:J,boundary:Z.filter(_Re),altBoundary:U},{reference:le,floating:fe,strategy:Se,x:Ae,y:be,placement:ke,middlewareData:De,update:Je}=fRe({strategy:"fixed",placement:V,whileElementsMounted:uRe,middleware:[qMe({mainAxis:m+$,alignmentAxis:b}),A?YMe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?KMe():void 0,...X}):void 0,j?hRe({element:j,padding:x}):void 0,A?UMe({...X}):void 0,kRe({arrowWidth:G,arrowHeight:$}),T?WMe({strategy:"referenceHidden"}):void 0].filter(CRe)});a1(()=>{le(I.anchor)},[le,I.anchor]);const Ye=Ae!==null&&be!==null,[mt,_t]=bY(ke),dt=(i=De.arrow)===null||i===void 0?void 0:i.x,vt=(o=De.arrow)===null||o===void 0?void 0:o.y,xt=((a=De.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=C.exports.useState();a1(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Rt,positionUpdateFns:ot}=xRe(J5,f),Ct=!Rt;C.exports.useLayoutEffect(()=>{if(!Ct)return ot.add(Je),()=>{ot.delete(Je)}},[Ct,ot,Je]),C.exports.useLayoutEffect(()=>{Ct&&Ye&&Array.from(ot).reverse().forEach(ue=>requestAnimationFrame(ue))},[Ct,Ye,ot]);const ln={"data-side":mt,"data-align":_t,...R,ref:z,style:{...R.style,animation:Ye?void 0:"none",opacity:(s=De.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:Ye?`translate3d(${Math.round(Ae)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=De.transformOrigin)===null||l===void 0?void 0:l.x,(u=De.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(bRe,{scope:f,placedSide:mt,onArrowChange:Y,arrowX:dt,arrowY:vt,shouldHideArrow:xt},Ct?C.exports.createElement(SRe,{scope:f,hasParent:!0,positionUpdateFns:ot},C.exports.createElement(uc.div,ln)):C.exports.createElement(uc.div,ln)))});function CRe(e){return e!==void 0}function _Re(e){return e!==null}const kRe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,v=p?0:e.arrowHeight,[b,x]=bY(s),E={start:"0%",center:"50%",end:"100%"}[x],k=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=p?E:`${k}px`,A=`${-v}px`):b==="top"?(T=p?E:`${k}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=p?E:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=p?E:`${_}px`),{data:{x:T,y:A}}}});function bY(e){const[t,n="center"]=e.split("-");return[t,n]}const ERe=mRe,PRe=yRe,TRe=wRe;function LRe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const SY=e=>{const{present:t,children:n}=e,r=ARe(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=gs(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};SY.displayName="Presence";function ARe(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=LRe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=jb(r.current);o.current=s==="mounted"?u:"none"},[s]),a1(()=>{const u=r.current,f=i.current;if(f!==e){const m=o.current,v=jb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a1(()=>{if(t){const u=p=>{const v=jb(r.current).includes(p.animationName);p.target===t&&v&&pu.exports.flushSync(()=>l("ANIMATION_END"))},f=p=>{p.target===t&&(o.current=jb(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function jb(e){return(e==null?void 0:e.animationName)||"none"}function ORe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=MRe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=fu(n),l=C.exports.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function MRe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=fu(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const NC="rovingFocusGroup.onEntryFocus",RRe={bubbles:!1,cancelable:!0},UP="RovingFocusGroup",[$8,xY,IRe]=rY(UP),[DRe,wY]=By(UP,[IRe]),[NRe,BRe]=DRe(UP),$Re=C.exports.forwardRef((e,t)=>C.exports.createElement($8.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement($8.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(FRe,Dn({},e,{ref:t}))))),FRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=e,p=C.exports.useRef(null),m=gs(t,p),v=iY(o),[b=null,x]=ORe({prop:a,defaultProp:s,onChange:l}),[E,k]=C.exports.useState(!1),_=fu(u),T=xY(n),A=C.exports.useRef(!1),[R,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=p.current;if(D)return D.addEventListener(NC,_),()=>D.removeEventListener(NC,_)},[_]),C.exports.createElement(NRe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>x(D),[x]),onItemShiftTab:C.exports.useCallback(()=>k(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(uc.div,Dn({tabIndex:E||R===0?-1:0,"data-orientation":r},f,{ref:m,style:{outline:"none",...e.style},onMouseDown:tr(e.onMouseDown,()=>{A.current=!0}),onFocus:tr(e.onFocus,D=>{const B=!A.current;if(D.target===D.currentTarget&&B&&!E){const z=new CustomEvent(NC,RRe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const j=T().filter(V=>V.focusable),Y=j.find(V=>V.active),te=j.find(V=>V.id===b),$=[Y,te,...j].filter(Boolean).map(V=>V.ref.current);CY($)}}A.current=!1}),onBlur:tr(e.onBlur,()=>k(!1))})))}),zRe="RovingFocusGroupItem",jRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=IMe(),s=BRe(zRe,n),l=s.currentTabStopId===a,u=xY(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=s;return C.exports.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.exports.createElement($8.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(uc.span,Dn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:tr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:tr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:tr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=URe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let x=u().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=s.loop?WRe(x,E+1):x.slice(E+1)}setTimeout(()=>CY(x))}})})))}),HRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function URe(e,t,n){const r=VRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HRe[r]}function CY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WRe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const GRe=$Re,qRe=jRe,YRe=["Enter"," "],KRe=["ArrowDown","PageUp","Home"],_Y=["ArrowUp","PageDown","End"],XRe=[...KRe,..._Y],Qx="Menu",[F8,ZRe,QRe]=rY(Qx),[Cp,kY]=By(Qx,[QRe,vY,wY]),WP=vY(),EY=wY(),[JRe,Jx]=Cp(Qx),[eIe,GP]=Cp(Qx),tIe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=C.exports.useState(null),f=C.exports.useRef(!1),p=fu(o),m=iY(i);return C.exports.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(ERe,s,C.exports.createElement(JRe,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},C.exports.createElement(eIe,{scope:t,onClose:C.exports.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:a},r)))},nIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return C.exports.createElement(PRe,Dn({},i,r,{ref:t}))}),rIe="MenuPortal",[Vze,iIe]=Cp(rIe,{forceMount:void 0}),Gd="MenuContent",[oIe,PY]=Cp(Gd),aIe=C.exports.forwardRef((e,t)=>{const n=iIe(Gd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Jx(Gd,e.__scopeMenu),a=GP(Gd,e.__scopeMenu);return C.exports.createElement(F8.Provider,{scope:e.__scopeMenu},C.exports.createElement(SY,{present:r||o.open},C.exports.createElement(F8.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(sIe,Dn({},i,{ref:t})):C.exports.createElement(lIe,Dn({},i,{ref:t})))))}),sIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu),r=C.exports.useRef(null),i=gs(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return MH(o)},[]),C.exports.createElement(TY,Dn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),lIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu);return C.exports.createElement(TY,Dn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),TY=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...b}=e,x=Jx(Gd,n),E=GP(Gd,n),k=WP(n),_=EY(n),T=ZRe(n),[A,R]=C.exports.useState(null),I=C.exports.useRef(null),D=gs(t,I,x.onContentChange),B=C.exports.useRef(0),z=C.exports.useRef(""),j=C.exports.useRef(0),Y=C.exports.useRef(null),te=C.exports.useRef("right"),G=C.exports.useRef(0),$=v?yV:C.exports.Fragment,V=v?{as:ny,allowPinchZoom:!0}:void 0,J=U=>{var X,le;const fe=z.current+U,Se=T().filter(Ye=>!Ye.disabled),Ae=document.activeElement,be=(X=Se.find(Ye=>Ye.ref.current===Ae))===null||X===void 0?void 0:X.textValue,ke=Se.map(Ye=>Ye.textValue),De=vIe(ke,fe,be),Je=(le=Se.find(Ye=>Ye.textValue===De))===null||le===void 0?void 0:le.ref.current;(function Ye(mt){z.current=mt,window.clearTimeout(B.current),mt!==""&&(B.current=window.setTimeout(()=>Ye(""),1e3))})(fe),Je&&setTimeout(()=>Je.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),_Me();const Z=C.exports.useCallback(U=>{var X,le;return te.current===((X=Y.current)===null||X===void 0?void 0:X.side)&&bIe(U,(le=Y.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(oIe,{scope:n,searchRef:z,onItemEnter:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(U=>{var X;Z(U)||((X=I.current)===null||X===void 0||X.focus(),R(null))},[Z]),onTriggerLeave:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:j,onPointerGraceIntentChange:C.exports.useCallback(U=>{Y.current=U},[])},C.exports.createElement($,V,C.exports.createElement(kMe,{asChild:!0,trapped:i,onMountAutoFocus:tr(o,U=>{var X;U.preventDefault(),(X=I.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:a},C.exports.createElement(xMe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m},C.exports.createElement(GRe,Dn({asChild:!0},_,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:R,onEntryFocus:U=>{E.isUsingKeyboardRef.current||U.preventDefault()}}),C.exports.createElement(TRe,Dn({role:"menu","aria-orientation":"vertical","data-state":pIe(x.open),"data-radix-menu-content":"",dir:E.dir},k,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:tr(b.onKeyDown,U=>{const le=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Se=U.key.length===1;le&&(U.key==="Tab"&&U.preventDefault(),!fe&&Se&&J(U.key));const Ae=I.current;if(U.target!==Ae||!XRe.includes(U.key))return;U.preventDefault();const ke=T().filter(De=>!De.disabled).map(De=>De.ref.current);_Y.includes(U.key)&&ke.reverse(),gIe(ke)}),onBlur:tr(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(B.current),z.current="")}),onPointerMove:tr(e.onPointerMove,j8(U=>{const X=U.target,le=G.current!==U.clientX;if(U.currentTarget.contains(X)&&le){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),z8="MenuItem",aN="menu.itemSelect",uIe=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=GP(z8,e.__scopeMenu),s=PY(z8,e.__scopeMenu),l=gs(t,o),u=C.exports.useRef(!1),f=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(aN,{bubbles:!0,cancelable:!0});p.addEventListener(aN,v=>r==null?void 0:r(v),{once:!0}),nY(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(cIe,Dn({},i,{ref:l,disabled:n,onClick:tr(e.onClick,f),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:tr(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:tr(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||YRe.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),cIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=PY(z8,n),s=EY(n),l=C.exports.useRef(null),u=gs(t,l),[f,p]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var x;v(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),C.exports.createElement(F8.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(qRe,Dn({asChild:!0},s,{focusable:!r}),C.exports.createElement(uc.div,Dn({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:tr(e.onPointerMove,j8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:tr(e.onPointerLeave,j8(b=>a.onItemLeave(b))),onFocus:tr(e.onFocus,()=>p(!0)),onBlur:tr(e.onBlur,()=>p(!1))}))))}),dIe="MenuRadioGroup";Cp(dIe,{value:void 0,onValueChange:()=>{}});const fIe="MenuItemIndicator";Cp(fIe,{checked:!1});const hIe="MenuSub";Cp(hIe);function pIe(e){return e?"open":"closed"}function gIe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vIe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=mIe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function yIe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=f>r&&n<(u-s)*(r-l)/(f-l)+s&&(i=!i)}return i}function bIe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yIe(n,t)}function j8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const SIe=tIe,xIe=nIe,wIe=aIe,CIe=uIe,LY="ContextMenu",[_Ie,Uze]=By(LY,[kY]),ew=kY(),[kIe,AY]=_Ie(LY),EIe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=ew(t),u=fu(r),f=C.exports.useCallback(p=>{s(p),u(p)},[u]);return C.exports.createElement(kIe,{scope:t,open:a,onOpenChange:f,modal:o},C.exports.createElement(SIe,Dn({},l,{dir:i,open:a,onOpenChange:f,modal:o}),n))},PIe="ContextMenuTrigger",TIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(PIe,n),o=ew(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),f=p=>{a.current={x:p.clientX,y:p.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(xIe,Dn({},o,{virtualRef:s})),C.exports.createElement(uc.span,Dn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:tr(e.onContextMenu,p=>{u(),f(p),p.preventDefault()}),onPointerDown:tr(e.onPointerDown,Hb(p=>{u(),l.current=window.setTimeout(()=>f(p),700)})),onPointerMove:tr(e.onPointerMove,Hb(u)),onPointerCancel:tr(e.onPointerCancel,Hb(u)),onPointerUp:tr(e.onPointerUp,Hb(u))})))}),LIe="ContextMenuContent",AIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(LIe,n),o=ew(n),a=C.exports.useRef(!1);return C.exports.createElement(wIe,Dn({},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)"}}))}),OIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=ew(n);return C.exports.createElement(CIe,Dn({},i,r,{ref:t}))});function Hb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const MIe=EIe,RIe=TIe,IIe=AIe,hd=OIe,DIe=lt([e=>e.gallery,e=>e.options,kr,_r],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightBoxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${f}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),NIe=lt([e=>e.options,e=>e.gallery,e=>e.system,_r],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BIe=e=>e.gallery,$Ie=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,FIe=C.exports.memo(e=>{var G,$,V,J,Z,U,X,le;const t=Be(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ve(NIe),{image:l,isSelected:u}=e,{url:f,thumbnail:p,uuid:m,metadata:v}=l,[b,x]=C.exports.useState(!1),E=Ty(),{t:k}=Ke(),_=()=>x(!0),T=()=>x(!1),A=()=>{l.metadata&&t(mx(l.metadata.image.prompt)),E({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},R=()=>{l.metadata&&t(Ly(l.metadata.image.seed)),E({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(Qu(!1)),t(C1(l)),n!=="img2img"&&t(Go("img2img")),E({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{a&&t(Qu(!1)),t(Sx(l)),t(bx()),n!=="unifiedCanvas"&&t(Go("unifiedCanvas")),E({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},B=()=>{v&&t(Z5e(v)),E({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},z=async()=>{var fe;if((fe=v==null?void 0:v.image)!=null&&fe.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Go("img2img")),t(K5e(v)),E({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}E({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},j=()=>t(wR(l)),Y=fe=>{fe.dataTransfer.setData("invokeai/imageUuid",m),fe.dataTransfer.effectAllowed="move"},te=()=>{t(Qu(!0)),t(wR(l))};return K(MIe,{onOpenChange:fe=>{t($U(fe))},children:[y(RIe,{children:K(rl,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:T,userSelect:"none",draggable:!0,onDragStart:Y,children:[y(nx,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:p||f,loading:"lazy"}),y("div",{className:"hoverable-image-content",onClick:j,children:u&&y($a,{width:"50%",height:"50%",as:aP,className:"hoverable-image-check"})}),b&&i>=64&&y("div",{className:"hoverable-image-delete-button",children:y(O8,{image:l,children:y(fs,{"aria-label":k("options:deleteImage"),icon:y(U8e,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},m)}),K(IIe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:fe=>{fe.detail.originalEvent.preventDefault()},children:[y(hd,{onClickCapture:te,children:k("options:openInViewer")}),y(hd,{onClickCapture:A,disabled:(($=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:$.prompt)===void 0,children:k("options:usePrompt")}),y(hd,{onClickCapture:R,disabled:((J=(V=l==null?void 0:l.metadata)==null?void 0:V.image)==null?void 0:J.seed)===void 0,children:k("options:useSeed")}),y(hd,{onClickCapture:B,disabled:!["txt2img","img2img"].includes((U=(Z=l==null?void 0:l.metadata)==null?void 0:Z.image)==null?void 0:U.type),children:k("options:useAll")}),y(hd,{onClickCapture:z,disabled:((le=(X=l==null?void 0:l.metadata)==null?void 0:X.image)==null?void 0:le.type)!=="img2img",children:k("options:useInitImg")}),y(hd,{onClickCapture:I,children:k("options:sendToImg2Img")}),y(hd,{onClickCapture:D,children:k("options:sendToUnifiedCanvas")}),y(hd,{"data-warning":!0,children:y(O8,{image:l,children:y("p",{children:k("options:deleteImage")})})})]})]})},$Ie),Vb=320,sN=40,zIe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},lN=400;function OY(){const e=Be(),{t}=Ke(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:x,isLightBoxOpen:E,isStaging:k,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=ve(DIe),{galleryMinWidth:A,galleryMaxWidth:R}=E?{galleryMinWidth:lN,galleryMaxWidth:lN}:zIe[f],[I,D]=C.exports.useState(x>=Vb),[B,z]=C.exports.useState(!1),[j,Y]=C.exports.useState(0),te=C.exports.useRef(null),G=C.exports.useRef(null),$=C.exports.useRef(null);C.exports.useEffect(()=>{x>=Vb&&D(!1)},[x]);const V=()=>{e(mSe(!o)),e(vi(!0))},J=()=>{a?U():Z()},Z=()=>{e(Vd(!0)),o&&e(vi(!0))},U=C.exports.useCallback(()=>{e(Vd(!1)),e($U(!1)),e(vSe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),X=()=>{e(c8(r))},le=be=>{e(ev(be))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Se=()=>{$.current&&window.clearTimeout($.current)};Ze("g",()=>{J()},[a,o]),Ze("left",()=>{e(VE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("right",()=>{e(HE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("shift+g",()=>{V()},[o]),Ze("esc",()=>{e(Vd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Ae=32;return Ze("shift+up",()=>{if(l<256){const be=He.clamp(l+Ae,32,256);e(ev(be))}},[l]),Ze("shift+down",()=>{if(l>32){const be=He.clamp(l-Ae,32,256);e(ev(be))}},[l]),C.exports.useEffect(()=>{!G.current||(G.current.scrollTop=s)},[s,a]),C.exports.useEffect(()=>{function be(ke){!o&&te.current&&!te.current.contains(ke.target)&&U()}return document.addEventListener("mousedown",be),()=>{document.removeEventListener("mousedown",be)}},[U,o]),y(Xq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:K("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[K(kq,{minWidth:A,maxWidth:o?R:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(be,ke,De)=>{Y(De.clientHeight),De.style.height=`${De.clientHeight}px`,o&&(De.style.position="fixed",De.style.right="1rem",z(!0))},onResizeStop:(be,ke,De,Je)=>{const Ye=o?He.clamp(Number(x)+Je.width,A,Number(R)):Number(x)+Je.width;e(SSe(Ye)),De.removeAttribute("data-resize-alert"),o&&(De.style.position="relative",De.style.removeProperty("right"),De.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(be,ke,De,Je)=>{const Ye=He.clamp(Number(x)+Je.width,A,Number(o?R:.95*window.innerWidth));Ye>=Vb&&!I?D(!0):YeYe-sN&&e(ev(Ye-sN)),o&&(Ye>=R?De.setAttribute("data-resize-alert","true"):De.removeAttribute("data-resize-alert")),De.style.height=`${j}px`},children:[K("div",{className:"image-gallery-header",children:[y(io,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:I?K(fn,{children:[y(qr,{size:"sm","data-selected":r==="result",onClick:()=>e(gb("result")),children:t("gallery:generations")}),y(qr,{size:"sm","data-selected":r==="user",onClick:()=>e(gb("user")),children:t("gallery:uploads")})]}):K(fn,{children:[y(Qe,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y(M8e,{}),onClick:()=>e(gb("result"))}),y(Qe,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y(G8e,{}),onClick:()=>e(gb("user"))})]})}),K("div",{className:"image-gallery-header-right-icons",children:[y(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y(Qe,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y(cP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:K("div",{className:"image-gallery-settings-popover",children:[K("div",{children:[y(Zo,{value:l,onChange:le,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y(Qe,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ev(64)),icon:y(Hx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y("div",{children:y(Qn,{label:t("gallery:maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(ySe(p==="contain"?"cover":"contain"))})}),y("div",{children:y(Qn,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:be=>e(bSe(be.target.checked))})}),y("div",{children:y(Qn,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:be=>e(xSe(be.target.checked))})})]})}),y(Qe,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:V,icon:o?y(Gq,{}):y(qq,{})})]})]}),y("div",{className:"image-gallery-container",ref:G,children:n.length||b?K(fn,{children:[y("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(be=>{const{uuid:ke}=be;return y(FIe,{image:be,isSelected:i===ke},ke)})}),y(ds,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):K("div",{className:"image-gallery-container-placeholder",children:[y(wq,{}),y("p",{children:t("gallery:noImagesInGallery")})]})})]}),B&&y("div",{style:{width:x+"px",height:"100%"}})]})})}const jIe=lt(BIe,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),HIe=()=>{const{resultImages:e,userImages:t}=ve(jIe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},VIe=lt([e=>e.options,_r],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qP=e=>{const t=Be(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ve(VIe),u=HIe(),f=()=>{t(lSe(!a)),t(vi(!0))},p=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(C1(b)):o==="unifiedCanvas"&&t(Sx(b)))};return y("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:K("div",{className:"workarea-main",children:[n,K("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&y(so,{label:"Toggle Split View",children:y("div",{className:"workarea-split-button","data-selected":a,onClick:f,children:y(uMe,{})})})]}),!s&&y(OY,{})]})})};function UIe(){return y(qP,{optionsPanel:y(QOe,{}),children:y(lMe,{})})}const WIe=()=>{const e=Be(),t=ve(i=>i.options.hiresFix),{t:n}=Ke(),r=i=>e(jE(i.target.checked));return y(at,{gap:2,direction:"column",children:y(os,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:r})})},GIe=()=>K(at,{gap:2,direction:"column",children:[y(Hq,{}),y(WIe,{})]});function qIe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(GIe,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(RP,{accordionInfo:t})]})}const YIe=()=>y("div",{className:"workarea-single-view",children:y("div",{className:"text-to-image-area",children:y(eY,{})})});function KIe(){return y(qP,{optionsPanel:y(qIe,{}),children:y(YIe,{})})}var H8=function(e,t){return H8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},H8(e,t)};function XIe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var su=function(){return su=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Sf(e,t,n,r){var i=fDe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):IY(e,r,n,function(v){var b=s+f*v,x=l+p*v,E=u+m*v;o(b,x,E)})}}function fDe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function hDe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,f=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:f}}var pDe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,f=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:f,minPositionY:p,maxPositionY:m}},YP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=hDe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,f=o.newContentHeight,p=o.newDiffHeight,m=pDe(a,l,u,s,f,p,Boolean(i));return m},s1=function(e,t){var n=YP(e,t);return e.bounds=n,n};function tw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,f=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var v=V8(e,s-p,u+p,r),b=V8(t,l-m,f+m,r);return{x:v,y:b}}var V8=function(e,t,n,r){return r?en?as(n,2):as(e,2):as(e,2)};function nw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*f,m=u-n*f,v=tw(p,m,i,o,0,0,null);return v}function Fy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var cN=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=rw(o,n);return!l},dN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},gDe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},mDe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function vDe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var f=e.bounds,p=f.maxPositionX,m=f.minPositionX,v=f.maxPositionY,b=f.minPositionY,x=n>p||nv||rp?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=nw(e,k,_,i,e.bounds,s||l),A=T.x,R=T.y;return{scale:i,positionX:x?A:n,positionY:E?R:r}}}function yDe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,f=l.positionX,p=l.positionY,m=t!==f,v=n!==p,b=!m||!v;if(!(!a||b||!s)){var x=tw(t,n,s,o,r,i,a),E=x.x,k=x.y;e.setTransformState(u,E,k)}}var bDe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var f=t-r.x,p=n-r.y,m=a?l:f,v=s?u:p;return{x:m,y:v}},eS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},SDe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},xDe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function wDe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function fN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var f=a+(e-a)*u;return f>l?l:fo?o:f}}return r?t:V8(e,o,a,i)}function CDe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function _De(e,t){var n=SDe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=CDe(a,s),f=t.x-r.x,p=t.y-r.y,m=f/u,v=p/u,b=l-i,x=f*f+p*p,E=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:v,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function kDe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=xDe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,f=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,E=r.panning,k=E.lockAxisY,_=E.lockAxisX,T=x.animationType,A=b.sizeX,R=b.sizeY,I=b.velocityAlignmentTime,D=I,B=wDe(e,l),z=Math.max(B,D),j=eS(e,A),Y=eS(e,R),te=j*i.offsetWidth/100,G=Y*i.offsetHeight/100,$=u+te,V=f-te,J=p+G,Z=m-G,U=e.transformState,X=new Date().getTime();IY(e,T,z,function(le){var fe=e.transformState,Se=fe.scale,Ae=fe.positionX,be=fe.positionY,ke=new Date().getTime()-X,De=ke/D,Je=MY[b.animationType],Ye=1-Je(Math.min(1,De)),mt=1-le,_t=Ae+a*mt,dt=be+s*mt,vt=fN(_t,U.positionX,Ae,_,v,f,u,V,$,Ye),xt=fN(dt,U.positionY,be,k,v,m,p,Z,J,Ye);(Ae!==_t||be!==dt)&&e.setTransformState(Se,vt,xt)})}}function hN(e,t){var n=e.transformState.scale;Gl(e),s1(e,n),t.touches?mDe(e,t):gDe(e,t)}function pN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=bDe(e,t,n),u=l.x,f=l.y,p=eS(e,a),m=eS(e,s);_De(e,{x:u,y:f}),yDe(e,u,f,p,m)}}function EDe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,f=(a==null?void 0:a.height)||0,p=s.1&&p;m?kDe(e):DY(e)}}function DY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,f=o||t=a;if((r>=1||s)&&DY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=KP(e,a,v,b);x&&Sf(e,x,f,p)}}function KP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Fy(as(t,2),o,a,0,!1),u=s1(e,l),f=nw(e,n,r,l,u,s),p=f.x,m=f.y;return{scale:l,positionX:p,positionY:m}}var cg={previousScale:1,scale:1,positionX:0,positionY:0},PDe=su(su({},cg),{setComponents:function(){},contextInstance:null}),dv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},BY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:cg.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:cg.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:cg.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:cg.positionY}},gN=function(e){var t=su({},dv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof dv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(dv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=su(su({},dv[n]),e[n]):s?t[n]=uN(uN([],dv[n]),e[n]):t[n]=e[n]}}),t},$Y=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var f=r*Math.exp(t*n),p=Fy(as(f,3),s,a,u,!1);return p};function FY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var f=o.offsetWidth,p=o.offsetHeight,m=(f/2-l)/s,v=(p/2-u)/s,b=$Y(e,t,n),x=KP(e,b,m,v);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,x,r,i)}function zY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=BY(e.props),s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!!i){var p=YP(e,a.scale),m=tw(a.positionX,a.positionY,p,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&f===a.positionY||Sf(e,v,t,n)}}function TDe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return cg;var l=r.getBoundingClientRect(),u=LDe(t),f=u.x,p=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/v,E=Fy(n||Math.min(b,x),a,s,0,!1),k=(l.width-m*E)/2,_=(l.height-v*E)/2,T=(l.left-f)*E+k,A=(l.top-p)*E+_,R=YP(e,E),I=tw(T,A,R,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:E}}function LDe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function ADe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var ODe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,1,t,n,r)}},MDe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,-1,t,n,r)}},RDe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,f=e.wrapperComponent,p=e.contentComponent,m=e.setup.disabled;if(!(m||!f||!p)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Sf(e,v,i,o)}}},IDe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),zY(e,t,n)}},DDe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=jY(t||i.scale,o,a);Sf(e,s,n,r)}}},NDe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Gl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&ADe(a)&&a&&o.contains(a)){var s=TDe(e,a,n);Sf(e,s,r,i)}}},ei=function(e){return{instance:e,state:e.transformState,zoomIn:ODe(e),zoomOut:MDe(e),setTransform:RDe(e),resetTransform:IDe(e),centerView:DDe(e),zoomToElement:NDe(e)}},BC=!1;function $C(){try{var e={get passive(){return BC=!0,!1}};return e}catch(t){return BC=!1,BC}}var rw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},mN=function(e){e&&clearTimeout(e)},BDe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},jY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},$De=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,f=s&&!l&&!r&&u;if(!f||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var p=rw(u,a);return!p};function FDe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ZIe(t,n);return r}function HY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var zDe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size,m=f.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,x=Fy(as(v,3),u,l,p,b);return x},jDe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},HDe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=rw(a,i);return!l},VDe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},UDe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=as(i[0].clientX-r.left,5),a=as(i[0].clientY-r.top,5),s=as(i[1].clientX-r.left,5),l=as(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},VY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},WDe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var f=t/r,p=f*n;return Fy(as(p,2),a,o,l,!u)},GDe=160,qDe=100,YDe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Gl(e),Pi(ei(e),t,r),Pi(ei(e),t,i))},KDe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,f=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,v=p.size,b=p.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var E=FDe(t,null),k=zDe(e,E,x,!t.ctrlKey);if(l!==k){var _=s1(e,k),T=HY(t,o,l),A=b||v===0||f,R=u&&A,I=nw(e,T.x,T.y,k,_,R),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(k,D,B),Pi(ei(e),t,r),Pi(ei(e),t,i)}},XDe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;mN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(NY(e,t.x,t.y),e.wheelAnimationTimer=null)},qDe);var o=jDe(e,t);o&&(mN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,Pi(ei(e),t,r),Pi(ei(e),t,i))},GDe))},ZDe=function(e,t){var n=VY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Gl(e)},QDe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,f=l.size;if(!(r===null||!n)){var p=UDe(t,i,n);if(!(!isFinite(p.x)||!isFinite(p.y))){var m=VY(t),v=WDe(e,m);if(v!==i){var b=s1(e,v),x=u||f===0||s,E=a&&x,k=nw(e,p.x,p.y,v,b,E),_=k.x,T=k.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(v,_,T)}}}},JDe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,NY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function eNe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return zY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var f=i==="zoomOut"?-1:1,p=$Y(e,f,o),m=HY(t,u,l),v=KP(e,p,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,v,a,s)}}var tNe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),f=n&&l&&u&&!a;if(!f)return!1;var p=rw(l,s);return!(p||!f)},UY=oe.createContext(PDe),nNe=function(e){XIe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=BY(n.props),n.setup=gN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=$C();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=$De(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||(YDe(n,r),KDe(n,r),XDe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),Gl(n),hN(n,r),Pi(ei(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=dN(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),pN(n,r.clientX,r.clientY),Pi(ei(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(EDe(n),Pi(ei(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=HDe(n,r);!l||(ZDe(n,r),Gl(n),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=VDe(n);!l||(r.preventDefault(),r.stopPropagation(),QDe(n,r),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(JDe(n),Pi(ei(n),r,o),Pi(ei(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Gl(n);var l=r.touches,u=l.length===1,f=l.length===2;u&&(Gl(n),hN(n,r),Pi(ei(n),r,o)),f&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=dN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];pN(n,s.clientX,s.clientY),Pi(ei(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=tNe(n,r);!o||eNe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ei(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=jY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=BDe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ei(n))},n}return t.prototype.componentDidMount=function(){var n=$C();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=$C();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Gl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s1(this,this.transformState.scale),this.setup=gN(this.props))},t.prototype.render=function(){var n=ei(this),r=this.props.children,i=typeof r=="function"?r(n):r;return y(UY.Provider,{value:su(su({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),rNe=oe.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),y(nNe,{...su({},e,{setRef:i})})});function iNe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var oNe=`.transform-component-module_wrapper__1_Fgj { + */var iP=Symbol.for("react.element"),oP=Symbol.for("react.portal"),Ex=Symbol.for("react.fragment"),Px=Symbol.for("react.strict_mode"),Tx=Symbol.for("react.profiler"),Lx=Symbol.for("react.provider"),Ax=Symbol.for("react.context"),t8e=Symbol.for("react.server_context"),Ox=Symbol.for("react.forward_ref"),Mx=Symbol.for("react.suspense"),Rx=Symbol.for("react.suspense_list"),Ix=Symbol.for("react.memo"),Dx=Symbol.for("react.lazy"),n8e=Symbol.for("react.offscreen"),LG;LG=Symbol.for("react.module.reference");function vs(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case iP:switch(e=e.type,e){case Ex:case Tx:case Px:case Mx:case Rx:return e;default:switch(e=e&&e.$$typeof,e){case t8e:case Ax:case Ox:case Dx:case Ix:case Lx:return e;default:return t}}case oP:return t}}}Bn.ContextConsumer=Ax;Bn.ContextProvider=Lx;Bn.Element=iP;Bn.ForwardRef=Ox;Bn.Fragment=Ex;Bn.Lazy=Dx;Bn.Memo=Ix;Bn.Portal=oP;Bn.Profiler=Tx;Bn.StrictMode=Px;Bn.Suspense=Mx;Bn.SuspenseList=Rx;Bn.isAsyncMode=function(){return!1};Bn.isConcurrentMode=function(){return!1};Bn.isContextConsumer=function(e){return vs(e)===Ax};Bn.isContextProvider=function(e){return vs(e)===Lx};Bn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===iP};Bn.isForwardRef=function(e){return vs(e)===Ox};Bn.isFragment=function(e){return vs(e)===Ex};Bn.isLazy=function(e){return vs(e)===Dx};Bn.isMemo=function(e){return vs(e)===Ix};Bn.isPortal=function(e){return vs(e)===oP};Bn.isProfiler=function(e){return vs(e)===Tx};Bn.isStrictMode=function(e){return vs(e)===Px};Bn.isSuspense=function(e){return vs(e)===Mx};Bn.isSuspenseList=function(e){return vs(e)===Rx};Bn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ex||e===Tx||e===Px||e===Mx||e===Rx||e===n8e||typeof e=="object"&&e!==null&&(e.$$typeof===Dx||e.$$typeof===Ix||e.$$typeof===Lx||e.$$typeof===Ax||e.$$typeof===Ox||e.$$typeof===LG||e.getModuleId!==void 0)};Bn.typeOf=vs;(function(e){e.exports=Bn})(e8e);function r8e(){const e=Y9e();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 YI={notify(){},get:()=>[]};function i8e(e,t){let n,r=YI;function i(p){return l(),r.subscribe(p)}function o(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=r8e())}function u(){n&&(n(),n=void 0,r.clear(),r=YI)}const f={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return f}const o8e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a8e=o8e?C.exports.useLayoutEffect:C.exports.useEffect;function s8e({store:e,context:t,children:n,serverState:r}){const i=C.exports.useMemo(()=>{const s=i8e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=C.exports.useMemo(()=>e.getState(),[e]);return a8e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),y((t||nf).Provider,{value:i,children:n})}function AG(e=nf){const t=e===nf?PG:()=>C.exports.useContext(e);return function(){const{store:r}=t();return r}}const l8e=AG();function u8e(e=nf){const t=e===nf?l8e:AG(e);return function(){return t().dispatch}}const c8e=u8e();X9e(_G.exports.useSyncExternalStoreWithSelector);q9e(pu.exports.unstable_batchedUpdates);function O4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O4=function(n){return typeof n}:O4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},O4(e)}function d8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;ny(at,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:y(by,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),Be=c8e,ve=J9e,g8e=lt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),m8e=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ve(g8e),i=t?Math.round(t*100/n):0;return y(LV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};var RG={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ZI=oe.createContext&&oe.createContext(RG),Wd=globalThis&&globalThis.__assign||function(){return Wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return y(so,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:y(fs,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function q8e(e){const{title:t,hotkey:n,description:r}=e;return K("div",{className:"hotkey-modal-item",children:[K("div",{className:"hotkey-info",children:[y("p",{className:"hotkey-title",children:t}),r&&y("p",{className:"hotkey-description",children:r})]}),y("div",{className:"hotkey-key",children:n})]})}function Y8e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=f=>{const p=[];return f.forEach((m,v)=>{p.push(y(q8e,{title:m.title,description:m.desc,hotkey:m.hotkey},v))}),y("div",{className:"hotkey-modal-category",children:p})};return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,children:[y(Jd,{}),K(ep,{className:" modal hotkeys-modal",children:[y(Cy,{className:"modal-close-btn"}),y("h1",{children:"Keyboard Shorcuts"}),y("div",{className:"hotkeys-modal-items",children:K(Nk,{allowMultiple:!0,children:[K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:appHotkeys")}),y(ng,{})]}),y(ig,{children:u(o)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:generalHotkeys")}),y(ng,{})]}),y(ig,{children:u(a)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:galleryHotkeys")}),y(ng,{})]}),y(ig,{children:u(s)})]}),K(rg,{children:[K(tg,{className:"hotkeys-modal-button",children:[y("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),y(ng,{})]}),y(ig,{children:u(l)})]})]})})]})]})]})}const os=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return K(Ir,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[y(ti,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),y(kE,{className:"invokeai__switch-root",...s})]})},nl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return K(Ir,{isDisabled:n,className:`invokeai__select ${l}`,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},children:[t&&y(ti,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),y(so,{label:i,...o,children:y(OV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(f=>typeof f=="string"||typeof f=="number"?y("option",{value:f,className:"invokeai__select-option",children:f},f):y("option",{value:f.value,className:"invokeai__select-option",children:f.key},f.value))})})]})},JI=/^-?(0\.)?\.?$/,Eo=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:f,min:p,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:x,numberInputFieldProps:E,numberInputStepperProps:k,tooltipProps:_,...T}=e,[A,R]=C.exports.useState(String(u));C.exports.useEffect(()=>{!A.match(JI)&&u!==Number(A)&&R(String(u))},[u,A]);const I=B=>{R(B),B.match(JI)||f(v?Math.floor(Number(B)):Number(B))},D=B=>{const z=He.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),p,m);R(String(z)),f(z)};return y(so,{..._,children:K(Ir,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&y(ti,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...x,children:t}),K(gE,{className:"invokeai__number-input-root",value:A,min:p,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[y(mE,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&K("div",{className:"invokeai__number-input-stepper",children:[y(yE,{...k,className:"invokeai__number-input-stepper-button"}),y(vE,{...k,className:"invokeai__number-input-stepper-button"})]})]})]})})},al=e=>e.system,K8e=e=>e.system.toastQueue,_r=lt(e=>e.options,e=>zE[e.activeTab],{memoizeOptions:{equalityCheck:He.isEqual}});lt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:He.isEqual}});const dP=e=>e.options,X8e=lt([al,dP],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:He.map(o,(u,f)=>f),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Z8e=({children:e})=>{const t=Be(),{t:n}=Ke(),r=ve(_=>_.options.steps),{isOpen:i,onOpen:o,onClose:a}=Qh(),{isOpen:s,onOpen:l,onClose:u}=Qh(),{shouldDisplayInProgressType:f,shouldConfirmOnDelete:p,shouldDisplayGuides:m,saveIntermediatesInterval:v,enableImageDebugging:b,shouldUseCanvasBetaLayout:x}=ve(X8e),E=()=>{MG.purge().then(()=>{a(),l()})},k=_=>{_>r&&(_=r),_<1&&(_=1),t(dwe(_))};return K(fn,{children:[C.exports.cloneElement(e,{onClick:o}),K(Qd,{isOpen:i,onClose:a,size:"lg",children:[y(Jd,{}),K(ep,{className:"modal settings-modal",children:[y(S1,{className:"settings-modal-header",children:n("common:settingsLabel")}),y(Cy,{className:"modal-close-btn"}),K(t1,{className:"settings-modal-content",children:[K("div",{className:"settings-modal-items",children:[K("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[y(nl,{label:n("settings:displayInProgress"),validValues:aCe,value:f,onChange:_=>t(iwe(_.target.value))}),f==="full-res"&&y(Eo,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:k,value:v,width:"auto",textAlign:"center"})]}),y(os,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:p,onChange:_=>t(eW(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(lwe(_.target.checked))}),y(os,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:x,onChange:_=>t(cSe(_.target.checked))})]}),K("div",{className:"settings-modal-items",children:[y("h2",{style:{fontWeight:"bold"},children:"Developer"}),y(os,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(fwe(_.target.checked))})]}),K("div",{className:"settings-modal-reset",children:[y(Hh,{size:"md",children:n("settings:resetWebUI")}),y(ds,{colorScheme:"red",onClick:E,children:n("settings:resetWebUI")}),y(yr,{children:n("settings:resetWebUIDesc1")}),y(yr,{children:n("settings:resetWebUIDesc2")})]})]}),y(cx,{children:y(ds,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),K(Qd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[y(Jd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),y(ep,{children:y(t1,{pb:6,pt:6,children:y(at,{justifyContent:"center",children:y(yr,{fontSize:"lg",children:y(yr,{children:n("settings:resetComplete")})})})})})]})]})},Q8e=lt(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:gi.exports.isEqual}}),J8e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ve(Q8e),s=Be(),{t:l}=Ke();let u;e&&!o?u="status-good":u="status-bad";let f=i;return[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(f)&&(u="status-working"),f&&t&&r>1&&(f=l(f)+` (${n}/${r})`),y(so,{label:o&&!a?"Click to clear, check logs for details":void 0,children:y(yr,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(tW())},className:`status ${u}`,children:l(f)})})},Js=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return K(bE,{...o,children:[y(wE,{children:t}),K(xE,{className:`invokeai__popover-content ${r}`,children:[i&&y(SE,{className:"invokeai__popover-arrow"}),n]})]})},qr=Oe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return y(so,{label:r,...i,children:y(ds,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})});function e_e(){const{t:e}=Ke(),{setColorMode:t,colorMode:n}=uy(),r=Be(),i=ve(l=>l.options.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};C.exports.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(Q5e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(y(qr,{style:{width:"6rem"},leftIcon:i===u?y(aP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(B8e,{})}),children:y(pi,{align:"stretch",children:s()})})}const t_e=lt([al],e=>{const{isProcessing:t,model_list:n}=e,r=He.map(n,(a,s)=>s),i=He.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),n_e=()=>{const e=Be(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ve(t_e);return y(at,{style:{paddingLeft:"0.3rem"},children:y(nl,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e(BW(a.target.value))}})})};function rs(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return K(Ir,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&y(ti,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),y(Uk,{...l,className:"input-entry",size:a,width:o})]})}var eD=Array.isArray,tD=Object.keys,r_e=Object.prototype.hasOwnProperty,i_e=typeof Element<"u";function w8(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=eD(e),r=eD(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!w8(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var p=tD(e);if(o=p.length,o!==tD(t).length)return!1;for(i=o;i--!==0;)if(!r_e.call(t,p[i]))return!1;if(i_e&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=p[i],!(a==="_owner"&&e.$$typeof)&&!w8(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Sd=function(t,n){try{return w8(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},o_e=function(t){return a_e(t)&&!s_e(t)};function a_e(e){return!!e&&typeof e=="object"}function s_e(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||c_e(e)}var l_e=typeof Symbol=="function"&&Symbol.for,u_e=l_e?Symbol.for("react.element"):60103;function c_e(e){return e.$$typeof===u_e}function d_e(e){return Array.isArray(e)?[]:{}}function q5(e,t){return t.clone!==!1&&t.isMergeableObject(e)?J2(d_e(e),e,t):e}function f_e(e,t,n){return e.concat(t).map(function(r){return q5(r,n)})}function h_e(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=q5(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=q5(t[i],n):r[i]=J2(e[i],t[i],n)}),r}function J2(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||f_e,n.isMergeableObject=n.isMergeableObject||o_e;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):h_e(e,t,n):q5(t,n)}J2.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return J2(r,i,n)},{})};var C8=J2,p_e=typeof global=="object"&&global&&global.Object===Object&&global;const GG=p_e;var g_e=typeof self=="object"&&self&&self.Object===Object&&self,m_e=GG||g_e||Function("return this")();const Su=m_e;var v_e=Su.Symbol;const rf=v_e;var qG=Object.prototype,y_e=qG.hasOwnProperty,b_e=qG.toString,cv=rf?rf.toStringTag:void 0;function S_e(e){var t=y_e.call(e,cv),n=e[cv];try{e[cv]=void 0;var r=!0}catch(o){}var i=b_e.call(e);return r&&(t?e[cv]=n:delete e[cv]),i}var x_e=Object.prototype,w_e=x_e.toString;function C_e(e){return w_e.call(e)}var __e="[object Null]",k_e="[object Undefined]",nD=rf?rf.toStringTag:void 0;function bp(e){return e==null?e===void 0?k_e:__e:nD&&nD in Object(e)?S_e(e):C_e(e)}function YG(e,t){return function(n){return e(t(n))}}var E_e=YG(Object.getPrototypeOf,Object);const fP=E_e;function Sp(e){return e!=null&&typeof e=="object"}var P_e="[object Object]",T_e=Function.prototype,L_e=Object.prototype,KG=T_e.toString,A_e=L_e.hasOwnProperty,O_e=KG.call(Object);function rD(e){if(!Sp(e)||bp(e)!=P_e)return!1;var t=fP(e);if(t===null)return!0;var n=A_e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&KG.call(n)==O_e}function M_e(){this.__data__=[],this.size=0}function XG(e,t){return e===t||e!==e&&t!==t}function Bx(e,t){for(var n=e.length;n--;)if(XG(e[n][0],t))return n;return-1}var R_e=Array.prototype,I_e=R_e.splice;function D_e(e){var t=this.__data__,n=Bx(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():I_e.call(t,n,1),--this.size,!0}function N_e(e){var t=this.__data__,n=Bx(t,e);return n<0?void 0:t[n][1]}function B_e(e){return Bx(this.__data__,e)>-1}function $_e(e,t){var n=this.__data__,r=Bx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Wke}var Gke="[object Arguments]",qke="[object Array]",Yke="[object Boolean]",Kke="[object Date]",Xke="[object Error]",Zke="[object Function]",Qke="[object Map]",Jke="[object Number]",eEe="[object Object]",tEe="[object RegExp]",nEe="[object Set]",rEe="[object String]",iEe="[object WeakMap]",oEe="[object ArrayBuffer]",aEe="[object DataView]",sEe="[object Float32Array]",lEe="[object Float64Array]",uEe="[object Int8Array]",cEe="[object Int16Array]",dEe="[object Int32Array]",fEe="[object Uint8Array]",hEe="[object Uint8ClampedArray]",pEe="[object Uint16Array]",gEe="[object Uint32Array]",ir={};ir[sEe]=ir[lEe]=ir[uEe]=ir[cEe]=ir[dEe]=ir[fEe]=ir[hEe]=ir[pEe]=ir[gEe]=!0;ir[Gke]=ir[qke]=ir[oEe]=ir[Yke]=ir[aEe]=ir[Kke]=ir[Xke]=ir[Zke]=ir[Qke]=ir[Jke]=ir[eEe]=ir[tEe]=ir[nEe]=ir[rEe]=ir[iEe]=!1;function mEe(e){return Sp(e)&&rq(e.length)&&!!ir[bp(e)]}function hP(e){return function(t){return e(t)}}var iq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,o2=iq&&typeof module=="object"&&module&&!module.nodeType&&module,vEe=o2&&o2.exports===iq,EC=vEe&&GG.process,yEe=function(){try{var e=o2&&o2.require&&o2.require("util").types;return e||EC&&EC.binding&&EC.binding("util")}catch(t){}}();const i1=yEe;var uD=i1&&i1.isTypedArray,bEe=uD?hP(uD):mEe;const SEe=bEe;var xEe=Object.prototype,wEe=xEe.hasOwnProperty;function oq(e,t){var n=Ny(e),r=!n&&Nke(e),i=!n&&!r&&nq(e),o=!n&&!r&&!i&&SEe(e),a=n||r||i||o,s=a?Oke(e.length,String):[],l=s.length;for(var u in e)(t||wEe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uke(u,l)))&&s.push(u);return s}var CEe=Object.prototype;function pP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CEe;return e===n}var _Ee=YG(Object.keys,Object);const kEe=_Ee;var EEe=Object.prototype,PEe=EEe.hasOwnProperty;function TEe(e){if(!pP(e))return kEe(e);var t=[];for(var n in Object(e))PEe.call(e,n)&&n!="constructor"&&t.push(n);return t}function aq(e){return e!=null&&rq(e.length)&&!ZG(e)}function gP(e){return aq(e)?oq(e):TEe(e)}function LEe(e,t){return e&&Fx(t,gP(t),e)}function AEe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var OEe=Object.prototype,MEe=OEe.hasOwnProperty;function REe(e){if(!Dy(e))return AEe(e);var t=pP(e),n=[];for(var r in e)r=="constructor"&&(t||!MEe.call(e,r))||n.push(r);return n}function mP(e){return aq(e)?oq(e,!0):REe(e)}function IEe(e,t){return e&&Fx(t,mP(t),e)}var sq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cD=sq&&typeof module=="object"&&module&&!module.nodeType&&module,DEe=cD&&cD.exports===sq,dD=DEe?Su.Buffer:void 0,fD=dD?dD.allocUnsafe:void 0;function NEe(e,t){if(t)return e.slice();var n=e.length,r=fD?fD(n):new e.constructor(n);return e.copy(r),r}function lq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function TD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var LD=function(t){return Array.isArray(t)&&t.length===0},Vo=function(t){return typeof t=="function"},zx=function(t){return t!==null&&typeof t=="object"},ITe=function(t){return String(Math.floor(Number(t)))===t},PC=function(t){return Object.prototype.toString.call(t)==="[object String]"},bq=function(t){return C.exports.Children.count(t)===0},TC=function(t){return zx(t)&&Vo(t.then)};function Hi(e,t,n,r){r===void 0&&(r=0);for(var i=yq(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function Sq(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?Ie.map(function(Xe){return B(Xe,Hi(ue,Xe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(We).then(function(Xe){return Xe.reduce(function(Ce,Ne,kt){return Ne==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ne&&(Ce=au(Ce,Ie[kt],Ne)),Ce},{})})},[B]),j=C.exports.useCallback(function(ue){return Promise.all([z(ue),m.validationSchema?D(ue):{},m.validate?I(ue):{}]).then(function(Ie){var We=Ie[0],Xe=Ie[1],Ce=Ie[2],Ne=C8.all([We,Xe,Ce],{arrayMerge:zTe});return Ne})},[m.validate,m.validationSchema,z,I,D]),Y=Xa(function(ue){return ue===void 0&&(ue=A.values),R({type:"SET_ISVALIDATING",payload:!0}),j(ue).then(function(Ie){return k.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ie})),Ie})});C.exports.useEffect(function(){a&&k.current===!0&&Sd(v.current,m.initialValues)&&Y(v.current)},[a,Y]);var te=C.exports.useCallback(function(ue){var Ie=ue&&ue.values?ue.values:v.current,We=ue&&ue.errors?ue.errors:b.current?b.current:m.initialErrors||{},Xe=ue&&ue.touched?ue.touched:x.current?x.current:m.initialTouched||{},Ce=ue&&ue.status?ue.status:E.current?E.current:m.initialStatus;v.current=Ie,b.current=We,x.current=Xe,E.current=Ce;var Ne=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!ue&&!!ue.isSubmitting,errors:We,touched:Xe,status:Ce,values:Ie,isValidating:!!ue&&!!ue.isValidating,submitCount:!!ue&&!!ue.submitCount&&typeof ue.submitCount=="number"?ue.submitCount:0}})};if(m.onReset){var kt=m.onReset(A.values,dt);TC(kt)?kt.then(Ne):Ne()}else Ne()},[m.initialErrors,m.initialStatus,m.initialTouched]);C.exports.useEffect(function(){k.current===!0&&!Sd(v.current,m.initialValues)&&(u&&(v.current=m.initialValues,te()),a&&Y(v.current))},[u,m.initialValues,te,a,Y]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(b.current,m.initialErrors)&&(b.current=m.initialErrors||fh,R({type:"SET_ERRORS",payload:m.initialErrors||fh}))},[u,m.initialErrors]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(x.current,m.initialTouched)&&(x.current=m.initialTouched||Nb,R({type:"SET_TOUCHED",payload:m.initialTouched||Nb}))},[u,m.initialTouched]),C.exports.useEffect(function(){u&&k.current===!0&&!Sd(E.current,m.initialStatus)&&(E.current=m.initialStatus,R({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var G=Xa(function(ue){if(_.current[ue]&&Vo(_.current[ue].validate)){var Ie=Hi(A.values,ue),We=_.current[ue].validate(Ie);return TC(We)?(R({type:"SET_ISVALIDATING",payload:!0}),We.then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:ue,value:We}}),Promise.resolve(We))}else if(m.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),D(A.values,ue).then(function(Xe){return Xe}).then(function(Xe){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Xe[ue]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),$=C.exports.useCallback(function(ue,Ie){var We=Ie.validate;_.current[ue]={validate:We}},[]),V=C.exports.useCallback(function(ue){delete _.current[ue]},[]),J=Xa(function(ue,Ie){R({type:"SET_TOUCHED",payload:ue});var We=Ie===void 0?i:Ie;return We?Y(A.values):Promise.resolve()}),Z=C.exports.useCallback(function(ue){R({type:"SET_ERRORS",payload:ue})},[]),U=Xa(function(ue,Ie){var We=Vo(ue)?ue(A.values):ue;R({type:"SET_VALUES",payload:We});var Xe=Ie===void 0?n:Ie;return Xe?Y(We):Promise.resolve()}),X=C.exports.useCallback(function(ue,Ie){R({type:"SET_FIELD_ERROR",payload:{field:ue,value:Ie}})},[]),le=Xa(function(ue,Ie,We){R({type:"SET_FIELD_VALUE",payload:{field:ue,value:Ie}});var Xe=We===void 0?n:We;return Xe?Y(au(A.values,ue,Ie)):Promise.resolve()}),fe=C.exports.useCallback(function(ue,Ie){var We=Ie,Xe=ue,Ce;if(!PC(ue)){ue.persist&&ue.persist();var Ne=ue.target?ue.target:ue.currentTarget,kt=Ne.type,Nt=Ne.name,Te=Ne.id,Et=Ne.value,Ut=Ne.checked,Ve=Ne.outerHTML,ft=Ne.options,un=Ne.multiple;We=Ie||Nt||Te,Xe=/number|range/.test(kt)?(Ce=parseFloat(Et),isNaN(Ce)?"":Ce):/checkbox/.test(kt)?HTe(Hi(A.values,We),Ut,Et):ft&&un?jTe(ft):Et}We&&le(We,Xe)},[le,A.values]),Se=Xa(function(ue){if(PC(ue))return function(Ie){return fe(Ie,ue)};fe(ue)}),Ae=Xa(function(ue,Ie,We){Ie===void 0&&(Ie=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:ue,value:Ie}});var Xe=We===void 0?i:We;return Xe?Y(A.values):Promise.resolve()}),be=C.exports.useCallback(function(ue,Ie){ue.persist&&ue.persist();var We=ue.target,Xe=We.name,Ce=We.id,Ne=We.outerHTML,kt=Ie||Xe||Ce;Ae(kt,!0)},[Ae]),ke=Xa(function(ue){if(PC(ue))return function(Ie){return be(Ie,ue)};be(ue)}),De=C.exports.useCallback(function(ue){Vo(ue)?R({type:"SET_FORMIK_STATE",payload:ue}):R({type:"SET_FORMIK_STATE",payload:function(){return ue}})},[]),Je=C.exports.useCallback(function(ue){R({type:"SET_STATUS",payload:ue})},[]),Ye=C.exports.useCallback(function(ue){R({type:"SET_ISSUBMITTING",payload:ue})},[]),mt=Xa(function(){return R({type:"SUBMIT_ATTEMPT"}),Y().then(function(ue){var Ie=ue instanceof Error,We=!Ie&&Object.keys(ue).length===0;if(We){var Xe;try{if(Xe=vt(),Xe===void 0)return}catch(Ce){throw Ce}return Promise.resolve(Xe).then(function(Ce){return k.current&&R({type:"SUBMIT_SUCCESS"}),Ce}).catch(function(Ce){if(k.current)throw R({type:"SUBMIT_FAILURE"}),Ce})}else if(k.current&&(R({type:"SUBMIT_FAILURE"}),Ie))throw ue})}),_t=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),mt().catch(function(Ie){console.warn("Warning: An unhandled error was caught from submitForm()",Ie)})}),dt={resetForm:te,validateForm:Y,validateField:G,setErrors:Z,setFieldError:X,setFieldTouched:Ae,setFieldValue:le,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,setFormikState:De,submitForm:mt},vt=Xa(function(){return f(A.values,dt)}),xt=Xa(function(ue){ue&&ue.preventDefault&&Vo(ue.preventDefault)&&ue.preventDefault(),ue&&ue.stopPropagation&&Vo(ue.stopPropagation)&&ue.stopPropagation(),te()}),Le=C.exports.useCallback(function(ue){return{value:Hi(A.values,ue),error:Hi(A.errors,ue),touched:!!Hi(A.touched,ue),initialValue:Hi(v.current,ue),initialTouched:!!Hi(x.current,ue),initialError:Hi(b.current,ue)}},[A.errors,A.touched,A.values]),ut=C.exports.useCallback(function(ue){return{setValue:function(We,Xe){return le(ue,We,Xe)},setTouched:function(We,Xe){return Ae(ue,We,Xe)},setError:function(We){return X(ue,We)}}},[le,Ae,X]),Rt=C.exports.useCallback(function(ue){var Ie=zx(ue),We=Ie?ue.name:ue,Xe=Hi(A.values,We),Ce={name:We,value:Xe,onChange:Se,onBlur:ke};if(Ie){var Ne=ue.type,kt=ue.value,Nt=ue.as,Te=ue.multiple;Ne==="checkbox"?kt===void 0?Ce.checked=!!Xe:(Ce.checked=!!(Array.isArray(Xe)&&~Xe.indexOf(kt)),Ce.value=kt):Ne==="radio"?(Ce.checked=Xe===kt,Ce.value=kt):Nt==="select"&&Te&&(Ce.value=Ce.value||[],Ce.multiple=!0)}return Ce},[ke,Se,A.values]),ot=C.exports.useMemo(function(){return!Sd(v.current,A.values)},[v.current,A.values]),Ct=C.exports.useMemo(function(){return typeof s<"u"?ot?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Vo(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,ot,A.errors,m]),ln=Wn({},A,{initialValues:v.current,initialErrors:b.current,initialTouched:x.current,initialStatus:E.current,handleBlur:ke,handleChange:Se,handleReset:xt,handleSubmit:_t,resetForm:te,setErrors:Z,setFormikState:De,setFieldTouched:Ae,setFieldValue:le,setFieldError:X,setStatus:Je,setSubmitting:Ye,setTouched:J,setValues:U,submitForm:mt,validateForm:Y,validateField:G,isValid:Ct,dirty:ot,unregisterField:V,registerField:$,getFieldProps:Rt,getFieldMeta:Le,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return ln}function wP(e){var t=BTe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return C.exports.useImperativeHandle(o,function(){return t}),C.exports.createElement(DTe,{value:t},n?C.exports.createElement(n,t):i?i(t):r?Vo(r)?r(t):bq(r)?null:C.exports.Children.only(r):null)}function $Te(e){var t={};if(e.inner){if(e.inner.length===0)return au(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Hi(t,a.path)||(t=au(t,a.path,a.message))}}return t}function FTe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=T8(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function T8(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||rD(i)?T8(i):i!==""?i:void 0}):rD(e[r])?t[r]=T8(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function zTe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?C8(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=C8(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function jTe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function HTe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var VTe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function Xa(e){var t=C.exports.useRef(e);return VTe(function(){t.current=e}),C.exports.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(Wn({},t,{length:n+1}))}else return[]},YTe=function(e){RTe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,f=l.formik.setFormikState;f(function(p){var m=typeof s=="function"?s:o,v=typeof a=="function"?a:o,b=au(p.values,u,o(Hi(p.values,u))),x=s?m(Hi(p.errors,u)):void 0,E=a?v(Hi(p.touched,u)):void 0;return LD(x)&&(x=void 0),LD(E)&&(E=void 0),Wn({},p,{values:b,errors:s?au(p.errors,u,x):p.errors,touched:a?au(p.touched,u,E):p.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(o1(a),[MTe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return GTe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return WTe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return LC(s,o,a)},function(s){return LC(s,o,null)},function(s){return LC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return qTe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(TD(i)),i.pop=i.pop.bind(TD(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Hi(i.formik.values,i.name),Hi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?o1(a):[];return o||(o=s[i]),Vo(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,f=o.formik,p=Ih(f,["validate","validationSchema"]),m=Wn({},i,{form:p,name:u});return a?C.exports.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):bq(l)?null:C.exports.Children.only(l):null},t}(C.exports.Component);YTe.defaultProps={validateOnChange:!0};const KTe=lt([al],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),AD=64,OD=2048;function XTe(){const{openModel:e,model_list:t}=ve(KTe),n=ve(l=>l.system.isProcessing),r=Be(),{t:i}=Ke(),[o,a]=C.exports.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1});C.exports.useEffect(()=>{var l,u,f,p,m,v,b;if(e){const x=He.pickBy(t,(E,k)=>He.isEqual(k,e));a({name:e,description:(l=x[e])==null?void 0:l.description,config:(u=x[e])==null?void 0:u.config,weights:(f=x[e])==null?void 0:f.weights,vae:(p=x[e])==null?void 0:p.vae,width:(m=x[e])==null?void 0:m.width,height:(v=x[e])==null?void 0:v.height,default:(b=x[e])==null?void 0:b.default})}},[t,e]);const s=l=>{r(XE(l))};return e?K(at,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[y(at,{alignItems:"center",children:y(yr,{fontSize:"lg",fontWeight:"bold",children:e})}),y(at,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:y(wP,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:f})=>y("form",{onSubmit:l,children:K(pi,{rowGap:"0.5rem",alignItems:"start",children:[K(Ir,{isInvalid:!!u.description&&f.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"lg"}),!!u.description&&f.description?y(Wo,{children:u.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.config&&f.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"lg"}),!!u.config&&f.config?y(Wo,{children:u.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.weights&&f.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"lg"}),!!u.weights&&f.weights?y(Wo,{children:u.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.vae&&f.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"lg"}),!!u.vae&&f.vae?y(Wo,{children:u.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!u.width&&f.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:p,form:m})=>y(Eo,{id:"width",name:"width",min:AD,max:OD,step:64,value:m.values.width,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.width&&f.width?y(Wo,{children:u.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!u.height&&f.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:p,form:m})=>y(Eo,{id:"height",name:"height",min:AD,max:OD,step:64,value:m.values.height,onChange:v=>m.setFieldValue(p.name,Number(v))})}),!!u.height&&f.height?y(Wo,{children:u.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):y(at,{width:"100%",height:"250px",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:y(yr,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Qn=e=>{const{label:t,styleClass:n,...r}=e;return y(Vj,{className:`invokeai__checkbox ${n}`,...r,children:t})};function ZTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function QTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function JTe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function eLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function wq(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function tLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function nLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function rLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function Hx(e){return yt({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 iLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function oLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function aLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function sLe(e){return yt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const Cq=lt([al],e=>{const{model_list:t}=e,n=[];return He.forEach(t,r=>{n.push(r.weights)}),n});function lLe(){const{t:e}=Ke();return y(rl,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function MD({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=ve(Cq),i=o=>{t.includes(o.target.value)?n(He.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return K(rl,{position:"relative",children:[r.includes(e.location)?y(lLe,{}):null,y(Qn,{value:e.name,label:y(fn,{children:K(pi,{alignItems:"start",children:[y("p",{style:{fontWeight:"bold"},children:e.name}),y("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function uLe(){const e=Be(),{t}=Ke(),n=ve(x=>x.system.searchFolder),r=ve(x=>x.system.foundModels),i=ve(Cq),o=ve(x=>x.options.shouldShowExistingModelsInSearch),a=ve(x=>x.system.isProcessing),[s,l]=oe.useState([]),u=()=>{e(nW(null)),e(rW(null)),l([])},f=x=>{e(kI(x.checkpointFolder))},p=()=>{l([]),r&&r.forEach(x=>{i.includes(x.location)||l(E=>[...E,x.name])})},m=()=>{l([])},v=()=>{const x=r==null?void 0:r.filter(E=>s.includes(E.name));x==null||x.forEach(E=>{const k={name:E.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:E.location,vae:"",width:512,height:512,default:!1};e(XE(k))}),l([])},b=()=>{const x=[],E=[];return r&&r.forEach((k,_)=>{i.includes(k.location)?E.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_)):x.push(y(MD,{model:k,modelsToAdd:s,setModelsToAdd:l},_))}),K(fn,{children:[x,o&&E]})};return K(fn,{children:[n?K(at,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),y("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),y(Qe,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:y(Hx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(kI(n))}),y(Qe,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:y(Iy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):y(wP,{initialValues:{checkpointFolder:""},onSubmit:x=>{f(x)},children:({handleSubmit:x})=>y("form",{onSubmit:x,children:K(Sy,{columnGap:"0.5rem",children:[y(Ir,{isRequired:!0,width:"max-content",children:y(qo,{as:rs,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),y(Qe,{icon:y(ZTe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&K(at,{flexDirection:"column",rowGap:"1rem",children:[K(at,{justifyContent:"space-between",alignItems:"center",children:[K("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),K("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),K(at,{columnGap:"0.5rem",justifyContent:"space-between",children:[K(at,{columnGap:"0.5rem",children:[y(qr,{isDisabled:s.length===r.length,onClick:p,children:t("modelmanager:selectAll")}),y(qr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),y(Qn,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(dSe(!o))})]}),y(qr,{isDisabled:s.length===0,onClick:v,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),K(at,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):y(yr,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const RD=64,ID=2048;function cLe(){const{isOpen:e,onOpen:t,onClose:n}=Qh(),r=Be(),{t:i}=Ke(),o=ve(v=>v.system.isProcessing);function a(v){return/\\s/g.test(v)}function s(v){let b;return a(v)&&(b=i("modelmanager:cannotUseSpaces")),b}const l={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1},u=v=>{r(XE(v)),n()},f=()=>{n()},[p,m]=oe.useState(!1);return K(fn,{children:[y(qr,{"aria-label":i("modelmanager:addNewModel"),tooltip:i("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:K(at,{columnGap:"0.5rem",alignItems:"center",children:[y(Iy,{}),i("modelmanager:addNew")]})}),K(Qd,{isOpen:e,onClose:f,size:"3xl",closeOnOverlayClick:!1,children:[y(Jd,{}),K(ep,{className:"modal add-model-modal",children:[y(S1,{children:i("modelmanager:addNewModel")}),y(Cy,{}),K(t1,{className:"add-model-modal-body",children:[y(uLe,{}),y(Qn,{label:i("modelmanager:addManually"),isChecked:p,onChange:()=>m(!p)}),p&&y(wP,{initialValues:l,onSubmit:u,children:({handleSubmit:v,errors:b,touched:x})=>y("form",{onSubmit:v,children:K(pi,{rowGap:"0.5rem",children:[y(yr,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:i("modelmanager:manual")}),K(Ir,{isInvalid:!!b.name&&x.name,isRequired:!0,children:[y(ti,{htmlFor:"name",fontSize:"sm",children:i("modelmanager:name")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"name",name:"name",type:"text",validate:s,width:"2xl"}),!!b.name&&x.name?y(Wo,{children:b.name}):y(Uo,{margin:0,children:i("modelmanager:nameValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.description&&x.description,isRequired:!0,children:[y(ti,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"description",name:"description",type:"text",width:"2xl"}),!!b.description&&x.description?y(Wo,{children:b.description}):y(Uo,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.config&&x.config,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"config",name:"config",type:"text",width:"2xl"}),!!b.config&&x.config?y(Wo,{children:b.config}):y(Uo,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.weights&&x.weights,isRequired:!0,children:[y(ti,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"weights",name:"weights",type:"text",width:"2xl"}),!!b.weights&&x.weights?y(Wo,{children:b.weights}):y(Uo,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.vae&&x.vae,children:[y(ti,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),K(pi,{alignItems:"start",children:[y(qo,{as:rs,id:"vae",name:"vae",type:"text",width:"2xl"}),!!b.vae&&x.vae?y(Wo,{children:b.vae}):y(Uo,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),K(Sy,{width:"100%",children:[K(Ir,{isInvalid:!!b.width&&x.width,children:[y(ti,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),K(pi,{alignItems:"start",children:[y(qo,{id:"width",name:"width",children:({field:E,form:k})=>y(Eo,{id:"width",name:"width",min:RD,max:ID,step:64,width:"90%",value:k.values.width,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.width&&x.width?y(Wo,{children:b.width}):y(Uo,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),K(Ir,{isInvalid:!!b.height&&x.height,children:[y(ti,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),K(pi,{alignItems:"start",children:[y(qo,{id:"height",name:"height",children:({field:E,form:k})=>y(Eo,{id:"height",name:"height",min:RD,max:ID,width:"90%",step:64,value:k.values.height,onChange:_=>k.setFieldValue(E.name,Number(_))})}),!!b.height&&x.height?y(Wo,{children:b.height}):y(Uo,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),y(qr,{type:"submit",className:"modal-close-btn",isLoading:o,children:i("modelmanager:addModel")})]})})})]})]})]})]})}bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"SunIcon",path:K("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[y("circle",{cx:"12",cy:"12",r:"5"}),y("path",{d:"M12 1v2"}),y("path",{d:"M12 21v2"}),y("path",{d:"M4.22 4.22l1.42 1.42"}),y("path",{d:"M18.36 18.36l1.42 1.42"}),y("path",{d:"M1 12h2"}),y("path",{d:"M21 12h2"}),y("path",{d:"M4.22 19.78l1.42-1.42"}),y("path",{d:"M18.36 5.64l1.42-1.42"})]})});bt({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"});bt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"ViewIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("circle",{cx:"12",cy:"12",r:"2"})]})});bt({displayName:"ViewOffIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});var dLe=bt({displayName:"DeleteIcon",path:y("g",{fill:"currentColor",children:y("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"})})});bt({displayName:"RepeatIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"RepeatClockIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});var fLe=bt({displayName:"EditIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),y("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});bt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});bt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});bt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});bt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});bt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});bt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});bt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});bt({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"});bt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var _q=bt({displayName:"ExternalLinkIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),y("path",{d:"M15 3h6v6"}),y("path",{d:"M10 14L21 3"})]})});bt({displayName:"LinkIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"PlusSquareIcon",path:K("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[y("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),y("path",{d:"M12 8v8"}),y("path",{d:"M8 12h8"})]})});bt({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"});bt({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"});bt({displayName:"TimeIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowRightIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({displayName:"ArrowLeftIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({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"});bt({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"});bt({displayName:"EmailIcon",path:K("g",{fill:"currentColor",children:[y("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"}),y("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"})]})});bt({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"});bt({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"});bt({displayName:"SpinnerIcon",path:K(fn,{children:[y("defs",{children:K("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[y("stop",{stopColor:"currentColor",offset:"0%"}),y("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),K("g",{transform:"translate(2)",fill:"none",children:[y("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),y("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),y("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});bt({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"});bt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:y("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"})});bt({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"});bt({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"});bt({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"});bt({displayName:"InfoOutlineIcon",path:K("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[y("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),y("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),y("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});bt({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"});bt({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"});bt({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"});bt({displayName:"QuestionOutlineIcon",path:K("g",{stroke:"currentColor",strokeWidth:"1.5",children:[y("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"}),y("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),y("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});bt({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"});bt({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"});bt({viewBox:"0 0 14 14",path:y("g",{fill:"currentColor",children:y("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});bt({displayName:"MinusIcon",path:y("g",{fill:"currentColor",children:y("rect",{height:"4",width:"20",x:"2",y:"10"})})});bt({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"});const CP=Oe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:f,onClose:p}=Qh(),m=C.exports.useRef(null),v=()=>{r(),p()},b=()=>{o&&o(),p()};return K(fn,{children:[C.exports.cloneElement(l,{onClick:f,ref:t}),y(xV,{isOpen:u,leastDestructiveRef:m,onClose:p,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:s}),y(t1,{children:a}),K(cx,{children:[y(ds,{ref:m,onClick:b,className:"modal-close-btn",children:i}),y(ds,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})});function DD(e){const{isProcessing:t,isConnected:n}=ve(v=>v.system),r=ve(v=>v.system.openModel),{t:i}=Ke(),o=Be(),{name:a,status:s,description:l}=e,u=()=>{o(BW(a))},f=()=>{o(lI(a))},p=()=>{o(Z6e(a)),o(lI(null))};return K(at,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[y(rl,{onClick:f,cursor:"pointer",children:y(so,{label:l,hasArrow:!0,placement:"bottom",children:y(yr,{fontWeight:"bold",children:a})})}),y(rH,{onClick:f,cursor:"pointer"}),K(at,{gap:2,alignItems:"center",children:[y(yr,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),y(ds,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),y(Qe,{icon:y(fLe,{}),size:"sm",onClick:f,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),y(CP,{title:i("modelmanager:deleteModel"),acceptCallback:p,acceptButtonText:i("modelmanager:delete"),triggerComponent:y(Qe,{icon:y(dLe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:K(at,{rowGap:"1rem",flexDirection:"column",children:[y("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),y("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const hLe=lt(e=>e.system,e=>{const t=He.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),pLe=()=>{const{models:e}=ve(hLe),[t,n]=C.exports.useState(""),{t:r}=Ke(),i=He.debounce(a=>{n(a.target.value)},400),o=()=>{const a=[],s=[];return e.forEach((l,u)=>{l.name.startsWith(t)&&s.push(y(DD,{name:l.name,status:l.status,description:l.description},u)),a.push(y(DD,{name:l.name,status:l.status,description:l.description},u))}),t!==""?s:a};return K(at,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[K(at,{justifyContent:"space-between",children:[y(yr,{fontSize:"1.4rem",fontWeight:"bold",children:r("modelmanager:availableModels")}),y(cLe,{})]}),y(rs,{onChange:i,label:r("modelmanager:search")}),y(at,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:o()})]})};function gLe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Qh(),{t:i}=Ke();return K(fn,{children:[C.exports.cloneElement(e,{onClick:n}),K(Qd,{isOpen:t,onClose:r,size:"6xl",children:[y(Jd,{}),K(ep,{className:" modal",children:[y(Cy,{className:"modal-close-btn"}),y(S1,{children:i("modelmanager:modelManager")}),K(at,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[y(pLe,{}),y(XTe,{})]})]})]})]})}function mLe(){const{t:e,i18n:t}=Ke(),n={en:e("common:langEnglish"),ru:e("common:langRussian"),it:e("common:langItalian"),pt_br:e("common:langBrPortuguese"),de:e("common:langGerman"),pl:e("common:langPolish"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(y(qr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:y(I8e,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:y(pi,{children:r()})})}const vLe=()=>{const{t:e}=Ke();return K("div",{className:"site-header",children:[K("div",{className:"site-header-left-side",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),K("div",{className:"site-header-right-side",children:[y(J8e,{}),y(n_e,{}),y(gLe,{children:y(Qe,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(E8e,{})})}),y(Y8e,{children:y(Qe,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:y(R8e,{})})}),y(e_e,{}),y(mLe,{}),y(Qe,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:y(k8e,{})})}),y(Qe,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:y(S8e,{})})}),y(Qe,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:y(Vh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:y(b8e,{})})}),y(Z8e,{children:y(Qe,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:y(JTe,{})})})]})]})};var yLe=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)}}(),Jr=globalThis&&globalThis.__assign||function(){return Jr=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)}},kLe=["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"],zD="__resizable_base__",kq=function(e){xLe(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(zD):o.className+=zD,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||wLe},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(),u=Number(n.state[s].toString().replace("px","")),f=u/l[s]*100;return f+"%"}return AC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?AC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?AC(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&&N0("left",o),s=i&&N0("top",o),l,u;if(this.props.bounds==="parent"){var f=this.parentNode;f&&(l=a?this.resizableRight-this.parentLeft:f.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:f.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=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),u=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,p=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,x=u||0;if(s){var E=(m-b)*this.ratio+x,k=(v-b)*this.ratio+x,_=(f-x)/this.ratio+b,T=(p-x)/this.ratio+b,A=Math.max(f,E),R=Math.min(p,k),I=Math.max(m,_),D=Math.min(v,T);n=$b(n,A,R),r=$b(r,I,D)}else n=$b(n,f,p),r=$b(r,m,v);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,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&CLe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Fb(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 u=this.parentNode;if(u){var f=this.window.getComputedStyle(u).flexDirection;this.flexDir=f.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Fl(Fl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(p)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Fb(n))try{n.preventDefault(),n.stopPropagation()}catch(V){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Fb(n)?n.touches[0].clientX:n.clientX,f=Fb(n)?n.touches[0].clientY:n.clientY,p=this.state,m=p.direction,v=p.original,b=p.width,x=p.height,E=this.getParentSize(),k=_Le(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=k.maxWidth,a=k.maxHeight,s=k.minWidth,l=k.minHeight;var _=this.calculateNewSizeFromDirection(u,f),T=_.newHeight,A=_.newWidth,R=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=FD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=FD(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(A,T,{width:R.maxWidth,height:R.maxHeight},{width:s,height:l});if(A=I.newWidth,T=I.newHeight,this.props.grid){var D=$D(A,this.props.grid[0]),B=$D(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(B-T)<=z?B:T}var j={width:A-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var Y=A/E.width*100;A=Y+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var G=A/this.window.innerHeight*100;A=G+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var Y=T/E.height*100;T=Y+"%"}else if(x.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(x.endsWith("vh")){var G=T/this.window.innerHeight*100;T=G+"vh"}}var $={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?$.flexBasis=$.width:this.flexDir==="column"&&($.flexBasis=$.height),pu.exports.flushSync(function(){r.setState($)}),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:Fl(Fl({},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,u=r.handleComponent;if(!i)return null;var f=Object.keys(i).map(function(p){return i[p]!==!1?y(SLe,{direction:p,onResizeStart:n.onResizeStart,replaceStyles:o&&o[p],className:a&&a[p],children:u&&u[p]?u[p]:null},p):null});return y("div",{className:l,style:s,children:f})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return kLe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Fl(Fl(Fl({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 K(o,{...Fl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&y("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}(C.exports.PureComponent),ELe=Object.create,Eq=Object.defineProperty,PLe=Object.getOwnPropertyDescriptor,TLe=Object.getOwnPropertyNames,LLe=Object.getPrototypeOf,ALe=Object.prototype.hasOwnProperty,Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),OLe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of TLe(t))!ALe.call(e,i)&&i!==n&&Eq(e,i,{get:()=>t[i],enumerable:!(r=PLe(t,i))||r.enumerable});return e},Pq=(e,t,n)=>(n=e!=null?ELe(LLe(e)):{},OLe(t||!e||!e.__esModule?Eq(n,"default",{value:e,enumerable:!0}):n,e)),MLe=Ue((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),Tq=Ue((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Vx=Ue((e,t)=>{var n=Tq();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),RLe=Ue((e,t)=>{var n=Vx(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),ILe=Ue((e,t)=>{var n=Vx();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),DLe=Ue((e,t)=>{var n=Vx();function r(i){return n(this.__data__,i)>-1}t.exports=r}),NLe=Ue((e,t)=>{var n=Vx();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Ux=Ue((e,t)=>{var n=MLe(),r=RLe(),i=ILe(),o=DLe(),a=NLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux();function r(){this.__data__=new n,this.size=0}t.exports=r}),$Le=Ue((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),FLe=Ue((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),zLe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),Lq=Ue((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),bc=Ue((e,t)=>{var n=Lq(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=Ue((e,t)=>{var n=bc(),r=n.Symbol;t.exports=r}),jLe=Ue((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),f=l[a];try{l[a]=void 0;var p=!0}catch(v){}var m=o.call(l);return p&&(u?l[a]=f:delete l[a]),m}t.exports=s}),HLe=Ue((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),Wx=Ue((e,t)=>{var n=_P(),r=jLe(),i=HLe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),Aq=Ue((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),Oq=Ue((e,t)=>{var n=Wx(),r=Aq(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var f=n(u);return f==o||f==a||f==i||f==s}t.exports=l}),VLe=Ue((e,t)=>{var n=bc(),r=n["__core-js_shared__"];t.exports=r}),ULe=Ue((e,t)=>{var n=VLe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),Mq=Ue((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),WLe=Ue((e,t)=>{var n=Oq(),r=ULe(),i=Aq(),o=Mq(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,f=l.toString,p=u.hasOwnProperty,m=RegExp("^"+f.call(p).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var x=n(b)?m:s;return x.test(o(b))}t.exports=v}),GLe=Ue((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),T1=Ue((e,t)=>{var n=WLe(),r=GLe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Map");t.exports=i}),Gx=Ue((e,t)=>{var n=T1(),r=n(Object,"create");t.exports=r}),qLe=Ue((e,t)=>{var n=Gx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),YLe=Ue((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),KLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),XLe=Ue((e,t)=>{var n=Gx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),ZLe=Ue((e,t)=>{var n=Gx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),QLe=Ue((e,t)=>{var n=qLe(),r=YLe(),i=KLe(),o=XLe(),a=ZLe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=QLe(),r=Ux(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),eAe=Ue((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),qx=Ue((e,t)=>{var n=eAe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),tAe=Ue((e,t)=>{var n=qx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),nAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).get(i)}t.exports=r}),rAe=Ue((e,t)=>{var n=qx();function r(i){return n(this,i).has(i)}t.exports=r}),iAe=Ue((e,t)=>{var n=qx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),Rq=Ue((e,t)=>{var n=JLe(),r=tAe(),i=nAe(),o=rAe(),a=iAe();function s(l){var u=-1,f=l==null?0:l.length;for(this.clear();++u{var n=Ux(),r=kP(),i=Rq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var f=u.__data__;if(!r||f.length{var n=Ux(),r=BLe(),i=$Le(),o=FLe(),a=zLe(),s=oAe();function l(u){var f=this.__data__=new n(u);this.size=f.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),sAe=Ue((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),lAe=Ue((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),uAe=Ue((e,t)=>{var n=Rq(),r=sAe(),i=lAe();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),Iq=Ue((e,t)=>{var n=uAe(),r=cAe(),i=dAe(),o=1,a=2;function s(l,u,f,p,m,v){var b=f&o,x=l.length,E=u.length;if(x!=E&&!(b&&E>x))return!1;var k=v.get(l),_=v.get(u);if(k&&_)return k==u&&_==l;var T=-1,A=!0,R=f&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=bc(),r=n.Uint8Array;t.exports=r}),hAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),pAe=Ue((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),gAe=Ue((e,t)=>{var n=_P(),r=fAe(),i=Tq(),o=Iq(),a=hAe(),s=pAe(),l=1,u=2,f="[object Boolean]",p="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",x="[object RegExp]",E="[object Set]",k="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",R=n?n.prototype:void 0,I=R?R.valueOf:void 0;function D(B,z,j,Y,te,G,$){switch(j){case A:if(B.byteLength!=z.byteLength||B.byteOffset!=z.byteOffset)return!1;B=B.buffer,z=z.buffer;case T:return!(B.byteLength!=z.byteLength||!G(new r(B),new r(z)));case f:case p:case b:return i(+B,+z);case m:return B.name==z.name&&B.message==z.message;case x:case k:return B==z+"";case v:var V=a;case E:var J=Y&l;if(V||(V=s),B.size!=z.size&&!J)return!1;var Z=$.get(B);if(Z)return Z==z;Y|=u,$.set(B,z);var U=o(V(B),V(z),Y,te,G,$);return $.delete(B),U;case _:if(I)return I.call(B)==I.call(z)}return!1}t.exports=D}),mAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),vAe=Ue((e,t)=>{var n=mAe(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),yAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),SAe=Ue((e,t)=>{var n=yAe(),r=bAe(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),xAe=Ue((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),wAe=Ue((e,t)=>{var n=Wx(),r=Yx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),CAe=Ue((e,t)=>{var n=wAe(),r=Yx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),_Ae=Ue((e,t)=>{function n(){return!1}t.exports=n}),Dq=Ue((e,t)=>{var n=bc(),r=_Ae(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),kAe=Ue((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),EAe=Ue((e,t)=>{var n=Wx(),r=Nq(),i=Yx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",f="[object Function]",p="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",x="[object Set]",E="[object String]",k="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",R="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",Y="[object Uint16Array]",te="[object Uint32Array]",G={};G[A]=G[R]=G[I]=G[D]=G[B]=G[z]=G[j]=G[Y]=G[te]=!0,G[o]=G[a]=G[_]=G[s]=G[T]=G[l]=G[u]=G[f]=G[p]=G[m]=G[v]=G[b]=G[x]=G[E]=G[k]=!1;function $(V){return i(V)&&r(V.length)&&!!G[n(V)]}t.exports=$}),PAe=Ue((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),TAe=Ue((e,t)=>{var n=Lq(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),Bq=Ue((e,t)=>{var n=EAe(),r=PAe(),i=TAe(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),LAe=Ue((e,t)=>{var n=xAe(),r=CAe(),i=EP(),o=Dq(),a=kAe(),s=Bq(),l=Object.prototype,u=l.hasOwnProperty;function f(p,m){var v=i(p),b=!v&&r(p),x=!v&&!b&&o(p),E=!v&&!b&&!x&&s(p),k=v||b||x||E,_=k?n(p.length,String):[],T=_.length;for(var A in p)(m||u.call(p,A))&&!(k&&(A=="length"||x&&(A=="offset"||A=="parent")||E&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=f}),AAe=Ue((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),OAe=Ue((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),MAe=Ue((e,t)=>{var n=OAe(),r=n(Object.keys,Object);t.exports=r}),RAe=Ue((e,t)=>{var n=AAe(),r=MAe(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),IAe=Ue((e,t)=>{var n=Oq(),r=Nq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),DAe=Ue((e,t)=>{var n=LAe(),r=RAe(),i=IAe();function o(a){return i(a)?n(a):r(a)}t.exports=o}),NAe=Ue((e,t)=>{var n=vAe(),r=SAe(),i=DAe();function o(a){return n(a,i,r)}t.exports=o}),BAe=Ue((e,t)=>{var n=NAe(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,f,p,m){var v=u&r,b=n(s),x=b.length,E=n(l),k=E.length;if(x!=k&&!v)return!1;for(var _=x;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var A=m.get(s),R=m.get(l);if(A&&R)return A==l&&R==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=T1(),r=bc(),i=n(r,"DataView");t.exports=i}),FAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Promise");t.exports=i}),zAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"Set");t.exports=i}),jAe=Ue((e,t)=>{var n=T1(),r=bc(),i=n(r,"WeakMap");t.exports=i}),HAe=Ue((e,t)=>{var n=$Ae(),r=kP(),i=FAe(),o=zAe(),a=jAe(),s=Wx(),l=Mq(),u="[object Map]",f="[object Object]",p="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",x=l(n),E=l(r),k=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=p||o&&A(new o)!=m||a&&A(new a)!=v)&&(A=function(R){var I=s(R),D=I==f?R.constructor:void 0,B=D?l(D):"";if(B)switch(B){case x:return b;case E:return u;case k:return p;case _:return m;case T:return v}return I}),t.exports=A}),VAe=Ue((e,t)=>{var n=aAe(),r=Iq(),i=gAe(),o=BAe(),a=HAe(),s=EP(),l=Dq(),u=Bq(),f=1,p="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,x=b.hasOwnProperty;function E(k,_,T,A,R,I){var D=s(k),B=s(_),z=D?m:a(k),j=B?m:a(_);z=z==p?v:z,j=j==p?v:j;var Y=z==v,te=j==v,G=z==j;if(G&&l(k)){if(!l(_))return!1;D=!0,Y=!1}if(G&&!Y)return I||(I=new n),D||u(k)?r(k,_,T,A,R,I):i(k,_,z,T,A,R,I);if(!(T&f)){var $=Y&&x.call(k,"__wrapped__"),V=te&&x.call(_,"__wrapped__");if($||V){var J=$?k.value():k,Z=V?_.value():_;return I||(I=new n),R(J,Z,T,A,I)}}return G?(I||(I=new n),o(k,_,T,A,R,I)):!1}t.exports=E}),UAe=Ue((e,t)=>{var n=VAe(),r=Yx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),$q=Ue((e,t)=>{var n=UAe();function r(i,o){return n(i,o)}t.exports=r}),WAe=["ctrl","shift","alt","meta","mod"],GAe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function OC(e,t=","){return typeof e=="string"?e.split(t):e}function s2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>GAe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!WAe.includes(o));return{...r,keys:i}}function qAe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function YAe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function KAe(e){return Fq(e,["input","textarea","select"])}function Fq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function XAe(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var ZAe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:f,metaKey:p,shiftKey:m,key:v,code:b}=e,x=b.toLowerCase().replace("key",""),E=v.toLowerCase();if(u!==r&&E!=="alt"||m!==s&&E!=="shift")return!1;if(a){if(!p&&!f)return!1}else if(p!==o&&x!=="meta"||f!==i&&x!=="ctrl")return!1;return l&&l.length===1&&(l.includes(E)||l.includes(x))?!0:l?l.every(k=>n.has(k)):!l},QAe=C.exports.createContext(void 0),JAe=()=>C.exports.useContext(QAe),eOe=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),tOe=()=>C.exports.useContext(eOe),nOe=Pq($q());function rOe(e){let t=C.exports.useRef(void 0);return(0,nOe.default)(t.current,e)||(t.current=e),t.current}var jD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ze(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=rOe(a),{enabledScopes:f}=tOe(),p=JAe();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!XAe(f,u==null?void 0:u.scopes))return;let m=x=>{var E;if(!(KAe(x)&&!Fq(x,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){jD(x);return}((E=x.target)==null?void 0:E.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||OC(e,u==null?void 0:u.splitKey).forEach(k=>{var T;let _=s2(k,u==null?void 0:u.combinationKey);if(ZAe(x,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(qAe(x,_,u==null?void 0:u.preventDefault),!YAe(x,_,u==null?void 0:u.enabled)){jD(x);return}l(x,_)}})}},v=x=>{o.add(x.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(x)},b=x=>{x.key.toLowerCase()!=="meta"?o.delete(x.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(x)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.addHotkey(s2(x,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),p&&OC(e,u==null?void 0:u.splitKey).forEach(x=>p.removeHotkey(s2(x,u==null?void 0:u.combinationKey)))}},[e,l,u,f]),i}Pq($q());var L8=new Set;function iOe(e){(Array.isArray(e)?e:[e]).forEach(t=>L8.add(s2(t)))}function oOe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=s2(t);for(let i of L8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&L8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{iOe(e.key)}),document.addEventListener("keyup",e=>{oOe(e.key)})});const aOe=lt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),sOe=lt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),lOe=()=>{const e=Be(),t=ve(aOe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ve(sOe),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(tW()),e(dC(!n))};return Ze("`",()=>{e(dC(!n))},[n]),Ze("esc",()=>{e(dC(!1))}),K(fn,{children:[n&&y(kq,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:y("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=f;return K("div",{className:`console-entry console-${b}-color`,children:[K("p",{className:"console-timestamp",children:[m,":"]}),y("p",{className:"console-message",children:v})]},p)})})}),n&&y(so,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:y(fs,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:y(x8e,{}),onClick:()=>a(!o)})}),y(so,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:y(fs,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?y(N8e,{}):y($G,{}),onClick:l})})]})};function uOe(){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)})}function cOe(){const{t:e}=Ke();return K("div",{className:"work-in-progress nodes-work-in-progress",children:[y("h1",{children:e("common:nodes")}),y("p",{children:e("common:nodesDesc")})]})}const dOe=()=>{const{t:e}=Ke();return K("div",{className:"work-in-progress post-processing-work-in-progress",children:[y("h1",{children:e("common:postProcessing")}),y("p",{children:e("common:postProcessDesc1")}),y("p",{children:e("common:postProcessDesc2")}),y("p",{children:e("common:postProcessDesc3")})]})},fOe=bt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:y("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"})})}),hOe=bt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:y("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"})}),pOe=bt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:y("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"})}),gOe=bt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:y("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:y("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 oo=(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[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(oo||{});const mOe=()=>{const{t:e}=Ke();return C.exports.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},vOe=e=>mOe()[e],yOe=lt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),bOe=lt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),PP=()=>{const e=Be(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ve(yOe),{isGFPGANAvailable:i}=ve(bOe),o=u=>e(w4(u)),a=u=>e(CU(u)),s=u=>e(C4(u.target.value)),{t:l}=Ke();return K(at,{direction:"column",gap:2,children:[y(nl,{label:l("options:type"),validValues:oCe.concat(),value:n,onChange:s}),y(Eo,{isDisabled:!i,label:l("options:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&y(Eo,{isDisabled:!i,label:l("options:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function zq(){const e=ve(i=>i.system.isGFPGANAvailable),t=ve(i=>i.options.shouldRunFacetool),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(sSe(i.target.checked))})}function SOe(){const e=Be(),t=ve(i=>i.options.shouldFitToWidthHeight),n=i=>e(OU(i.target.checked)),{t:r}=Ke();return y(os,{label:r("options:imageFit"),isChecked:t,onChange:n})}function Zo(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:f="",withSliderMarks:p=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:x=!1,inputWidth:E="5.5rem",inputReadOnly:k=!0,withReset:_=!1,hideTooltip:T=!1,isCompact:A=!1,handleReset:R,isResetDisabled:I,isSliderDisabled:D,isInputDisabled:B,styleClass:z,sliderFormControlProps:j,sliderFormLabelProps:Y,sliderMarkProps:te,sliderTrackProps:G,sliderThumbProps:$,sliderNumberInputProps:V,sliderNumberInputFieldProps:J,sliderNumberInputStepperProps:Z,sliderTooltipProps:U,sliderIAIIconButtonProps:X,...le}=e,[fe,Se]=C.exports.useState(String(i)),Ae=C.exports.useMemo(()=>V!=null&&V.max?V.max:a,[a,V==null?void 0:V.max]);C.exports.useEffect(()=>{String(i)!==fe&&fe!==""&&Se(String(i))},[i,fe,Se]);const be=Je=>{const Ye=He.clamp(x?Math.floor(Number(Je.target.value)):Number(Je.target.value),o,Ae);Se(String(Ye)),l(Ye)},ke=Je=>{Se(String(Je)),l(Number(Je))},De=()=>{!R||R()};return K(Ir,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":p,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...j,children:[y(ti,{className:"invokeai__slider-component-label",...Y,children:r}),K(Sy,{w:"100%",gap:2,alignItems:"center",children:[K(_E,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ke,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...le,children:[p&&K(fn,{children:[y($9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),y($9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...te,children:a})]}),y(HV,{className:"invokeai__slider_track",...G,children:y(VV,{className:"invokeai__slider_track-filled"})}),y(so,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${f}`,hidden:T,...U,children:y(jV,{className:"invokeai__slider-thumb",...$})})]}),b&&K(gE,{min:o,max:Ae,step:s,value:fe,onChange:ke,onBlur:be,className:"invokeai__slider-number-field",isDisabled:B,...V,children:[y(mE,{className:"invokeai__slider-number-input",width:E,minWidth:E,readOnly:k,...J}),K(_V,{...Z,children:[y(yE,{className:"invokeai__slider-number-stepper"}),y(vE,{className:"invokeai__slider-number-stepper"})]})]}),_&&y(Qe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:y(Hx,{}),onClick:De,isDisabled:I,...X})]})]})}function jq(e){const{t}=Ke(),{label:n=`${t("options:strength")}`,styleClass:r}=e,i=ve(l=>l.options.img2imgStrength),o=Be();return y(Zo,{label:n,step:.01,min:.01,max:.99,onChange:l=>o(Y9(l)),value:i,isInteger:!1,styleClass:r,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{o(Y9(.75))}})}const Hq=()=>{const e=Be(),t=ve(i=>i.options.seamless),n=i=>e(LU(i.target.checked)),{t:r}=Ke();return y(at,{gap:2,direction:"column",children:y(os,{label:r("options:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},xOe=()=>y(at,{gap:2,direction:"column",children:y(Hq,{})});function wOe(){const e=Be(),{t}=Ke(),n=ve(i=>i.options.shouldRandomizeSeed),r=i=>e(oSe(i.target.checked));return y(os,{label:t("options:randomizeSeed"),isChecked:n,onChange:r})}function COe(){const e=ve(a=>a.options.seed),t=ve(a=>a.options.shouldRandomizeSeed),n=ve(a=>a.options.shouldGenerateVariations),{t:r}=Ke(),i=Be(),o=a=>i(Ly(a));return y(Eo,{label:r("options:seed"),step:1,precision:0,flexGrow:1,min:ZE,max:QE,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function _Oe(){const e=Be(),t=ve(i=>i.options.shouldRandomizeSeed),{t:n}=Ke();return y(ds,{size:"sm",isDisabled:t,onClick:()=>e(Ly($W(ZE,QE))),padding:"0 1.5rem",children:y("p",{children:n("options:shuffle")})})}function kOe(){const e=Be(),t=ve(i=>i.options.threshold),{t:n}=Ke(),r=i=>e(IU(i));return y(Eo,{label:n("options:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}function EOe(){const e=Be(),t=ve(i=>i.options.perlin),{t:n}=Ke(),r=i=>e(PU(i));return y(Eo,{label:n("options:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}const TP=()=>K(at,{gap:2,direction:"column",children:[y(wOe,{}),K(at,{gap:2,children:[y(COe,{}),y(_Oe,{})]}),y(at,{gap:2,children:y(kOe,{})}),y(at,{gap:2,children:y(EOe,{})})]}),POe=lt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),TOe=lt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),LP=()=>{const e=Be(),{upscalingLevel:t,upscalingStrength:n}=ve(POe),{isESRGANAvailable:r}=ve(TOe),{t:i}=Ke(),o=s=>e(K9(Number(s.target.value))),a=s=>e(X9(s));return K("div",{className:"upscale-options",children:[y(nl,{isDisabled:!r,label:i("options:scale"),value:t,onChange:o,validValues:iCe}),y(Eo,{isDisabled:!r,label:i("options:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};function Vq(){const e=ve(i=>i.system.isESRGANAvailable),t=ve(i=>i.options.shouldRunESRGAN),n=Be();return y(os,{isDisabled:!e,isChecked:t,onChange:i=>n(aSe(i.target.checked))})}function AP(){const e=ve(r=>r.options.shouldGenerateVariations),t=Be();return y(os,{isChecked:e,width:"auto",onChange:r=>t(tSe(r.target.checked))})}function LOe(){const e=ve(o=>o.options.seedWeights),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(AU(o.target.value));return y(rs,{label:n("options:seedWeights"),value:e,isInvalid:t&&!(FE(e)||e===""),isDisabled:!t,onChange:i})}function AOe(){const e=ve(o=>o.options.variationAmount),t=ve(o=>o.options.shouldGenerateVariations),{t:n}=Ke(),r=Be(),i=o=>r(uSe(o));return y(Eo,{label:n("options:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const OP=()=>K(at,{gap:2,direction:"column",children:[y(AOe,{}),y(LOe,{})]});function OOe(){const e=Be(),t=ve(i=>i.options.cfgScale),{t:n}=Ke(),r=i=>e(wU(i));return y(Eo,{label:n("options:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function MOe(){const e=ve(o=>o.options.height),t=ve(_r),n=Be(),{t:r}=Ke(),i=o=>n(_U(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:r("options:height"),value:e,flexGrow:1,onChange:i,validValues:rCe,styleClass:"main-option-block"})}const ROe=lt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function IOe(){const e=Be(),{iterations:t}=ve(ROe),{t:n}=Ke(),r=i=>e(J5e(i));return y(Eo,{label:n("options:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function DOe(){const e=ve(i=>i.options.sampler),t=Be(),{t:n}=Ke(),r=i=>t(TU(i.target.value));return y(nl,{label:n("options:sampler"),value:e,onChange:r,validValues:tCe,styleClass:"main-option-block"})}function NOe(){const e=Be(),t=ve(i=>i.options.steps),{t:n}=Ke(),r=i=>e(RU(i));return y(Eo,{label:n("options:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function BOe(){const e=ve(o=>o.options.width),t=ve(_r),{t:n}=Ke(),r=Be(),i=o=>r(DU(Number(o.target.value)));return y(nl,{isDisabled:t==="unifiedCanvas",label:n("options:width"),value:e,flexGrow:1,onChange:i,validValues:nCe,styleClass:"main-option-block"})}function MP(){return y("div",{className:"main-options",children:K("div",{className:"main-options-list",children:[K("div",{className:"main-options-row",children:[y(IOe,{}),y(NOe,{}),y(OOe,{})]}),K("div",{className:"main-options-row",children:[y(BOe,{}),y(MOe,{}),y(DOe,{})]})]})})}const $Oe=lt(e=>e.system,e=>e.shouldDisplayGuides),FOe=({children:e,feature:t})=>{const n=ve($Oe),{text:r}=vOe(t);return n?K(bE,{trigger:"hover",children:[y(wE,{children:y(rl,{children:e})}),K(xE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[y(SE,{className:"guide-popover-arrow"}),y("div",{className:"guide-popover-guide-content",children:r})]})]}):null},zOe=Oe(({feature:e,icon:t=QTe},n)=>y(FOe,{feature:e,children:y(rl,{ref:n,children:y($a,{marginBottom:"-.15rem",as:t})})}));function jOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return K(rg,{className:"advanced-settings-item",children:[y(tg,{className:"advanced-settings-header",children:K(at,{width:"100%",gap:"0.5rem",align:"center",children:[y(rl,{flexGrow:1,textAlign:"left",children:t}),i,n&&y(zOe,{feature:n}),y(ng,{})]})}),y(ig,{className:"advanced-settings-panel",children:r})]})}const RP=e=>{const{accordionInfo:t}=e,n=ve(a=>a.system.openAccordions),r=Be();return y(Nk,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(owe(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:f,additionalHeaderComponents:p}=t[s];a.push(y(jOe,{header:l,feature:u,content:f,additionalHeaderComponents:p},s))}),a})()})},rn=e=>e.canvas,kr=lt([rn,_r,al],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Uq=e=>e.canvas.layerState.objects.find(H5),Wq=lt([e=>e.options,e=>e.system,Uq,_r],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:f}=t;let p=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(p=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(p=!1,m.push("No initial image selected")),u&&(p=!1,m.push("System Busy")),f||(p=!1,m.push("System Disconnected")),o&&(!(FE(a)||a==="")||l===-1)&&(p=!1,m.push("Seed-Weights badly formatted.")),{isReady:p,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:He.isEqual,resultEqualityCheck:He.isEqual}});function IP(e){const{iconButton:t=!1,...n}=e,r=Be(),{isReady:i}=ve(Wq),o=ve(_r),a=()=>{r(u8(o))},{t:s}=Ke();return Ze(["ctrl+enter","meta+enter"],()=>{r(u8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),y("div",{style:{flexGrow:4},children:t?y(Qe,{"aria-label":s("options:invoke"),type:"submit",icon:y($8e,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("options:invoke"),tooltipProps:{placement:"bottom"},...n}):y(qr,{"aria-label":s("options:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const HOe=lt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:He.isEqual}});function DP(e){const{...t}=e,n=Be(),{isProcessing:r,isConnected:i,isCancelable:o}=ve(HOe),a=()=>n(K6e()),{t:s}=Ke();return Ze("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),y(Qe,{icon:y(nLe,{}),tooltip:s("options:cancel"),"aria-label":s("options:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const VOe=lt(e=>e.options,e=>e.shouldLoopback),UOe=()=>{const e=Be(),t=ve(VOe),{t:n}=Ke();return y(Qe,{"aria-label":n("options:toggleLoopback"),tooltip:n("options:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:y(z8e,{}),onClick:()=>{e(rSe(!t))}})},NP=()=>{const e=ve(_r);return K("div",{className:"process-buttons",children:[y(IP,{}),e==="img2img"&&y(UOe,{}),y(DP,{})]})},WOe=lt([e=>e.options,_r],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BP=()=>{const e=Be(),{prompt:t,activeTabName:n}=ve(WOe),{isReady:r}=ve(Wq),i=C.exports.useRef(null),{t:o}=Ke(),a=l=>{e(mx(l.target.value))};Ze("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(u8(n)))};return y("div",{className:"prompt-bar",children:y(Ir,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:y(ZV,{id:"prompt",name:"prompt",placeholder:o("options:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function Gq(e){return yt({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 qq(e){return yt({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-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function GOe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function qOe(e,t){e.classList?e.classList.add(t):GOe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function HD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function YOe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=HD(e.className,t):e.setAttribute("class",HD(e.className&&e.className.baseVal||"",t))}const VD={disabled:!1},Yq=oe.createContext(null);var Kq=function(t){return t.scrollTop},Av="unmounted",Sh="exited",xh="entering",z0="entered",A8="exiting",Sc=function(e){oE(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=Sh,o.appearStatus=xh):l=z0:r.unmountOnExit||r.mountOnEnter?l=Av:l=Sh,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Av?{status:Sh}: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!==xh&&a!==z0&&(o=xh):(a===xh||a===z0)&&(o=A8)}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===xh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:W3.findDOMNode(this);a&&Kq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Sh&&this.setState({status:Av})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[W3.findDOMNode(this),s],u=l[0],f=l[1],p=this.getTimeouts(),m=s?p.appear:p.enter;if(!i&&!a||VD.disabled){this.safeSetState({status:z0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:xh},function(){o.props.onEntering(u,f),o.onTransitionEnd(m,function(){o.safeSetState({status:z0},function(){o.props.onEntered(u,f)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:W3.findDOMNode(this);if(!o||VD.disabled){this.safeSetState({status:Sh},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:A8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Sh},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:W3.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],u=l[0],f=l[1];this.props.addEndListener(u,f)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Av)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=nE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return y(Yq.Provider,{value:null,children:typeof a=="function"?a(i,s):oe.cloneElement(oe.Children.only(a),s)})},t}(oe.Component);Sc.contextType=Yq;Sc.propTypes={};function B0(){}Sc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:B0,onEntering:B0,onEntered:B0,onExit:B0,onExiting:B0,onExited:B0};Sc.UNMOUNTED=Av;Sc.EXITED=Sh;Sc.ENTERING=xh;Sc.ENTERED=z0;Sc.EXITING=A8;const KOe=Sc;var XOe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return qOe(t,r)})},MC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return YOe(t,r)})},$P=function(e){oE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ae.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),FP=e=>{const t=Be(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ve(ZOe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ze("o",()=>{t(Ju(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Ze("esc",()=>{t(Ju(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ze("shift+o",()=>{m(),t(vi(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(eSe(a.current?a.current.scrollTop:0)),t(Ju(!1)),t(nSe(!1)))},[t,i]),f=()=>{s.current=window.setTimeout(()=>u(),500)},p=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(iSe(!i)),t(vi(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),y(Xq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:y("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:p,onMouseOver:i?void 0:p,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:y("div",{className:"options-panel-margin",children:K("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?p():!i&&f()},children:[y(so,{label:"Pin Options Panel",children:y("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?y(Gq,{}):y(qq,{})})}),!i&&K("div",{className:"invoke-ai-logo-wrapper",children:[y("img",{src:WG,alt:"invoke-ai-logo"}),K("h1",{children:["invoke ",y("strong",{children:"ai"})]})]}),l]})})})})};function QOe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(xOe,{})}},n=Be(),r=ve(_r);return C.exports.useEffect(()=>{r==="img2img"&&n(jE(!1))},[r,n]),K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(jq,{label:e("options:img2imgStrength"),styleClass:"main-option-block image-to-image-strength-main-option"}),y(SOe,{}),y(RP,{accordionInfo:t})]})}const zP=C.exports.createContext(null),JOe=e=>{const{styleClass:t}=e,n=C.exports.useContext(zP),r=()=>{n&&n()};return y("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:K("div",{className:"image-upload-button",children:[y(Nx,{}),y(Hh,{size:"lg",children:"Click or Drag and Drop"})]})})},eMe=lt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),O8=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Qh(),a=Be(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ve(eMe),f=C.exports.useRef(null),p=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Y6e(e)),o()};Ze("delete",()=>{s?i():m()},[e,s]);const v=b=>a(eW(!b.target.checked));return K(fn,{children:[C.exports.cloneElement(t,{onClick:e?p:void 0,ref:n}),y(xV,{isOpen:r,leastDestructiveRef:f,onClose:o,children:y(Jd,{children:K(wV,{className:"modal",children:[y(S1,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),y(t1,{children:K(at,{direction:"column",gap:5,children:[y(yr,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),y(Ir,{children:K(at,{alignItems:"center",children:[y(ti,{mb:0,children:"Don't ask me again"}),y(kE,{checked:!s,onChange:v})]})})]})}),K(cx,{children:[y(ds,{ref:f,onClick:o,className:"modal-close-btn",children:"Cancel"}),y(ds,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),tMe=lt([e=>e.system,e=>e.options,e=>e.gallery,_r],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:f,isLightBoxOpen:p}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:f,activeTabName:r,isLightBoxOpen:p}},{memoizeOptions:{resultEqualityCheck:gi.exports.isEqual}}),Zq=()=>{var B,z,j,Y,te,G;const e=Be(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:f,activeTabName:p}=ve(tMe),m=Ty(),{t:v}=Ke(),b=()=>{!u||(f&&e(Qu(!1)),e(C1(u)),e(Go("img2img")))},x=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:v("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Ze("shift+i",()=>{u?(b(),m({title:v("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:imageNotLoaded"),description:v("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var $,V;!u||(u.metadata&&e(X5e(u.metadata)),(($=u.metadata)==null?void 0:$.image.type)==="img2img"?e(Go("img2img")):((V=u.metadata)==null?void 0:V.image.type)==="txt2img"&&e(Go("txt2img")))};Ze("a",()=>{var $,V;["txt2img","img2img"].includes((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.type)?(E(),m({title:v("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:parametersNotSet"),description:v("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{u!=null&&u.metadata&&e(Ly(u.metadata.image.seed))};Ze("s",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.seed?(k(),m({title:v("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:seedNotSet"),description:v("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{var $,V;return((V=($=u==null?void 0:u.metadata)==null?void 0:$.image)==null?void 0:V.prompt)&&e(mx(u.metadata.image.prompt))};Ze("p",()=>{var $,V;(V=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&V.prompt?(_(),m({title:v("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:v("toast:promptNotSet"),description:v("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{u&&e(G6e(u))};Ze("Shift+U",()=>{i&&!s&&n&&!t&&o?T():m({title:v("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const A=()=>{u&&e(q6e(u))};Ze("Shift+R",()=>{r&&!s&&n&&!t&&a?A():m({title:v("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(MU(!l)),I=()=>{!u||(f&&e(Qu(!1)),e(Sx(u)),e(vi(!0)),p!=="unifiedCanvas"&&e(Go("unifiedCanvas")),m({title:v("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Ze("i",()=>{u?R():m({title:v("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const D=()=>{e(Qu(!f))};return K("div",{className:"current-image-options",children:[K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{"aria-label":`${v("options:sendTo")}...`,icon:y(V8e,{})}),children:K("div",{className:"current-image-send-to-popover",children:[y(qr,{size:"sm",onClick:b,leftIcon:y(QI,{}),children:v("options:sendToImg2Img")}),y(qr,{size:"sm",onClick:I,leftIcon:y(QI,{}),children:v("options:sendToUnifiedCanvas")}),y(qr,{size:"sm",onClick:x,leftIcon:y(Ry,{}),children:v("options:copyImageToLink")}),y(qr,{leftIcon:y(sP,{}),size:"sm",children:y(Vh,{download:!0,href:u==null?void 0:u.url,children:v("options:downloadImage")})})]})}),y(Qe,{icon:y(T8e,{}),tooltip:f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"aria-label":f?`${v("options:closeViewer")} (Z)`:`${v("options:openInViewer")} (Z)`,"data-selected":f,onClick:D})]}),K(io,{isAttached:!0,children:[y(Qe,{icon:y(F8e,{}),tooltip:`${v("options:usePrompt")} (P)`,"aria-label":`${v("options:usePrompt")} (P)`,isDisabled:!((z=(B=u==null?void 0:u.metadata)==null?void 0:B.image)!=null&&z.prompt),onClick:_}),y(Qe,{icon:y(H8e,{}),tooltip:`${v("options:useSeed")} (S)`,"aria-label":`${v("options:useSeed")} (S)`,isDisabled:!((Y=(j=u==null?void 0:u.metadata)==null?void 0:j.image)!=null&&Y.seed),onClick:k}),y(Qe,{icon:y(_8e,{}),tooltip:`${v("options:useAll")} (A)`,"aria-label":`${v("options:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((G=(te=u==null?void 0:u.metadata)==null?void 0:te.image)==null?void 0:G.type),onClick:E})]}),K(io,{isAttached:!0,children:[y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(O8e,{}),"aria-label":v("options:restoreFaces")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(PP,{}),y(qr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:A,children:v("options:restoreFaces")})]})}),y(Js,{trigger:"hover",triggerComponent:y(Qe,{icon:y(P8e,{}),"aria-label":v("options:upscale")}),children:K("div",{className:"current-image-postprocessing-popover",children:[y(LP,{}),y(qr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:T,children:v("options:upscaleImage")})]})})]}),y(io,{isAttached:!0,children:y(Qe,{icon:y($G,{}),tooltip:`${v("options:info")} (I)`,"aria-label":`${v("options:info")} (I)`,"data-selected":l,onClick:R})}),y(O8,{image:u,children:y(Qe,{icon:y(yp,{}),tooltip:`${v("options:deleteImage")} (Del)`,"aria-label":`${v("options:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};function nMe(e){return yt({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 $n=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>K(at,{gap:2,children:[n&&y(so,{label:`Recall ${e}`,children:y(fs,{"aria-label":"Use this parameter",icon:y(nMe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&y(so,{label:`Copy ${e}`,children:y(fs,{"aria-label":`Copy ${e}`,icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),K(at,{direction:i?"column":"row",children:[K(yr,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?K(Vh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",y(_q,{mx:"2px"})]}):y(yr,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),rMe=(e,t)=>e.image.uuid===t.image.uuid,Qq=C.exports.memo(({image:e,styleClass:t})=>{var j,Y;const n=Be();Ze("esc",()=>{n(MU(!1))});const r=((j=e==null?void 0:e.metadata)==null?void 0:j.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:f,orig_path:p,perlin:m,postprocessing:v,prompt:b,sampler:x,scale:E,seamless:k,seed:_,steps:T,strength:A,threshold:R,type:I,variations:D,width:B}=r,z=JSON.stringify(e.metadata,null,2);return y("div",{className:`image-metadata-viewer ${t}`,children:K(at,{gap:1,direction:"column",width:"100%",children:[K(at,{gap:2,children:[y(yr,{fontWeight:"semibold",children:"File:"}),K(Vh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,y(_q,{mx:"2px"})]})]}),Object.keys(r).length>0?K(fn,{children:[I&&y($n,{label:"Generation type",value:I}),((Y=e.metadata)==null?void 0:Y.model_weights)&&y($n,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&y($n,{label:"Original image",value:p}),I==="gfpgan"&&A!==void 0&&y($n,{label:"Fix faces strength",value:A,onClick:()=>n(w4(A))}),I==="esrgan"&&E!==void 0&&y($n,{label:"Upscaling scale",value:E,onClick:()=>n(K9(E))}),I==="esrgan"&&A!==void 0&&y($n,{label:"Upscaling strength",value:A,onClick:()=>n(X9(A))}),b&&y($n,{label:"Prompt",labelPosition:"top",value:x4(b),onClick:()=>n(mx(b))}),_!==void 0&&y($n,{label:"Seed",value:_,onClick:()=>n(Ly(_))}),R!==void 0&&y($n,{label:"Noise Threshold",value:R,onClick:()=>n(IU(R))}),m!==void 0&&y($n,{label:"Perlin Noise",value:m,onClick:()=>n(PU(m))}),x&&y($n,{label:"Sampler",value:x,onClick:()=>n(TU(x))}),T&&y($n,{label:"Steps",value:T,onClick:()=>n(RU(T))}),o!==void 0&&y($n,{label:"CFG scale",value:o,onClick:()=>n(wU(o))}),D&&D.length>0&&y($n,{label:"Seed-weight pairs",value:N5(D),onClick:()=>n(AU(N5(D)))}),k&&y($n,{label:"Seamless",value:k,onClick:()=>n(LU(k))}),l&&y($n,{label:"High Resolution Optimization",value:l,onClick:()=>n(jE(l))}),B&&y($n,{label:"Width",value:B,onClick:()=>n(DU(B))}),s&&y($n,{label:"Height",value:s,onClick:()=>n(_U(s))}),u&&y($n,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(C1(u))}),f&&y($n,{label:"Mask image",value:f,isLink:!0,onClick:()=>n(EU(f))}),I==="img2img"&&A&&y($n,{label:"Image to image strength",value:A,onClick:()=>n(Y9(A))}),a&&y($n,{label:"Image to image fit",value:a,onClick:()=>n(OU(a))}),v&&v.length>0&&K(fn,{children:[y(Hh,{size:"sm",children:"Postprocessing"}),v.map((te,G)=>{if(te.type==="esrgan"){const{scale:$,strength:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Upscale (ESRGAN)`}),y($n,{label:"Scale",value:$,onClick:()=>n(K9($))}),y($n,{label:"Strength",value:V,onClick:()=>n(X9(V))})]},G)}else if(te.type==="gfpgan"){const{strength:$}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (GFPGAN)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("gfpgan"))}})]},G)}else if(te.type==="codeformer"){const{strength:$,fidelity:V}=te;return K(at,{pl:"2rem",gap:1,direction:"column",children:[y(yr,{size:"md",children:`${G+1}: Face restoration (Codeformer)`}),y($n,{label:"Strength",value:$,onClick:()=>{n(w4($)),n(C4("codeformer"))}}),V&&y($n,{label:"Fidelity",value:V,onClick:()=>{n(CU(V)),n(C4("codeformer"))}})]},G)}})]}),i&&y($n,{withCopy:!0,label:"Dream Prompt",value:i}),K(at,{gap:2,direction:"column",children:[K(at,{gap:2,children:[y(so,{label:"Copy metadata JSON",children:y(fs,{"aria-label":"Copy metadata JSON",icon:y(Ry,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),y(yr,{fontWeight:"semibold",children:"Metadata JSON:"})]}),y("div",{className:"image-json-viewer",children:y("pre",{children:z})})]})]}):y(eH,{width:"100%",pt:10,children:y(yr,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},rMe),Jq=lt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var f;return u.uuid===((f=e==null?void 0:e.currentImage)==null?void 0:f.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:He.isEqual}});function iMe(){const e=Be(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ve(Jq),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(VE())},p=()=>{e(HE())};return K("div",{className:"current-image-preview",children:[i&&y(nx,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&K("div",{className:"current-image-next-prev-buttons",children:[y("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&y(fs,{"aria-label":"Previous image",icon:y(DG,{className:"next-prev-button"}),variant:"unstyled",onClick:f})}),y("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&y(fs,{"aria-label":"Next image",icon:y(NG,{className:"next-prev-button"}),variant:"unstyled",onClick:p})})]}),r&&i&&y(Qq,{image:i,styleClass:"current-image-metadata"})]})}const oMe=lt([e=>e.gallery,e=>e.options,_r],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),eY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ve(oMe);return y("div",{className:"current-image-area","data-tab-name":t,children:e?K(fn,{children:[y(Zq,{}),y(iMe,{})]}):y("div",{className:"current-image-display-placeholder",children:y(tLe,{})})})},aMe=()=>{const e=C.exports.useContext(zP);return y(Qe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:y(Nx,{}),onClick:e||void 0})};function sMe(){const e=ve(o=>o.options.initialImage),{t}=Ke(),n=Be(),r=Ty(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(xU())};return K(fn,{children:[K("div",{className:"init-image-preview-header",children:[y("h2",{children:t("options:initialImage")}),y(aMe,{})]}),e&&y("div",{className:"init-image-preview",children:y(nx,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const lMe=()=>{const e=ve(r=>r.options.initialImage),{currentImage:t}=ve(r=>r.gallery);return K("div",{className:"workarea-split-view",children:[y("div",{className:"workarea-split-view-left",children:e?y("div",{className:"image-to-image-area",children:y(sMe,{})}):y(JOe,{})}),t&&y("div",{className:"workarea-split-view-right",children:y(eY,{})})]})};function uMe(e){return yt({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 tr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function By(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(p){const{scope:m,children:v,...b}=p,x=(m==null?void 0:m[e][l])||s,E=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(x.Provider,{value:E},v)}function f(p,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,f]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,cMe(i,...t)]}function cMe(...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:u})=>{const p=l(o)[`__scope${u}`];return{...s,...p}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function dMe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tY(...e){return t=>e.forEach(n=>dMe(n,t))}function gs(...e){return C.exports.useCallback(tY(...e),e)}const ny=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(hMe);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(M8,Dn({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(M8,Dn({},r,{ref:t}),n)});ny.displayName="Slot";const M8=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...pMe(r,n.props),ref:tY(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});M8.displayName="SlotClone";const fMe=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function hMe(e){return C.exports.isValidElement(e)&&e.type===fMe}function pMe(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 gMe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],uc=gMe.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ny:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,Dn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nY(e,t){e&&pu.exports.flushSync(()=>e.dispatchEvent(t))}function rY(e){const t=e+"CollectionProvider",[n,r]=By(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:x}=v,E=oe.useRef(null),k=oe.useRef(new Map).current;return oe.createElement(i,{scope:b,itemMap:k,collectionRef:E},x)},s=e+"CollectionSlot",l=oe.forwardRef((v,b)=>{const{scope:x,children:E}=v,k=o(s,x),_=gs(b,k.collectionRef);return oe.createElement(ny,{ref:_},E)}),u=e+"CollectionItemSlot",f="data-radix-collection-item",p=oe.forwardRef((v,b)=>{const{scope:x,children:E,...k}=v,_=oe.useRef(null),T=gs(b,_),A=o(u,x);return oe.useEffect(()=>(A.itemMap.set(_,{ref:_,...k}),()=>void A.itemMap.delete(_))),oe.createElement(ny,{[f]:"",ref:T},E)});function m(v){const b=o(e+"CollectionConsumer",v);return oe.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((A,R)=>k.indexOf(A.ref.current)-k.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:p},m,r]}const mMe=C.exports.createContext(void 0);function iY(e){const t=C.exports.useContext(mMe);return e||t||"ltr"}function fu(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function vMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const R8="dismissableLayer.update",yMe="dismissableLayer.pointerDownOutside",bMe="dismissableLayer.focusOutside";let UD;const SMe=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xMe=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,f=C.exports.useContext(SMe),[p,m]=C.exports.useState(null),v=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),x=gs(t,B=>m(B)),E=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),T=p?E.indexOf(p):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,R=T>=_,I=wMe(B=>{const z=B.target,j=[...f.branches].some(Y=>Y.contains(z));!R||j||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=CMe(B=>{const z=B.target;[...f.branches].some(Y=>Y.contains(z))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return vMe(B=>{T===f.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!p)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),WD(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=UD)}},[p,v,r,f]),C.exports.useEffect(()=>()=>{!p||(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),WD())},[p,f]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener(R8,B),()=>document.removeEventListener(R8,B)},[]),C.exports.createElement(uc.div,Dn({},u,{ref:x,style:{pointerEvents:A?R?"auto":"none":void 0,...e.style},onFocusCapture:tr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:tr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:tr(e.onPointerDownCapture,I.onPointerDownCapture)}))});function wMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){oY(yMe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}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 CMe(e,t=globalThis==null?void 0:globalThis.document){const n=fu(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&oY(bMe,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 WD(){const e=new CustomEvent(R8);document.dispatchEvent(e)}function oY(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?nY(i,o):i.dispatchEvent(o)}let RC=0;function _Me(){C.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:GD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GD()),RC++,()=>{RC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),RC--}},[])}function GD(){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 IC="focusScope.autoFocusOnMount",DC="focusScope.autoFocusOnUnmount",qD={bubbles:!1,cancelable:!0},kMe=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=fu(i),f=fu(o),p=C.exports.useRef(null),m=gs(t,x=>l(x)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let x=function(k){if(v.paused||!s)return;const _=k.target;s.contains(_)?p.current=_:wh(p.current,{select:!0})},E=function(k){v.paused||!s||s.contains(k.relatedTarget)||wh(p.current,{select:!0})};return document.addEventListener("focusin",x),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){KD.add(v);const x=document.activeElement;if(!s.contains(x)){const k=new CustomEvent(IC,qD);s.addEventListener(IC,u),s.dispatchEvent(k),k.defaultPrevented||(EMe(OMe(aY(s)),{select:!0}),document.activeElement===x&&wh(s))}return()=>{s.removeEventListener(IC,u),setTimeout(()=>{const k=new CustomEvent(DC,qD);s.addEventListener(DC,f),s.dispatchEvent(k),k.defaultPrevented||wh(x!=null?x:document.body,{select:!0}),s.removeEventListener(DC,f),KD.remove(v)},0)}}},[s,u,f,v]);const b=C.exports.useCallback(x=>{if(!n&&!r||v.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(E&&k){const _=x.currentTarget,[T,A]=PMe(_);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),n&&wh(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),n&&wh(A,{select:!0})):k===_&&x.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(uc.div,Dn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function EMe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wh(r,{select:t}),document.activeElement!==n)return}function PMe(e){const t=aY(e),n=YD(t,e),r=YD(t.reverse(),e);return[n,r]}function aY(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 YD(e,t){for(const n of e)if(!TMe(n,{upTo:t}))return n}function TMe(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 LMe(e){return e instanceof HTMLInputElement&&"select"in e}function wh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LMe(e)&&t&&e.select()}}const KD=AMe();function AMe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XD(e,t),e.unshift(t)},remove(t){var n;e=XD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function XD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OMe(e){return e.filter(t=>t.tagName!=="A")}const a1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},MMe=jC["useId".toString()]||(()=>{});let RMe=0;function IMe(e){const[t,n]=C.exports.useState(MMe());return a1(()=>{e||n(r=>r!=null?r:String(RMe++))},[e]),e||(t?`radix-${t}`:"")}function L1(e){return e.split("-")[0]}function Kx(e){return e.split("-")[1]}function A1(e){return["top","bottom"].includes(L1(e))?"x":"y"}function jP(e){return e==="y"?"height":"width"}function ZD(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=A1(t),l=jP(s),u=r[l]/2-i[l]/2,f=L1(t),p=s==="x";let m;switch(f){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(Kx(t)){case"start":m[s]-=u*(n&&p?-1:1);break;case"end":m[s]+=u*(n&&p?-1:1);break}return m}const DMe=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:u,y:f}=ZD(l,r,s),p=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=sY(r),f={x:i,y:o},p=A1(a),m=Kx(a),v=jP(p),b=await l.getDimensions(n),x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",k=s.reference[v]+s.reference[p]-f[p]-s.floating[v],_=f[p]-s.reference[p],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?p==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[v]);const R=k/2-_/2,I=u[x],D=A-b[v]-u[E],B=A/2-b[v]/2+R,z=I8(I,B,D),te=(m==="start"?u[x]:u[E])>0&&B!==z&&s.reference[v]<=s.floating[v]?BFMe[t])}function zMe(e,t,n){n===void 0&&(n=!1);const r=Kx(e),i=A1(e),o=jP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=X5(a)),{main:a,cross:X5(a)}}const jMe={start:"end",end:"start"};function JD(e){return e.replace(/start|end/g,t=>jMe[t])}const HMe=["top","right","bottom","left"];function VMe(e){const t=X5(e);return[JD(e),t,JD(t)]}const UMe=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:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,x=L1(r),k=p||(x===a||!v?[X5(a)]:VMe(a)),_=[a,...k],T=await K5(t,b),A=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&A.push(T[x]),f){const{main:z,cross:j}=zMe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));A.push(T[z],T[j])}if(R=[...R,{placement:r,overflows:A}],!A.every(z=>z<=0)){var I,D;const z=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,j=_[z];if(j)return{data:{index:z,overflows:R},reset:{placement:j}};let Y="bottom";switch(m){case"bestFit":{var B;const te=(B=R.map(G=>[G,G.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((G,$)=>G[1]-$[1])[0])==null?void 0:B[0].placement;te&&(Y=te);break}case"initialPlacement":Y=a;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function eN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tN(e){return HMe.some(t=>e[t]>=0)}const WMe=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 K5(r,{...n,elementContext:"reference"}),a=eN(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tN(a)}}}case"escaped":{const o=await K5(r,{...n,altBoundary:!0}),a=eN(o,i.floating);return{data:{escapedOffsets:a,escaped:tN(a)}}}default:return{}}}}};async function GMe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=L1(n),s=Kx(n),l=A1(n)==="x",u=["left","top"].includes(a)?-1:1,f=o&&l?-1:1,p=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*f,y:m*u}:{x:m*u,y:v*f}}const qMe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await GMe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function lY(e){return e==="x"?"y":"x"}const YMe=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:k,y:_}=E;return{x:k,y:_}}},...l}=e,u={x:n,y:r},f=await K5(t,l),p=A1(L1(i)),m=lY(p);let v=u[p],b=u[m];if(o){const E=p==="y"?"top":"left",k=p==="y"?"bottom":"right",_=v+f[E],T=v-f[k];v=I8(_,v,T)}if(a){const E=m==="y"?"top":"left",k=m==="y"?"bottom":"right",_=b+f[E],T=b-f[k];b=I8(_,b,T)}const x=s.fn({...t,[p]:v,[m]:b});return{...x,data:{x:x.x-n,y:x.y-r}}}}},KMe=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:u=!0}=e,f={x:n,y:r},p=A1(i),m=lY(p);let v=f[p],b=f[m];const x=typeof s=="function"?s({...o,placement:i}):s,E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const R=p==="y"?"height":"width",I=o.reference[p]-o.floating[R]+E.mainAxis,D=o.reference[p]+o.reference[R]-E.mainAxis;vD&&(v=D)}if(u){var k,_,T,A;const R=p==="y"?"width":"height",I=["top","left"].includes(L1(i)),D=o.reference[m]-o.floating[R]+(I&&(k=(_=a.offset)==null?void 0:_[m])!=null?k:0)+(I?0:E.crossAxis),B=o.reference[m]+o.reference[R]+(I?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(I?E.crossAxis:0);bB&&(b=B)}return{[p]:v,[m]:b}}}};function uY(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function xc(e){if(e==null)return window;if(!uY(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function $y(e){return xc(e).getComputedStyle(e)}function cc(e){return uY(e)?"":e?(e.nodeName||"").toLowerCase():""}function cY(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function hu(e){return e instanceof xc(e).HTMLElement}function of(e){return e instanceof xc(e).Element}function XMe(e){return e instanceof xc(e).Node}function HP(e){if(typeof ShadowRoot>"u")return!1;const t=xc(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xx(e){const{overflow:t,overflowX:n,overflowY:r}=$y(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZMe(e){return["table","td","th"].includes(cc(e))}function dY(e){const t=/firefox/i.test(cY()),n=$y(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 fY(){return!/^((?!chrome|android).)*safari/i.test(cY())}const nN=Math.min,l2=Math.max,Z5=Math.round;function dc(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,u=1;t&&hu(e)&&(l=e.offsetWidth>0&&Z5(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Z5(s.height)/e.offsetHeight||1);const f=of(e)?xc(e):window,p=!fY()&&n,m=(s.left+(p&&(r=(i=f.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(p&&(o=(a=f.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,x=s.height/u;return{width:b,height:x,top:v,right:m+b,bottom:v+x,left:m,x:m,y:v}}function bf(e){return((XMe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zx(e){return of(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function hY(e){return dc(bf(e)).left+Zx(e).scrollLeft}function QMe(e){const t=dc(e);return Z5(t.width)!==e.offsetWidth||Z5(t.height)!==e.offsetHeight}function JMe(e,t,n){const r=hu(t),i=bf(t),o=dc(e,r&&QMe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((cc(t)!=="body"||Xx(i))&&(a=Zx(t)),hu(t)){const l=dc(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=hY(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function pY(e){return cc(e)==="html"?e:e.assignedSlot||e.parentNode||(HP(e)?e.host:null)||bf(e)}function rN(e){return!hu(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function eRe(e){let t=pY(e);for(HP(t)&&(t=t.host);hu(t)&&!["html","body"].includes(cc(t));){if(dY(t))return t;t=t.parentNode}return null}function D8(e){const t=xc(e);let n=rN(e);for(;n&&ZMe(n)&&getComputedStyle(n).position==="static";)n=rN(n);return n&&(cc(n)==="html"||cc(n)==="body"&&getComputedStyle(n).position==="static"&&!dY(n))?t:n||eRe(e)||t}function iN(e){if(hu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=dc(e);return{width:t.width,height:t.height}}function tRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=hu(n),o=bf(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((cc(n)!=="body"||Xx(o))&&(a=Zx(n)),hu(n))){const l=dc(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 nRe(e,t){const n=xc(e),r=bf(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=fY();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function rRe(e){var t;const n=bf(e),r=Zx(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=l2(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=l2(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+hY(e);const l=-r.scrollTop;return $y(i||n).direction==="rtl"&&(s+=l2(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function gY(e){const t=pY(e);return["html","body","#document"].includes(cc(t))?e.ownerDocument.body:hu(t)&&Xx(t)?t:gY(t)}function Q5(e,t){var n;t===void 0&&(t=[]);const r=gY(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xc(r),a=i?[o].concat(o.visualViewport||[],Xx(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Q5(a))}function iRe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&HP(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function oRe(e,t){const n=dc(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 oN(e,t,n){return t==="viewport"?Y5(nRe(e,n)):of(t)?oRe(t,n):Y5(rRe(bf(e)))}function aRe(e){const t=Q5(e),r=["absolute","fixed"].includes($y(e).position)&&hu(e)?D8(e):e;return of(r)?t.filter(i=>of(i)&&iRe(i,r)&&cc(i)!=="body"):[]}function sRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?aRe(t):[].concat(n),r],s=a[0],l=a.reduce((u,f)=>{const p=oN(t,f,i);return u.top=l2(p.top,u.top),u.right=nN(p.right,u.right),u.bottom=nN(p.bottom,u.bottom),u.left=l2(p.left,u.left),u},oN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const lRe={getClippingRect:sRe,convertOffsetParentRelativeRectToViewportRelativeRect:tRe,isElement:of,getDimensions:iN,getOffsetParent:D8,getDocumentElement:bf,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JMe(t,D8(n),r),floating:{...iN(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>$y(e).direction==="rtl"};function uRe(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,u=o&&!s,f=l||u?[...of(e)?Q5(e):[],...Q5(t)]:[];f.forEach(x=>{l&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});let p=null;if(a){let x=!0;p=new ResizeObserver(()=>{x||n(),x=!1}),of(e)&&!s&&p.observe(e),p.observe(t)}let m,v=s?dc(e):null;s&&b();function b(){const x=dc(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,m=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(E=>{l&&E.removeEventListener("scroll",n),u&&E.removeEventListener("resize",n)}),(x=p)==null||x.disconnect(),p=null,s&&cancelAnimationFrame(m)}}const cRe=(e,t,n)=>DMe(e,t,{platform:lRe,...n});var N8=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function B8(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(!B8(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)&&!B8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function dRe(e){const t=C.exports.useRef(e);return N8(()=>{t.current=e}),t}function fRe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=dRe(i),l=C.exports.useRef(null),[u,f]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[p,m]=C.exports.useState(t);B8(p==null?void 0:p.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||cRe(o.current,a.current,{middleware:p,placement:n,strategy:r}).then(T=>{b.current&&pu.exports.flushSync(()=>{f(T)})})},[p,n,r]);N8(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);N8(()=>(b.current=!0,()=>{b.current=!1}),[]);const x=C.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,v);l.current=T}else v()},[v,s]),E=C.exports.useCallback(T=>{o.current=T,x()},[x]),k=C.exports.useCallback(T=>{a.current=T,x()},[x]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:E,floating:k}),[u,v,_,E,k])}const hRe=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?QD({element:t.current,padding:n}).fn(i):{}:t?QD({element:t,padding:n}).fn(i):{}}}};function pRe(e){const[t,n]=C.exports.useState(void 0);return a1(()=>{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,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.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 mY="Popper",[VP,vY]=By(mY),[gRe,yY]=VP(mY),mRe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(gRe,{scope:t,anchor:r,onAnchorChange:i},n)},vRe="PopperAnchor",yRe=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=yY(vRe,n),a=C.exports.useRef(null),s=gs(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(uc.div,Dn({},i,{ref:s}))}),J5="PopperContent",[bRe,Hze]=VP(J5),[SRe,xRe]=VP(J5,{hasParent:!1,positionUpdateFns:new Set}),wRe=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:f,side:p="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:x=0,collisionBoundary:E=[],collisionPadding:k=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...R}=e,I=yY(J5,f),[D,B]=C.exports.useState(null),z=gs(t,ue=>B(ue)),[j,Y]=C.exports.useState(null),te=pRe(j),G=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,$=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,V=p+(v!=="center"?"-"+v:""),J=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},Z=Array.isArray(E)?E:[E],U=Z.length>0,X={padding:J,boundary:Z.filter(_Re),altBoundary:U},{reference:le,floating:fe,strategy:Se,x:Ae,y:be,placement:ke,middlewareData:De,update:Je}=fRe({strategy:"fixed",placement:V,whileElementsMounted:uRe,middleware:[qMe({mainAxis:m+$,alignmentAxis:b}),A?YMe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?KMe():void 0,...X}):void 0,j?hRe({element:j,padding:x}):void 0,A?UMe({...X}):void 0,kRe({arrowWidth:G,arrowHeight:$}),T?WMe({strategy:"referenceHidden"}):void 0].filter(CRe)});a1(()=>{le(I.anchor)},[le,I.anchor]);const Ye=Ae!==null&&be!==null,[mt,_t]=bY(ke),dt=(i=De.arrow)===null||i===void 0?void 0:i.x,vt=(o=De.arrow)===null||o===void 0?void 0:o.y,xt=((a=De.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Le,ut]=C.exports.useState();a1(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Rt,positionUpdateFns:ot}=xRe(J5,f),Ct=!Rt;C.exports.useLayoutEffect(()=>{if(!Ct)return ot.add(Je),()=>{ot.delete(Je)}},[Ct,ot,Je]),C.exports.useLayoutEffect(()=>{Ct&&Ye&&Array.from(ot).reverse().forEach(ue=>requestAnimationFrame(ue))},[Ct,Ye,ot]);const ln={"data-side":mt,"data-align":_t,...R,ref:z,style:{...R.style,animation:Ye?void 0:"none",opacity:(s=De.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:Ye?`translate3d(${Math.round(Ae)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Le,["--radix-popper-transform-origin"]:[(l=De.transformOrigin)===null||l===void 0?void 0:l.x,(u=De.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(bRe,{scope:f,placedSide:mt,onArrowChange:Y,arrowX:dt,arrowY:vt,shouldHideArrow:xt},Ct?C.exports.createElement(SRe,{scope:f,hasParent:!0,positionUpdateFns:ot},C.exports.createElement(uc.div,ln)):C.exports.createElement(uc.div,ln)))});function CRe(e){return e!==void 0}function _Re(e){return e!==null}const kRe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,p=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=p?0:e.arrowWidth,v=p?0:e.arrowHeight,[b,x]=bY(s),E={start:"0%",center:"50%",end:"100%"}[x],k=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",A="";return b==="bottom"?(T=p?E:`${k}px`,A=`${-v}px`):b==="top"?(T=p?E:`${k}px`,A=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,A=p?E:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,A=p?E:`${_}px`),{data:{x:T,y:A}}}});function bY(e){const[t,n="center"]=e.split("-");return[t,n]}const ERe=mRe,PRe=yRe,TRe=wRe;function LRe(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const SY=e=>{const{present:t,children:n}=e,r=ARe(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=gs(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};SY.displayName="Presence";function ARe(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=LRe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=jb(r.current);o.current=s==="mounted"?u:"none"},[s]),a1(()=>{const u=r.current,f=i.current;if(f!==e){const m=o.current,v=jb(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a1(()=>{if(t){const u=p=>{const v=jb(r.current).includes(p.animationName);p.target===t&&v&&pu.exports.flushSync(()=>l("ANIMATION_END"))},f=p=>{p.target===t&&(o.current=jb(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function jb(e){return(e==null?void 0:e.animationName)||"none"}function ORe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=MRe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=fu(n),l=C.exports.useCallback(u=>{if(o){const p=typeof u=="function"?u(e):u;p!==e&&s(p)}else i(u)},[o,e,i,s]);return[a,l]}function MRe({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=fu(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const NC="rovingFocusGroup.onEntryFocus",RRe={bubbles:!1,cancelable:!0},UP="RovingFocusGroup",[$8,xY,IRe]=rY(UP),[DRe,wY]=By(UP,[IRe]),[NRe,BRe]=DRe(UP),$Re=C.exports.forwardRef((e,t)=>C.exports.createElement($8.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement($8.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(FRe,Dn({},e,{ref:t}))))),FRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=e,p=C.exports.useRef(null),m=gs(t,p),v=iY(o),[b=null,x]=ORe({prop:a,defaultProp:s,onChange:l}),[E,k]=C.exports.useState(!1),_=fu(u),T=xY(n),A=C.exports.useRef(!1),[R,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=p.current;if(D)return D.addEventListener(NC,_),()=>D.removeEventListener(NC,_)},[_]),C.exports.createElement(NRe,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>x(D),[x]),onItemShiftTab:C.exports.useCallback(()=>k(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(uc.div,Dn({tabIndex:E||R===0?-1:0,"data-orientation":r},f,{ref:m,style:{outline:"none",...e.style},onMouseDown:tr(e.onMouseDown,()=>{A.current=!0}),onFocus:tr(e.onFocus,D=>{const B=!A.current;if(D.target===D.currentTarget&&B&&!E){const z=new CustomEvent(NC,RRe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const j=T().filter(V=>V.focusable),Y=j.find(V=>V.active),te=j.find(V=>V.id===b),$=[Y,te,...j].filter(Boolean).map(V=>V.ref.current);CY($)}}A.current=!1}),onBlur:tr(e.onBlur,()=>k(!1))})))}),zRe="RovingFocusGroupItem",jRe=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=IMe(),s=BRe(zRe,n),l=s.currentTabStopId===a,u=xY(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=s;return C.exports.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.exports.createElement($8.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(uc.span,Dn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:tr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:tr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:tr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=URe(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let x=u().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=s.loop?WRe(x,E+1):x.slice(E+1)}setTimeout(()=>CY(x))}})})))}),HRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function URe(e,t,n){const r=VRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HRe[r]}function CY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WRe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const GRe=$Re,qRe=jRe,YRe=["Enter"," "],KRe=["ArrowDown","PageUp","Home"],_Y=["ArrowUp","PageDown","End"],XRe=[...KRe,..._Y],Qx="Menu",[F8,ZRe,QRe]=rY(Qx),[Cp,kY]=By(Qx,[QRe,vY,wY]),WP=vY(),EY=wY(),[JRe,Jx]=Cp(Qx),[eIe,GP]=Cp(Qx),tIe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=WP(t),[l,u]=C.exports.useState(null),f=C.exports.useRef(!1),p=fu(o),m=iY(i);return C.exports.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(ERe,s,C.exports.createElement(JRe,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:u},C.exports.createElement(eIe,{scope:t,onClose:C.exports.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:a},r)))},nIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=WP(n);return C.exports.createElement(PRe,Dn({},i,r,{ref:t}))}),rIe="MenuPortal",[Vze,iIe]=Cp(rIe,{forceMount:void 0}),Gd="MenuContent",[oIe,PY]=Cp(Gd),aIe=C.exports.forwardRef((e,t)=>{const n=iIe(Gd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Jx(Gd,e.__scopeMenu),a=GP(Gd,e.__scopeMenu);return C.exports.createElement(F8.Provider,{scope:e.__scopeMenu},C.exports.createElement(SY,{present:r||o.open},C.exports.createElement(F8.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(sIe,Dn({},i,{ref:t})):C.exports.createElement(lIe,Dn({},i,{ref:t})))))}),sIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu),r=C.exports.useRef(null),i=gs(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return MH(o)},[]),C.exports.createElement(TY,Dn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),lIe=C.exports.forwardRef((e,t)=>{const n=Jx(Gd,e.__scopeMenu);return C.exports.createElement(TY,Dn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),TY=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,...b}=e,x=Jx(Gd,n),E=GP(Gd,n),k=WP(n),_=EY(n),T=ZRe(n),[A,R]=C.exports.useState(null),I=C.exports.useRef(null),D=gs(t,I,x.onContentChange),B=C.exports.useRef(0),z=C.exports.useRef(""),j=C.exports.useRef(0),Y=C.exports.useRef(null),te=C.exports.useRef("right"),G=C.exports.useRef(0),$=v?yV:C.exports.Fragment,V=v?{as:ny,allowPinchZoom:!0}:void 0,J=U=>{var X,le;const fe=z.current+U,Se=T().filter(Ye=>!Ye.disabled),Ae=document.activeElement,be=(X=Se.find(Ye=>Ye.ref.current===Ae))===null||X===void 0?void 0:X.textValue,ke=Se.map(Ye=>Ye.textValue),De=vIe(ke,fe,be),Je=(le=Se.find(Ye=>Ye.textValue===De))===null||le===void 0?void 0:le.ref.current;(function Ye(mt){z.current=mt,window.clearTimeout(B.current),mt!==""&&(B.current=window.setTimeout(()=>Ye(""),1e3))})(fe),Je&&setTimeout(()=>Je.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),_Me();const Z=C.exports.useCallback(U=>{var X,le;return te.current===((X=Y.current)===null||X===void 0?void 0:X.side)&&bIe(U,(le=Y.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(oIe,{scope:n,searchRef:z,onItemEnter:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(U=>{var X;Z(U)||((X=I.current)===null||X===void 0||X.focus(),R(null))},[Z]),onTriggerLeave:C.exports.useCallback(U=>{Z(U)&&U.preventDefault()},[Z]),pointerGraceTimerRef:j,onPointerGraceIntentChange:C.exports.useCallback(U=>{Y.current=U},[])},C.exports.createElement($,V,C.exports.createElement(kMe,{asChild:!0,trapped:i,onMountAutoFocus:tr(o,U=>{var X;U.preventDefault(),(X=I.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:a},C.exports.createElement(xMe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m},C.exports.createElement(GRe,Dn({asChild:!0},_,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:R,onEntryFocus:U=>{E.isUsingKeyboardRef.current||U.preventDefault()}}),C.exports.createElement(TRe,Dn({role:"menu","aria-orientation":"vertical","data-state":pIe(x.open),"data-radix-menu-content":"",dir:E.dir},k,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:tr(b.onKeyDown,U=>{const le=U.target.closest("[data-radix-menu-content]")===U.currentTarget,fe=U.ctrlKey||U.altKey||U.metaKey,Se=U.key.length===1;le&&(U.key==="Tab"&&U.preventDefault(),!fe&&Se&&J(U.key));const Ae=I.current;if(U.target!==Ae||!XRe.includes(U.key))return;U.preventDefault();const ke=T().filter(De=>!De.disabled).map(De=>De.ref.current);_Y.includes(U.key)&&ke.reverse(),gIe(ke)}),onBlur:tr(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(B.current),z.current="")}),onPointerMove:tr(e.onPointerMove,j8(U=>{const X=U.target,le=G.current!==U.clientX;if(U.currentTarget.contains(X)&&le){const fe=U.clientX>G.current?"right":"left";te.current=fe,G.current=U.clientX}}))})))))))}),z8="MenuItem",aN="menu.itemSelect",uIe=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=GP(z8,e.__scopeMenu),s=PY(z8,e.__scopeMenu),l=gs(t,o),u=C.exports.useRef(!1),f=()=>{const p=o.current;if(!n&&p){const m=new CustomEvent(aN,{bubbles:!0,cancelable:!0});p.addEventListener(aN,v=>r==null?void 0:r(v),{once:!0}),nY(p,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(cIe,Dn({},i,{ref:l,disabled:n,onClick:tr(e.onClick,f),onPointerDown:p=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,p),u.current=!0},onPointerUp:tr(e.onPointerUp,p=>{var m;u.current||(m=p.currentTarget)===null||m===void 0||m.click()}),onKeyDown:tr(e.onKeyDown,p=>{const m=s.searchRef.current!=="";n||m&&p.key===" "||YRe.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),cIe=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=PY(z8,n),s=EY(n),l=C.exports.useRef(null),u=gs(t,l),[f,p]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var x;v(((x=b.textContent)!==null&&x!==void 0?x:"").trim())}},[o.children]),C.exports.createElement(F8.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(qRe,Dn({asChild:!0},s,{focusable:!r}),C.exports.createElement(uc.div,Dn({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:tr(e.onPointerMove,j8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:tr(e.onPointerLeave,j8(b=>a.onItemLeave(b))),onFocus:tr(e.onFocus,()=>p(!0)),onBlur:tr(e.onBlur,()=>p(!1))}))))}),dIe="MenuRadioGroup";Cp(dIe,{value:void 0,onValueChange:()=>{}});const fIe="MenuItemIndicator";Cp(fIe,{checked:!1});const hIe="MenuSub";Cp(hIe);function pIe(e){return e?"open":"closed"}function gIe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vIe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=mIe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function yIe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=f>r&&n<(u-s)*(r-l)/(f-l)+s&&(i=!i)}return i}function bIe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yIe(n,t)}function j8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const SIe=tIe,xIe=nIe,wIe=aIe,CIe=uIe,LY="ContextMenu",[_Ie,Uze]=By(LY,[kY]),ew=kY(),[kIe,AY]=_Ie(LY),EIe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=ew(t),u=fu(r),f=C.exports.useCallback(p=>{s(p),u(p)},[u]);return C.exports.createElement(kIe,{scope:t,open:a,onOpenChange:f,modal:o},C.exports.createElement(SIe,Dn({},l,{dir:i,open:a,onOpenChange:f,modal:o}),n))},PIe="ContextMenuTrigger",TIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(PIe,n),o=ew(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),f=p=>{a.current={x:p.clientX,y:p.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(xIe,Dn({},o,{virtualRef:s})),C.exports.createElement(uc.span,Dn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:tr(e.onContextMenu,p=>{u(),f(p),p.preventDefault()}),onPointerDown:tr(e.onPointerDown,Hb(p=>{u(),l.current=window.setTimeout(()=>f(p),700)})),onPointerMove:tr(e.onPointerMove,Hb(u)),onPointerCancel:tr(e.onPointerCancel,Hb(u)),onPointerUp:tr(e.onPointerUp,Hb(u))})))}),LIe="ContextMenuContent",AIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=AY(LIe,n),o=ew(n),a=C.exports.useRef(!1);return C.exports.createElement(wIe,Dn({},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)"}}))}),OIe=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=ew(n);return C.exports.createElement(CIe,Dn({},i,r,{ref:t}))});function Hb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const MIe=EIe,RIe=TIe,IIe=AIe,hd=OIe,DIe=lt([e=>e.gallery,e=>e.options,kr,_r],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:x}=e,{isLightBoxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:f,galleryImageObjectFit:p,galleryGridTemplateColumns:x?"auto":`repeat(auto-fill, minmax(${f}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:x}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),NIe=lt([e=>e.options,e=>e.gallery,e=>e.system,_r],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:He.isEqual}}),BIe=e=>e.gallery,$Ie=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,FIe=C.exports.memo(e=>{var G,$,V,J,Z,U,X,le;const t=Be(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ve(NIe),{image:l,isSelected:u}=e,{url:f,thumbnail:p,uuid:m,metadata:v}=l,[b,x]=C.exports.useState(!1),E=Ty(),{t:k}=Ke(),_=()=>x(!0),T=()=>x(!1),A=()=>{l.metadata&&t(mx(l.metadata.image.prompt)),E({title:k("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},R=()=>{l.metadata&&t(Ly(l.metadata.image.seed)),E({title:k("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(Qu(!1)),t(C1(l)),n!=="img2img"&&t(Go("img2img")),E({title:k("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},D=()=>{a&&t(Qu(!1)),t(Sx(l)),t(bx()),n!=="unifiedCanvas"&&t(Go("unifiedCanvas")),E({title:k("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},B=()=>{v&&t(Z5e(v)),E({title:k("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},z=async()=>{var fe;if((fe=v==null?void 0:v.image)!=null&&fe.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Go("img2img")),t(K5e(v)),E({title:k("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}E({title:k("toast:initialImageNotSet"),description:k("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},j=()=>t(wR(l)),Y=fe=>{fe.dataTransfer.setData("invokeai/imageUuid",m),fe.dataTransfer.effectAllowed="move"},te=()=>{t(Qu(!0)),t(wR(l))};return K(MIe,{onOpenChange:fe=>{t($U(fe))},children:[y(RIe,{children:K(rl,{position:"relative",className:"hoverable-image",onMouseOver:_,onMouseOut:T,userSelect:"none",draggable:!0,onDragStart:Y,children:[y(nx,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:p||f,loading:"lazy"}),y("div",{className:"hoverable-image-content",onClick:j,children:u&&y($a,{width:"50%",height:"50%",as:aP,className:"hoverable-image-check"})}),b&&i>=64&&y("div",{className:"hoverable-image-delete-button",children:y(O8,{image:l,children:y(fs,{"aria-label":k("options:deleteImage"),icon:y(U8e,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},m)}),K(IIe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:fe=>{fe.detail.originalEvent.preventDefault()},children:[y(hd,{onClickCapture:te,children:k("options:openInViewer")}),y(hd,{onClickCapture:A,disabled:(($=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:$.prompt)===void 0,children:k("options:usePrompt")}),y(hd,{onClickCapture:R,disabled:((J=(V=l==null?void 0:l.metadata)==null?void 0:V.image)==null?void 0:J.seed)===void 0,children:k("options:useSeed")}),y(hd,{onClickCapture:B,disabled:!["txt2img","img2img"].includes((U=(Z=l==null?void 0:l.metadata)==null?void 0:Z.image)==null?void 0:U.type),children:k("options:useAll")}),y(hd,{onClickCapture:z,disabled:((le=(X=l==null?void 0:l.metadata)==null?void 0:X.image)==null?void 0:le.type)!=="img2img",children:k("options:useInitImg")}),y(hd,{onClickCapture:I,children:k("options:sendToImg2Img")}),y(hd,{onClickCapture:D,children:k("options:sendToUnifiedCanvas")}),y(hd,{"data-warning":!0,children:y(O8,{image:l,children:y("p",{children:k("options:deleteImage")})})})]})]})},$Ie),Vb=320,sN=40,zIe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},lN=400;function OY(){const e=Be(),{t}=Ke(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:f,galleryImageObjectFit:p,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,areMoreImagesAvailable:b,galleryWidth:x,isLightBoxOpen:E,isStaging:k,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=ve(DIe),{galleryMinWidth:A,galleryMaxWidth:R}=E?{galleryMinWidth:lN,galleryMaxWidth:lN}:zIe[f],[I,D]=C.exports.useState(x>=Vb),[B,z]=C.exports.useState(!1),[j,Y]=C.exports.useState(0),te=C.exports.useRef(null),G=C.exports.useRef(null),$=C.exports.useRef(null);C.exports.useEffect(()=>{x>=Vb&&D(!1)},[x]);const V=()=>{e(mSe(!o)),e(vi(!0))},J=()=>{a?U():Z()},Z=()=>{e(Vd(!0)),o&&e(vi(!0))},U=C.exports.useCallback(()=>{e(Vd(!1)),e($U(!1)),e(vSe(G.current?G.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),X=()=>{e(c8(r))},le=be=>{e(ev(be))},fe=()=>{m||($.current=window.setTimeout(()=>U(),500))},Se=()=>{$.current&&window.clearTimeout($.current)};Ze("g",()=>{J()},[a,o]),Ze("left",()=>{e(VE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("right",()=>{e(HE())},{enabled:!k||f!=="unifiedCanvas"},[k]),Ze("shift+g",()=>{V()},[o]),Ze("esc",()=>{e(Vd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Ae=32;return Ze("shift+up",()=>{if(l<256){const be=He.clamp(l+Ae,32,256);e(ev(be))}},[l]),Ze("shift+down",()=>{if(l>32){const be=He.clamp(l-Ae,32,256);e(ev(be))}},[l]),C.exports.useEffect(()=>{!G.current||(G.current.scrollTop=s)},[s,a]),C.exports.useEffect(()=>{function be(ke){!o&&te.current&&!te.current.contains(ke.target)&&U()}return document.addEventListener("mousedown",be),()=>{document.removeEventListener("mousedown",be)}},[U,o]),y(Xq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:K("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[K(kq,{minWidth:A,maxWidth:o?R:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:x,height:o?"100%":"100vh"},onResizeStart:(be,ke,De)=>{Y(De.clientHeight),De.style.height=`${De.clientHeight}px`,o&&(De.style.position="fixed",De.style.right="1rem",z(!0))},onResizeStop:(be,ke,De,Je)=>{const Ye=o?He.clamp(Number(x)+Je.width,A,Number(R)):Number(x)+Je.width;e(SSe(Ye)),De.removeAttribute("data-resize-alert"),o&&(De.style.position="relative",De.style.removeProperty("right"),De.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(be,ke,De,Je)=>{const Ye=He.clamp(Number(x)+Je.width,A,Number(o?R:.95*window.innerWidth));Ye>=Vb&&!I?D(!0):YeYe-sN&&e(ev(Ye-sN)),o&&(Ye>=R?De.setAttribute("data-resize-alert","true"):De.removeAttribute("data-resize-alert")),De.style.height=`${j}px`},children:[K("div",{className:"image-gallery-header",children:[y(io,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:I?K(fn,{children:[y(qr,{size:"sm","data-selected":r==="result",onClick:()=>e(gb("result")),children:t("gallery:generations")}),y(qr,{size:"sm","data-selected":r==="user",onClick:()=>e(gb("user")),children:t("gallery:uploads")})]}):K(fn,{children:[y(Qe,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:y(M8e,{}),onClick:()=>e(gb("result"))}),y(Qe,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:y(G8e,{}),onClick:()=>e(gb("user"))})]})}),K("div",{className:"image-gallery-header-right-icons",children:[y(Js,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:y(Qe,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:y(cP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:K("div",{className:"image-gallery-settings-popover",children:[K("div",{children:[y(Zo,{value:l,onChange:le,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),y(Qe,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(ev(64)),icon:y(Hx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),y("div",{children:y(Qn,{label:t("gallery:maintainAspectRatio"),isChecked:p==="contain",onChange:()=>e(ySe(p==="contain"?"cover":"contain"))})}),y("div",{children:y(Qn,{label:t("gallery:autoSwitchNewImages"),isChecked:v,onChange:be=>e(bSe(be.target.checked))})}),y("div",{children:y(Qn,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:be=>e(xSe(be.target.checked))})})]})}),y(Qe,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:V,icon:o?y(Gq,{}):y(qq,{})})]})]}),y("div",{className:"image-gallery-container",ref:G,children:n.length||b?K(fn,{children:[y("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(be=>{const{uuid:ke}=be;return y(FIe,{image:be,isSelected:i===ke},ke)})}),y(ds,{onClick:X,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):K("div",{className:"image-gallery-container-placeholder",children:[y(wq,{}),y("p",{children:t("gallery:noImagesInGallery")})]})})]}),B&&y("div",{style:{width:x+"px",height:"100%"}})]})})}const jIe=lt(BIe,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),HIe=()=>{const{resultImages:e,userImages:t}=ve(jIe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},VIe=lt([e=>e.options,_r],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:He.isEqual}}),qP=e=>{const t=Be(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ve(VIe),u=HIe(),f=()=>{t(lSe(!a)),t(vi(!0))},p=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(C1(b)):o==="unifiedCanvas"&&t(Sx(b)))};return y("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:K("div",{className:"workarea-main",children:[n,K("div",{className:"workarea-children-wrapper",onDrop:p,children:[r,l&&y(so,{label:"Toggle Split View",children:y("div",{className:"workarea-split-button","data-selected":a,onClick:f,children:y(uMe,{})})})]}),!s&&y(OY,{})]})})};function UIe(){return y(qP,{optionsPanel:y(QOe,{}),children:y(lMe,{})})}const WIe=()=>{const e=Be(),t=ve(i=>i.options.hiresFix),{t:n}=Ke(),r=i=>e(jE(i.target.checked));return y(at,{gap:2,direction:"column",children:y(os,{label:n("options:hiresOptim"),fontSize:"md",isChecked:t,onChange:r})})},GIe=()=>K(at,{gap:2,direction:"column",children:[y(Hq,{}),y(WIe,{})]});function qIe(){const{t:e}=Ke(),t={seed:{header:`${e("options:seed")}`,feature:oo.SEED,content:y(TP,{})},variations:{header:`${e("options:variations")}`,feature:oo.VARIATIONS,content:y(OP,{}),additionalHeaderComponents:y(AP,{})},face_restore:{header:`${e("options:faceRestoration")}`,feature:oo.FACE_CORRECTION,content:y(PP,{}),additionalHeaderComponents:y(zq,{})},upscale:{header:`${e("options:upscaling")}`,feature:oo.UPSCALE,content:y(LP,{}),additionalHeaderComponents:y(Vq,{})},other:{header:`${e("options:otherOptions")}`,feature:oo.OTHER,content:y(GIe,{})}};return K(FP,{children:[y(BP,{}),y(NP,{}),y(MP,{}),y(RP,{accordionInfo:t})]})}const YIe=()=>y("div",{className:"workarea-single-view",children:y("div",{className:"text-to-image-area",children:y(eY,{})})});function KIe(){return y(qP,{optionsPanel:y(qIe,{}),children:y(YIe,{})})}var H8=function(e,t){return H8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},H8(e,t)};function XIe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var su=function(){return su=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Sf(e,t,n,r){var i=fDe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=t.scale-s,p=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):IY(e,r,n,function(v){var b=s+f*v,x=l+p*v,E=u+m*v;o(b,x,E)})}}function fDe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function hDe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,f=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:f}}var pDe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,f=s,p=r-i-l,m=l;return{minPositionX:u,maxPositionX:f,minPositionY:p,maxPositionY:m}},YP=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=hDe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,f=o.newContentHeight,p=o.newDiffHeight,m=pDe(a,l,u,s,f,p,Boolean(i));return m},s1=function(e,t){var n=YP(e,t);return e.bounds=n,n};function tw(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,f=n.maxPositionY,p=0,m=0;a&&(p=i,m=o);var v=V8(e,s-p,u+p,r),b=V8(t,l-m,f+m,r);return{x:v,y:b}}var V8=function(e,t,n,r){return r?en?as(n,2):as(e,2):as(e,2)};function nw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,f=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var p=l-t*f,m=u-n*f,v=tw(p,m,i,o,0,0,null);return v}function Fy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var cN=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=rw(o,n);return!l},dN=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},gDe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},mDe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function vDe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var f=e.bounds,p=f.maxPositionX,m=f.minPositionX,v=f.maxPositionY,b=f.minPositionY,x=n>p||nv||rp?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=nw(e,k,_,i,e.bounds,s||l),A=T.x,R=T.y;return{scale:i,positionX:x?A:n,positionY:E?R:r}}}function yDe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,f=l.positionX,p=l.positionY,m=t!==f,v=n!==p,b=!m||!v;if(!(!a||b||!s)){var x=tw(t,n,s,o,r,i,a),E=x.x,k=x.y;e.setTransformState(u,E,k)}}var bDe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var f=t-r.x,p=n-r.y,m=a?l:f,v=s?u:p;return{x:m,y:v}},eS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},SDe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},xDe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function wDe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function fN(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var f=a+(e-a)*u;return f>l?l:fo?o:f}}return r?t:V8(e,o,a,i)}function CDe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function _De(e,t){var n=SDe(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=CDe(a,s),f=t.x-r.x,p=t.y-r.y,m=f/u,v=p/u,b=l-i,x=f*f+p*p,E=Math.sqrt(x)/b;e.velocity={velocityX:m,velocityY:v,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function kDe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=xDe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,f=n.minPositionX,p=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,x=r.zoomAnimation,E=r.panning,k=E.lockAxisY,_=E.lockAxisX,T=x.animationType,A=b.sizeX,R=b.sizeY,I=b.velocityAlignmentTime,D=I,B=wDe(e,l),z=Math.max(B,D),j=eS(e,A),Y=eS(e,R),te=j*i.offsetWidth/100,G=Y*i.offsetHeight/100,$=u+te,V=f-te,J=p+G,Z=m-G,U=e.transformState,X=new Date().getTime();IY(e,T,z,function(le){var fe=e.transformState,Se=fe.scale,Ae=fe.positionX,be=fe.positionY,ke=new Date().getTime()-X,De=ke/D,Je=MY[b.animationType],Ye=1-Je(Math.min(1,De)),mt=1-le,_t=Ae+a*mt,dt=be+s*mt,vt=fN(_t,U.positionX,Ae,_,v,f,u,V,$,Ye),xt=fN(dt,U.positionY,be,k,v,m,p,Z,J,Ye);(Ae!==_t||be!==dt)&&e.setTransformState(Se,vt,xt)})}}function hN(e,t){var n=e.transformState.scale;Gl(e),s1(e,n),t.touches?mDe(e,t):gDe(e,t)}function pN(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=bDe(e,t,n),u=l.x,f=l.y,p=eS(e,a),m=eS(e,s);_De(e,{x:u,y:f}),yDe(e,u,f,p,m)}}function EDe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,f=(a==null?void 0:a.height)||0,p=s.1&&p;m?kDe(e):DY(e)}}function DY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,f=o||t=a;if((r>=1||s)&&DY(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,x=KP(e,a,v,b);x&&Sf(e,x,f,p)}}function KP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Fy(as(t,2),o,a,0,!1),u=s1(e,l),f=nw(e,n,r,l,u,s),p=f.x,m=f.y;return{scale:l,positionX:p,positionY:m}}var cg={previousScale:1,scale:1,positionX:0,positionY:0},PDe=su(su({},cg),{setComponents:function(){},contextInstance:null}),dv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},BY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:cg.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:cg.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:cg.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:cg.positionY}},gN=function(e){var t=su({},dv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof dv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(dv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=su(su({},dv[n]),e[n]):s?t[n]=uN(uN([],dv[n]),e[n]):t[n]=e[n]}}),t},$Y=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var f=r*Math.exp(t*n),p=Fy(as(f,3),s,a,u,!1);return p};function FY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var f=o.offsetWidth,p=o.offsetHeight,m=(f/2-l)/s,v=(p/2-u)/s,b=$Y(e,t,n),x=KP(e,b,m,v);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,x,r,i)}function zY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=BY(e.props),s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!!i){var p=YP(e,a.scale),m=tw(a.positionX,a.positionY,p,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&f===a.positionY||Sf(e,v,t,n)}}function TDe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return cg;var l=r.getBoundingClientRect(),u=LDe(t),f=u.x,p=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,x=r.offsetHeight/v,E=Fy(n||Math.min(b,x),a,s,0,!1),k=(l.width-m*E)/2,_=(l.height-v*E)/2,T=(l.left-f)*E+k,A=(l.top-p)*E+_,R=YP(e,E),I=tw(T,A,R,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:E}}function LDe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function ADe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var ODe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,1,t,n,r)}},MDe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),FY(e,-1,t,n,r)}},RDe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,f=e.wrapperComponent,p=e.contentComponent,m=e.setup.disabled;if(!(m||!f||!p)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Sf(e,v,i,o)}}},IDe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),zY(e,t,n)}},DDe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=jY(t||i.scale,o,a);Sf(e,s,n,r)}}},NDe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Gl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&ADe(a)&&a&&o.contains(a)){var s=TDe(e,a,n);Sf(e,s,r,i)}}},ei=function(e){return{instance:e,state:e.transformState,zoomIn:ODe(e),zoomOut:MDe(e),setTransform:RDe(e),resetTransform:IDe(e),centerView:DDe(e),zoomToElement:NDe(e)}},BC=!1;function $C(){try{var e={get passive(){return BC=!0,!1}};return e}catch(t){return BC=!1,BC}}var rw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},mN=function(e){e&&clearTimeout(e)},BDe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},jY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},$De=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,f=s&&!l&&!r&&u;if(!f||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var p=rw(u,a);return!p};function FDe(e,t){var n=e?e.deltaY<0?1:-1:0,r=ZIe(t,n);return r}function HY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var zDe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size,m=f.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,x=Fy(as(v,3),u,l,p,b);return x},jDe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},HDe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=rw(a,i);return!l},VDe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},UDe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=as(i[0].clientX-r.left,5),a=as(i[0].clientY-r.top,5),s=as(i[1].clientX-r.left,5),l=as(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},VY=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},WDe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var f=t/r,p=f*n;return Fy(as(p,2),a,o,l,!u)},GDe=160,qDe=100,YDe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Gl(e),Pi(ei(e),t,r),Pi(ei(e),t,i))},KDe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,f=a.centerZoomedOut,p=a.zoomAnimation,m=a.wheel,v=p.size,b=p.disabled,x=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var E=FDe(t,null),k=zDe(e,E,x,!t.ctrlKey);if(l!==k){var _=s1(e,k),T=HY(t,o,l),A=b||v===0||f,R=u&&A,I=nw(e,T.x,T.y,k,_,R),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(k,D,B),Pi(ei(e),t,r),Pi(ei(e),t,i)}},XDe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;mN(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(NY(e,t.x,t.y),e.wheelAnimationTimer=null)},qDe);var o=jDe(e,t);o&&(mN(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,Pi(ei(e),t,r),Pi(ei(e),t,i))},GDe))},ZDe=function(e,t){var n=VY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Gl(e)},QDe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,f=l.size;if(!(r===null||!n)){var p=UDe(t,i,n);if(!(!isFinite(p.x)||!isFinite(p.y))){var m=VY(t),v=WDe(e,m);if(v!==i){var b=s1(e,v),x=u||f===0||s,E=a&&x,k=nw(e,p.x,p.y,v,b,E),_=k.x,T=k.y;e.pinchMidpoint=p,e.lastDistance=m,e.setTransformState(v,_,T)}}}},JDe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,NY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function eNe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return zY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var f=i==="zoomOut"?-1:1,p=$Y(e,f,o),m=HY(t,u,l),v=KP(e,p,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Sf(e,v,a,s)}}var tNe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),f=n&&l&&u&&!a;if(!f)return!1;var p=rw(l,s);return!(p||!f)},UY=oe.createContext(PDe),nNe=function(e){XIe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=BY(n.props),n.setup=gN(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=$C();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=$De(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||(YDe(n,r),KDe(n,r),XDe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),Gl(n),hN(n,r),Pi(ei(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=dN(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),pN(n,r.clientX,r.clientY),Pi(ei(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(EDe(n),Pi(ei(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=HDe(n,r);!l||(ZDe(n,r),Gl(n),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=VDe(n);!l||(r.preventDefault(),r.stopPropagation(),QDe(n,r),Pi(ei(n),r,a),Pi(ei(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(JDe(n),Pi(ei(n),r,o),Pi(ei(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=cN(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Gl(n);var l=r.touches,u=l.length===1,f=l.length===2;u&&(Gl(n),hN(n,r),Pi(ei(n),r,o)),f&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=dN(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];pN(n,s.clientX,s.clientY),Pi(ei(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=tNe(n,r);!o||eNe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ei(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=jY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=BDe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ei(n))},n}return t.prototype.componentDidMount=function(){var n=$C();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=$C();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Gl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s1(this,this.transformState.scale),this.setup=gN(this.props))},t.prototype.render=function(){var n=ei(this),r=this.props.children,i=typeof r=="function"?r(n):r;return y(UY.Provider,{value:su(su({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),rNe=oe.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),y(nNe,{...su({},e,{setRef:i})})});function iNe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var oNe=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 7c448efecb..4f09727e0e 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ InvokeAI - A Stable Diffusion Toolkit - + @@ -18,6 +18,6 @@ - + diff --git a/frontend/dist/locales/modelmanager/de.json b/frontend/dist/locales/modelmanager/de.json index 395267878c..63da31026a 100644 --- a/frontend/dist/locales/modelmanager/de.json +++ b/frontend/dist/locales/modelmanager/de.json @@ -34,6 +34,7 @@ "checkpointFolder": "Checkpoint-Ordner", "clearCheckpointFolder": "Checkpoint-Ordner löschen", "findModels": "Models finden", + "scanAgain": "Erneut scannen", "modelsFound": "Models gefunden", "selectFolder": "Ordner auswählen", "selected": "Ausgewählt", @@ -42,6 +43,8 @@ "showExisting": "Vorhandene anzeigen", "addSelected": "Auswahl hinzufügen", "modelExists": "Model existiert", + "selectAndAdd": "Unten aufgeführte Models auswählen und hinzufügen", + "noModelsFound": "Keine Models gefunden", "delete": "Löschen", "deleteModel": "Model löschen", "deleteConfig": "Konfiguration löschen", diff --git a/frontend/dist/locales/modelmanager/ru.json b/frontend/dist/locales/modelmanager/ru.json index 0967ef424b..37cef8a774 100644 --- a/frontend/dist/locales/modelmanager/ru.json +++ b/frontend/dist/locales/modelmanager/ru.json @@ -1 +1,53 @@ -{} +{ + "modelManager": "Менеджер моделей", + "model": "Модель", + "modelAdded": "Модель добавлена", + "modelUpdated": "Модель обновлена", + "modelEntryDeleted": "Запись о модели удалена", + "cannotUseSpaces": "Нельзя использовать пробелы", + "addNew": "Добавить новую", + "addNewModel": "Добавить новую модель", + "addManually": "Добавить вручную", + "manual": "Ручное", + "name": "Название", + "nameValidationMsg": "Введите название модели", + "description": "Описание", + "descriptionValidationMsg": "Введите описание модели", + "config": "Файл конфигурации", + "configValidationMsg": "Путь до файла конфигурации", + "modelLocation": "Расположение модели", + "modelLocationValidationMsg": "Путь до файла с моделью", + "vaeLocation": "Расположение VAE", + "vaeLocationValidationMsg": "Путь до VAE", + "width": "Ширина", + "widthValidationMsg": "Исходная ширина изображений", + "height": "Высота", + "heightValidationMsg": "Исходная высота изображений", + "addModel": "Добавить модель", + "updateModel": "Обновить модель", + "availableModels": "Доступные модели", + "search": "Искать", + "load": "Загрузить", + "active": "активна", + "notLoaded": "не загружена", + "cached": "кэширована", + "checkpointFolder": "Папка с моделями", + "clearCheckpointFolder": "Очистить папку с моделями", + "findModels": "Найти модели", + "scanAgain": "Сканировать снова", + "modelsFound": "Найденные модели", + "selectFolder": "Выбрать папку", + "selected": "Выбраны", + "selectAll": "Выбрать все", + "deselectAll": "Снять выделение", + "showExisting": "Показывать добавленные", + "addSelected": "Добавить выбранные", + "modelExists": "Модель уже добавлена", + "selectAndAdd": "Выберите и добавьте модели из списка", + "noModelsFound": "Модели не найдены", + "delete": "Удалить", + "deleteModel": "Удалить модель", + "deleteConfig": "Удалить конфигурацию", + "deleteMsg1": "Вы точно хотите удалить модель из InvokeAI?", + "deleteMsg2": "Это не удалит файл модели с диска. Позже вы можете добавить его снова." +} diff --git a/frontend/dist/locales/tooltip/de.json b/frontend/dist/locales/tooltip/de.json index 0967ef424b..f88cecb146 100644 --- a/frontend/dist/locales/tooltip/de.json +++ b/frontend/dist/locales/tooltip/de.json @@ -1 +1,15 @@ -{} +{ + "feature": { + "prompt": "Dies ist das Prompt-Feld. Ein Prompt enthält Generierungsobjekte und stilistische Begriffe. Sie können auch Gewichtungen (Token-Bedeutung) dem Prompt hinzufügen, aber CLI-Befehle und Parameter funktionieren nicht.", + "gallery": "Die Galerie zeigt erzeugte Bilder aus dem Ausgabeordner an, sobald sie erstellt wurden. Die Einstellungen werden in den Dateien gespeichert und können über das Kontextmenü aufgerufen werden.", + "other": "Mit diesen Optionen werden alternative Verarbeitungsmodi für InvokeAI aktiviert. 'Nahtlose Kachelung' erzeugt sich wiederholende Muster in der Ausgabe. 'Hohe Auflösungen' werden in zwei Schritten mit img2img erzeugt: Verwenden Sie diese Einstellung, wenn Sie ein größeres und kohärenteres Bild ohne Artefakte wünschen. Es dauert länger als das normale txt2img.", + "seed": "Der Seed-Wert beeinflusst das Ausgangsrauschen, aus dem das Bild erstellt wird. Sie können die bereits vorhandenen Seeds von früheren Bildern verwenden. 'Der Rauschschwellenwert' wird verwendet, um Artefakte bei hohen CFG-Werten abzuschwächen (versuchen Sie es im Bereich 0-10), und Perlin, um während der Erzeugung Perlin-Rauschen hinzuzufügen: Beide dienen dazu, Ihre Ergebnisse zu variieren.", + "variations": "Versuchen Sie eine Variation mit einem Wert zwischen 0,1 und 1,0, um das Ergebnis für ein bestimmtes Seed zu ändern. Interessante Variationen des Seeds liegen zwischen 0,1 und 0,3.", + "upscale": "Verwenden Sie ESRGAN, um das Bild unmittelbar nach der Erzeugung zu vergrößern.", + "faceCorrection": "Gesichtskorrektur mit GFPGAN oder Codeformer: Der Algorithmus erkennt Gesichter im Bild und korrigiert alle Fehler. Ein hoher Wert verändert das Bild stärker, was zu attraktiveren Gesichtern führt. Codeformer mit einer höheren Genauigkeit bewahrt das Originalbild auf Kosten einer stärkeren Gesichtskorrektur.", + "imageToImage": "Bild zu Bild lädt ein beliebiges Bild als Ausgangsbild, aus dem dann zusammen mit dem Prompt ein neues Bild erzeugt wird. Je höher der Wert ist, desto stärker wird das Ergebnisbild verändert. Werte von 0,0 bis 1,0 sind möglich, der empfohlene Bereich ist .25-.75", + "boundingBox": "Der Begrenzungsrahmen ist derselbe wie die Einstellungen für Breite und Höhe bei Text zu Bild oder Bild zu Bild. Es wird nur der Bereich innerhalb des Rahmens verarbeitet.", + "seamCorrection": "Steuert die Behandlung von sichtbaren Übergängen, die zwischen den erzeugten Bildern auf der Leinwand auftreten.", + "infillAndScaling": "Verwalten Sie Infill-Methoden (für maskierte oder gelöschte Bereiche der Leinwand) und Skalierung (nützlich für kleine Begrenzungsrahmengrößen)." + } +} diff --git a/frontend/dist/locales/tooltip/en-US.json b/frontend/dist/locales/tooltip/en-US.json index 1d03f54b7f..572594fe65 100644 --- a/frontend/dist/locales/tooltip/en-US.json +++ b/frontend/dist/locales/tooltip/en-US.json @@ -1,15 +1,15 @@ { "feature": { - "prompt": "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.", - "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", - "other": "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.", - "seed": "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.", - "variations": "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.", - "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", - "faceCorrection": "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.", - "imageToImage": "Image to Image 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.", - "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", - "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "prompt": "This is the prompt field. Prompt includes generation objects and stylistic terms. You can add weight (token importance) in the prompt as well, but CLI commands and parameters will not work.", + "gallery": "Gallery displays generations from the outputs folder as they're created. Settings are stored within files and accesed by context menu.", + "other": "These options will enable alternative processing modes for Invoke. 'Seamless tiling' will create repeating patterns in the output. 'High resolution' is generation in two steps with img2img: use this setting when you want a larger and more coherent image without artifacts. It will take longer that usual txt2img.", + "seed": "Seed value affects the initial noise from which the image is formed. You can use the already existing seeds from previous images. 'Noise Threshold' is used to mitigate artifacts at high CFG values (try the 0-10 range), and Perlin to add Perlin noise during generation: both serve to add variation to your outputs.", + "variations": "Try a variation with a value between 0.1 and 1.0 to change the result for a given seed. Interesting variations of the seed are between 0.1 and 0.3.", + "upscale": "Use ESRGAN to enlarge the image immediately after generation.", + "faceCorrection": "Face correction with GFPGAN or Codeformer: the algorithm detects faces in the image and corrects any defects. High value will change the image more, resulting in more attractive faces. Codeformer with a higher fidelity preserves the original image at the expense of stronger face correction.", + "imageToImage": "Image to Image loads any image as initial, which is then used to generate a new one along with the prompt. The higher the value, the more the result image will change. Values from 0.0 to 1.0 are possible, the recommended range is .25-.75", + "boundingBox": "The bounding box is the same as the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Controls the handling of visible seams that occur between generated images on the canvas.", "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." } } diff --git a/frontend/dist/locales/tooltip/en.json b/frontend/dist/locales/tooltip/en.json index 1d03f54b7f..572594fe65 100644 --- a/frontend/dist/locales/tooltip/en.json +++ b/frontend/dist/locales/tooltip/en.json @@ -1,15 +1,15 @@ { "feature": { - "prompt": "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.", - "gallery": "As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.", - "other": "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.", - "seed": "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.", - "variations": "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.", - "upscale": "Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.", - "faceCorrection": "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.", - "imageToImage": "Image to Image 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.", - "boundingBox": "The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", - "seamCorrection": "Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.", + "prompt": "This is the prompt field. Prompt includes generation objects and stylistic terms. You can add weight (token importance) in the prompt as well, but CLI commands and parameters will not work.", + "gallery": "Gallery displays generations from the outputs folder as they're created. Settings are stored within files and accesed by context menu.", + "other": "These options will enable alternative processing modes for Invoke. 'Seamless tiling' will create repeating patterns in the output. 'High resolution' is generation in two steps with img2img: use this setting when you want a larger and more coherent image without artifacts. It will take longer that usual txt2img.", + "seed": "Seed value affects the initial noise from which the image is formed. You can use the already existing seeds from previous images. 'Noise Threshold' is used to mitigate artifacts at high CFG values (try the 0-10 range), and Perlin to add Perlin noise during generation: both serve to add variation to your outputs.", + "variations": "Try a variation with a value between 0.1 and 1.0 to change the result for a given seed. Interesting variations of the seed are between 0.1 and 0.3.", + "upscale": "Use ESRGAN to enlarge the image immediately after generation.", + "faceCorrection": "Face correction with GFPGAN or Codeformer: the algorithm detects faces in the image and corrects any defects. High value will change the image more, resulting in more attractive faces. Codeformer with a higher fidelity preserves the original image at the expense of stronger face correction.", + "imageToImage": "Image to Image loads any image as initial, which is then used to generate a new one along with the prompt. The higher the value, the more the result image will change. Values from 0.0 to 1.0 are possible, the recommended range is .25-.75", + "boundingBox": "The bounding box is the same as the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.", + "seamCorrection": "Controls the handling of visible seams that occur between generated images on the canvas.", "infillAndScaling": "Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes)." } } diff --git a/frontend/dist/locales/tooltip/ru.json b/frontend/dist/locales/tooltip/ru.json index 0967ef424b..ad4793dca8 100644 --- a/frontend/dist/locales/tooltip/ru.json +++ b/frontend/dist/locales/tooltip/ru.json @@ -1 +1,15 @@ -{} +{ + "feature": { + "prompt": "Это поле для текста запроса, включая объекты генерации и стилистические термины. В запрос можно включить и коэффициенты веса (значимости токена), но консольные команды и параметры не будут работать.", + "gallery": "Здесь отображаются генерации из папки outputs по мере их появления.", + "other": "Эти опции включают альтернативные режимы обработки для Invoke. 'Бесшовный узор' создаст повторяющиеся узоры на выходе. 'Высокое разрешение' это генерация в два этапа с помощью img2img: используйте эту настройку, когда хотите получить цельное изображение большего размера без артефактов.", + "seed": "Значение сида влияет на начальный шум, из которого сформируется изображение. Можно использовать уже имеющийся сид из предыдущих изображений. 'Порог шума' используется для смягчения артефактов при высоких значениях CFG (попробуйте в диапазоне 0-10), а Перлин для добавления шума Перлина в процессе генерации: оба параметра служат для большей вариативности результатов.", + "variations": "Попробуйте вариацию со значением от 0.1 до 1.0, чтобы изменить результат для заданного сида. Интересные вариации сида находятся между 0.1 и 0.3.", + "upscale": "Используйте ESRGAN, чтобы увеличить изображение сразу после генерации.", + "faceCorrection": "Коррекция лиц с помощью GFPGAN или Codeformer: алгоритм определяет лица в готовом изображении и исправляет любые дефекты. Высокие значение силы меняет изображение сильнее, в результате лица будут выглядеть привлекательнее. У Codeformer более высокая точность сохранит исходное изображение в ущерб коррекции лица.", + "imageToImage": "'Изображение в изображение' загружает любое изображение, которое затем используется для генерации вместе с запросом. Чем больше значение, тем сильнее изменится изображение в результате. Возможны значения от 0 до 1, рекомендуется диапазон .25-.75", + "boundingBox": "'Ограничительная рамка' аналогична настройкам Ширина и Высота для 'Избражения из текста' или 'Изображения в изображение'. Будет обработана только область в рамке.", + "seamCorrection": "Управление обработкой видимых швов, возникающих между изображениями на холсте.", + "infillAndScaling": "Управление методами заполнения (используется для масок или стертых областей холста) и масштабирования (полезно для малых размеров ограничивающей рамки)." + } +} diff --git a/frontend/dist/locales/tooltips/it.json b/frontend/dist/locales/tooltips/it.json new file mode 100644 index 0000000000..182fa9e62a --- /dev/null +++ b/frontend/dist/locales/tooltips/it.json @@ -0,0 +1,15 @@ +{ + "feature": { + "prompt": "Questo è il campo del prompt. Il prompt include oggetti di generazione e termini stilistici. Puoi anche aggiungere il peso (importanza del token) nel prompt, ma i comandi e i parametri dell'interfaccia a linea di comando non funzioneranno.", + "gallery": "Galleria visualizza le generazioni dalla cartella degli output man mano che vengono create. Le impostazioni sono memorizzate all'interno di file e accessibili dal menu contestuale.", + "other": "Queste opzioni abiliteranno modalità di elaborazione alternative per Invoke. 'Piastrella senza cuciture' creerà modelli ripetuti nell'output. 'Ottimizzzazione Alta risoluzione' è la generazione in due passaggi con 'Immagine a Immagine': usa questa impostazione quando vuoi un'immagine più grande e più coerente senza artefatti. Ci vorrà più tempo del solito 'Testo a Immagine'.", + "seed": "Il valore del Seme influenza il rumore iniziale da cui è formata l'immagine. Puoi usare i semi già esistenti dalle immagini precedenti. 'Soglia del rumore' viene utilizzato per mitigare gli artefatti a valori CFG elevati (provare l'intervallo 0-10) e Perlin per aggiungere il rumore Perlin durante la generazione: entrambi servono per aggiungere variazioni ai risultati.", + "variations": "Prova una variazione con un valore compreso tra 0.1 e 1.0 per modificare il risultato per un dato seme. Variazioni interessanti del seme sono comprese tra 0.1 e 0.3.", + "upscale": "Utilizza ESRGAN per ingrandire l'immagine subito dopo la generazione.", + "faceCorrection": "Correzione del volto con GFPGAN o Codeformer: l'algoritmo rileva i volti nell'immagine e corregge eventuali difetti. Un valore alto cambierà maggiormente l'immagine, dando luogo a volti più attraenti. Codeformer con una maggiore fedeltà preserva l'immagine originale a scapito di una correzione facciale più forte.", + "imageToImage": "Da Immagine a Immagine carica qualsiasi immagine come iniziale, che viene quindi utilizzata per generarne una nuova in base al prompt. Più alto è il valore, più cambierà l'immagine risultante. Sono possibili valori da 0.0 a 1.0, l'intervallo consigliato è 0.25-0.75", + "boundingBox": "Il riquadro di selezione è lo stesso delle impostazioni Larghezza e Altezza per dat Testo a Immagine o da Immagine a Immagine. Verrà elaborata solo l'area nella casella.", + "seamCorrection": "Controlla la gestione delle giunzioni visibili che si verificano tra le immagini generate sulla tela.", + "infillAndScaling": "Gestisce i metodi di riempimento (utilizzati su aree mascherate o cancellate dell'area di disegno) e il ridimensionamento (utile per i riquadri di selezione di piccole dimensioni)." + } +} From 9fded69f0c1d2c7d5e414096931f5cbf338b9145 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Sat, 31 Dec 2022 04:46:39 +1300 Subject: [PATCH 11/11] Frontend Lint --- frontend/src/features/system/components/StatusIndicator.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/system/components/StatusIndicator.tsx b/frontend/src/features/system/components/StatusIndicator.tsx index 6e16a537fd..c2227d1f26 100644 --- a/frontend/src/features/system/components/StatusIndicator.tsx +++ b/frontend/src/features/system/components/StatusIndicator.tsx @@ -61,7 +61,9 @@ const StatusIndicator = () => { if (statusMessage) if (isProcessing) { if (totalIterations > 1) { - statusMessage = t(statusMessage as keyof typeof t) + ` (${currentIteration}/${totalIterations})`; + statusMessage = + t(statusMessage as keyof typeof t) + + ` (${currentIteration}/${totalIterations})`; } }