diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.yml
index 9de458b1..f7d30a9a 100644
--- a/.github/workflows/stable-release.yml
+++ b/.github/workflows/stable-release.yml
@@ -22,7 +22,7 @@ on:
description: 'Python patch version'
required: true
type: string
- default: "8"
+ default: "9"
jobs:
diff --git a/.github/workflows/update-frontend.yml b/.github/workflows/update-frontend.yml
deleted file mode 100644
index 0c577478..00000000
--- a/.github/workflows/update-frontend.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: Update Frontend Release
-
-on:
- workflow_dispatch:
- inputs:
- version:
- description: "Frontend version to update to (e.g., 1.0.0)"
- required: true
- type: string
-
-jobs:
- update-frontend:
- runs-on: ubuntu-latest
- permissions:
- contents: write
- pull-requests: write
-
- steps:
- - name: Checkout ComfyUI
- uses: actions/checkout@v4
- - uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- - name: Install requirements
- run: |
- python -m pip install --upgrade pip
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
- pip install -r requirements.txt
- pip install wait-for-it
- # Frontend asset will be downloaded to ComfyUI/web_custom_versions/Comfy-Org_ComfyUI_frontend/{version}
- - name: Start ComfyUI server
- run: |
- python main.py --cpu --front-end-version Comfy-Org/ComfyUI_frontend@${{ github.event.inputs.version }} 2>&1 | tee console_output.log &
- wait-for-it --service 127.0.0.1:8188 -t 30
- - name: Configure Git
- run: |
- git config --global user.name "GitHub Action"
- git config --global user.email "action@github.com"
- # Replace existing frontend content with the new version and remove .js.map files
- # See https://github.com/Comfy-Org/ComfyUI_frontend/issues/2145 for why we remove .js.map files
- - name: Update frontend content
- run: |
- rm -rf web/
- cp -r web_custom_versions/Comfy-Org_ComfyUI_frontend/${{ github.event.inputs.version }} web/
- rm web/**/*.js.map
- - name: Create Pull Request
- uses: peter-evans/create-pull-request@v7
- with:
- token: ${{ secrets.PR_BOT_PAT }}
- commit-message: "Update frontend to v${{ github.event.inputs.version }}"
- title: "Frontend Update: v${{ github.event.inputs.version }}"
- body: |
- Automated PR to update frontend content to version ${{ github.event.inputs.version }}
-
- This PR was created automatically by the frontend update workflow.
- branch: release-${{ github.event.inputs.version }}
- base: master
- labels: Frontend,dependencies
diff --git a/.github/workflows/windows_release_dependencies.yml b/.github/workflows/windows_release_dependencies.yml
index afbbb7af..7a8ec578 100644
--- a/.github/workflows/windows_release_dependencies.yml
+++ b/.github/workflows/windows_release_dependencies.yml
@@ -29,7 +29,7 @@ on:
description: 'python patch version'
required: true
type: string
- default: "8"
+ default: "9"
# push:
# branches:
# - master
diff --git a/.github/workflows/windows_release_package.yml b/.github/workflows/windows_release_package.yml
index b6840017..416544f7 100644
--- a/.github/workflows/windows_release_package.yml
+++ b/.github/workflows/windows_release_package.yml
@@ -19,7 +19,7 @@ on:
description: 'python patch version'
required: true
type: string
- default: "8"
+ default: "9"
# push:
# branches:
# - master
diff --git a/CODEOWNERS b/CODEOWNERS
index 77da0b7e..eeec358d 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -11,14 +11,13 @@
/notebooks/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
/script_examples/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
/.github/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
+/requirements.txt @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
+/pyproject.toml @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata @Kosinkadink
# Python web server
/api_server/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
/app/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
/utils/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
-# Frontend assets
-/web/ @huchenlei @webfiltered @pythongosssss @yoland68 @robinjhuang
-
# Extra nodes
/comfy_extras/ @yoland68 @robinjhuang @huchenlei @pythongosssss @ltdrdata @Kosinkadink
diff --git a/README.md b/README.md
index b51f7a06..9190dd49 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# ComfyUI
-**The most powerful and modular diffusion model GUI and backend.**
+**The most powerful and modular visual AI engine and application.**
[![Website][website-shield]][website-url]
@@ -46,7 +46,7 @@ ComfyUI lets you design and execute advanced stable diffusion pipelines using a
#### [Manual Install](#manual-install-windows-linux)
Supports all operating systems and GPU types (NVIDIA, AMD, Intel, Apple Silicon, Ascend).
-## Examples
+## [Examples](https://comfyanonymous.github.io/ComfyUI_examples/)
See what ComfyUI can do with the [example workflows](https://comfyanonymous.github.io/ComfyUI_examples/).
@@ -68,6 +68,7 @@ See what ComfyUI can do with the [example workflows](https://comfyanonymous.gith
- [LTX-Video](https://comfyanonymous.github.io/ComfyUI_examples/ltxv/)
- [Hunyuan Video](https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_video/)
- [Nvidia Cosmos](https://comfyanonymous.github.io/ComfyUI_examples/cosmos/)
+ - [Wan 2.1](https://comfyanonymous.github.io/ComfyUI_examples/wan/)
- [Stable Audio](https://comfyanonymous.github.io/ComfyUI_examples/audio/)
- Asynchronous Queue system
- Many optimizations: Only re-executes the parts of the workflow that changes between executions.
@@ -260,6 +261,13 @@ For models compatible with Ascend Extension for PyTorch (torch_npu). To get star
3. Next, install the necessary packages for torch-npu by adhering to the platform-specific instructions on the [Installation](https://ascend.github.io/docs/sources/pytorch/install.html#pytorch) page.
4. Finally, adhere to the [ComfyUI manual installation](#manual-install-windows-linux) guide for Linux. Once all components are installed, you can run ComfyUI as described earlier.
+#### Cambricon MLUs
+
+For models compatible with Cambricon Extension for PyTorch (torch_mlu). Here's a step-by-step guide tailored to your platform and installation method:
+
+1. Install the Cambricon CNToolkit by adhering to the platform-specific instructions on the [Installation](https://www.cambricon.com/docs/sdk_1.15.0/cntoolkit_3.7.2/cntoolkit_install_3.7.2/index.html)
+2. Next, install the PyTorch(torch_mlu) following the instructions on the [Installation](https://www.cambricon.com/docs/sdk_1.15.0/cambricon_pytorch_1.17.0/user_guide_1.9/index.html)
+3. Launch ComfyUI by running `python main.py`
# Running
diff --git a/app/frontend_management.py b/app/frontend_management.py
index 6f20e439..20345faf 100644
--- a/app/frontend_management.py
+++ b/app/frontend_management.py
@@ -3,8 +3,10 @@ import argparse
import logging
import os
import re
+import sys
import tempfile
import zipfile
+import importlib
from dataclasses import dataclass
from functools import cached_property
from pathlib import Path
@@ -12,9 +14,18 @@ from typing import TypedDict, Optional
import requests
from typing_extensions import NotRequired
+
from comfy.cli_args import DEFAULT_VERSION_STRING
+try:
+ import comfyui_frontend_package
+except ImportError:
+ # TODO: Remove the check after roll out of 0.3.16
+ logging.error(f"\n\n********** ERROR ***********\n\ncomfyui-frontend-package is not installed. Please install the updated requirements.txt file by running:\n{sys.executable} -m pip install -r requirements.txt\n\nThis error is happening because the ComfyUI frontend is no longer shipped as part of the main repo but as a pip package instead.\n********** ERROR **********\n")
+ exit(-1)
+
+
REQUEST_TIMEOUT = 10 # seconds
@@ -109,7 +120,7 @@ def download_release_asset_zip(release: Release, destination_path: str) -> None:
class FrontendManager:
- DEFAULT_FRONTEND_PATH = str(Path(__file__).parents[1] / "web")
+ DEFAULT_FRONTEND_PATH = str(importlib.resources.files(comfyui_frontend_package) / "static")
CUSTOM_FRONTENDS_ROOT = str(Path(__file__).parents[1] / "web_custom_versions")
@classmethod
diff --git a/comfy/cli_args.py b/comfy/cli_args.py
index efe9cff7..2221eba8 100644
--- a/comfy/cli_args.py
+++ b/comfy/cli_args.py
@@ -130,7 +130,12 @@ parser.add_argument("--default-hashing-function", type=str, choices=['md5', 'sha
parser.add_argument("--disable-smart-memory", action="store_true", help="Force ComfyUI to agressively offload to regular ram instead of keeping models in vram when it can.")
parser.add_argument("--deterministic", action="store_true", help="Make pytorch use slower deterministic algorithms when it can. Note that this might not make images deterministic in all cases.")
-parser.add_argument("--fast", action="store_true", help="Enable some untested and potentially quality deteriorating optimizations.")
+
+class PerformanceFeature(enum.Enum):
+ Fp16Accumulation = "fp16_accumulation"
+ Fp8MatrixMultiplication = "fp8_matrix_mult"
+
+parser.add_argument("--fast", nargs="*", type=PerformanceFeature, help="Enable some untested and potentially quality deteriorating optimizations. --fast with no arguments enables everything. You can pass a list specific optimizations if you only want to enable specific ones. Current valid optimizations: fp16_accumulation fp8_matrix_mult")
parser.add_argument("--dont-print-server", action="store_true", help="Don't print server output.")
parser.add_argument("--quick-test-for-ci", action="store_true", help="Quick test for CI.")
@@ -194,3 +199,14 @@ if args.disable_auto_launch:
if args.force_fp16:
args.fp16_unet = True
+
+
+# '--fast' is not provided, use an empty set
+if args.fast is None:
+ args.fast = set()
+# '--fast' is provided with an empty list, enable all optimizations
+elif args.fast == []:
+ args.fast = set(PerformanceFeature)
+# '--fast' is provided with a list of performance features, use that list
+else:
+ args.fast = set(args.fast)
diff --git a/comfy/controlnet.py b/comfy/controlnet.py
index 31227ae3..9bcd1d2e 100644
--- a/comfy/controlnet.py
+++ b/comfy/controlnet.py
@@ -461,10 +461,7 @@ def controlnet_config(sd, model_options={}):
weight_dtype = comfy.utils.weight_dtype(sd)
supported_inference_dtypes = list(model_config.supported_inference_dtypes)
- if weight_dtype is not None:
- supported_inference_dtypes.append(weight_dtype)
-
- unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes)
+ unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes, weight_dtype=weight_dtype)
load_device = comfy.model_management.get_torch_device()
manual_cast_dtype = comfy.model_management.unet_manual_cast(unet_dtype, load_device)
@@ -732,10 +729,7 @@ def load_controlnet_state_dict(state_dict, model=None, model_options={}):
if supported_inference_dtypes is None:
supported_inference_dtypes = [comfy.model_management.unet_dtype()]
- if weight_dtype is not None:
- supported_inference_dtypes.append(weight_dtype)
-
- unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes)
+ unet_dtype = comfy.model_management.unet_dtype(model_params=-1, supported_dtypes=supported_inference_dtypes, weight_dtype=weight_dtype)
load_device = comfy.model_management.get_torch_device()
diff --git a/comfy/latent_formats.py b/comfy/latent_formats.py
index e98982c9..622c1df5 100644
--- a/comfy/latent_formats.py
+++ b/comfy/latent_formats.py
@@ -407,3 +407,52 @@ class Cosmos1CV8x8x8(LatentFormat):
]
latent_rgb_factors_bias = [-0.1223, -0.1889, -0.1976]
+
+class Wan21(LatentFormat):
+ latent_channels = 16
+ latent_dimensions = 3
+
+ latent_rgb_factors = [
+ [-0.1299, -0.1692, 0.2932],
+ [ 0.0671, 0.0406, 0.0442],
+ [ 0.3568, 0.2548, 0.1747],
+ [ 0.0372, 0.2344, 0.1420],
+ [ 0.0313, 0.0189, -0.0328],
+ [ 0.0296, -0.0956, -0.0665],
+ [-0.3477, -0.4059, -0.2925],
+ [ 0.0166, 0.1902, 0.1975],
+ [-0.0412, 0.0267, -0.1364],
+ [-0.1293, 0.0740, 0.1636],
+ [ 0.0680, 0.3019, 0.1128],
+ [ 0.0032, 0.0581, 0.0639],
+ [-0.1251, 0.0927, 0.1699],
+ [ 0.0060, -0.0633, 0.0005],
+ [ 0.3477, 0.2275, 0.2950],
+ [ 0.1984, 0.0913, 0.1861]
+ ]
+
+ latent_rgb_factors_bias = [-0.1835, -0.0868, -0.3360]
+
+ def __init__(self):
+ self.scale_factor = 1.0
+ self.latents_mean = torch.tensor([
+ -0.7571, -0.7089, -0.9113, 0.1075, -0.1745, 0.9653, -0.1517, 1.5508,
+ 0.4134, -0.0715, 0.5517, -0.3632, -0.1922, -0.9497, 0.2503, -0.2921
+ ]).view(1, self.latent_channels, 1, 1, 1)
+ self.latents_std = torch.tensor([
+ 2.8184, 1.4541, 2.3275, 2.6558, 1.2196, 1.7708, 2.6052, 2.0743,
+ 3.2687, 2.1526, 2.8652, 1.5579, 1.6382, 1.1253, 2.8251, 1.9160
+ ]).view(1, self.latent_channels, 1, 1, 1)
+
+
+ self.taesd_decoder_name = None #TODO
+
+ def process_in(self, latent):
+ latents_mean = self.latents_mean.to(latent.device, latent.dtype)
+ latents_std = self.latents_std.to(latent.device, latent.dtype)
+ return (latent - latents_mean) * self.scale_factor / latents_std
+
+ def process_out(self, latent):
+ latents_mean = self.latents_mean.to(latent.device, latent.dtype)
+ latents_std = self.latents_std.to(latent.device, latent.dtype)
+ return latent * latents_std / self.scale_factor + latents_mean
diff --git a/comfy/ldm/wan/model.py b/comfy/ldm/wan/model.py
new file mode 100644
index 00000000..e78d846b
--- /dev/null
+++ b/comfy/ldm/wan/model.py
@@ -0,0 +1,480 @@
+# original version: https://github.com/Wan-Video/Wan2.1/blob/main/wan/modules/model.py
+# Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved.
+import math
+
+import torch
+import torch.nn as nn
+from einops import repeat
+
+from comfy.ldm.modules.attention import optimized_attention
+from comfy.ldm.flux.layers import EmbedND
+from comfy.ldm.flux.math import apply_rope
+from comfy.ldm.modules.diffusionmodules.mmdit import RMSNorm
+import comfy.ldm.common_dit
+import comfy.model_management
+
+
+def sinusoidal_embedding_1d(dim, position):
+ # preprocess
+ assert dim % 2 == 0
+ half = dim // 2
+ position = position.type(torch.float32)
+
+ # calculation
+ sinusoid = torch.outer(
+ position, torch.pow(10000, -torch.arange(half).to(position).div(half)))
+ x = torch.cat([torch.cos(sinusoid), torch.sin(sinusoid)], dim=1)
+ return x
+
+
+class WanSelfAttention(nn.Module):
+
+ def __init__(self,
+ dim,
+ num_heads,
+ window_size=(-1, -1),
+ qk_norm=True,
+ eps=1e-6, operation_settings={}):
+ assert dim % num_heads == 0
+ super().__init__()
+ self.dim = dim
+ self.num_heads = num_heads
+ self.head_dim = dim // num_heads
+ self.window_size = window_size
+ self.qk_norm = qk_norm
+ self.eps = eps
+
+ # layers
+ self.q = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.k = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.v = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.o = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.norm_q = RMSNorm(dim, eps=eps, elementwise_affine=True, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")) if qk_norm else nn.Identity()
+ self.norm_k = RMSNorm(dim, eps=eps, elementwise_affine=True, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")) if qk_norm else nn.Identity()
+
+ def forward(self, x, freqs):
+ r"""
+ Args:
+ x(Tensor): Shape [B, L, num_heads, C / num_heads]
+ freqs(Tensor): Rope freqs, shape [1024, C / num_heads / 2]
+ """
+ b, s, n, d = *x.shape[:2], self.num_heads, self.head_dim
+
+ # query, key, value function
+ def qkv_fn(x):
+ q = self.norm_q(self.q(x)).view(b, s, n, d)
+ k = self.norm_k(self.k(x)).view(b, s, n, d)
+ v = self.v(x).view(b, s, n * d)
+ return q, k, v
+
+ q, k, v = qkv_fn(x)
+ q, k = apply_rope(q, k, freqs)
+
+ x = optimized_attention(
+ q.view(b, s, n * d),
+ k.view(b, s, n * d),
+ v,
+ heads=self.num_heads,
+ )
+
+ x = self.o(x)
+ return x
+
+
+class WanT2VCrossAttention(WanSelfAttention):
+
+ def forward(self, x, context):
+ r"""
+ Args:
+ x(Tensor): Shape [B, L1, C]
+ context(Tensor): Shape [B, L2, C]
+ """
+ # compute query, key, value
+ q = self.norm_q(self.q(x))
+ k = self.norm_k(self.k(context))
+ v = self.v(context)
+
+ # compute attention
+ x = optimized_attention(q, k, v, heads=self.num_heads)
+
+ x = self.o(x)
+ return x
+
+
+class WanI2VCrossAttention(WanSelfAttention):
+
+ def __init__(self,
+ dim,
+ num_heads,
+ window_size=(-1, -1),
+ qk_norm=True,
+ eps=1e-6, operation_settings={}):
+ super().__init__(dim, num_heads, window_size, qk_norm, eps, operation_settings=operation_settings)
+
+ self.k_img = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.v_img = operation_settings.get("operations").Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ # self.alpha = nn.Parameter(torch.zeros((1, )))
+ self.norm_k_img = RMSNorm(dim, eps=eps, elementwise_affine=True, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")) if qk_norm else nn.Identity()
+
+ def forward(self, x, context):
+ r"""
+ Args:
+ x(Tensor): Shape [B, L1, C]
+ context(Tensor): Shape [B, L2, C]
+ """
+ context_img = context[:, :257]
+ context = context[:, 257:]
+
+ # compute query, key, value
+ q = self.norm_q(self.q(x))
+ k = self.norm_k(self.k(context))
+ v = self.v(context)
+ k_img = self.norm_k_img(self.k_img(context_img))
+ v_img = self.v_img(context_img)
+ img_x = optimized_attention(q, k_img, v_img, heads=self.num_heads)
+ # compute attention
+ x = optimized_attention(q, k, v, heads=self.num_heads)
+
+ # output
+ x = x + img_x
+ x = self.o(x)
+ return x
+
+
+WAN_CROSSATTENTION_CLASSES = {
+ 't2v_cross_attn': WanT2VCrossAttention,
+ 'i2v_cross_attn': WanI2VCrossAttention,
+}
+
+
+class WanAttentionBlock(nn.Module):
+
+ def __init__(self,
+ cross_attn_type,
+ dim,
+ ffn_dim,
+ num_heads,
+ window_size=(-1, -1),
+ qk_norm=True,
+ cross_attn_norm=False,
+ eps=1e-6, operation_settings={}):
+ super().__init__()
+ self.dim = dim
+ self.ffn_dim = ffn_dim
+ self.num_heads = num_heads
+ self.window_size = window_size
+ self.qk_norm = qk_norm
+ self.cross_attn_norm = cross_attn_norm
+ self.eps = eps
+
+ # layers
+ self.norm1 = operation_settings.get("operations").LayerNorm(dim, eps, elementwise_affine=False, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.self_attn = WanSelfAttention(dim, num_heads, window_size, qk_norm,
+ eps, operation_settings=operation_settings)
+ self.norm3 = operation_settings.get("operations").LayerNorm(
+ dim, eps,
+ elementwise_affine=True, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")) if cross_attn_norm else nn.Identity()
+ self.cross_attn = WAN_CROSSATTENTION_CLASSES[cross_attn_type](dim,
+ num_heads,
+ (-1, -1),
+ qk_norm,
+ eps, operation_settings=operation_settings)
+ self.norm2 = operation_settings.get("operations").LayerNorm(dim, eps, elementwise_affine=False, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.ffn = nn.Sequential(
+ operation_settings.get("operations").Linear(dim, ffn_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")), nn.GELU(approximate='tanh'),
+ operation_settings.get("operations").Linear(ffn_dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ # modulation
+ self.modulation = nn.Parameter(torch.empty(1, 6, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ def forward(
+ self,
+ x,
+ e,
+ freqs,
+ context,
+ ):
+ r"""
+ Args:
+ x(Tensor): Shape [B, L, C]
+ e(Tensor): Shape [B, 6, C]
+ freqs(Tensor): Rope freqs, shape [1024, C / num_heads / 2]
+ """
+ # assert e.dtype == torch.float32
+
+ e = (comfy.model_management.cast_to(self.modulation, dtype=x.dtype, device=x.device) + e).chunk(6, dim=1)
+ # assert e[0].dtype == torch.float32
+
+ # self-attention
+ y = self.self_attn(
+ self.norm1(x) * (1 + e[1]) + e[0],
+ freqs)
+
+ x = x + y * e[2]
+
+ # cross-attention & ffn
+ x = x + self.cross_attn(self.norm3(x), context)
+ y = self.ffn(self.norm2(x) * (1 + e[4]) + e[3])
+ x = x + y * e[5]
+ return x
+
+
+class Head(nn.Module):
+
+ def __init__(self, dim, out_dim, patch_size, eps=1e-6, operation_settings={}):
+ super().__init__()
+ self.dim = dim
+ self.out_dim = out_dim
+ self.patch_size = patch_size
+ self.eps = eps
+
+ # layers
+ out_dim = math.prod(patch_size) * out_dim
+ self.norm = operation_settings.get("operations").LayerNorm(dim, eps, elementwise_affine=False, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+ self.head = operation_settings.get("operations").Linear(dim, out_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype"))
+
+ # modulation
+ self.modulation = nn.Parameter(torch.empty(1, 2, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ def forward(self, x, e):
+ r"""
+ Args:
+ x(Tensor): Shape [B, L1, C]
+ e(Tensor): Shape [B, C]
+ """
+ # assert e.dtype == torch.float32
+ e = (comfy.model_management.cast_to(self.modulation, dtype=x.dtype, device=x.device) + e.unsqueeze(1)).chunk(2, dim=1)
+ x = (self.head(self.norm(x) * (1 + e[1]) + e[0]))
+ return x
+
+
+class MLPProj(torch.nn.Module):
+
+ def __init__(self, in_dim, out_dim, operation_settings={}):
+ super().__init__()
+
+ self.proj = torch.nn.Sequential(
+ operation_settings.get("operations").LayerNorm(in_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")), operation_settings.get("operations").Linear(in_dim, in_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")),
+ torch.nn.GELU(), operation_settings.get("operations").Linear(in_dim, out_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")),
+ operation_settings.get("operations").LayerNorm(out_dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ def forward(self, image_embeds):
+ clip_extra_context_tokens = self.proj(image_embeds)
+ return clip_extra_context_tokens
+
+
+class WanModel(torch.nn.Module):
+ r"""
+ Wan diffusion backbone supporting both text-to-video and image-to-video.
+ """
+
+ def __init__(self,
+ model_type='t2v',
+ patch_size=(1, 2, 2),
+ text_len=512,
+ in_dim=16,
+ dim=2048,
+ ffn_dim=8192,
+ freq_dim=256,
+ text_dim=4096,
+ out_dim=16,
+ num_heads=16,
+ num_layers=32,
+ window_size=(-1, -1),
+ qk_norm=True,
+ cross_attn_norm=True,
+ eps=1e-6,
+ image_model=None,
+ device=None,
+ dtype=None,
+ operations=None,
+ ):
+ r"""
+ Initialize the diffusion model backbone.
+
+ Args:
+ model_type (`str`, *optional*, defaults to 't2v'):
+ Model variant - 't2v' (text-to-video) or 'i2v' (image-to-video)
+ patch_size (`tuple`, *optional*, defaults to (1, 2, 2)):
+ 3D patch dimensions for video embedding (t_patch, h_patch, w_patch)
+ text_len (`int`, *optional*, defaults to 512):
+ Fixed length for text embeddings
+ in_dim (`int`, *optional*, defaults to 16):
+ Input video channels (C_in)
+ dim (`int`, *optional*, defaults to 2048):
+ Hidden dimension of the transformer
+ ffn_dim (`int`, *optional*, defaults to 8192):
+ Intermediate dimension in feed-forward network
+ freq_dim (`int`, *optional*, defaults to 256):
+ Dimension for sinusoidal time embeddings
+ text_dim (`int`, *optional*, defaults to 4096):
+ Input dimension for text embeddings
+ out_dim (`int`, *optional*, defaults to 16):
+ Output video channels (C_out)
+ num_heads (`int`, *optional*, defaults to 16):
+ Number of attention heads
+ num_layers (`int`, *optional*, defaults to 32):
+ Number of transformer blocks
+ window_size (`tuple`, *optional*, defaults to (-1, -1)):
+ Window size for local attention (-1 indicates global attention)
+ qk_norm (`bool`, *optional*, defaults to True):
+ Enable query/key normalization
+ cross_attn_norm (`bool`, *optional*, defaults to False):
+ Enable cross-attention normalization
+ eps (`float`, *optional*, defaults to 1e-6):
+ Epsilon value for normalization layers
+ """
+
+ super().__init__()
+ self.dtype = dtype
+ operation_settings = {"operations": operations, "device": device, "dtype": dtype}
+
+ assert model_type in ['t2v', 'i2v']
+ self.model_type = model_type
+
+ self.patch_size = patch_size
+ self.text_len = text_len
+ self.in_dim = in_dim
+ self.dim = dim
+ self.ffn_dim = ffn_dim
+ self.freq_dim = freq_dim
+ self.text_dim = text_dim
+ self.out_dim = out_dim
+ self.num_heads = num_heads
+ self.num_layers = num_layers
+ self.window_size = window_size
+ self.qk_norm = qk_norm
+ self.cross_attn_norm = cross_attn_norm
+ self.eps = eps
+
+ # embeddings
+ self.patch_embedding = operations.Conv3d(
+ in_dim, dim, kernel_size=patch_size, stride=patch_size, device=operation_settings.get("device"), dtype=torch.float32)
+ self.text_embedding = nn.Sequential(
+ operations.Linear(text_dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")), nn.GELU(approximate='tanh'),
+ operations.Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ self.time_embedding = nn.Sequential(
+ operations.Linear(freq_dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")), nn.SiLU(), operations.Linear(dim, dim, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+ self.time_projection = nn.Sequential(nn.SiLU(), operations.Linear(dim, dim * 6, device=operation_settings.get("device"), dtype=operation_settings.get("dtype")))
+
+ # blocks
+ cross_attn_type = 't2v_cross_attn' if model_type == 't2v' else 'i2v_cross_attn'
+ self.blocks = nn.ModuleList([
+ WanAttentionBlock(cross_attn_type, dim, ffn_dim, num_heads,
+ window_size, qk_norm, cross_attn_norm, eps, operation_settings=operation_settings)
+ for _ in range(num_layers)
+ ])
+
+ # head
+ self.head = Head(dim, out_dim, patch_size, eps, operation_settings=operation_settings)
+
+ d = dim // num_heads
+ self.rope_embedder = EmbedND(dim=d, theta=10000.0, axes_dim=[d - 4 * (d // 6), 2 * (d // 6), 2 * (d // 6)])
+
+ if model_type == 'i2v':
+ self.img_emb = MLPProj(1280, dim, operation_settings=operation_settings)
+ else:
+ self.img_emb = None
+
+ def forward_orig(
+ self,
+ x,
+ t,
+ context,
+ clip_fea=None,
+ freqs=None,
+ ):
+ r"""
+ Forward pass through the diffusion model
+
+ Args:
+ x (Tensor):
+ List of input video tensors with shape [B, C_in, F, H, W]
+ t (Tensor):
+ Diffusion timesteps tensor of shape [B]
+ context (List[Tensor]):
+ List of text embeddings each with shape [B, L, C]
+ seq_len (`int`):
+ Maximum sequence length for positional encoding
+ clip_fea (Tensor, *optional*):
+ CLIP image features for image-to-video mode
+ y (List[Tensor], *optional*):
+ Conditional video inputs for image-to-video mode, same shape as x
+
+ Returns:
+ List[Tensor]:
+ List of denoised video tensors with original input shapes [C_out, F, H / 8, W / 8]
+ """
+ # embeddings
+ x = self.patch_embedding(x.float()).to(x.dtype)
+ grid_sizes = x.shape[2:]
+ x = x.flatten(2).transpose(1, 2)
+
+ # time embeddings
+ e = self.time_embedding(
+ sinusoidal_embedding_1d(self.freq_dim, t).to(dtype=x[0].dtype))
+ e0 = self.time_projection(e).unflatten(1, (6, self.dim))
+
+ # context
+ context = self.text_embedding(context)
+
+ if clip_fea is not None and self.img_emb is not None:
+ context_clip = self.img_emb(clip_fea) # bs x 257 x dim
+ context = torch.concat([context_clip, context], dim=1)
+
+ # arguments
+ kwargs = dict(
+ e=e0,
+ freqs=freqs,
+ context=context)
+
+ for block in self.blocks:
+ x = block(x, **kwargs)
+
+ # head
+ x = self.head(x, e)
+
+ # unpatchify
+ x = self.unpatchify(x, grid_sizes)
+ return x
+
+ def forward(self, x, timestep, context, clip_fea=None, **kwargs):
+ bs, c, t, h, w = x.shape
+ x = comfy.ldm.common_dit.pad_to_patch_size(x, self.patch_size)
+ patch_size = self.patch_size
+ t_len = ((t + (patch_size[0] // 2)) // patch_size[0])
+ h_len = ((h + (patch_size[1] // 2)) // patch_size[1])
+ w_len = ((w + (patch_size[2] // 2)) // patch_size[2])
+ img_ids = torch.zeros((t_len, h_len, w_len, 3), device=x.device, dtype=x.dtype)
+ img_ids[:, :, :, 0] = img_ids[:, :, :, 0] + torch.linspace(0, t_len - 1, steps=t_len, device=x.device, dtype=x.dtype).reshape(-1, 1, 1)
+ img_ids[:, :, :, 1] = img_ids[:, :, :, 1] + torch.linspace(0, h_len - 1, steps=h_len, device=x.device, dtype=x.dtype).reshape(1, -1, 1)
+ img_ids[:, :, :, 2] = img_ids[:, :, :, 2] + torch.linspace(0, w_len - 1, steps=w_len, device=x.device, dtype=x.dtype).reshape(1, 1, -1)
+ img_ids = repeat(img_ids, "t h w c -> b (t h w) c", b=bs)
+
+ freqs = self.rope_embedder(img_ids).movedim(1, 2)
+ return self.forward_orig(x, timestep, context, clip_fea=clip_fea, freqs=freqs)[:, :, :t, :h, :w]
+
+ def unpatchify(self, x, grid_sizes):
+ r"""
+ Reconstruct video tensors from patch embeddings.
+
+ Args:
+ x (List[Tensor]):
+ List of patchified features, each with shape [L, C_out * prod(patch_size)]
+ grid_sizes (Tensor):
+ Original spatial-temporal grid dimensions before patching,
+ shape [B, 3] (3 dimensions correspond to F_patches, H_patches, W_patches)
+
+ Returns:
+ List[Tensor]:
+ Reconstructed video tensors with shape [L, C_out, F, H / 8, W / 8]
+ """
+
+ c = self.out_dim
+ u = x
+ b = u.shape[0]
+ u = u[:, :math.prod(grid_sizes)].view(b, *grid_sizes, *self.patch_size, c)
+ u = torch.einsum('bfhwpqrc->bcfphqwr', u)
+ u = u.reshape(b, c, *[i * j for i, j in zip(grid_sizes, self.patch_size)])
+ return u
diff --git a/comfy/ldm/wan/vae.py b/comfy/ldm/wan/vae.py
new file mode 100644
index 00000000..a8ebc5ec
--- /dev/null
+++ b/comfy/ldm/wan/vae.py
@@ -0,0 +1,567 @@
+# original version: https://github.com/Wan-Video/Wan2.1/blob/main/wan/modules/vae.py
+# Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved.
+
+import torch
+import torch.nn as nn
+import torch.nn.functional as F
+from einops import rearrange
+from comfy.ldm.modules.diffusionmodules.model import vae_attention
+
+import comfy.ops
+ops = comfy.ops.disable_weight_init
+
+CACHE_T = 2
+
+
+class CausalConv3d(ops.Conv3d):
+ """
+ Causal 3d convolusion.
+ """
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._padding = (self.padding[2], self.padding[2], self.padding[1],
+ self.padding[1], 2 * self.padding[0], 0)
+ self.padding = (0, 0, 0)
+
+ def forward(self, x, cache_x=None):
+ padding = list(self._padding)
+ if cache_x is not None and self._padding[4] > 0:
+ cache_x = cache_x.to(x.device)
+ x = torch.cat([cache_x, x], dim=2)
+ padding[4] -= cache_x.shape[2]
+ x = F.pad(x, padding)
+
+ return super().forward(x)
+
+
+class RMS_norm(nn.Module):
+
+ def __init__(self, dim, channel_first=True, images=True, bias=False):
+ super().__init__()
+ broadcastable_dims = (1, 1, 1) if not images else (1, 1)
+ shape = (dim, *broadcastable_dims) if channel_first else (dim,)
+
+ self.channel_first = channel_first
+ self.scale = dim**0.5
+ self.gamma = nn.Parameter(torch.ones(shape))
+ self.bias = nn.Parameter(torch.zeros(shape)) if bias else None
+
+ def forward(self, x):
+ return F.normalize(
+ x, dim=(1 if self.channel_first else -1)) * self.scale * self.gamma.to(x) + (self.bias.to(x) if self.bias is not None else 0)
+
+
+class Upsample(nn.Upsample):
+
+ def forward(self, x):
+ """
+ Fix bfloat16 support for nearest neighbor interpolation.
+ """
+ return super().forward(x.float()).type_as(x)
+
+
+class Resample(nn.Module):
+
+ def __init__(self, dim, mode):
+ assert mode in ('none', 'upsample2d', 'upsample3d', 'downsample2d',
+ 'downsample3d')
+ super().__init__()
+ self.dim = dim
+ self.mode = mode
+
+ # layers
+ if mode == 'upsample2d':
+ self.resample = nn.Sequential(
+ Upsample(scale_factor=(2., 2.), mode='nearest-exact'),
+ ops.Conv2d(dim, dim // 2, 3, padding=1))
+ elif mode == 'upsample3d':
+ self.resample = nn.Sequential(
+ Upsample(scale_factor=(2., 2.), mode='nearest-exact'),
+ ops.Conv2d(dim, dim // 2, 3, padding=1))
+ self.time_conv = CausalConv3d(
+ dim, dim * 2, (3, 1, 1), padding=(1, 0, 0))
+
+ elif mode == 'downsample2d':
+ self.resample = nn.Sequential(
+ nn.ZeroPad2d((0, 1, 0, 1)),
+ ops.Conv2d(dim, dim, 3, stride=(2, 2)))
+ elif mode == 'downsample3d':
+ self.resample = nn.Sequential(
+ nn.ZeroPad2d((0, 1, 0, 1)),
+ ops.Conv2d(dim, dim, 3, stride=(2, 2)))
+ self.time_conv = CausalConv3d(
+ dim, dim, (3, 1, 1), stride=(2, 1, 1), padding=(0, 0, 0))
+
+ else:
+ self.resample = nn.Identity()
+
+ def forward(self, x, feat_cache=None, feat_idx=[0]):
+ b, c, t, h, w = x.size()
+ if self.mode == 'upsample3d':
+ if feat_cache is not None:
+ idx = feat_idx[0]
+ if feat_cache[idx] is None:
+ feat_cache[idx] = 'Rep'
+ feat_idx[0] += 1
+ else:
+
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[
+ idx] is not None and feat_cache[idx] != 'Rep':
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ if cache_x.shape[2] < 2 and feat_cache[
+ idx] is not None and feat_cache[idx] == 'Rep':
+ cache_x = torch.cat([
+ torch.zeros_like(cache_x).to(cache_x.device),
+ cache_x
+ ],
+ dim=2)
+ if feat_cache[idx] == 'Rep':
+ x = self.time_conv(x)
+ else:
+ x = self.time_conv(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+
+ x = x.reshape(b, 2, c, t, h, w)
+ x = torch.stack((x[:, 0, :, :, :, :], x[:, 1, :, :, :, :]),
+ 3)
+ x = x.reshape(b, c, t * 2, h, w)
+ t = x.shape[2]
+ x = rearrange(x, 'b c t h w -> (b t) c h w')
+ x = self.resample(x)
+ x = rearrange(x, '(b t) c h w -> b c t h w', t=t)
+
+ if self.mode == 'downsample3d':
+ if feat_cache is not None:
+ idx = feat_idx[0]
+ if feat_cache[idx] is None:
+ feat_cache[idx] = x.clone()
+ feat_idx[0] += 1
+ else:
+
+ cache_x = x[:, :, -1:, :, :].clone()
+ # if cache_x.shape[2] < 2 and feat_cache[idx] is not None and feat_cache[idx]!='Rep':
+ # # cache last frame of last two chunk
+ # cache_x = torch.cat([feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(cache_x.device), cache_x], dim=2)
+
+ x = self.time_conv(
+ torch.cat([feat_cache[idx][:, :, -1:, :, :], x], 2))
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ return x
+
+ def init_weight(self, conv):
+ conv_weight = conv.weight
+ nn.init.zeros_(conv_weight)
+ c1, c2, t, h, w = conv_weight.size()
+ one_matrix = torch.eye(c1, c2)
+ init_matrix = one_matrix
+ nn.init.zeros_(conv_weight)
+ #conv_weight.data[:,:,-1,1,1] = init_matrix * 0.5
+ conv_weight.data[:, :, 1, 0, 0] = init_matrix #* 0.5
+ conv.weight.data.copy_(conv_weight)
+ nn.init.zeros_(conv.bias.data)
+
+ def init_weight2(self, conv):
+ conv_weight = conv.weight.data
+ nn.init.zeros_(conv_weight)
+ c1, c2, t, h, w = conv_weight.size()
+ init_matrix = torch.eye(c1 // 2, c2)
+ #init_matrix = repeat(init_matrix, 'o ... -> (o 2) ...').permute(1,0,2).contiguous().reshape(c1,c2)
+ conv_weight[:c1 // 2, :, -1, 0, 0] = init_matrix
+ conv_weight[c1 // 2:, :, -1, 0, 0] = init_matrix
+ conv.weight.data.copy_(conv_weight)
+ nn.init.zeros_(conv.bias.data)
+
+
+class ResidualBlock(nn.Module):
+
+ def __init__(self, in_dim, out_dim, dropout=0.0):
+ super().__init__()
+ self.in_dim = in_dim
+ self.out_dim = out_dim
+
+ # layers
+ self.residual = nn.Sequential(
+ RMS_norm(in_dim, images=False), nn.SiLU(),
+ CausalConv3d(in_dim, out_dim, 3, padding=1),
+ RMS_norm(out_dim, images=False), nn.SiLU(), nn.Dropout(dropout),
+ CausalConv3d(out_dim, out_dim, 3, padding=1))
+ self.shortcut = CausalConv3d(in_dim, out_dim, 1) \
+ if in_dim != out_dim else nn.Identity()
+
+ def forward(self, x, feat_cache=None, feat_idx=[0]):
+ h = self.shortcut(x)
+ for layer in self.residual:
+ if isinstance(layer, CausalConv3d) and feat_cache is not None:
+ idx = feat_idx[0]
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[idx] is not None:
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ x = layer(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ else:
+ x = layer(x)
+ return x + h
+
+
+class AttentionBlock(nn.Module):
+ """
+ Causal self-attention with a single head.
+ """
+
+ def __init__(self, dim):
+ super().__init__()
+ self.dim = dim
+
+ # layers
+ self.norm = RMS_norm(dim)
+ self.to_qkv = ops.Conv2d(dim, dim * 3, 1)
+ self.proj = ops.Conv2d(dim, dim, 1)
+ self.optimized_attention = vae_attention()
+
+ def forward(self, x):
+ identity = x
+ b, c, t, h, w = x.size()
+ x = rearrange(x, 'b c t h w -> (b t) c h w')
+ x = self.norm(x)
+ # compute query, key, value
+
+ q, k, v = self.to_qkv(x).chunk(3, dim=1)
+ x = self.optimized_attention(q, k, v)
+
+ # output
+ x = self.proj(x)
+ x = rearrange(x, '(b t) c h w-> b c t h w', t=t)
+ return x + identity
+
+
+class Encoder3d(nn.Module):
+
+ def __init__(self,
+ dim=128,
+ z_dim=4,
+ dim_mult=[1, 2, 4, 4],
+ num_res_blocks=2,
+ attn_scales=[],
+ temperal_downsample=[True, True, False],
+ dropout=0.0):
+ super().__init__()
+ self.dim = dim
+ self.z_dim = z_dim
+ self.dim_mult = dim_mult
+ self.num_res_blocks = num_res_blocks
+ self.attn_scales = attn_scales
+ self.temperal_downsample = temperal_downsample
+
+ # dimensions
+ dims = [dim * u for u in [1] + dim_mult]
+ scale = 1.0
+
+ # init block
+ self.conv1 = CausalConv3d(3, dims[0], 3, padding=1)
+
+ # downsample blocks
+ downsamples = []
+ for i, (in_dim, out_dim) in enumerate(zip(dims[:-1], dims[1:])):
+ # residual (+attention) blocks
+ for _ in range(num_res_blocks):
+ downsamples.append(ResidualBlock(in_dim, out_dim, dropout))
+ if scale in attn_scales:
+ downsamples.append(AttentionBlock(out_dim))
+ in_dim = out_dim
+
+ # downsample block
+ if i != len(dim_mult) - 1:
+ mode = 'downsample3d' if temperal_downsample[
+ i] else 'downsample2d'
+ downsamples.append(Resample(out_dim, mode=mode))
+ scale /= 2.0
+ self.downsamples = nn.Sequential(*downsamples)
+
+ # middle blocks
+ self.middle = nn.Sequential(
+ ResidualBlock(out_dim, out_dim, dropout), AttentionBlock(out_dim),
+ ResidualBlock(out_dim, out_dim, dropout))
+
+ # output blocks
+ self.head = nn.Sequential(
+ RMS_norm(out_dim, images=False), nn.SiLU(),
+ CausalConv3d(out_dim, z_dim, 3, padding=1))
+
+ def forward(self, x, feat_cache=None, feat_idx=[0]):
+ if feat_cache is not None:
+ idx = feat_idx[0]
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[idx] is not None:
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ x = self.conv1(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ else:
+ x = self.conv1(x)
+
+ ## downsamples
+ for layer in self.downsamples:
+ if feat_cache is not None:
+ x = layer(x, feat_cache, feat_idx)
+ else:
+ x = layer(x)
+
+ ## middle
+ for layer in self.middle:
+ if isinstance(layer, ResidualBlock) and feat_cache is not None:
+ x = layer(x, feat_cache, feat_idx)
+ else:
+ x = layer(x)
+
+ ## head
+ for layer in self.head:
+ if isinstance(layer, CausalConv3d) and feat_cache is not None:
+ idx = feat_idx[0]
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[idx] is not None:
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ x = layer(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ else:
+ x = layer(x)
+ return x
+
+
+class Decoder3d(nn.Module):
+
+ def __init__(self,
+ dim=128,
+ z_dim=4,
+ dim_mult=[1, 2, 4, 4],
+ num_res_blocks=2,
+ attn_scales=[],
+ temperal_upsample=[False, True, True],
+ dropout=0.0):
+ super().__init__()
+ self.dim = dim
+ self.z_dim = z_dim
+ self.dim_mult = dim_mult
+ self.num_res_blocks = num_res_blocks
+ self.attn_scales = attn_scales
+ self.temperal_upsample = temperal_upsample
+
+ # dimensions
+ dims = [dim * u for u in [dim_mult[-1]] + dim_mult[::-1]]
+ scale = 1.0 / 2**(len(dim_mult) - 2)
+
+ # init block
+ self.conv1 = CausalConv3d(z_dim, dims[0], 3, padding=1)
+
+ # middle blocks
+ self.middle = nn.Sequential(
+ ResidualBlock(dims[0], dims[0], dropout), AttentionBlock(dims[0]),
+ ResidualBlock(dims[0], dims[0], dropout))
+
+ # upsample blocks
+ upsamples = []
+ for i, (in_dim, out_dim) in enumerate(zip(dims[:-1], dims[1:])):
+ # residual (+attention) blocks
+ if i == 1 or i == 2 or i == 3:
+ in_dim = in_dim // 2
+ for _ in range(num_res_blocks + 1):
+ upsamples.append(ResidualBlock(in_dim, out_dim, dropout))
+ if scale in attn_scales:
+ upsamples.append(AttentionBlock(out_dim))
+ in_dim = out_dim
+
+ # upsample block
+ if i != len(dim_mult) - 1:
+ mode = 'upsample3d' if temperal_upsample[i] else 'upsample2d'
+ upsamples.append(Resample(out_dim, mode=mode))
+ scale *= 2.0
+ self.upsamples = nn.Sequential(*upsamples)
+
+ # output blocks
+ self.head = nn.Sequential(
+ RMS_norm(out_dim, images=False), nn.SiLU(),
+ CausalConv3d(out_dim, 3, 3, padding=1))
+
+ def forward(self, x, feat_cache=None, feat_idx=[0]):
+ ## conv1
+ if feat_cache is not None:
+ idx = feat_idx[0]
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[idx] is not None:
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ x = self.conv1(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ else:
+ x = self.conv1(x)
+
+ ## middle
+ for layer in self.middle:
+ if isinstance(layer, ResidualBlock) and feat_cache is not None:
+ x = layer(x, feat_cache, feat_idx)
+ else:
+ x = layer(x)
+
+ ## upsamples
+ for layer in self.upsamples:
+ if feat_cache is not None:
+ x = layer(x, feat_cache, feat_idx)
+ else:
+ x = layer(x)
+
+ ## head
+ for layer in self.head:
+ if isinstance(layer, CausalConv3d) and feat_cache is not None:
+ idx = feat_idx[0]
+ cache_x = x[:, :, -CACHE_T:, :, :].clone()
+ if cache_x.shape[2] < 2 and feat_cache[idx] is not None:
+ # cache last frame of last two chunk
+ cache_x = torch.cat([
+ feat_cache[idx][:, :, -1, :, :].unsqueeze(2).to(
+ cache_x.device), cache_x
+ ],
+ dim=2)
+ x = layer(x, feat_cache[idx])
+ feat_cache[idx] = cache_x
+ feat_idx[0] += 1
+ else:
+ x = layer(x)
+ return x
+
+
+def count_conv3d(model):
+ count = 0
+ for m in model.modules():
+ if isinstance(m, CausalConv3d):
+ count += 1
+ return count
+
+
+class WanVAE(nn.Module):
+
+ def __init__(self,
+ dim=128,
+ z_dim=4,
+ dim_mult=[1, 2, 4, 4],
+ num_res_blocks=2,
+ attn_scales=[],
+ temperal_downsample=[True, True, False],
+ dropout=0.0):
+ super().__init__()
+ self.dim = dim
+ self.z_dim = z_dim
+ self.dim_mult = dim_mult
+ self.num_res_blocks = num_res_blocks
+ self.attn_scales = attn_scales
+ self.temperal_downsample = temperal_downsample
+ self.temperal_upsample = temperal_downsample[::-1]
+
+ # modules
+ self.encoder = Encoder3d(dim, z_dim * 2, dim_mult, num_res_blocks,
+ attn_scales, self.temperal_downsample, dropout)
+ self.conv1 = CausalConv3d(z_dim * 2, z_dim * 2, 1)
+ self.conv2 = CausalConv3d(z_dim, z_dim, 1)
+ self.decoder = Decoder3d(dim, z_dim, dim_mult, num_res_blocks,
+ attn_scales, self.temperal_upsample, dropout)
+
+ def forward(self, x):
+ mu, log_var = self.encode(x)
+ z = self.reparameterize(mu, log_var)
+ x_recon = self.decode(z)
+ return x_recon, mu, log_var
+
+ def encode(self, x):
+ self.clear_cache()
+ ## cache
+ t = x.shape[2]
+ iter_ = 1 + (t - 1) // 4
+ ## 对encode输入的x,按时间拆分为1、4、4、4....
+ for i in range(iter_):
+ self._enc_conv_idx = [0]
+ if i == 0:
+ out = self.encoder(
+ x[:, :, :1, :, :],
+ feat_cache=self._enc_feat_map,
+ feat_idx=self._enc_conv_idx)
+ else:
+ out_ = self.encoder(
+ x[:, :, 1 + 4 * (i - 1):1 + 4 * i, :, :],
+ feat_cache=self._enc_feat_map,
+ feat_idx=self._enc_conv_idx)
+ out = torch.cat([out, out_], 2)
+ mu, log_var = self.conv1(out).chunk(2, dim=1)
+ self.clear_cache()
+ return mu
+
+ def decode(self, z):
+ self.clear_cache()
+ # z: [b,c,t,h,w]
+
+ iter_ = z.shape[2]
+ x = self.conv2(z)
+ for i in range(iter_):
+ self._conv_idx = [0]
+ if i == 0:
+ out = self.decoder(
+ x[:, :, i:i + 1, :, :],
+ feat_cache=self._feat_map,
+ feat_idx=self._conv_idx)
+ else:
+ out_ = self.decoder(
+ x[:, :, i:i + 1, :, :],
+ feat_cache=self._feat_map,
+ feat_idx=self._conv_idx)
+ out = torch.cat([out, out_], 2)
+ self.clear_cache()
+ return out
+
+ def reparameterize(self, mu, log_var):
+ std = torch.exp(0.5 * log_var)
+ eps = torch.randn_like(std)
+ return eps * std + mu
+
+ def sample(self, imgs, deterministic=False):
+ mu, log_var = self.encode(imgs)
+ if deterministic:
+ return mu
+ std = torch.exp(0.5 * log_var.clamp(-30.0, 20.0))
+ return mu + std * torch.randn_like(std)
+
+ def clear_cache(self):
+ self._conv_num = count_conv3d(self.decoder)
+ self._conv_idx = [0]
+ self._feat_map = [None] * self._conv_num
+ #cache encode
+ self._enc_conv_num = count_conv3d(self.encoder)
+ self._enc_conv_idx = [0]
+ self._enc_feat_map = [None] * self._enc_conv_num
diff --git a/comfy/model_base.py b/comfy/model_base.py
index 0eeaed79..66cd0ded 100644
--- a/comfy/model_base.py
+++ b/comfy/model_base.py
@@ -35,6 +35,7 @@ import comfy.ldm.lightricks.model
import comfy.ldm.hunyuan_video.model
import comfy.ldm.cosmos.model
import comfy.ldm.lumina.model
+import comfy.ldm.wan.model
import comfy.model_management
import comfy.patcher_extension
@@ -927,3 +928,47 @@ class Lumina2(BaseModel):
if cross_attn is not None:
out['c_crossattn'] = comfy.conds.CONDRegular(cross_attn)
return out
+
+class WAN21(BaseModel):
+ def __init__(self, model_config, model_type=ModelType.FLOW, image_to_video=False, device=None):
+ super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.wan.model.WanModel)
+ self.image_to_video = image_to_video
+
+ def concat_cond(self, **kwargs):
+ if not self.image_to_video:
+ return None
+
+ image = kwargs.get("concat_latent_image", None)
+ noise = kwargs.get("noise", None)
+ device = kwargs["device"]
+
+ if image is None:
+ image = torch.zeros_like(noise)
+
+ image = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center")
+ image = self.process_latent_in(image)
+ image = utils.resize_to_batch_size(image, noise.shape[0])
+
+ mask = kwargs.get("concat_mask", kwargs.get("denoise_mask", None))
+ if mask is None:
+ mask = torch.zeros_like(noise)[:, :4]
+ else:
+ mask = 1.0 - torch.mean(mask, dim=1, keepdim=True)
+ mask = utils.common_upscale(mask.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center")
+ if mask.shape[-3] < noise.shape[-3]:
+ mask = torch.nn.functional.pad(mask, (0, 0, 0, 0, 0, noise.shape[-3] - mask.shape[-3]), mode='constant', value=0)
+ mask = mask.repeat(1, 4, 1, 1, 1)
+ mask = utils.resize_to_batch_size(mask, noise.shape[0])
+
+ return torch.cat((mask, image), dim=1)
+
+ def extra_conds(self, **kwargs):
+ out = super().extra_conds(**kwargs)
+ cross_attn = kwargs.get("cross_attn", None)
+ if cross_attn is not None:
+ out['c_crossattn'] = comfy.conds.CONDRegular(cross_attn)
+
+ clip_vision_output = kwargs.get("clip_vision_output", None)
+ if clip_vision_output is not None:
+ out['clip_fea'] = comfy.conds.CONDRegular(clip_vision_output.penultimate_hidden_states)
+ return out
diff --git a/comfy/model_detection.py b/comfy/model_detection.py
index b1faa63f..f149a4bf 100644
--- a/comfy/model_detection.py
+++ b/comfy/model_detection.py
@@ -299,6 +299,27 @@ def detect_unet_config(state_dict, key_prefix):
dit_config["axes_lens"] = [300, 512, 512]
return dit_config
+ if '{}head.modulation'.format(key_prefix) in state_dict_keys: # Wan 2.1
+ dit_config = {}
+ dit_config["image_model"] = "wan2.1"
+ dim = state_dict['{}head.modulation'.format(key_prefix)].shape[-1]
+ dit_config["dim"] = dim
+ dit_config["num_heads"] = dim // 128
+ dit_config["ffn_dim"] = state_dict['{}blocks.0.ffn.0.weight'.format(key_prefix)].shape[0]
+ dit_config["num_layers"] = count_blocks(state_dict_keys, '{}blocks.'.format(key_prefix) + '{}.')
+ dit_config["patch_size"] = (1, 2, 2)
+ dit_config["freq_dim"] = 256
+ dit_config["window_size"] = (-1, -1)
+ dit_config["qk_norm"] = True
+ dit_config["cross_attn_norm"] = True
+ dit_config["eps"] = 1e-6
+ dit_config["in_dim"] = state_dict['{}patch_embedding.weight'.format(key_prefix)].shape[1]
+ if '{}img_emb.proj.0.bias'.format(key_prefix) in state_dict_keys:
+ dit_config["model_type"] = "i2v"
+ else:
+ dit_config["model_type"] = "t2v"
+ return dit_config
+
if '{}input_blocks.0.0.weight'.format(key_prefix) not in state_dict_keys:
return None
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 3ee8857c..10d0dece 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -20,7 +20,7 @@ from __future__ import annotations
import psutil
import logging
from enum import Enum
-from comfy.cli_args import args
+from comfy.cli_args import args, PerformanceFeature
import torch
import sys
import platform
@@ -101,6 +101,13 @@ try:
except:
npu_available = False
+try:
+ import torch_mlu # noqa: F401
+ _ = torch.mlu.device_count()
+ mlu_available = torch.mlu.is_available()
+except:
+ mlu_available = False
+
if args.cpu:
cpu_state = CPUState.CPU
@@ -118,6 +125,12 @@ def is_ascend_npu():
return True
return False
+def is_mlu():
+ global mlu_available
+ if mlu_available:
+ return True
+ return False
+
def get_torch_device():
global directml_enabled
global cpu_state
@@ -133,6 +146,8 @@ def get_torch_device():
return torch.device("xpu", torch.xpu.current_device())
elif is_ascend_npu():
return torch.device("npu", torch.npu.current_device())
+ elif is_mlu():
+ return torch.device("mlu", torch.mlu.current_device())
else:
return torch.device(torch.cuda.current_device())
@@ -178,6 +193,12 @@ def get_total_memory(dev=None, torch_total_too=False):
_, mem_total_npu = torch.npu.mem_get_info(dev)
mem_total_torch = mem_reserved
mem_total = mem_total_npu
+ elif is_mlu():
+ stats = torch.mlu.memory_stats(dev)
+ mem_reserved = stats['reserved_bytes.all.current']
+ _, mem_total_mlu = torch.mlu.mem_get_info(dev)
+ mem_total_torch = mem_reserved
+ mem_total = mem_total_mlu
else:
stats = torch.cuda.memory_stats(dev)
mem_reserved = stats['reserved_bytes.all.current']
@@ -257,7 +278,7 @@ try:
if torch_version_numeric[0] >= 2:
if ENABLE_PYTORCH_ATTENTION == False and args.use_split_cross_attention == False and args.use_quad_cross_attention == False:
ENABLE_PYTORCH_ATTENTION = True
- if is_intel_xpu() or is_ascend_npu():
+ if is_intel_xpu() or is_ascend_npu() or is_mlu():
if args.use_split_cross_attention == False and args.use_quad_cross_attention == False:
ENABLE_PYTORCH_ATTENTION = True
except:
@@ -284,9 +305,10 @@ if ENABLE_PYTORCH_ATTENTION:
PRIORITIZE_FP16 = False # TODO: remove and replace with something that shows exactly which dtype is faster than the other
try:
- if is_nvidia() and args.fast:
+ if is_nvidia() and PerformanceFeature.Fp16Accumulation in args.fast:
torch.backends.cuda.matmul.allow_fp16_accumulation = True
PRIORITIZE_FP16 = True # TODO: limit to cards where it actually boosts performance
+ logging.info("Enabled fp16 accumulation.")
except:
pass
@@ -341,6 +363,8 @@ def get_torch_device_name(device):
return "{} {}".format(device, torch.xpu.get_device_name(device))
elif is_ascend_npu():
return "{} {}".format(device, torch.npu.get_device_name(device))
+ elif is_mlu():
+ return "{} {}".format(device, torch.mlu.get_device_name(device))
else:
return "CUDA {}: {}".format(device, torch.cuda.get_device_name(device))
@@ -680,7 +704,7 @@ def unet_inital_load_device(parameters, dtype):
def maximum_vram_for_weights(device=None):
return (get_total_memory(device) * 0.88 - minimum_inference_memory())
-def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, torch.bfloat16, torch.float32]):
+def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, torch.bfloat16, torch.float32], weight_dtype=None):
if model_params < 0:
model_params = 1000000000000000000000
if args.fp32_unet:
@@ -698,10 +722,8 @@ def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, tor
fp8_dtype = None
try:
- for dtype in [torch.float8_e4m3fn, torch.float8_e5m2]:
- if dtype in supported_dtypes:
- fp8_dtype = dtype
- break
+ if weight_dtype in [torch.float8_e4m3fn, torch.float8_e5m2]:
+ fp8_dtype = weight_dtype
except:
pass
@@ -713,7 +735,7 @@ def unet_dtype(device=None, model_params=0, supported_dtypes=[torch.float16, tor
if model_params * 2 > free_model_memory:
return fp8_dtype
- if PRIORITIZE_FP16:
+ if PRIORITIZE_FP16 or weight_dtype == torch.float16:
if torch.float16 in supported_dtypes and should_use_fp16(device=device, model_params=model_params):
return torch.float16
@@ -749,6 +771,9 @@ def unet_manual_cast(weight_dtype, inference_device, supported_dtypes=[torch.flo
return None
fp16_supported = should_use_fp16(inference_device, prioritize_performance=True)
+ if PRIORITIZE_FP16 and fp16_supported and torch.float16 in supported_dtypes:
+ return torch.float16
+
for dt in supported_dtypes:
if dt == torch.float16 and fp16_supported:
return torch.float16
@@ -934,6 +959,8 @@ def xformers_enabled():
return False
if is_ascend_npu():
return False
+ if is_mlu():
+ return False
if directml_enabled:
return False
return XFORMERS_IS_AVAILABLE
@@ -965,6 +992,8 @@ def pytorch_attention_flash_attention():
return True
if is_ascend_npu():
return True
+ if is_mlu():
+ return True
if is_amd():
return True #if you have pytorch attention enabled on AMD it probably supports at least mem efficient attention
return False
@@ -1013,6 +1042,13 @@ def get_free_memory(dev=None, torch_free_too=False):
mem_free_npu, _ = torch.npu.mem_get_info(dev)
mem_free_torch = mem_reserved - mem_active
mem_free_total = mem_free_npu + mem_free_torch
+ elif is_mlu():
+ stats = torch.mlu.memory_stats(dev)
+ mem_active = stats['active_bytes.all.current']
+ mem_reserved = stats['reserved_bytes.all.current']
+ mem_free_mlu, _ = torch.mlu.mem_get_info(dev)
+ mem_free_torch = mem_reserved - mem_active
+ mem_free_total = mem_free_mlu + mem_free_torch
else:
stats = torch.cuda.memory_stats(dev)
mem_active = stats['active_bytes.all.current']
@@ -1082,6 +1118,9 @@ def should_use_fp16(device=None, model_params=0, prioritize_performance=True, ma
if is_ascend_npu():
return True
+ if is_mlu():
+ return True
+
if torch.version.hip:
return True
@@ -1150,6 +1189,11 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma
return False
props = torch.cuda.get_device_properties(device)
+
+ if is_mlu():
+ if props.major > 3:
+ return True
+
if props.major >= 8:
return True
diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py
index 5ede41dd..828b1c40 100644
--- a/comfy/model_patcher.py
+++ b/comfy/model_patcher.py
@@ -719,7 +719,7 @@ class ModelPatcher:
mem_counter += module_mem
load_completely.append((module_mem, n, m, params))
- if cast_weight:
+ if cast_weight and hasattr(m, "comfy_cast_weights"):
m.prev_comfy_cast_weights = m.comfy_cast_weights
m.comfy_cast_weights = True
diff --git a/comfy/ops.py b/comfy/ops.py
index 30014477..358c6ec6 100644
--- a/comfy/ops.py
+++ b/comfy/ops.py
@@ -18,7 +18,7 @@
import torch
import comfy.model_management
-from comfy.cli_args import args
+from comfy.cli_args import args, PerformanceFeature
import comfy.float
cast_to = comfy.model_management.cast_to #TODO: remove once no more references
@@ -360,7 +360,11 @@ def pick_operations(weight_dtype, compute_dtype, load_device=None, disable_fast_
if scaled_fp8 is not None:
return scaled_fp8_ops(fp8_matrix_mult=fp8_compute, scale_input=True, override_dtype=scaled_fp8)
- if fp8_compute and (fp8_optimizations or args.fast) and not disable_fast_fp8:
+ if (
+ fp8_compute and
+ (fp8_optimizations or PerformanceFeature.Fp8MatrixMultiplication in args.fast) and
+ not disable_fast_fp8
+ ):
return fp8_ops
if compute_dtype is None or weight_dtype == compute_dtype:
diff --git a/comfy/samplers.py b/comfy/samplers.py
index d02627d8..babfe7a4 100644
--- a/comfy/samplers.py
+++ b/comfy/samplers.py
@@ -22,6 +22,12 @@ import scipy.stats
import numpy
import threading
+
+def add_area_dims(area, num_dims):
+ while (len(area) // 2) < num_dims:
+ area = [2147483648] + area[:len(area) // 2] + [0] + area[len(area) // 2:]
+ return area
+
def get_area_and_mult(conds, x_in, timestep_in):
dims = tuple(x_in.shape[2:])
area = None
@@ -37,6 +43,10 @@ def get_area_and_mult(conds, x_in, timestep_in):
return None
if 'area' in conds:
area = list(conds['area'])
+ area = add_area_dims(area, len(dims))
+ if (len(area) // 2) > len(dims):
+ area = area[:len(dims)] + area[len(area) // 2:(len(area) // 2) + len(dims)]
+
if 'strength' in conds:
strength = conds['strength']
@@ -53,7 +63,7 @@ def get_area_and_mult(conds, x_in, timestep_in):
if "mask_strength" in conds:
mask_strength = conds["mask_strength"]
mask = conds['mask']
- assert(mask.shape[1:] == x_in.shape[2:])
+ assert (mask.shape[1:] == x_in.shape[2:])
mask = mask[:input_x.shape[0]]
if area is not None:
@@ -67,16 +77,17 @@ def get_area_and_mult(conds, x_in, timestep_in):
mult = mask * strength
if 'mask' not in conds and area is not None:
- rr = 8
+ fuzz = 8
for i in range(len(dims)):
+ rr = min(fuzz, mult.shape[2 + i] // 4)
if area[len(dims) + i] != 0:
for t in range(rr):
m = mult.narrow(i + 2, t, 1)
- m *= ((1.0/rr) * (t + 1))
+ m *= ((1.0 / rr) * (t + 1))
if (area[i] + area[len(dims) + i]) < x_in.shape[i + 2]:
for t in range(rr):
m = mult.narrow(i + 2, area[i] - 1 - t, 1)
- m *= ((1.0/rr) * (t + 1))
+ m *= ((1.0 / rr) * (t + 1))
conditioning = {}
model_conds = conds["model_conds"]
@@ -739,25 +750,37 @@ def resolve_areas_and_cond_masks(conditions, h, w, device):
logging.warning("WARNING: The comfy.samplers.resolve_areas_and_cond_masks function is deprecated please use the resolve_areas_and_cond_masks_multidim one instead.")
return resolve_areas_and_cond_masks_multidim(conditions, [h, w], device)
-def create_cond_with_same_area_if_none(conds, c): #TODO: handle dim != 2
+def create_cond_with_same_area_if_none(conds, c):
if 'area' not in c:
return
+ def area_inside(a, area_cmp):
+ a = add_area_dims(a, len(area_cmp) // 2)
+ area_cmp = add_area_dims(area_cmp, len(a) // 2)
+
+ a_l = len(a) // 2
+ area_cmp_l = len(area_cmp) // 2
+ for i in range(min(a_l, area_cmp_l)):
+ if a[a_l + i] < area_cmp[area_cmp_l + i]:
+ return False
+ for i in range(min(a_l, area_cmp_l)):
+ if (a[i] + a[a_l + i]) > (area_cmp[i] + area_cmp[area_cmp_l + i]):
+ return False
+ return True
+
c_area = c['area']
smallest = None
for x in conds:
if 'area' in x:
a = x['area']
- if c_area[2] >= a[2] and c_area[3] >= a[3]:
- if a[0] + a[2] >= c_area[0] + c_area[2]:
- if a[1] + a[3] >= c_area[1] + c_area[3]:
- if smallest is None:
- smallest = x
- elif 'area' not in smallest:
- smallest = x
- else:
- if smallest['area'][0] * smallest['area'][1] > a[0] * a[1]:
- smallest = x
+ if area_inside(c_area, a):
+ if smallest is None:
+ smallest = x
+ elif 'area' not in smallest:
+ smallest = x
+ else:
+ if math.prod(smallest['area'][:len(smallest['area']) // 2]) > math.prod(a[:len(a) // 2]):
+ smallest = x
else:
if smallest is None:
smallest = x
diff --git a/comfy/sd.py b/comfy/sd.py
index eabf0bda..21913cf3 100644
--- a/comfy/sd.py
+++ b/comfy/sd.py
@@ -12,6 +12,7 @@ from .ldm.audio.autoencoder import AudioOobleckVAE
import comfy.ldm.genmo.vae.model
import comfy.ldm.lightricks.vae.causal_video_autoencoder
import comfy.ldm.cosmos.vae
+import comfy.ldm.wan.vae
import yaml
import math
@@ -37,6 +38,7 @@ import comfy.text_encoders.lt
import comfy.text_encoders.hunyuan_video
import comfy.text_encoders.cosmos
import comfy.text_encoders.lumina2
+import comfy.text_encoders.wan
import comfy.model_patcher
import comfy.lora
@@ -392,6 +394,18 @@ class VAE:
self.memory_used_decode = lambda shape, dtype: (50 * shape[2] * shape[3] * shape[4] * (8 * 8 * 8)) * model_management.dtype_size(dtype)
self.memory_used_encode = lambda shape, dtype: (50 * (round((shape[2] + 7) / 8) * 8) * shape[3] * shape[4]) * model_management.dtype_size(dtype)
self.working_dtypes = [torch.bfloat16, torch.float32]
+ elif "decoder.middle.0.residual.0.gamma" in sd:
+ self.upscale_ratio = (lambda a: max(0, a * 4 - 3), 8, 8)
+ self.upscale_index_formula = (4, 8, 8)
+ self.downscale_ratio = (lambda a: max(0, math.floor((a + 3) / 4)), 8, 8)
+ self.downscale_index_formula = (4, 8, 8)
+ self.latent_dim = 3
+ self.latent_channels = 16
+ ddconfig = {"dim": 96, "z_dim": self.latent_channels, "dim_mult": [1, 2, 4, 4], "num_res_blocks": 2, "attn_scales": [], "temperal_downsample": [False, True, True], "dropout": 0.0}
+ self.first_stage_model = comfy.ldm.wan.vae.WanVAE(**ddconfig)
+ self.working_dtypes = [torch.bfloat16, torch.float16, torch.float32]
+ self.memory_used_encode = lambda shape, dtype: 6000 * shape[3] * shape[4] * model_management.dtype_size(dtype)
+ self.memory_used_decode = lambda shape, dtype: 7000 * shape[3] * shape[4] * (8 * 8) * model_management.dtype_size(dtype)
else:
logging.warning("WARNING: No VAE weights detected, VAE not initalized.")
self.first_stage_model = None
@@ -659,6 +673,7 @@ class CLIPType(Enum):
PIXART = 10
COSMOS = 11
LUMINA2 = 12
+ WAN = 13
def load_clip(ckpt_paths, embedding_directory=None, clip_type=CLIPType.STABLE_DIFFUSION, model_options={}):
@@ -763,6 +778,10 @@ def load_text_encoder_state_dicts(state_dicts=[], embedding_directory=None, clip
elif clip_type == CLIPType.PIXART:
clip_target.clip = comfy.text_encoders.pixart_t5.pixart_te(**t5xxl_detect(clip_data))
clip_target.tokenizer = comfy.text_encoders.pixart_t5.PixArtTokenizer
+ elif clip_type == CLIPType.WAN:
+ clip_target.clip = comfy.text_encoders.wan.te(**t5xxl_detect(clip_data))
+ clip_target.tokenizer = comfy.text_encoders.wan.WanT5Tokenizer
+ tokenizer_data["spiece_model"] = clip_data[0].get("spiece_model", None)
else: #CLIPType.MOCHI
clip_target.clip = comfy.text_encoders.genmo.mochi_te(**t5xxl_detect(clip_data))
clip_target.tokenizer = comfy.text_encoders.genmo.MochiT5Tokenizer
@@ -877,14 +896,14 @@ def load_state_dict_guess_config(sd, output_vae=True, output_clip=True, output_c
return None
unet_weight_dtype = list(model_config.supported_inference_dtypes)
- if weight_dtype is not None and model_config.scaled_fp8 is None:
- unet_weight_dtype.append(weight_dtype)
+ if model_config.scaled_fp8 is not None:
+ weight_dtype = None
model_config.custom_operations = model_options.get("custom_operations", None)
unet_dtype = model_options.get("dtype", model_options.get("weight_dtype", None))
if unet_dtype is None:
- unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=unet_weight_dtype)
+ unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=unet_weight_dtype, weight_dtype=weight_dtype)
manual_cast_dtype = model_management.unet_manual_cast(unet_dtype, load_device, model_config.supported_inference_dtypes)
model_config.set_inference_dtype(unet_dtype, manual_cast_dtype)
@@ -975,11 +994,11 @@ def load_diffusion_model_state_dict(sd, model_options={}): #load unet in diffuse
offload_device = model_management.unet_offload_device()
unet_weight_dtype = list(model_config.supported_inference_dtypes)
- if weight_dtype is not None and model_config.scaled_fp8 is None:
- unet_weight_dtype.append(weight_dtype)
+ if model_config.scaled_fp8 is not None:
+ weight_dtype = None
if dtype is None:
- unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=unet_weight_dtype)
+ unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=unet_weight_dtype, weight_dtype=weight_dtype)
else:
unet_dtype = dtype
diff --git a/comfy/supported_models.py b/comfy/supported_models.py
index 7aa15248..a8212c1f 100644
--- a/comfy/supported_models.py
+++ b/comfy/supported_models.py
@@ -16,6 +16,7 @@ import comfy.text_encoders.lt
import comfy.text_encoders.hunyuan_video
import comfy.text_encoders.cosmos
import comfy.text_encoders.lumina2
+import comfy.text_encoders.wan
from . import supported_models_base
from . import latent_formats
@@ -895,6 +896,49 @@ class Lumina2(supported_models_base.BASE):
hunyuan_detect = comfy.text_encoders.hunyuan_video.llama_detect(state_dict, "{}gemma2_2b.transformer.".format(pref))
return supported_models_base.ClipTarget(comfy.text_encoders.lumina2.LuminaTokenizer, comfy.text_encoders.lumina2.te(**hunyuan_detect))
-models = [Stable_Zero123, SD15_instructpix2pix, SD15, SD20, SD21UnclipL, SD21UnclipH, SDXL_instructpix2pix, SDXLRefiner, SDXL, SSD1B, KOALA_700M, KOALA_1B, Segmind_Vega, SD_X4Upscaler, Stable_Cascade_C, Stable_Cascade_B, SV3D_u, SV3D_p, SD3, StableAudio, AuraFlow, PixArtAlpha, PixArtSigma, HunyuanDiT, HunyuanDiT1, FluxInpaint, Flux, FluxSchnell, GenmoMochi, LTXV, HunyuanVideo, CosmosT2V, CosmosI2V, Lumina2]
+class WAN21_T2V(supported_models_base.BASE):
+ unet_config = {
+ "image_model": "wan2.1",
+ "model_type": "t2v",
+ }
+
+ sampling_settings = {
+ "shift": 8.0,
+ }
+
+ unet_extra_config = {}
+ latent_format = latent_formats.Wan21
+
+ memory_usage_factor = 1.0
+
+ supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32]
+
+ vae_key_prefix = ["vae."]
+ text_encoder_key_prefix = ["text_encoders."]
+
+ def __init__(self, unet_config):
+ super().__init__(unet_config)
+ self.memory_usage_factor = self.unet_config.get("dim", 2000) / 2000
+
+ def get_model(self, state_dict, prefix="", device=None):
+ out = model_base.WAN21(self, device=device)
+ return out
+
+ def clip_target(self, state_dict={}):
+ pref = self.text_encoder_key_prefix[0]
+ t5_detect = comfy.text_encoders.sd3_clip.t5_xxl_detect(state_dict, "{}umt5xxl.transformer.".format(pref))
+ return supported_models_base.ClipTarget(comfy.text_encoders.wan.WanT5Tokenizer, comfy.text_encoders.wan.te(**t5_detect))
+
+class WAN21_I2V(WAN21_T2V):
+ unet_config = {
+ "image_model": "wan2.1",
+ "model_type": "i2v",
+ }
+
+ def get_model(self, state_dict, prefix="", device=None):
+ out = model_base.WAN21(self, image_to_video=True, device=device)
+ return out
+
+models = [Stable_Zero123, SD15_instructpix2pix, SD15, SD20, SD21UnclipL, SD21UnclipH, SDXL_instructpix2pix, SDXLRefiner, SDXL, SSD1B, KOALA_700M, KOALA_1B, Segmind_Vega, SD_X4Upscaler, Stable_Cascade_C, Stable_Cascade_B, SV3D_u, SV3D_p, SD3, StableAudio, AuraFlow, PixArtAlpha, PixArtSigma, HunyuanDiT, HunyuanDiT1, FluxInpaint, Flux, FluxSchnell, GenmoMochi, LTXV, HunyuanVideo, CosmosT2V, CosmosI2V, Lumina2, WAN21_T2V, WAN21_I2V]
models += [SVD_img2vid]
diff --git a/comfy/text_encoders/lumina2.py b/comfy/text_encoders/lumina2.py
index 166d1328..a7b1d702 100644
--- a/comfy/text_encoders/lumina2.py
+++ b/comfy/text_encoders/lumina2.py
@@ -19,11 +19,6 @@ class LuminaTokenizer(sd1_clip.SD1Tokenizer):
class Gemma2_2BModel(sd1_clip.SDClipModel):
def __init__(self, device="cpu", layer="hidden", layer_idx=-2, dtype=None, attention_mask=True, model_options={}):
- llama_scaled_fp8 = model_options.get("llama_scaled_fp8", None)
- if llama_scaled_fp8 is not None:
- model_options = model_options.copy()
- model_options["scaled_fp8"] = llama_scaled_fp8
-
super().__init__(device=device, layer=layer, layer_idx=layer_idx, textmodel_json_config={}, dtype=dtype, special_tokens={"start": 2, "pad": 0}, layer_norm_hidden_state=False, model_class=comfy.text_encoders.llama.Gemma2_2B, enable_attention_masks=attention_mask, return_attention_masks=attention_mask, model_options=model_options)
@@ -35,10 +30,10 @@ class LuminaModel(sd1_clip.SD1ClipModel):
def te(dtype_llama=None, llama_scaled_fp8=None):
class LuminaTEModel_(LuminaModel):
def __init__(self, device="cpu", dtype=None, model_options={}):
- if llama_scaled_fp8 is not None and "llama_scaled_fp8" not in model_options:
+ if llama_scaled_fp8 is not None and "scaled_fp8" not in model_options:
model_options = model_options.copy()
- model_options["llama_scaled_fp8"] = llama_scaled_fp8
- if dtype_llama is not None:
- dtype = dtype_llama
+ model_options["scaled_fp8"] = llama_scaled_fp8
+ if dtype_llama is not None:
+ dtype = dtype_llama
super().__init__(device=device, dtype=dtype, model_options=model_options)
return LuminaTEModel_
diff --git a/comfy/text_encoders/umt5_config_xxl.json b/comfy/text_encoders/umt5_config_xxl.json
new file mode 100644
index 00000000..dfcb4b54
--- /dev/null
+++ b/comfy/text_encoders/umt5_config_xxl.json
@@ -0,0 +1,22 @@
+{
+ "d_ff": 10240,
+ "d_kv": 64,
+ "d_model": 4096,
+ "decoder_start_token_id": 0,
+ "dropout_rate": 0.1,
+ "eos_token_id": 1,
+ "dense_act_fn": "gelu_pytorch_tanh",
+ "initializer_factor": 1.0,
+ "is_encoder_decoder": true,
+ "is_gated_act": true,
+ "layer_norm_epsilon": 1e-06,
+ "model_type": "umt5",
+ "num_decoder_layers": 24,
+ "num_heads": 64,
+ "num_layers": 24,
+ "output_past": true,
+ "pad_token_id": 0,
+ "relative_attention_num_buckets": 32,
+ "tie_word_embeddings": false,
+ "vocab_size": 256384
+}
diff --git a/comfy/text_encoders/wan.py b/comfy/text_encoders/wan.py
new file mode 100644
index 00000000..971ac8fa
--- /dev/null
+++ b/comfy/text_encoders/wan.py
@@ -0,0 +1,37 @@
+from comfy import sd1_clip
+from .spiece_tokenizer import SPieceTokenizer
+import comfy.text_encoders.t5
+import os
+
+class UMT5XXlModel(sd1_clip.SDClipModel):
+ def __init__(self, device="cpu", layer="last", layer_idx=None, dtype=None, model_options={}):
+ textmodel_json_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "umt5_config_xxl.json")
+ super().__init__(device=device, layer=layer, layer_idx=layer_idx, textmodel_json_config=textmodel_json_config, dtype=dtype, special_tokens={"end": 1, "pad": 0}, model_class=comfy.text_encoders.t5.T5, enable_attention_masks=True, zero_out_masked=True, model_options=model_options)
+
+class UMT5XXlTokenizer(sd1_clip.SDTokenizer):
+ def __init__(self, embedding_directory=None, tokenizer_data={}):
+ tokenizer = tokenizer_data.get("spiece_model", None)
+ super().__init__(tokenizer, pad_with_end=False, embedding_size=4096, embedding_key='umt5xxl', tokenizer_class=SPieceTokenizer, has_start_token=False, pad_to_max_length=False, max_length=99999999, min_length=512, pad_token=0)
+
+ def state_dict(self):
+ return {"spiece_model": self.tokenizer.serialize_model()}
+
+
+class WanT5Tokenizer(sd1_clip.SD1Tokenizer):
+ def __init__(self, embedding_directory=None, tokenizer_data={}):
+ super().__init__(embedding_directory=embedding_directory, tokenizer_data=tokenizer_data, clip_name="umt5xxl", tokenizer=UMT5XXlTokenizer)
+
+class WanT5Model(sd1_clip.SD1ClipModel):
+ def __init__(self, device="cpu", dtype=None, model_options={}, **kwargs):
+ super().__init__(device=device, dtype=dtype, model_options=model_options, name="umt5xxl", clip_model=UMT5XXlModel, **kwargs)
+
+def te(dtype_t5=None, t5xxl_scaled_fp8=None):
+ class WanTEModel(WanT5Model):
+ def __init__(self, device="cpu", dtype=None, model_options={}):
+ if t5xxl_scaled_fp8 is not None and "scaled_fp8" not in model_options:
+ model_options = model_options.copy()
+ model_options["scaled_fp8"] = t5xxl_scaled_fp8
+ if dtype_t5 is not None:
+ dtype = dtype_t5
+ super().__init__(device=device, dtype=dtype, model_options=model_options)
+ return WanTEModel
diff --git a/comfy_extras/nodes_video.py b/comfy_extras/nodes_video.py
index f3922e03..53920ba1 100644
--- a/comfy_extras/nodes_video.py
+++ b/comfy_extras/nodes_video.py
@@ -59,6 +59,7 @@ class SaveWEBM:
frame = av.VideoFrame.from_ndarray(torch.clamp(frame[..., :3] * 255, min=0, max=255).to(device=torch.device("cpu"), dtype=torch.uint8).numpy(), format="rgb24")
for packet in stream.encode(frame):
container.mux(packet)
+ container.mux(stream.encode())
container.close()
results = [{
diff --git a/comfy_extras/nodes_video_model.py b/comfy_extras/nodes_video_model.py
index e7a7ec18..0f760aa2 100644
--- a/comfy_extras/nodes_video_model.py
+++ b/comfy_extras/nodes_video_model.py
@@ -4,6 +4,7 @@ import comfy.utils
import comfy.sd
import folder_paths
import comfy_extras.nodes_model_merging
+import node_helpers
class ImageOnlyCheckpointLoader:
@@ -121,12 +122,38 @@ class ImageOnlyCheckpointSave(comfy_extras.nodes_model_merging.CheckpointSave):
comfy_extras.nodes_model_merging.save_checkpoint(model, clip_vision=clip_vision, vae=vae, filename_prefix=filename_prefix, output_dir=self.output_dir, prompt=prompt, extra_pnginfo=extra_pnginfo)
return {}
+
+class ConditioningSetAreaPercentageVideo:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"conditioning": ("CONDITIONING", ),
+ "width": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "height": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "temporal": ("FLOAT", {"default": 1.0, "min": 0, "max": 1.0, "step": 0.01}),
+ "x": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "y": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "z": ("FLOAT", {"default": 0, "min": 0, "max": 1.0, "step": 0.01}),
+ "strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
+ }}
+ RETURN_TYPES = ("CONDITIONING",)
+ FUNCTION = "append"
+
+ CATEGORY = "conditioning"
+
+ def append(self, conditioning, width, height, temporal, x, y, z, strength):
+ c = node_helpers.conditioning_set_values(conditioning, {"area": ("percentage", temporal, height, width, z, y, x),
+ "strength": strength,
+ "set_area_to_bounds": False})
+ return (c, )
+
+
NODE_CLASS_MAPPINGS = {
"ImageOnlyCheckpointLoader": ImageOnlyCheckpointLoader,
"SVD_img2vid_Conditioning": SVD_img2vid_Conditioning,
"VideoLinearCFGGuidance": VideoLinearCFGGuidance,
"VideoTriangleCFGGuidance": VideoTriangleCFGGuidance,
"ImageOnlyCheckpointSave": ImageOnlyCheckpointSave,
+ "ConditioningSetAreaPercentageVideo": ConditioningSetAreaPercentageVideo,
}
NODE_DISPLAY_NAME_MAPPINGS = {
diff --git a/comfy_extras/nodes_wan.py b/comfy_extras/nodes_wan.py
new file mode 100644
index 00000000..dc30eb54
--- /dev/null
+++ b/comfy_extras/nodes_wan.py
@@ -0,0 +1,54 @@
+import nodes
+import node_helpers
+import torch
+import comfy.model_management
+import comfy.utils
+
+
+class WanImageToVideo:
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {"positive": ("CONDITIONING", ),
+ "negative": ("CONDITIONING", ),
+ "vae": ("VAE", ),
+ "width": ("INT", {"default": 832, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}),
+ "height": ("INT", {"default": 480, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}),
+ "length": ("INT", {"default": 81, "min": 1, "max": nodes.MAX_RESOLUTION, "step": 4}),
+ "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096}),
+ },
+ "optional": {"clip_vision_output": ("CLIP_VISION_OUTPUT", ),
+ "start_image": ("IMAGE", ),
+ }}
+
+ RETURN_TYPES = ("CONDITIONING", "CONDITIONING", "LATENT")
+ RETURN_NAMES = ("positive", "negative", "latent")
+ FUNCTION = "encode"
+
+ CATEGORY = "conditioning/video_models"
+
+ def encode(self, positive, negative, vae, width, height, length, batch_size, start_image=None, clip_vision_output=None):
+ latent = torch.zeros([batch_size, 16, ((length - 1) // 4) + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device())
+ if start_image is not None:
+ start_image = comfy.utils.common_upscale(start_image[:length].movedim(-1, 1), width, height, "bilinear", "center").movedim(1, -1)
+ image = torch.ones((length, height, width, start_image.shape[-1]), device=start_image.device, dtype=start_image.dtype) * 0.5
+ image[:start_image.shape[0]] = start_image
+
+ concat_latent_image = vae.encode(image[:, :, :, :3])
+ mask = torch.ones((1, 1, latent.shape[2], concat_latent_image.shape[-2], concat_latent_image.shape[-1]), device=start_image.device, dtype=start_image.dtype)
+ mask[:, :, :((start_image.shape[0] - 1) // 4) + 1] = 0.0
+
+ positive = node_helpers.conditioning_set_values(positive, {"concat_latent_image": concat_latent_image, "concat_mask": mask})
+ negative = node_helpers.conditioning_set_values(negative, {"concat_latent_image": concat_latent_image, "concat_mask": mask})
+
+ if clip_vision_output is not None:
+ positive = node_helpers.conditioning_set_values(positive, {"clip_vision_output": clip_vision_output})
+ negative = node_helpers.conditioning_set_values(negative, {"clip_vision_output": clip_vision_output})
+
+ out_latent = {}
+ out_latent["samples"] = latent
+ return (positive, negative, out_latent)
+
+
+NODE_CLASS_MAPPINGS = {
+ "WanImageToVideo": WanImageToVideo,
+}
diff --git a/comfyui_version.py b/comfyui_version.py
index fc7bb1df..5ded466a 100644
--- a/comfyui_version.py
+++ b/comfyui_version.py
@@ -1,3 +1,3 @@
# This file is automatically generated by the build process when version is
# updated in pyproject.toml.
-__version__ = "0.3.15"
+__version__ = "0.3.19"
diff --git a/nodes.py b/nodes.py
index ecf43252..34ea2b82 100644
--- a/nodes.py
+++ b/nodes.py
@@ -914,7 +914,7 @@ class CLIPLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
- "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2"], ),
+ "type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2", "wan"], ),
},
"optional": {
"device": (["default", "cpu"], {"advanced": True}),
@@ -924,7 +924,7 @@ class CLIPLoader:
CATEGORY = "advanced/loaders"
- DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 / clip-g / clip-l\nstable_audio: t5\nmochi: t5\ncosmos: old t5 xxl\nlumina2: gemma 2 2B"
+ DESCRIPTION = "[Recipes]\n\nstable_diffusion: clip-l\nstable_cascade: clip-g\nsd3: t5 xxl/ clip-g / clip-l\nstable_audio: t5 base\nmochi: t5 xxl\ncosmos: old t5 xxl\nlumina2: gemma 2 2B\nwan: umt5 xxl"
def load_clip(self, clip_name, type="stable_diffusion", device="default"):
if type == "stable_cascade":
@@ -943,6 +943,8 @@ class CLIPLoader:
clip_type = comfy.sd.CLIPType.COSMOS
elif type == "lumina2":
clip_type = comfy.sd.CLIPType.LUMINA2
+ elif type == "wan":
+ clip_type = comfy.sd.CLIPType.WAN
else:
clip_type = comfy.sd.CLIPType.STABLE_DIFFUSION
@@ -2268,6 +2270,7 @@ def init_builtin_extra_nodes():
"nodes_cosmos.py",
"nodes_video.py",
"nodes_lumina2.py",
+ "nodes_wan.py",
]
import_failed = []
diff --git a/pyproject.toml b/pyproject.toml
index 877ae4d7..444a1efc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "ComfyUI"
-version = "0.3.15"
+version = "0.3.19"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
diff --git a/requirements.txt b/requirements.txt
index afbcb7cb..4ad5f3b8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
+comfyui-frontend-package==1.10.17
torch
torchsde
torchvision
diff --git a/web/assets/BaseViewTemplate-BTbuZf5t.js b/web/assets/BaseViewTemplate-BTbuZf5t.js
deleted file mode 100644
index d7f9e402..00000000
--- a/web/assets/BaseViewTemplate-BTbuZf5t.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import { d as defineComponent, T as ref, p as onMounted, b8 as isElectron, V as nextTick, b9 as electronAPI, o as openBlock, f as createElementBlock, i as withDirectives, v as vShow, j as unref, ba as isNativeWindow, m as createBaseVNode, A as renderSlot, aj as normalizeClass } from "./index-Bv0b06LE.js";
-const _hoisted_1 = { class: "flex-grow w-full flex items-center justify-center overflow-auto" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "BaseViewTemplate",
- props: {
- dark: { type: Boolean, default: false }
- },
- setup(__props) {
- const props = __props;
- const darkTheme = {
- color: "rgba(0, 0, 0, 0)",
- symbolColor: "#d4d4d4"
- };
- const lightTheme = {
- color: "rgba(0, 0, 0, 0)",
- symbolColor: "#171717"
- };
- const topMenuRef = ref(null);
- onMounted(async () => {
- if (isElectron()) {
- await nextTick();
- electronAPI().changeTheme({
- ...props.dark ? darkTheme : lightTheme,
- height: topMenuRef.value.getBoundingClientRect().height
- });
- }
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", {
- class: normalizeClass(["font-sans w-screen h-screen flex flex-col", [
- props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300"
- ]])
- }, [
- withDirectives(createBaseVNode("div", {
- ref_key: "topMenuRef",
- ref: topMenuRef,
- class: "app-drag w-full h-[var(--comfy-topbar-height)]"
- }, null, 512), [
- [vShow, unref(isNativeWindow)()]
- ]),
- createBaseVNode("div", _hoisted_1, [
- renderSlot(_ctx.$slots, "default")
- ])
- ], 2);
- };
- }
-});
-export {
- _sfc_main as _
-};
-//# sourceMappingURL=BaseViewTemplate-BTbuZf5t.js.map
diff --git a/web/assets/CREDIT.txt b/web/assets/CREDIT.txt
deleted file mode 100644
index b3a9bc90..00000000
--- a/web/assets/CREDIT.txt
+++ /dev/null
@@ -1 +0,0 @@
-Thanks to OpenArt (https://openart.ai) for providing the sorted-custom-node-map data, captured in September 2024.
\ No newline at end of file
diff --git a/web/assets/DesktopStartView-D9r53Bue.js b/web/assets/DesktopStartView-D9r53Bue.js
deleted file mode 100644
index 744682ec..00000000
--- a/web/assets/DesktopStartView-D9r53Bue.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { d as defineComponent, o as openBlock, y as createBlock, z as withCtx, k as createVNode, j as unref, bE as script } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "DesktopStartView",
- setup(__props) {
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
- default: withCtx(() => [
- createVNode(unref(script), { class: "m-8 w-48 h-48" })
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=DesktopStartView-D9r53Bue.js.map
diff --git a/web/assets/DesktopUpdateView-C-R0415K.js b/web/assets/DesktopUpdateView-C-R0415K.js
deleted file mode 100644
index 8de7eee9..00000000
--- a/web/assets/DesktopUpdateView-C-R0415K.js
+++ /dev/null
@@ -1,58 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, T as ref, d8 as onUnmounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, j as unref, bg as t, k as createVNode, bE as script, l as script$1, b9 as electronAPI, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { s as script$2 } from "./index-A_bXPJCN.js";
-import { _ as _sfc_main$1 } from "./TerminalOutputDrawer-CKr7Br7O.js";
-import { _ as _sfc_main$2 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = { class: "h-screen w-screen grid items-center justify-around overflow-y-auto" };
-const _hoisted_2 = { class: "relative m-8 text-center" };
-const _hoisted_3 = { class: "download-bg pi-download text-4xl font-bold" };
-const _hoisted_4 = { class: "m-8" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "DesktopUpdateView",
- setup(__props) {
- const electron = electronAPI();
- const terminalVisible = ref(false);
- const toggleConsoleDrawer = /* @__PURE__ */ __name(() => {
- terminalVisible.value = !terminalVisible.value;
- }, "toggleConsoleDrawer");
- onUnmounted(() => electron.Validation.dispose());
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$2, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("div", _hoisted_2, [
- createBaseVNode("h1", _hoisted_3, toDisplayString(unref(t)("desktopUpdate.title")), 1),
- createBaseVNode("div", _hoisted_4, [
- createBaseVNode("span", null, toDisplayString(unref(t)("desktopUpdate.description")), 1)
- ]),
- createVNode(unref(script), { class: "m-8 w-48 h-48" }),
- createVNode(unref(script$1), {
- style: { "transform": "translateX(-50%)" },
- class: "fixed bottom-0 left-1/2 my-8",
- label: unref(t)("maintenance.consoleLogs"),
- icon: "pi pi-desktop",
- "icon-pos": "left",
- severity: "secondary",
- onClick: toggleConsoleDrawer
- }, null, 8, ["label"]),
- createVNode(_sfc_main$1, {
- modelValue: terminalVisible.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => terminalVisible.value = $event),
- header: unref(t)("g.terminal"),
- "default-message": unref(t)("desktopUpdate.terminalDefaultMessage")
- }, null, 8, ["modelValue", "header", "default-message"])
- ])
- ]),
- createVNode(unref(script$2))
- ]),
- _: 1
- });
- };
- }
-});
-const DesktopUpdateView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8d77828d"]]);
-export {
- DesktopUpdateView as default
-};
-//# sourceMappingURL=DesktopUpdateView-C-R0415K.js.map
diff --git a/web/assets/DesktopUpdateView-CxchaIvw.css b/web/assets/DesktopUpdateView-CxchaIvw.css
deleted file mode 100644
index e85cbfae..00000000
--- a/web/assets/DesktopUpdateView-CxchaIvw.css
+++ /dev/null
@@ -1,20 +0,0 @@
-
-.download-bg[data-v-8d77828d]::before {
- position: absolute;
- margin: 0px;
- color: var(--p-text-muted-color);
- font-family: 'primeicons';
- top: -2rem;
- right: 2rem;
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
- display: inline-block;
- -webkit-font-smoothing: antialiased;
- opacity: 0.02;
- font-size: min(14rem, 90vw);
- z-index: 0
-}
diff --git a/web/assets/DownloadGitView-PWqK5ke4.js b/web/assets/DownloadGitView-PWqK5ke4.js
deleted file mode 100644
index 2128466d..00000000
--- a/web/assets/DownloadGitView-PWqK5ke4.js
+++ /dev/null
@@ -1,58 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, bi as useRouter } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" };
-const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" };
-const _hoisted_3 = { class: "space-y-4" };
-const _hoisted_4 = { class: "text-xl" };
-const _hoisted_5 = { class: "text-xl" };
-const _hoisted_6 = { class: "text-m" };
-const _hoisted_7 = { class: "flex gap-4 flex-row-reverse" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "DownloadGitView",
- setup(__props) {
- const openGitDownloads = /* @__PURE__ */ __name(() => {
- window.open("https://git-scm.com/downloads/", "_blank");
- }, "openGitDownloads");
- const skipGit = /* @__PURE__ */ __name(() => {
- console.warn("pushing");
- const router = useRouter();
- router.push("install");
- }, "skipGit");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, null, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("downloadGit.title")), 1),
- createBaseVNode("div", _hoisted_3, [
- createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("downloadGit.message")), 1),
- createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("downloadGit.instructions")), 1),
- createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("downloadGit.warning")), 1)
- ]),
- createBaseVNode("div", _hoisted_7, [
- createVNode(unref(script), {
- label: _ctx.$t("downloadGit.gitWebsite"),
- icon: "pi pi-external-link",
- "icon-pos": "right",
- onClick: openGitDownloads,
- severity: "primary"
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- label: _ctx.$t("downloadGit.skip"),
- icon: "pi pi-exclamation-triangle",
- onClick: skipGit,
- severity: "secondary"
- }, null, 8, ["label"])
- ])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=DownloadGitView-PWqK5ke4.js.map
diff --git a/web/assets/ExtensionPanel-Ba57xrmg.js b/web/assets/ExtensionPanel-Ba57xrmg.js
deleted file mode 100644
index 575b6d5b..00000000
--- a/web/assets/ExtensionPanel-Ba57xrmg.js
+++ /dev/null
@@ -1,182 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, T as ref, dx as FilterMatchMode, dC as useExtensionStore, a as useSettingStore, p as onMounted, c as computed, o as openBlock, y as createBlock, z as withCtx, k as createVNode, dy as SearchBox, j as unref, bn as script, m as createBaseVNode, f as createElementBlock, D as renderList, E as toDisplayString, a8 as createTextVNode, F as Fragment, l as script$1, B as createCommentVNode, a5 as script$3, ay as script$4, br as script$5, dz as _sfc_main$1 } from "./index-Bv0b06LE.js";
-import { g as script$2, h as script$6 } from "./index-CgMyWf7n.js";
-import "./index-Dzu9WL4p.js";
-const _hoisted_1 = { class: "flex justify-end" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "ExtensionPanel",
- setup(__props) {
- const filters = ref({
- global: { value: "", matchMode: FilterMatchMode.CONTAINS }
- });
- const extensionStore = useExtensionStore();
- const settingStore = useSettingStore();
- const editingEnabledExtensions = ref({});
- onMounted(() => {
- extensionStore.extensions.forEach((ext) => {
- editingEnabledExtensions.value[ext.name] = extensionStore.isExtensionEnabled(ext.name);
- });
- });
- const changedExtensions = computed(() => {
- return extensionStore.extensions.filter(
- (ext) => editingEnabledExtensions.value[ext.name] !== extensionStore.isExtensionEnabled(ext.name)
- );
- });
- const hasChanges = computed(() => {
- return changedExtensions.value.length > 0;
- });
- const updateExtensionStatus = /* @__PURE__ */ __name(() => {
- const editingDisabledExtensionNames = Object.entries(
- editingEnabledExtensions.value
- ).filter(([_, enabled]) => !enabled).map(([name]) => name);
- settingStore.set("Comfy.Extension.Disabled", [
- ...extensionStore.inactiveDisabledExtensionNames,
- ...editingDisabledExtensionNames
- ]);
- }, "updateExtensionStatus");
- const enableAllExtensions = /* @__PURE__ */ __name(() => {
- extensionStore.extensions.forEach((ext) => {
- if (extensionStore.isExtensionReadOnly(ext.name)) return;
- editingEnabledExtensions.value[ext.name] = true;
- });
- updateExtensionStatus();
- }, "enableAllExtensions");
- const disableAllExtensions = /* @__PURE__ */ __name(() => {
- extensionStore.extensions.forEach((ext) => {
- if (extensionStore.isExtensionReadOnly(ext.name)) return;
- editingEnabledExtensions.value[ext.name] = false;
- });
- updateExtensionStatus();
- }, "disableAllExtensions");
- const disableThirdPartyExtensions = /* @__PURE__ */ __name(() => {
- extensionStore.extensions.forEach((ext) => {
- if (extensionStore.isCoreExtension(ext.name)) return;
- editingEnabledExtensions.value[ext.name] = false;
- });
- updateExtensionStatus();
- }, "disableThirdPartyExtensions");
- const applyChanges = /* @__PURE__ */ __name(() => {
- window.location.reload();
- }, "applyChanges");
- const menu = ref();
- const contextMenuItems = [
- {
- label: "Enable All",
- icon: "pi pi-check",
- command: enableAllExtensions
- },
- {
- label: "Disable All",
- icon: "pi pi-times",
- command: disableAllExtensions
- },
- {
- label: "Disable 3rd Party",
- icon: "pi pi-times",
- command: disableThirdPartyExtensions,
- disabled: !extensionStore.hasThirdPartyExtensions
- }
- ];
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, {
- value: "Extension",
- class: "extension-panel"
- }, {
- header: withCtx(() => [
- createVNode(SearchBox, {
- modelValue: filters.value["global"].value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event),
- placeholder: _ctx.$t("g.searchExtensions") + "..."
- }, null, 8, ["modelValue", "placeholder"]),
- hasChanges.value ? (openBlock(), createBlock(unref(script), {
- key: 0,
- severity: "info",
- "pt:text": "w-full",
- class: "max-h-96 overflow-y-auto"
- }, {
- default: withCtx(() => [
- createBaseVNode("ul", null, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(changedExtensions.value, (ext) => {
- return openBlock(), createElementBlock("li", {
- key: ext.name
- }, [
- createBaseVNode("span", null, toDisplayString(unref(extensionStore).isExtensionEnabled(ext.name) ? "[-]" : "[+]"), 1),
- createTextVNode(" " + toDisplayString(ext.name), 1)
- ]);
- }), 128))
- ]),
- createBaseVNode("div", _hoisted_1, [
- createVNode(unref(script$1), {
- label: _ctx.$t("g.reloadToApplyChanges"),
- onClick: applyChanges,
- outlined: "",
- severity: "danger"
- }, null, 8, ["label"])
- ])
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ]),
- default: withCtx(() => [
- createVNode(unref(script$6), {
- value: unref(extensionStore).extensions,
- stripedRows: "",
- size: "small",
- filters: filters.value
- }, {
- default: withCtx(() => [
- createVNode(unref(script$2), {
- header: _ctx.$t("g.extensionName"),
- sortable: "",
- field: "name"
- }, {
- body: withCtx((slotProps) => [
- createTextVNode(toDisplayString(slotProps.data.name) + " ", 1),
- unref(extensionStore).isCoreExtension(slotProps.data.name) ? (openBlock(), createBlock(unref(script$3), {
- key: 0,
- value: "Core"
- })) : createCommentVNode("", true)
- ]),
- _: 1
- }, 8, ["header"]),
- createVNode(unref(script$2), { pt: {
- headerCell: "flex items-center justify-end",
- bodyCell: "flex items-center justify-end"
- } }, {
- header: withCtx(() => [
- createVNode(unref(script$1), {
- icon: "pi pi-ellipsis-h",
- text: "",
- severity: "secondary",
- onClick: _cache[1] || (_cache[1] = ($event) => menu.value.show($event))
- }),
- createVNode(unref(script$4), {
- ref_key: "menu",
- ref: menu,
- model: contextMenuItems
- }, null, 512)
- ]),
- body: withCtx((slotProps) => [
- createVNode(unref(script$5), {
- disabled: unref(extensionStore).isExtensionReadOnly(slotProps.data.name),
- modelValue: editingEnabledExtensions.value[slotProps.data.name],
- "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => editingEnabledExtensions.value[slotProps.data.name] = $event, "onUpdate:modelValue"),
- onChange: updateExtensionStatus
- }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"])
- ]),
- _: 1
- })
- ]),
- _: 1
- }, 8, ["value", "filters"])
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=ExtensionPanel-Ba57xrmg.js.map
diff --git a/web/assets/GraphView-B_UDZi95.js b/web/assets/GraphView-B_UDZi95.js
deleted file mode 100644
index dc655470..00000000
--- a/web/assets/GraphView-B_UDZi95.js
+++ /dev/null
@@ -1,4919 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createVNode, s as showNativeMenu, l as script, m as createBaseVNode, n as normalizeStyle, _ as _export_sfc, p as onMounted, q as onBeforeUnmount, t as useSidebarTabStore, x as useBottomPanelStore, y as createBlock, z as withCtx, A as renderSlot, B as createCommentVNode, C as resolveDynamicComponent, F as Fragment, D as renderList, E as toDisplayString, G as script$5, H as markRaw, I as useI18n, J as useCommandStore, K as useCanvasStore, L as LiteGraph, M as useColorPaletteStore, N as watch, O as useNodeDefStore, P as BadgePosition, Q as LGraphBadge, R as _, S as NodeBadgeMode, T as ref, U as useEventListener, V as nextTick, W as st, X as normalizeI18nKey, Y as useTitleEditorStore, Z as LGraphGroup, $ as LGraphNode, a0 as EditableText, a1 as defineStore, a2 as useNodeFrequencyStore, a3 as useNodeBookmarkStore, a4 as highlightQuery, a5 as script$8, a6 as formatNumberWithSuffix, a7 as NodeSourceType, a8 as createTextVNode, a9 as script$9, aa as NodePreview, ab as NodeSearchFilter, ac as script$a, ad as SearchFilterChip, ae as useLitegraphService, af as storeToRefs, ag as isRef, ah as toRaw, ai as LinkReleaseTriggerAction, aj as normalizeClass, ak as useUserStore, al as useDialogStore, am as SettingDialogHeader, an as SettingDialogContent, ao as useKeybindingStore, ap as Teleport, aq as usePragmaticDraggable, ar as usePragmaticDroppable, as as withModifiers, at as mergeProps, au as useWorkflowService, av as useWorkflowBookmarkStore, aw as script$c, ax as script$d, ay as script$e, az as useModelToNodeStore, aA as ComfyNodeDefImpl, aB as ComfyModelDef, aC as ComfyWorkflow, aD as LGraphCanvas, aE as te, aF as LGraph, aG as LLink, aH as DragAndScale, aI as ContextMenu, aJ as CanvasPointer, aK as isImageNode, aL as api, aM as getStorageValue, aN as useModelStore, aO as setStorageValue, aP as LinkMarkerShape, aQ as IS_CONTROL_WIDGET, aR as updateControlWidgetLabel, aS as useColorPaletteService, aT as ChangeTracker, aU as i18n, aV as useToast, aW as useToastStore, aX as useQueueSettingsStore, aY as script$g, aZ as useQueuePendingTaskCountStore, a_ as useLocalStorage, a$ as useDraggable, b0 as watchDebounced, b1 as inject, b2 as useElementBounding, b3 as script$i, b4 as lodashExports, b5 as useEventBus, b6 as useMenuItemStore, b7 as provide, b8 as isElectron, b9 as electronAPI, ba as isNativeWindow, bb as useDialogService, bc as LGraphEventMode, bd as useQueueStore, be as DEFAULT_DARK_COLOR_PALETTE, bf as DEFAULT_LIGHT_COLOR_PALETTE, bg as t, bh as useErrorHandling } from "./index-Bv0b06LE.js";
-import { s as script$1, a as script$2, b as script$3, c as script$4, d as script$6, e as script$7, f as script$b, g as script$h, h as script$j } from "./index-C068lYT4.js";
-import { s as script$f } from "./index-A_bXPJCN.js";
-import { u as useKeybindingService } from "./keybindingService-DyjX-nxF.js";
-import { u as useServerConfigStore } from "./serverConfigStore-D2Vr0L0h.js";
-import "./index-Dzu9WL4p.js";
-const DEFAULT_TITLE = "ComfyUI";
-const TITLE_SUFFIX = " - ComfyUI";
-const _sfc_main$u = /* @__PURE__ */ defineComponent({
- __name: "BrowserTabTitle",
- setup(__props) {
- const executionStore = useExecutionStore();
- const executionText = computed(
- () => executionStore.isIdle ? "" : `[${executionStore.executionProgress}%]`
- );
- const settingStore = useSettingStore();
- const betaMenuEnabled = computed(
- () => settingStore.get("Comfy.UseNewMenu") !== "Disabled"
- );
- const workflowStore = useWorkflowStore();
- const isUnsavedText = computed(
- () => workflowStore.activeWorkflow?.isModified || !workflowStore.activeWorkflow?.isPersisted ? " *" : ""
- );
- const workflowNameText = computed(() => {
- const workflowName = workflowStore.activeWorkflow?.filename;
- return workflowName ? isUnsavedText.value + workflowName + TITLE_SUFFIX : DEFAULT_TITLE;
- });
- const nodeExecutionTitle = computed(
- () => executionStore.executingNode && executionStore.executingNodeProgress ? `${executionText.value}[${executionStore.executingNodeProgress}%] ${executionStore.executingNode.type}` : ""
- );
- const workflowTitle = computed(
- () => executionText.value + (betaMenuEnabled.value ? workflowNameText.value : DEFAULT_TITLE)
- );
- const title = computed(() => nodeExecutionTitle.value || workflowTitle.value);
- useTitle(title);
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div");
- };
- }
-});
-const _hoisted_1$k = { class: "window-actions-spacer" };
-const _sfc_main$t = /* @__PURE__ */ defineComponent({
- __name: "MenuHamburger",
- setup(__props) {
- const workspaceState = useWorkspaceStore();
- const settingStore = useSettingStore();
- const exitFocusMode = /* @__PURE__ */ __name(() => {
- workspaceState.focusMode = false;
- }, "exitFocusMode");
- watchEffect(() => {
- if (settingStore.get("Comfy.UseNewMenu") !== "Disabled") {
- return;
- }
- if (workspaceState.focusMode) {
- app.ui.menuContainer.style.display = "none";
- } else {
- app.ui.menuContainer.style.display = "block";
- }
- });
- const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu"));
- const positionCSS = computed(
- () => (
- // 'Bottom' menuSetting shows the hamburger button in the bottom right corner
- // 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner
- menuSetting.value === "Bottom" ? { bottom: "0px", right: "0px" } : { top: "0px", right: "0px" }
- )
- );
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return withDirectives((openBlock(), createElementBlock("div", {
- class: "comfy-menu-hamburger no-drag",
- style: normalizeStyle(positionCSS.value)
- }, [
- withDirectives(createVNode(unref(script), {
- icon: "pi pi-bars",
- severity: "secondary",
- text: "",
- size: "large",
- "aria-label": _ctx.$t("menu.showMenu"),
- "aria-live": "assertive",
- onClick: exitFocusMode,
- onContextmenu: unref(showNativeMenu)
- }, null, 8, ["aria-label", "onContextmenu"]), [
- [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }]
- ]),
- withDirectives(createBaseVNode("div", _hoisted_1$k, null, 512), [
- [vShow, menuSetting.value !== "Bottom"]
- ])
- ], 4)), [
- [vShow, unref(workspaceState).focusMode]
- ]);
- };
- }
-});
-const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-82120b51"]]);
-const _sfc_main$s = /* @__PURE__ */ defineComponent({
- __name: "UnloadWindowConfirmDialog",
- setup(__props) {
- const settingStore = useSettingStore();
- const workflowStore = useWorkflowStore();
- const handleBeforeUnload = /* @__PURE__ */ __name((event) => {
- if (settingStore.get("Comfy.Window.UnloadConfirmation") && workflowStore.modifiedWorkflows.length > 0) {
- event.preventDefault();
- return true;
- }
- return void 0;
- }, "handleBeforeUnload");
- onMounted(() => {
- window.addEventListener("beforeunload", handleBeforeUnload);
- });
- onBeforeUnmount(() => {
- window.removeEventListener("beforeunload", handleBeforeUnload);
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div");
- };
- }
-});
-const _sfc_main$r = /* @__PURE__ */ defineComponent({
- __name: "LiteGraphCanvasSplitterOverlay",
- setup(__props) {
- const settingStore = useSettingStore();
- const sidebarLocation = computed(
- () => settingStore.get("Comfy.Sidebar.Location")
- );
- const sidebarPanelVisible = computed(
- () => useSidebarTabStore().activeSidebarTab !== null
- );
- const bottomPanelVisible = computed(
- () => useBottomPanelStore().bottomPanelVisible
- );
- const activeSidebarTabId = computed(
- () => useSidebarTabStore().activeSidebarTabId
- );
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$2), {
- class: "splitter-overlay-root splitter-overlay",
- "pt:gutter": sidebarPanelVisible.value ? "" : "hidden",
- key: activeSidebarTabId.value,
- stateKey: activeSidebarTabId.value,
- stateStorage: "local"
- }, {
- default: withCtx(() => [
- sidebarLocation.value === "left" ? withDirectives((openBlock(), createBlock(unref(script$1), {
- key: 0,
- class: "side-bar-panel",
- minSize: 10,
- size: 20
- }, {
- default: withCtx(() => [
- renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true)
- ]),
- _: 3
- }, 512)), [
- [vShow, sidebarPanelVisible.value]
- ]) : createCommentVNode("", true),
- createVNode(unref(script$1), { size: 100 }, {
- default: withCtx(() => [
- createVNode(unref(script$2), {
- class: "splitter-overlay max-w-full",
- layout: "vertical",
- "pt:gutter": bottomPanelVisible.value ? "" : "hidden",
- stateKey: "bottom-panel-splitter",
- stateStorage: "local"
- }, {
- default: withCtx(() => [
- createVNode(unref(script$1), { class: "graph-canvas-panel relative" }, {
- default: withCtx(() => [
- renderSlot(_ctx.$slots, "graph-canvas-panel", {}, void 0, true)
- ]),
- _: 3
- }),
- withDirectives(createVNode(unref(script$1), { class: "bottom-panel" }, {
- default: withCtx(() => [
- renderSlot(_ctx.$slots, "bottom-panel", {}, void 0, true)
- ]),
- _: 3
- }, 512), [
- [vShow, bottomPanelVisible.value]
- ])
- ]),
- _: 3
- }, 8, ["pt:gutter"])
- ]),
- _: 3
- }),
- sidebarLocation.value === "right" ? withDirectives((openBlock(), createBlock(unref(script$1), {
- key: 1,
- class: "side-bar-panel",
- minSize: 10,
- size: 20
- }, {
- default: withCtx(() => [
- renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true)
- ]),
- _: 3
- }, 512)), [
- [vShow, sidebarPanelVisible.value]
- ]) : createCommentVNode("", true)
- ]),
- _: 3
- }, 8, ["pt:gutter", "stateKey"]);
- };
- }
-});
-const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-e50caa15"]]);
-const _sfc_main$q = /* @__PURE__ */ defineComponent({
- __name: "ExtensionSlot",
- props: {
- extension: {}
- },
- setup(__props) {
- const props = __props;
- const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => {
- extension.render(el);
- }, "mountCustomExtension");
- onBeforeUnmount(() => {
- if (props.extension.type === "custom" && props.extension.destroy) {
- props.extension.destroy();
- }
- });
- return (_ctx, _cache) => {
- return _ctx.extension.type === "vue" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.extension.component), { key: 0 })) : (openBlock(), createElementBlock("div", {
- key: 1,
- ref: /* @__PURE__ */ __name((el) => {
- if (el)
- mountCustomExtension(
- props.extension,
- el
- );
- }, "ref")
- }, null, 512));
- };
- }
-});
-const _hoisted_1$j = { class: "flex flex-col h-full" };
-const _hoisted_2$7 = { class: "w-full flex justify-between" };
-const _hoisted_3$6 = { class: "tabs-container" };
-const _hoisted_4$2 = { class: "font-bold" };
-const _hoisted_5$1 = { class: "flex-grow h-0" };
-const _sfc_main$p = /* @__PURE__ */ defineComponent({
- __name: "BottomPanel",
- setup(__props) {
- const bottomPanelStore = useBottomPanelStore();
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
- createVNode(unref(script$5), {
- value: unref(bottomPanelStore).activeBottomPanelTabId,
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event)
- }, {
- default: withCtx(() => [
- createVNode(unref(script$3), { "pt:tabList": "border-none" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_2$7, [
- createBaseVNode("div", _hoisted_3$6, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => {
- return openBlock(), createBlock(unref(script$4), {
- key: tab.id,
- value: tab.id,
- class: "p-3 border-none"
- }, {
- default: withCtx(() => [
- createBaseVNode("span", _hoisted_4$2, toDisplayString(tab.title.toUpperCase()), 1)
- ]),
- _: 2
- }, 1032, ["value"]);
- }), 128))
- ]),
- createVNode(unref(script), {
- class: "justify-self-end",
- icon: "pi pi-times",
- severity: "secondary",
- size: "small",
- text: "",
- onClick: _cache[0] || (_cache[0] = ($event) => unref(bottomPanelStore).bottomPanelVisible = false)
- })
- ])
- ]),
- _: 1
- })
- ]),
- _: 1
- }, 8, ["value"]),
- createBaseVNode("div", _hoisted_5$1, [
- unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$q, {
- key: 0,
- extension: unref(bottomPanelStore).activeBottomPanelTab
- }, null, 8, ["extension"])) : createCommentVNode("", true)
- ])
- ]);
- };
- }
-});
-const _hoisted_1$i = {
- viewBox: "0 0 1024 1024",
- width: "1.2em",
- height: "1.2em"
-};
-function render$7(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$i, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "currentColor",
- d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769"
- }, null, -1)
- ]));
-}
-__name(render$7, "render$7");
-const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$7 });
-const _hoisted_1$h = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$6(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$h, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "currentColor",
- d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5"
- }, null, -1)
- ]));
-}
-__name(render$6, "render$6");
-const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$6 });
-const _sfc_main$o = /* @__PURE__ */ defineComponent({
- __name: "GraphCanvasMenu",
- setup(__props) {
- const { t: t2 } = useI18n();
- const commandStore = useCommandStore();
- const canvasStore = useCanvasStore();
- const settingStore = useSettingStore();
- const linkHidden = computed(
- () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK
- );
- let interval = null;
- const repeat = /* @__PURE__ */ __name((command) => {
- if (interval) return;
- const cmd = /* @__PURE__ */ __name(() => commandStore.execute(command), "cmd");
- cmd();
- interval = window.setInterval(cmd, 100);
- }, "repeat");
- const stopRepeat = /* @__PURE__ */ __name(() => {
- if (interval) {
- clearInterval(interval);
- interval = null;
- }
- }, "stopRepeat");
- return (_ctx, _cache) => {
- const _component_i_material_symbols58pan_tool_outline = __unplugin_components_0$2;
- const _component_i_simple_line_icons58cursor = __unplugin_components_1$2;
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createBlock(unref(script$6), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000]" }, {
- default: withCtx(() => [
- withDirectives(createVNode(unref(script), {
- severity: "secondary",
- icon: "pi pi-plus",
- "aria-label": _ctx.$t("graphCanvasMenu.zoomIn"),
- onMousedown: _cache[0] || (_cache[0] = ($event) => repeat("Comfy.Canvas.ZoomIn")),
- onMouseup: stopRepeat
- }, null, 8, ["aria-label"]), [
- [
- _directive_tooltip,
- unref(t2)("graphCanvasMenu.zoomIn"),
- void 0,
- { left: true }
- ]
- ]),
- withDirectives(createVNode(unref(script), {
- severity: "secondary",
- icon: "pi pi-minus",
- "aria-label": _ctx.$t("graphCanvasMenu.zoomOut"),
- onMousedown: _cache[1] || (_cache[1] = ($event) => repeat("Comfy.Canvas.ZoomOut")),
- onMouseup: stopRepeat
- }, null, 8, ["aria-label"]), [
- [
- _directive_tooltip,
- unref(t2)("graphCanvasMenu.zoomOut"),
- void 0,
- { left: true }
- ]
- ]),
- withDirectives(createVNode(unref(script), {
- severity: "secondary",
- icon: "pi pi-expand",
- "aria-label": _ctx.$t("graphCanvasMenu.fitView"),
- onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView"))
- }, null, 8, ["aria-label"]), [
- [
- _directive_tooltip,
- unref(t2)("graphCanvasMenu.fitView"),
- void 0,
- { left: true }
- ]
- ]),
- withDirectives((openBlock(), createBlock(unref(script), {
- severity: "secondary",
- "aria-label": unref(t2)(
- "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode")
- ),
- onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock"))
- }, {
- icon: withCtx(() => [
- unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 }))
- ]),
- _: 1
- }, 8, ["aria-label"])), [
- [
- _directive_tooltip,
- unref(t2)(
- "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode")
- ) + " (Space)",
- void 0,
- { left: true }
- ]
- ]),
- withDirectives(createVNode(unref(script), {
- severity: "secondary",
- icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye",
- "aria-label": _ctx.$t("graphCanvasMenu.toggleLinkVisibility"),
- onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")),
- "data-testid": "toggle-link-visibility-button"
- }, null, 8, ["icon", "aria-label"]), [
- [
- _directive_tooltip,
- unref(t2)("graphCanvasMenu.toggleLinkVisibility"),
- void 0,
- { left: true }
- ]
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-27a9500c"]]);
-const _sfc_main$n = /* @__PURE__ */ defineComponent({
- __name: "NodeBadge",
- setup(__props) {
- const settingStore = useSettingStore();
- const colorPaletteStore = useColorPaletteStore();
- const nodeSourceBadgeMode = computed(
- () => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode")
- );
- const nodeIdBadgeMode = computed(
- () => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode")
- );
- const nodeLifeCycleBadgeMode = computed(
- () => settingStore.get("Comfy.NodeBadge.NodeLifeCycleBadgeMode")
- );
- watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => {
- app.graph?.setDirtyCanvas(true, true);
- });
- const nodeDefStore = useNodeDefStore();
- function badgeTextVisible(nodeDef, badgeMode) {
- return !(badgeMode === NodeBadgeMode.None || nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn);
- }
- __name(badgeTextVisible, "badgeTextVisible");
- onMounted(() => {
- app.registerExtension({
- name: "Comfy.NodeBadge",
- nodeCreated(node) {
- node.badgePosition = BadgePosition.TopRight;
- const badge = computed(() => {
- const nodeDef = nodeDefStore.fromLGraphNode(node);
- return new LGraphBadge({
- text: _.truncate(
- [
- badgeTextVisible(nodeDef, nodeIdBadgeMode.value) ? `#${node.id}` : "",
- badgeTextVisible(nodeDef, nodeLifeCycleBadgeMode.value) ? nodeDef?.nodeLifeCycleBadgeText ?? "" : "",
- badgeTextVisible(nodeDef, nodeSourceBadgeMode.value) ? nodeDef?.nodeSource?.badgeText ?? "" : ""
- ].filter((s) => s.length > 0).join(" "),
- {
- length: 31
- }
- ),
- fgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_FG_COLOR,
- bgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_BG_COLOR
- });
- });
- node.badges.push(() => badge.value);
- }
- });
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div");
- };
- }
-});
-const _sfc_main$m = /* @__PURE__ */ defineComponent({
- __name: "NodeTooltip",
- setup(__props) {
- let idleTimeout;
- const nodeDefStore = useNodeDefStore();
- const settingStore = useSettingStore();
- const tooltipRef = ref();
- const tooltipText = ref("");
- const left = ref();
- const top = ref();
- const hideTooltip = /* @__PURE__ */ __name(() => tooltipText.value = null, "hideTooltip");
- const showTooltip = /* @__PURE__ */ __name(async (tooltip) => {
- if (!tooltip) return;
- left.value = app.canvas.mouse[0] + "px";
- top.value = app.canvas.mouse[1] + "px";
- tooltipText.value = tooltip;
- await nextTick();
- const rect = tooltipRef.value.getBoundingClientRect();
- if (rect.right > window.innerWidth) {
- left.value = app.canvas.mouse[0] - rect.width + "px";
- }
- if (rect.top < 0) {
- top.value = app.canvas.mouse[1] + rect.height + "px";
- }
- }, "showTooltip");
- const onIdle = /* @__PURE__ */ __name(() => {
- const { canvas } = app;
- const node = canvas.node_over;
- if (!node) return;
- const ctor = node.constructor;
- const nodeDef = nodeDefStore.nodeDefsByName[node.type];
- if (ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1]) {
- return showTooltip(nodeDef.description);
- }
- if (node.flags?.collapsed) return;
- const inputSlot = canvas.isOverNodeInput(
- node,
- canvas.graph_mouse[0],
- canvas.graph_mouse[1],
- [0, 0]
- );
- if (inputSlot !== -1) {
- const inputName = node.inputs[inputSlot].name;
- const translatedTooltip = st(
- `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`,
- nodeDef.inputs.getInput(inputName)?.tooltip
- );
- return showTooltip(translatedTooltip);
- }
- const outputSlot = canvas.isOverNodeOutput(
- node,
- canvas.graph_mouse[0],
- canvas.graph_mouse[1],
- [0, 0]
- );
- if (outputSlot !== -1) {
- const translatedTooltip = st(
- `nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`,
- nodeDef.outputs.all?.[outputSlot]?.tooltip
- );
- return showTooltip(translatedTooltip);
- }
- const widget = app.canvas.getWidgetAtCursor();
- if (widget && !widget.element) {
- const translatedTooltip = st(
- `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`,
- nodeDef.inputs.getInput(widget.name)?.tooltip
- );
- return showTooltip(widget.tooltip ?? translatedTooltip);
- }
- }, "onIdle");
- const onMouseMove = /* @__PURE__ */ __name((e) => {
- hideTooltip();
- clearTimeout(idleTimeout);
- if (e.target.nodeName !== "CANVAS") return;
- idleTimeout = window.setTimeout(
- onIdle,
- settingStore.get("LiteGraph.Node.TooltipDelay")
- );
- }, "onMouseMove");
- useEventListener(window, "mousemove", onMouseMove);
- useEventListener(window, "click", hideTooltip);
- return (_ctx, _cache) => {
- return tooltipText.value ? (openBlock(), createElementBlock("div", {
- key: 0,
- ref_key: "tooltipRef",
- ref: tooltipRef,
- class: "node-tooltip",
- style: normalizeStyle({ left: left.value, top: top.value })
- }, toDisplayString(tooltipText.value), 5)) : createCommentVNode("", true);
- };
- }
-});
-const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-f03142eb"]]);
-const _sfc_main$l = /* @__PURE__ */ defineComponent({
- __name: "TitleEditor",
- setup(__props) {
- const settingStore = useSettingStore();
- const showInput = ref(false);
- const editedTitle = ref("");
- const inputStyle = ref({
- position: "fixed",
- left: "0px",
- top: "0px",
- width: "200px",
- height: "20px",
- fontSize: "12px"
- });
- const titleEditorStore = useTitleEditorStore();
- const canvasStore = useCanvasStore();
- const previousCanvasDraggable = ref(true);
- const onEdit = /* @__PURE__ */ __name((newValue) => {
- if (titleEditorStore.titleEditorTarget && newValue.trim() !== "") {
- titleEditorStore.titleEditorTarget.title = newValue.trim();
- app.graph.setDirtyCanvas(true, true);
- }
- showInput.value = false;
- titleEditorStore.titleEditorTarget = null;
- canvasStore.canvas.allow_dragcanvas = previousCanvasDraggable.value;
- }, "onEdit");
- watch(
- () => titleEditorStore.titleEditorTarget,
- (target) => {
- if (target === null) {
- return;
- }
- editedTitle.value = target.title;
- showInput.value = true;
- previousCanvasDraggable.value = canvasStore.canvas.allow_dragcanvas;
- canvasStore.canvas.allow_dragcanvas = false;
- if (target instanceof LGraphGroup) {
- const group = target;
- const [x, y] = group.pos;
- const [w, h] = group.size;
- const [left, top] = app.canvasPosToClientPos([x, y]);
- inputStyle.value.left = `${left}px`;
- inputStyle.value.top = `${top}px`;
- const width = w * app.canvas.ds.scale;
- const height = group.titleHeight * app.canvas.ds.scale;
- inputStyle.value.width = `${width}px`;
- inputStyle.value.height = `${height}px`;
- const fontSize = group.font_size * app.canvas.ds.scale;
- inputStyle.value.fontSize = `${fontSize}px`;
- } else if (target instanceof LGraphNode) {
- const node = target;
- const [x, y] = node.getBounding();
- const canvasWidth = node.width;
- const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT;
- const [left, top] = app.canvasPosToClientPos([x, y]);
- inputStyle.value.left = `${left}px`;
- inputStyle.value.top = `${top}px`;
- const width = canvasWidth * app.canvas.ds.scale;
- const height = canvasHeight * app.canvas.ds.scale;
- inputStyle.value.width = `${width}px`;
- inputStyle.value.height = `${height}px`;
- const fontSize = 12 * app.canvas.ds.scale;
- inputStyle.value.fontSize = `${fontSize}px`;
- }
- }
- );
- const canvasEventHandler = /* @__PURE__ */ __name((event) => {
- if (event.detail.subType === "group-double-click") {
- if (!settingStore.get("Comfy.Group.DoubleClickTitleToEdit")) {
- return;
- }
- const group = event.detail.group;
- const [x, y] = group.pos;
- const e = event.detail.originalEvent;
- const relativeY = e.canvasY - y;
- if (relativeY <= group.titleHeight) {
- titleEditorStore.titleEditorTarget = group;
- }
- } else if (event.detail.subType === "node-double-click") {
- if (!settingStore.get("Comfy.Node.DoubleClickTitleToEdit")) {
- return;
- }
- const node = event.detail.node;
- const [x, y] = node.pos;
- const e = event.detail.originalEvent;
- const relativeY = e.canvasY - y;
- if (relativeY <= 0) {
- titleEditorStore.titleEditorTarget = node;
- }
- }
- }, "canvasEventHandler");
- useEventListener(document, "litegraph:canvas", canvasEventHandler);
- return (_ctx, _cache) => {
- return showInput.value ? (openBlock(), createElementBlock("div", {
- key: 0,
- class: "group-title-editor node-title-editor",
- style: normalizeStyle(inputStyle.value)
- }, [
- createVNode(EditableText, {
- isEditing: showInput.value,
- modelValue: editedTitle.value,
- onEdit
- }, null, 8, ["isEditing", "modelValue"])
- ], 4)) : createCommentVNode("", true);
- };
- }
-});
-const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-12d3fd12"]]);
-const useSearchBoxStore = defineStore("searchBox", () => {
- const visible = ref(false);
- function toggleVisible() {
- visible.value = !visible.value;
- }
- __name(toggleVisible, "toggleVisible");
- return {
- visible,
- toggleVisible
- };
-});
-class ConnectingLinkImpl {
- static {
- __name(this, "ConnectingLinkImpl");
- }
- constructor(node, slot, input, output, pos, afterRerouteId) {
- this.node = node;
- this.slot = slot;
- this.input = input;
- this.output = output;
- this.pos = pos;
- this.afterRerouteId = afterRerouteId;
- }
- static createFromPlainObject(obj) {
- return new ConnectingLinkImpl(
- obj.node,
- obj.slot,
- obj.input,
- obj.output,
- obj.pos,
- obj.afterRerouteId
- );
- }
- get type() {
- const result = this.input ? this.input.type : this.output?.type ?? null;
- return result === -1 ? null : result;
- }
- /**
- * Which slot type is release and need to be reconnected.
- * - 'output' means we need a new node's outputs slot to connect with this link
- */
- get releaseSlotType() {
- return this.output ? "input" : "output";
- }
- connectTo(newNode) {
- const newNodeSlots = this.releaseSlotType === "output" ? newNode.outputs : newNode.inputs;
- if (!newNodeSlots) return;
- const newNodeSlot = newNodeSlots.findIndex(
- (slot) => LiteGraph.isValidConnection(slot.type, this.type)
- );
- if (newNodeSlot === -1) {
- console.warn(
- `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen`
- );
- return;
- }
- if (this.releaseSlotType === "input") {
- this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId);
- } else {
- newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId);
- }
- }
-}
-const _sfc_main$k = {
- name: "AutoCompletePlus",
- extends: script$7,
- emits: ["focused-option-changed"],
- data() {
- return {
- // Flag to determine if IME is active
- isComposing: false
- };
- },
- mounted() {
- if (typeof script$7.mounted === "function") {
- script$7.mounted.call(this);
- }
- const inputEl = this.$el.querySelector("input");
- if (inputEl) {
- inputEl.addEventListener("compositionstart", () => {
- this.isComposing = true;
- });
- inputEl.addEventListener("compositionend", () => {
- this.isComposing = false;
- });
- }
- this.$watch(
- () => this.focusedOptionIndex,
- (newVal, oldVal) => {
- this.$emit("focused-option-changed", newVal);
- }
- );
- },
- methods: {
- // Override onKeyDown to block Enter when IME is active
- onKeyDown(event) {
- if (event.key === "Enter" && this.isComposing) {
- event.preventDefault();
- event.stopPropagation();
- return;
- }
- script$7.methods.onKeyDown.call(this, event);
- }
- }
-};
-const _hoisted_1$g = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" };
-const _hoisted_2$6 = { class: "option-display-name font-semibold flex flex-col" };
-const _hoisted_3$5 = { key: 0 };
-const _hoisted_4$1 = ["innerHTML"];
-const _hoisted_5 = ["innerHTML"];
-const _hoisted_6 = {
- key: 0,
- class: "option-category font-light text-sm text-muted overflow-hidden text-ellipsis whitespace-nowrap"
-};
-const _hoisted_7 = { class: "option-badges" };
-const _sfc_main$j = /* @__PURE__ */ defineComponent({
- __name: "NodeSearchItem",
- props: {
- nodeDef: {},
- currentQuery: {}
- },
- setup(__props) {
- const settingStore = useSettingStore();
- const showCategory = computed(
- () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowCategory")
- );
- const showIdName = computed(
- () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowIdName")
- );
- const showNodeFrequency = computed(
- () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowNodeFrequency")
- );
- const nodeFrequencyStore = useNodeFrequencyStore();
- const nodeFrequency = computed(
- () => nodeFrequencyStore.getNodeFrequency(props.nodeDef)
- );
- const nodeBookmarkStore = useNodeBookmarkStore();
- const isBookmarked = computed(
- () => nodeBookmarkStore.isBookmarked(props.nodeDef)
- );
- const props = __props;
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
- createBaseVNode("div", _hoisted_2$6, [
- createBaseVNode("div", null, [
- isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$5, _cache[0] || (_cache[0] = [
- createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1)
- ]))) : createCommentVNode("", true),
- createBaseVNode("span", {
- innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery)
- }, null, 8, _hoisted_4$1),
- _cache[1] || (_cache[1] = createBaseVNode("span", null, " ", -1)),
- showIdName.value ? (openBlock(), createBlock(unref(script$8), {
- key: 1,
- severity: "secondary"
- }, {
- default: withCtx(() => [
- createBaseVNode("span", {
- innerHTML: unref(highlightQuery)(_ctx.nodeDef.name, _ctx.currentQuery)
- }, null, 8, _hoisted_5)
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ]),
- showCategory.value ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(_ctx.nodeDef.category.replaceAll("/", " > ")), 1)) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", _hoisted_7, [
- _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$8), {
- key: 0,
- value: _ctx.$t("g.experimental"),
- severity: "primary"
- }, null, 8, ["value"])) : createCommentVNode("", true),
- _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$8), {
- key: 1,
- value: _ctx.$t("g.deprecated"),
- severity: "danger"
- }, null, 8, ["value"])) : createCommentVNode("", true),
- showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$8), {
- key: 2,
- value: unref(formatNumberWithSuffix)(nodeFrequency.value, { roundToInt: true }),
- severity: "secondary"
- }, null, 8, ["value"])) : createCommentVNode("", true),
- _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$9), {
- key: 3,
- class: "text-sm font-light"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.nodeDef.nodeSource.displayText), 1)
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ])
- ]);
- };
- }
-});
-const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-fd0a74bd"]]);
-const _hoisted_1$f = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96" };
-const _hoisted_2$5 = {
- key: 0,
- class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]"
-};
-const _hoisted_3$4 = { class: "_dialog-body" };
-const _sfc_main$i = /* @__PURE__ */ defineComponent({
- __name: "NodeSearchBox",
- props: {
- filters: {},
- searchLimit: { default: 64 }
- },
- emits: ["addFilter", "removeFilter", "addNode"],
- setup(__props, { emit: __emit }) {
- const settingStore = useSettingStore();
- const { t: t2 } = useI18n();
- const enableNodePreview = computed(
- () => settingStore.get("Comfy.NodeSearchBoxImpl.NodePreview")
- );
- const props = __props;
- const nodeSearchFilterVisible = ref(false);
- const inputId = `comfy-vue-node-search-box-input-${Math.random()}`;
- const suggestions = ref([]);
- const hoveredSuggestion = ref(null);
- const currentQuery = ref("");
- const placeholder = computed(() => {
- return props.filters.length === 0 ? t2("g.searchNodes") + "..." : "";
- });
- const nodeDefStore = useNodeDefStore();
- const nodeFrequencyStore = useNodeFrequencyStore();
- const search = /* @__PURE__ */ __name((query) => {
- const queryIsEmpty = query === "" && props.filters.length === 0;
- currentQuery.value = query;
- suggestions.value = queryIsEmpty ? nodeFrequencyStore.topNodeDefs : [
- ...nodeDefStore.nodeSearchService.searchNode(query, props.filters, {
- limit: props.searchLimit
- })
- ];
- }, "search");
- const emit = __emit;
- let inputElement = null;
- const reFocusInput = /* @__PURE__ */ __name(() => {
- inputElement ??= document.getElementById(inputId);
- if (inputElement) {
- inputElement.blur();
- nextTick(() => inputElement?.focus());
- }
- }, "reFocusInput");
- onMounted(reFocusInput);
- const onAddFilter = /* @__PURE__ */ __name((filterAndValue) => {
- nodeSearchFilterVisible.value = false;
- emit("addFilter", filterAndValue);
- }, "onAddFilter");
- const onRemoveFilter = /* @__PURE__ */ __name((event, filterAndValue) => {
- event.stopPropagation();
- event.preventDefault();
- emit("removeFilter", filterAndValue);
- reFocusInput();
- }, "onRemoveFilter");
- const setHoverSuggestion = /* @__PURE__ */ __name((index) => {
- if (index === -1) {
- hoveredSuggestion.value = null;
- return;
- }
- const value = suggestions.value[index];
- hoveredSuggestion.value = value;
- }, "setHoverSuggestion");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
- enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
- hoveredSuggestion.value ? (openBlock(), createBlock(NodePreview, {
- nodeDef: hoveredSuggestion.value,
- key: hoveredSuggestion.value?.name || ""
- }, null, 8, ["nodeDef"])) : createCommentVNode("", true)
- ])) : createCommentVNode("", true),
- createVNode(unref(script), {
- icon: "pi pi-filter",
- severity: "secondary",
- class: "filter-button z-10",
- onClick: _cache[0] || (_cache[0] = ($event) => nodeSearchFilterVisible.value = true)
- }),
- createVNode(unref(script$a), {
- visible: nodeSearchFilterVisible.value,
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => nodeSearchFilterVisible.value = $event),
- class: "min-w-96",
- "dismissable-mask": "",
- modal: "",
- onHide: reFocusInput
- }, {
- header: withCtx(() => _cache[5] || (_cache[5] = [
- createBaseVNode("h3", null, "Add node filter condition", -1)
- ])),
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_3$4, [
- createVNode(NodeSearchFilter, { onAddFilter })
- ])
- ]),
- _: 1
- }, 8, ["visible"]),
- createVNode(_sfc_main$k, {
- "model-value": props.filters,
- class: "comfy-vue-node-search-box z-10 flex-grow",
- scrollHeight: "40vh",
- placeholder: placeholder.value,
- "input-id": inputId,
- "append-to": "self",
- suggestions: suggestions.value,
- "min-length": 0,
- delay: 100,
- loading: !unref(nodeFrequencyStore).isLoaded,
- onComplete: _cache[2] || (_cache[2] = ($event) => search($event.query)),
- onOptionSelect: _cache[3] || (_cache[3] = ($event) => emit("addNode", $event.value)),
- onFocusedOptionChanged: _cache[4] || (_cache[4] = ($event) => setHoverSuggestion($event)),
- "complete-on-focus": "",
- "auto-option-focus": "",
- "force-selection": "",
- multiple: "",
- optionLabel: "display_name"
- }, {
- option: withCtx(({ option }) => [
- createVNode(NodeSearchItem, {
- nodeDef: option,
- currentQuery: currentQuery.value
- }, null, 8, ["nodeDef", "currentQuery"])
- ]),
- chip: withCtx(({ value }) => [
- Array.isArray(value) && value.length === 2 ? (openBlock(), createBlock(SearchFilterChip, {
- key: `${value[0].id}-${value[1]}`,
- onRemove: /* @__PURE__ */ __name(($event) => onRemoveFilter($event, value), "onRemove"),
- text: value[1],
- badge: value[0].invokeSequence.toUpperCase(),
- "badge-class": value[0].invokeSequence + "-badge"
- }, null, 8, ["onRemove", "text", "badge", "badge-class"])) : createCommentVNode("", true)
- ]),
- _: 1
- }, 8, ["model-value", "placeholder", "suggestions", "loading"])
- ]);
- };
- }
-});
-const _sfc_main$h = /* @__PURE__ */ defineComponent({
- __name: "NodeSearchBoxPopover",
- setup(__props) {
- const settingStore = useSettingStore();
- const litegraphService = useLitegraphService();
- const { visible } = storeToRefs(useSearchBoxStore());
- const dismissable = ref(true);
- const triggerEvent = ref(null);
- const getNewNodeLocation = /* @__PURE__ */ __name(() => {
- if (!triggerEvent.value) {
- return litegraphService.getCanvasCenter();
- }
- const originalEvent = triggerEvent.value.detail.originalEvent;
- return [originalEvent.canvasX, originalEvent.canvasY];
- }, "getNewNodeLocation");
- const nodeFilters = ref([]);
- const addFilter = /* @__PURE__ */ __name((filter) => {
- nodeFilters.value.push(filter);
- }, "addFilter");
- const removeFilter = /* @__PURE__ */ __name((filter) => {
- nodeFilters.value = nodeFilters.value.filter(
- (f) => toRaw(f) !== toRaw(filter)
- );
- }, "removeFilter");
- const clearFilters = /* @__PURE__ */ __name(() => {
- nodeFilters.value = [];
- }, "clearFilters");
- const closeDialog = /* @__PURE__ */ __name(() => {
- visible.value = false;
- }, "closeDialog");
- const addNode = /* @__PURE__ */ __name((nodeDef) => {
- const node = litegraphService.addNodeOnGraph(nodeDef, {
- pos: getNewNodeLocation()
- });
- const eventDetail = triggerEvent.value?.detail;
- if (eventDetail && eventDetail.subType === "empty-release") {
- eventDetail.linkReleaseContext.links.forEach((link) => {
- ConnectingLinkImpl.createFromPlainObject(link).connectTo(node);
- });
- }
- window.setTimeout(() => {
- closeDialog();
- }, 100);
- }, "addNode");
- const newSearchBoxEnabled = computed(
- () => settingStore.get("Comfy.NodeSearchBoxImpl") === "default"
- );
- const showSearchBox = /* @__PURE__ */ __name((e) => {
- const detail = e.detail;
- if (newSearchBoxEnabled.value) {
- if (detail.originalEvent?.pointerType === "touch") {
- setTimeout(() => {
- showNewSearchBox(e);
- }, 128);
- } else {
- showNewSearchBox(e);
- }
- } else {
- canvasStore.canvas.showSearchBox(detail.originalEvent);
- }
- }, "showSearchBox");
- const nodeDefStore = useNodeDefStore();
- const showNewSearchBox = /* @__PURE__ */ __name((e) => {
- if (e.detail.subType === "empty-release") {
- const links = e.detail.linkReleaseContext.links;
- if (links.length === 0) {
- console.warn("Empty release with no links! This should never happen");
- return;
- }
- const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]);
- const filter = nodeDefStore.nodeSearchService.getFilterById(
- firstLink.releaseSlotType
- );
- const dataType = firstLink.type.toString();
- addFilter([filter, dataType]);
- }
- visible.value = true;
- triggerEvent.value = e;
- dismissable.value = false;
- setTimeout(() => {
- dismissable.value = true;
- }, 300);
- }, "showNewSearchBox");
- const showContextMenu = /* @__PURE__ */ __name((e) => {
- if (e.detail.subType !== "empty-release") {
- return;
- }
- const links = e.detail.linkReleaseContext.links;
- if (links.length === 0) {
- console.warn("Empty release with no links! This should never happen");
- return;
- }
- const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]);
- const mouseEvent = e.detail.originalEvent;
- const commonOptions = {
- e: mouseEvent,
- allow_searchbox: true,
- showSearchBox: /* @__PURE__ */ __name(() => showSearchBox(e), "showSearchBox")
- };
- const connectionOptions = firstLink.output ? {
- nodeFrom: firstLink.node,
- slotFrom: firstLink.output,
- afterRerouteId: firstLink.afterRerouteId
- } : {
- nodeTo: firstLink.node,
- slotTo: firstLink.input,
- afterRerouteId: firstLink.afterRerouteId
- };
- canvasStore.canvas.showConnectionMenu({
- ...connectionOptions,
- ...commonOptions
- });
- }, "showContextMenu");
- const canvasStore = useCanvasStore();
- watchEffect(() => {
- if (canvasStore.canvas) {
- LiteGraph.release_link_on_empty_shows_menu = false;
- canvasStore.canvas.allow_searchbox = false;
- }
- });
- const canvasEventHandler = /* @__PURE__ */ __name((e) => {
- if (e.detail.subType === "empty-double-click") {
- showSearchBox(e);
- } else if (e.detail.subType === "empty-release") {
- handleCanvasEmptyRelease(e);
- } else if (e.detail.subType === "group-double-click") {
- const group = e.detail.group;
- const [x, y] = group.pos;
- const relativeY = e.detail.originalEvent.canvasY - y;
- if (relativeY > group.titleHeight) {
- showSearchBox(e);
- }
- }
- }, "canvasEventHandler");
- const linkReleaseAction = computed(() => {
- return settingStore.get("Comfy.LinkRelease.Action");
- });
- const linkReleaseActionShift = computed(() => {
- return settingStore.get("Comfy.LinkRelease.ActionShift");
- });
- const handleCanvasEmptyRelease = /* @__PURE__ */ __name((e) => {
- const detail = e.detail;
- const shiftPressed = detail.originalEvent.shiftKey;
- const action = shiftPressed ? linkReleaseActionShift.value : linkReleaseAction.value;
- switch (action) {
- case LinkReleaseTriggerAction.SEARCH_BOX:
- showSearchBox(e);
- break;
- case LinkReleaseTriggerAction.CONTEXT_MENU:
- showContextMenu(e);
- break;
- case LinkReleaseTriggerAction.NO_ACTION:
- default:
- break;
- }
- }, "handleCanvasEmptyRelease");
- useEventListener(document, "litegraph:canvas", canvasEventHandler);
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", null, [
- createVNode(unref(script$a), {
- visible: unref(visible),
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isRef(visible) ? visible.value = $event : null),
- modal: "",
- "dismissable-mask": dismissable.value,
- onHide: clearFilters,
- pt: {
- root: {
- class: "invisible-dialog-root",
- role: "search"
- },
- mask: { class: "node-search-box-dialog-mask" },
- transition: {
- enterFromClass: "opacity-0 scale-75",
- // 100ms is the duration of the transition in the dialog component
- enterActiveClass: "transition-all duration-100 ease-out",
- leaveActiveClass: "transition-all duration-100 ease-in",
- leaveToClass: "opacity-0 scale-75"
- }
- }
- }, {
- container: withCtx(() => [
- createVNode(_sfc_main$i, {
- filters: nodeFilters.value,
- onAddFilter: addFilter,
- onRemoveFilter: removeFilter,
- onAddNode: addNode
- }, null, 8, ["filters"])
- ]),
- _: 1
- }, 8, ["visible", "dismissable-mask"])
- ]);
- };
- }
-});
-const _sfc_main$g = /* @__PURE__ */ defineComponent({
- __name: "SidebarIcon",
- props: {
- icon: String,
- selected: Boolean,
- tooltip: {
- type: String,
- default: ""
- },
- class: {
- type: String,
- default: ""
- },
- iconBadge: {
- type: [String, Function],
- default: ""
- }
- },
- emits: ["click"],
- setup(__props, { emit: __emit }) {
- const props = __props;
- const emit = __emit;
- const overlayValue = computed(
- () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge
- );
- const shouldShowBadge = computed(() => !!overlayValue.value);
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return withDirectives((openBlock(), createBlock(unref(script), {
- class: normalizeClass(props.class),
- text: "",
- pt: {
- root: {
- class: `side-bar-button ${props.selected ? "p-button-primary side-bar-button-selected" : "p-button-secondary"}`,
- "aria-label": props.tooltip
- }
- },
- onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event))
- }, {
- icon: withCtx(() => [
- shouldShowBadge.value ? (openBlock(), createBlock(unref(script$b), {
- key: 0,
- value: overlayValue.value
- }, {
- default: withCtx(() => [
- createBaseVNode("i", {
- class: normalizeClass(props.icon + " side-bar-button-icon")
- }, null, 2)
- ]),
- _: 1
- }, 8, ["value"])) : (openBlock(), createElementBlock("i", {
- key: 1,
- class: normalizeClass(props.icon + " side-bar-button-icon")
- }, null, 2))
- ]),
- _: 1
- }, 8, ["class", "pt"])), [
- [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }]
- ]);
- };
- }
-});
-const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6ab4daa6"]]);
-const _sfc_main$f = /* @__PURE__ */ defineComponent({
- __name: "SidebarLogoutIcon",
- setup(__props) {
- const { t: t2 } = useI18n();
- const userStore = useUserStore();
- const tooltip = computed(
- () => `${t2("sideToolbar.logout")} (${userStore.currentUser?.username})`
- );
- const logout = /* @__PURE__ */ __name(() => {
- userStore.logout();
- window.location.reload();
- }, "logout");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(SidebarIcon, {
- icon: "pi pi-sign-out",
- tooltip: tooltip.value,
- onClick: logout
- }, null, 8, ["tooltip"]);
- };
- }
-});
-const _sfc_main$e = /* @__PURE__ */ defineComponent({
- __name: "SidebarSettingsToggleIcon",
- setup(__props) {
- const dialogStore = useDialogStore();
- const showSetting = /* @__PURE__ */ __name(() => {
- dialogStore.showDialog({
- key: "global-settings",
- headerComponent: SettingDialogHeader,
- component: SettingDialogContent
- });
- }, "showSetting");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(SidebarIcon, {
- icon: "pi pi-cog",
- class: "comfy-settings-btn",
- onClick: showSetting,
- tooltip: _ctx.$t("g.settings")
- }, null, 8, ["tooltip"]);
- };
- }
-});
-const _sfc_main$d = /* @__PURE__ */ defineComponent({
- __name: "SidebarThemeToggleIcon",
- setup(__props) {
- const colorPaletteStore = useColorPaletteStore();
- const icon = computed(
- () => colorPaletteStore.completedActivePalette.light_theme ? "pi pi-sun" : "pi pi-moon"
- );
- const commandStore = useCommandStore();
- const toggleTheme = /* @__PURE__ */ __name(() => {
- commandStore.execute("Comfy.ToggleTheme");
- }, "toggleTheme");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(SidebarIcon, {
- icon: icon.value,
- onClick: toggleTheme,
- tooltip: _ctx.$t("sideToolbar.themeToggle"),
- class: "comfy-vue-theme-toggle"
- }, null, 8, ["icon", "tooltip"]);
- };
- }
-});
-const _hoisted_1$e = { class: "side-tool-bar-end" };
-const _hoisted_2$4 = {
- key: 0,
- class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden"
-};
-const _sfc_main$c = /* @__PURE__ */ defineComponent({
- __name: "SideToolbar",
- setup(__props) {
- const workspaceStore = useWorkspaceStore();
- const settingStore = useSettingStore();
- const userStore = useUserStore();
- const teleportTarget = computed(
- () => settingStore.get("Comfy.Sidebar.Location") === "left" ? ".comfyui-body-left" : ".comfyui-body-right"
- );
- const isSmall = computed(
- () => settingStore.get("Comfy.Sidebar.Size") === "small"
- );
- const tabs = computed(() => workspaceStore.getSidebarTabs());
- const selectedTab = computed(() => workspaceStore.sidebarTab.activeSidebarTab);
- const onTabClick = /* @__PURE__ */ __name((item) => {
- workspaceStore.sidebarTab.toggleSidebarTab(item.id);
- }, "onTabClick");
- const keybindingStore = useKeybindingStore();
- const getTabTooltipSuffix = /* @__PURE__ */ __name((tab) => {
- const keybinding = keybindingStore.getKeybindingByCommandId(
- `Workspace.ToggleSidebarTab.${tab.id}`
- );
- return keybinding ? ` (${keybinding.combo.toString()})` : "";
- }, "getTabTooltipSuffix");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock(Fragment, null, [
- (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [
- createBaseVNode("nav", {
- class: normalizeClass(["side-tool-bar-container", { "small-sidebar": isSmall.value }])
- }, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => {
- return openBlock(), createBlock(SidebarIcon, {
- key: tab.id,
- icon: tab.icon,
- iconBadge: tab.iconBadge,
- tooltip: tab.tooltip + getTabTooltipSuffix(tab),
- selected: tab.id === selectedTab.value?.id,
- class: normalizeClass(tab.id + "-tab-button"),
- onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick")
- }, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]);
- }), 128)),
- createBaseVNode("div", _hoisted_1$e, [
- unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$f, { key: 0 })) : createCommentVNode("", true),
- createVNode(_sfc_main$d),
- createVNode(_sfc_main$e)
- ])
- ], 2)
- ], 8, ["to"])),
- selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
- createVNode(_sfc_main$q, { extension: selectedTab.value }, null, 8, ["extension"])
- ])) : createCommentVNode("", true)
- ], 64);
- };
- }
-});
-const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-04875455"]]);
-const _hoisted_1$d = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" };
-const _hoisted_2$3 = { class: "relative" };
-const _hoisted_3$3 = {
- key: 0,
- class: "status-indicator"
-};
-const _sfc_main$b = /* @__PURE__ */ defineComponent({
- __name: "WorkflowTab",
- props: {
- class: {},
- workflowOption: {}
- },
- setup(__props) {
- const props = __props;
- const { t: t2 } = useI18n();
- const workspaceStore = useWorkspaceStore();
- const workflowStore = useWorkflowStore();
- const workflowTabRef = ref(null);
- const closeWorkflows = /* @__PURE__ */ __name(async (options) => {
- for (const opt of options) {
- if (!await useWorkflowService().closeWorkflow(opt.workflow, {
- warnIfUnsaved: !workspaceStore.shiftDown,
- hint: t2("sideToolbar.workflowTab.dirtyCloseHint")
- })) {
- break;
- }
- }
- }, "closeWorkflows");
- const onCloseWorkflow = /* @__PURE__ */ __name((option) => {
- closeWorkflows([option]);
- }, "onCloseWorkflow");
- const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter");
- usePragmaticDraggable(tabGetter, {
- getInitialData: /* @__PURE__ */ __name(() => {
- return {
- workflowKey: props.workflowOption.workflow.key
- };
- }, "getInitialData")
- });
- usePragmaticDroppable(tabGetter, {
- getData: /* @__PURE__ */ __name(() => {
- return {
- workflowKey: props.workflowOption.workflow.key
- };
- }, "getData"),
- onDrop: /* @__PURE__ */ __name((e) => {
- const fromIndex = workflowStore.openWorkflows.findIndex(
- (wf) => wf.key === e.source.data.workflowKey
- );
- const toIndex = workflowStore.openWorkflows.findIndex(
- (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey
- );
- if (fromIndex !== toIndex) {
- workflowStore.reorderWorkflows(fromIndex, toIndex);
- }
- }, "onDrop")
- });
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", mergeProps({
- class: "flex p-2 gap-2 workflow-tab",
- ref_key: "workflowTabRef",
- ref: workflowTabRef
- }, _ctx.$attrs), [
- withDirectives((openBlock(), createElementBlock("span", _hoisted_1$d, [
- createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1)
- ])), [
- [
- _directive_tooltip,
- _ctx.workflowOption.workflow.key,
- void 0,
- { bottom: true }
- ]
- ]),
- createBaseVNode("div", _hoisted_2$3, [
- !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3$3, "•")) : createCommentVNode("", true),
- createVNode(unref(script), {
- class: "close-button p-0 w-auto",
- icon: "pi pi-times",
- text: "",
- severity: "secondary",
- size: "small",
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"]))
- })
- ])
- ], 16);
- };
- }
-});
-const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-fd6ae3af"]]);
-const _hoisted_1$c = { class: "workflow-tabs-container flex flex-row max-w-full h-full" };
-const _sfc_main$a = /* @__PURE__ */ defineComponent({
- __name: "WorkflowTabs",
- props: {
- class: {}
- },
- setup(__props) {
- const props = __props;
- const { t: t2 } = useI18n();
- const workspaceStore = useWorkspaceStore();
- const workflowStore = useWorkflowStore();
- const workflowService = useWorkflowService();
- const workflowBookmarkStore = useWorkflowBookmarkStore();
- const rightClickedTab = ref(null);
- const menu = ref();
- const workflowToOption = /* @__PURE__ */ __name((workflow) => ({
- value: workflow.path,
- workflow
- }), "workflowToOption");
- const options = computed(
- () => workflowStore.openWorkflows.map(workflowToOption)
- );
- const selectedWorkflow = computed(
- () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null
- );
- const onWorkflowChange = /* @__PURE__ */ __name((option) => {
- if (!option) {
- return;
- }
- if (selectedWorkflow.value?.value === option.value) {
- return;
- }
- workflowService.openWorkflow(option.workflow);
- }, "onWorkflowChange");
- const closeWorkflows = /* @__PURE__ */ __name(async (options2) => {
- for (const opt of options2) {
- if (!await workflowService.closeWorkflow(opt.workflow, {
- warnIfUnsaved: !workspaceStore.shiftDown
- })) {
- break;
- }
- }
- }, "closeWorkflows");
- const onCloseWorkflow = /* @__PURE__ */ __name((option) => {
- closeWorkflows([option]);
- }, "onCloseWorkflow");
- const showContextMenu = /* @__PURE__ */ __name((event, option) => {
- rightClickedTab.value = option;
- menu.value.show(event);
- }, "showContextMenu");
- const contextMenuItems = computed(() => {
- const tab = rightClickedTab.value;
- if (!tab) return [];
- const index = options.value.findIndex((v) => v.workflow === tab.workflow);
- return [
- {
- label: t2("tabMenu.duplicateTab"),
- command: /* @__PURE__ */ __name(() => {
- workflowService.duplicateWorkflow(tab.workflow);
- }, "command")
- },
- {
- separator: true
- },
- {
- label: t2("tabMenu.closeTab"),
- command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command")
- },
- {
- label: t2("tabMenu.closeTabsToLeft"),
- command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"),
- disabled: index <= 0
- },
- {
- label: t2("tabMenu.closeTabsToRight"),
- command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"),
- disabled: index === options.value.length - 1
- },
- {
- label: t2("tabMenu.closeOtherTabs"),
- command: /* @__PURE__ */ __name(() => closeWorkflows([
- ...options.value.slice(index + 1),
- ...options.value.slice(0, index)
- ]), "command"),
- disabled: options.value.length <= 1
- },
- {
- label: workflowBookmarkStore.isBookmarked(tab.workflow.path) ? t2("tabMenu.removeFromBookmarks") : t2("tabMenu.addToBookmarks"),
- command: /* @__PURE__ */ __name(() => workflowBookmarkStore.toggleBookmarked(tab.workflow.path), "command"),
- disabled: tab.workflow.isTemporary
- }
- ];
- });
- const commandStore = useCommandStore();
- const handleWheel = /* @__PURE__ */ __name((event) => {
- const scrollElement = event.currentTarget;
- const scrollAmount = event.deltaX || event.deltaY;
- scrollElement.scroll({
- left: scrollElement.scrollLeft + scrollAmount
- });
- }, "handleWheel");
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
- createVNode(unref(script$d), {
- class: "overflow-hidden no-drag",
- "pt:content": {
- class: "p-0 w-full",
- onwheel: handleWheel
- },
- "pt:barX": "h-1"
- }, {
- default: withCtx(() => [
- createVNode(unref(script$c), {
- class: normalizeClass(["workflow-tabs bg-transparent", props.class]),
- modelValue: selectedWorkflow.value,
- "onUpdate:modelValue": onWorkflowChange,
- options: options.value,
- optionLabel: "label",
- dataKey: "value"
- }, {
- option: withCtx(({ option }) => [
- createVNode(WorkflowTab, {
- onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option), "onContextmenu"),
- onMouseup: withModifiers(($event) => onCloseWorkflow(option), ["middle"]),
- "workflow-option": option
- }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"])
- ]),
- _: 1
- }, 8, ["class", "modelValue", "options"])
- ]),
- _: 1
- }, 8, ["pt:content"]),
- withDirectives(createVNode(unref(script), {
- class: "new-blank-workflow-button flex-shrink-0 no-drag",
- icon: "pi pi-plus",
- text: "",
- severity: "secondary",
- "aria-label": _ctx.$t("sideToolbar.newBlankWorkflow"),
- onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow"))
- }, null, 8, ["aria-label"]), [
- [_directive_tooltip, { value: _ctx.$t("sideToolbar.newBlankWorkflow"), showDelay: 300 }]
- ]),
- createVNode(unref(script$e), {
- ref_key: "menu",
- ref: menu,
- model: contextMenuItems.value
- }, null, 8, ["model"])
- ]);
- };
- }
-});
-const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-54fadc45"]]);
-const _hoisted_1$b = { class: "absolute top-0 left-0 w-auto max-w-full" };
-const _sfc_main$9 = /* @__PURE__ */ defineComponent({
- __name: "SecondRowWorkflowTabs",
- setup(__props) {
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
- createVNode(WorkflowTabs)
- ]);
- };
- }
-});
-const SecondRowWorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6ab68035"]]);
-const useCanvasDrop = /* @__PURE__ */ __name((canvasRef) => {
- const modelToNodeStore = useModelToNodeStore();
- const litegraphService = useLitegraphService();
- const workflowService = useWorkflowService();
- usePragmaticDroppable(() => canvasRef.value, {
- getDropEffect: /* @__PURE__ */ __name((args) => args.source.data.type === "tree-explorer-node" ? "copy" : "move", "getDropEffect"),
- onDrop: /* @__PURE__ */ __name((event) => {
- const loc = event.location.current.input;
- const dndData = event.source.data;
- if (dndData.type === "tree-explorer-node") {
- const node = dndData.data;
- if (node.data instanceof ComfyNodeDefImpl) {
- const nodeDef = node.data;
- const pos = app.clientPosToCanvasPos([
- loc.clientX,
- loc.clientY + LiteGraph.NODE_TITLE_HEIGHT
- ]);
- litegraphService.addNodeOnGraph(nodeDef, { pos });
- } else if (node.data instanceof ComfyModelDef) {
- const model = node.data;
- const pos = app.clientPosToCanvasPos([loc.clientX, loc.clientY]);
- const nodeAtPos = app.graph.getNodeOnPos(pos[0], pos[1]);
- let targetProvider = null;
- let targetGraphNode = null;
- if (nodeAtPos) {
- const providers = modelToNodeStore.getAllNodeProviders(
- model.directory
- );
- for (const provider of providers) {
- if (provider.nodeDef.name === nodeAtPos.comfyClass) {
- targetGraphNode = nodeAtPos;
- targetProvider = provider;
- }
- }
- }
- if (!targetGraphNode) {
- const provider = modelToNodeStore.getNodeProvider(model.directory);
- if (provider) {
- targetGraphNode = litegraphService.addNodeOnGraph(
- provider.nodeDef,
- {
- pos
- }
- );
- targetProvider = provider;
- }
- }
- if (targetGraphNode) {
- const widget = targetGraphNode.widgets?.find(
- (widget2) => widget2.name === targetProvider?.key
- );
- if (widget) {
- widget.value = model.file_name;
- }
- }
- } else if (node.data instanceof ComfyWorkflow) {
- const workflow = node.data;
- const position = app.clientPosToCanvasPos([
- loc.clientX,
- loc.clientY
- ]);
- workflowService.insertWorkflow(workflow, { position });
- }
- }
- }, "onDrop")
- });
-}, "useCanvasDrop");
-const useContextMenuTranslation = /* @__PURE__ */ __name(() => {
- const f = LGraphCanvas.prototype.getCanvasMenuOptions;
- const getCanvasCenterMenuOptions = /* @__PURE__ */ __name(function(...args) {
- const res = f.apply(this, args);
- for (const item of res) {
- if (item?.content) {
- item.content = st(`contextMenu.${item.content}`, item.content);
- }
- }
- return res;
- }, "getCanvasCenterMenuOptions");
- LGraphCanvas.prototype.getCanvasMenuOptions = getCanvasCenterMenuOptions;
- function translateMenus(values, options) {
- if (!values) return;
- const reInput = /Convert (.*) to input/;
- const reWidget = /Convert (.*) to widget/;
- const cvt = st("contextMenu.Convert ", "Convert ");
- const tinp = st("contextMenu. to input", " to input");
- const twgt = st("contextMenu. to widget", " to widget");
- for (const value of values) {
- if (typeof value === "string") continue;
- translateMenus(value?.submenu?.options, options);
- if (!value?.content) {
- continue;
- }
- if (te(`contextMenu.${value.content}`)) {
- value.content = st(`contextMenu.${value.content}`, value.content);
- }
- const extraInfo = options.extra || options.parentMenu?.options?.extra;
- const matchInput = value.content?.match(reInput);
- if (matchInput) {
- let match = matchInput[1];
- extraInfo?.inputs?.find((i) => {
- if (i.name != match) return false;
- match = i.label ? i.label : i.name;
- });
- extraInfo?.widgets?.find((i) => {
- if (i.name != match) return false;
- match = i.label ? i.label : i.name;
- });
- value.content = cvt + match + tinp;
- continue;
- }
- const matchWidget = value.content?.match(reWidget);
- if (matchWidget) {
- let match = matchWidget[1];
- extraInfo?.inputs?.find((i) => {
- if (i.name != match) return false;
- match = i.label ? i.label : i.name;
- });
- extraInfo?.widgets?.find((i) => {
- if (i.name != match) return false;
- match = i.label ? i.label : i.name;
- });
- value.content = cvt + match + twgt;
- continue;
- }
- }
- }
- __name(translateMenus, "translateMenus");
- const OriginalContextMenu = LiteGraph.ContextMenu;
- function ContextMenu2(values, options) {
- if (options.title) {
- options.title = st(
- `nodeDefs.${normalizeI18nKey(options.title)}.display_name`,
- options.title
- );
- }
- translateMenus(values, options);
- const ctx = new OriginalContextMenu(values, options);
- return ctx;
- }
- __name(ContextMenu2, "ContextMenu");
- LiteGraph.ContextMenu = ContextMenu2;
-}, "useContextMenuTranslation");
-const useCopy = /* @__PURE__ */ __name(() => {
- const canvasStore = useCanvasStore();
- useEventListener(document, "copy", (e) => {
- if (!(e.target instanceof Element)) {
- return;
- }
- if (e.target instanceof HTMLTextAreaElement && e.target.type === "textarea" || e.target instanceof HTMLInputElement && e.target.type === "text") {
- return;
- }
- const isTargetInGraph = e.target.classList.contains("litegraph") || e.target.classList.contains("graph-canvas-container") || e.target.id === "graph-canvas";
- const canvas = canvasStore.canvas;
- if (isTargetInGraph && canvas?.selectedItems) {
- canvas.copyToClipboard();
- e.clipboardData?.setData("text", " ");
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- }
- });
-}, "useCopy");
-const useGlobalLitegraph = /* @__PURE__ */ __name(() => {
- window["LiteGraph"] = LiteGraph;
- window["LGraph"] = LGraph;
- window["LLink"] = LLink;
- window["LGraphNode"] = LGraphNode;
- window["LGraphGroup"] = LGraphGroup;
- window["DragAndScale"] = DragAndScale;
- window["LGraphCanvas"] = LGraphCanvas;
- window["ContextMenu"] = ContextMenu;
- window["LGraphBadge"] = LGraphBadge;
-}, "useGlobalLitegraph");
-const useLitegraphSettings = /* @__PURE__ */ __name(() => {
- const settingStore = useSettingStore();
- const canvasStore = useCanvasStore();
- watchEffect(() => {
- const canvasInfoEnabled = settingStore.get("Comfy.Graph.CanvasInfo");
- if (canvasStore.canvas) {
- canvasStore.canvas.show_info = canvasInfoEnabled;
- }
- });
- watchEffect(() => {
- const zoomSpeed = settingStore.get("Comfy.Graph.ZoomSpeed");
- if (canvasStore.canvas) {
- canvasStore.canvas.zoom_speed = zoomSpeed;
- }
- });
- watchEffect(() => {
- LiteGraph.snaps_for_comfy = settingStore.get(
- "Comfy.Node.AutoSnapLinkToSlot"
- );
- });
- watchEffect(() => {
- LiteGraph.snap_highlights_node = settingStore.get(
- "Comfy.Node.SnapHighlightsNode"
- );
- });
- watchEffect(() => {
- LGraphNode.keepAllLinksOnBypass = settingStore.get(
- "Comfy.Node.BypassAllLinksOnDelete"
- );
- });
- watchEffect(() => {
- LiteGraph.middle_click_slot_add_default_node = settingStore.get(
- "Comfy.Node.MiddleClickRerouteNode"
- );
- });
- watchEffect(() => {
- const linkRenderMode = settingStore.get("Comfy.LinkRenderMode");
- if (canvasStore.canvas) {
- canvasStore.canvas.links_render_mode = linkRenderMode;
- canvasStore.canvas.setDirty(
- /* fg */
- false,
- /* bg */
- true
- );
- }
- });
- watchEffect(() => {
- const lowQualityRenderingZoomThreshold = settingStore.get(
- "LiteGraph.Canvas.LowQualityRenderingZoomThreshold"
- );
- if (canvasStore.canvas) {
- canvasStore.canvas.low_quality_zoom_threshold = lowQualityRenderingZoomThreshold;
- canvasStore.canvas.setDirty(
- /* fg */
- true,
- /* bg */
- true
- );
- }
- });
- watchEffect(() => {
- const linkMarkerShape = settingStore.get("Comfy.Graph.LinkMarkers");
- const { canvas } = canvasStore;
- if (canvas) {
- canvas.linkMarkerShape = linkMarkerShape;
- canvas.setDirty(false, true);
- }
- });
- watchEffect(() => {
- const reroutesEnabled = settingStore.get("Comfy.RerouteBeta");
- const { canvas } = canvasStore;
- if (canvas) {
- canvas.reroutesEnabled = reroutesEnabled;
- canvas.setDirty(false, true);
- }
- });
- watchEffect(() => {
- const maximumFps = settingStore.get("LiteGraph.Canvas.MaximumFps");
- const { canvas } = canvasStore;
- if (canvas) canvas.maximumFps = maximumFps;
- });
- watchEffect(() => {
- const dragZoomEnabled = settingStore.get("Comfy.Graph.CtrlShiftZoom");
- const { canvas } = canvasStore;
- if (canvas) canvas.dragZoomEnabled = dragZoomEnabled;
- });
- watchEffect(() => {
- CanvasPointer.doubleClickTime = settingStore.get(
- "Comfy.Pointer.DoubleClickTime"
- );
- });
- watchEffect(() => {
- CanvasPointer.bufferTime = settingStore.get("Comfy.Pointer.ClickBufferTime");
- });
- watchEffect(() => {
- CanvasPointer.maxClickDrift = settingStore.get("Comfy.Pointer.ClickDrift");
- });
- watchEffect(() => {
- LiteGraph.CANVAS_GRID_SIZE = settingStore.get("Comfy.SnapToGrid.GridSize");
- });
- watchEffect(() => {
- LiteGraph.alwaysSnapToGrid = settingStore.get("pysssss.SnapToGrid");
- });
- watchEffect(() => {
- LiteGraph.context_menu_scaling = settingStore.get(
- "LiteGraph.ContextMenu.Scaling"
- );
- });
-}, "useLitegraphSettings");
-const usePaste = /* @__PURE__ */ __name(() => {
- const workspaceStore = useWorkspaceStore();
- const canvasStore = useCanvasStore();
- useEventListener(document, "paste", async (e) => {
- if (workspaceStore.shiftDown) return;
- const canvas = canvasStore.canvas;
- if (!canvas) return;
- const graph = canvas.graph;
- let data = e.clipboardData || window.clipboardData;
- const items = data.items;
- for (const item of items) {
- if (item.type.startsWith("image/")) {
- let imageNode = null;
- const currentNode = canvas.current_node;
- if (currentNode && currentNode.is_selected && isImageNode(currentNode)) {
- imageNode = currentNode;
- }
- if (!imageNode) {
- const newNode = LiteGraph.createNode("LoadImage");
- newNode.pos = [...canvas.graph_mouse];
- imageNode = graph.add(newNode) ?? null;
- graph.change();
- }
- const blob = item.getAsFile();
- imageNode?.pasteFile?.(blob);
- return;
- }
- }
- data = data.getData("text/plain");
- let workflow = null;
- try {
- data = data.slice(data.indexOf("{"));
- workflow = JSON.parse(data);
- } catch (err) {
- try {
- data = data.slice(data.indexOf("workflow\n"));
- data = data.slice(data.indexOf("{"));
- workflow = JSON.parse(data);
- } catch (error) {
- workflow = null;
- }
- }
- if (workflow && workflow.version && workflow.nodes && workflow.extra) {
- await app.loadGraphData(workflow);
- } else {
- if (e.target instanceof HTMLTextAreaElement && e.target.type === "textarea" || e.target instanceof HTMLInputElement && e.target.type === "text") {
- return;
- }
- canvas.pasteFromClipboard();
- }
- });
-}, "usePaste");
-function useWorkflowPersistence() {
- const workflowStore = useWorkflowStore();
- const settingStore = useSettingStore();
- const persistCurrentWorkflow = /* @__PURE__ */ __name(() => {
- const workflow = JSON.stringify(app.serializeGraph());
- localStorage.setItem("workflow", workflow);
- if (api.clientId) {
- sessionStorage.setItem(`workflow:${api.clientId}`, workflow);
- }
- }, "persistCurrentWorkflow");
- const loadWorkflowFromStorage = /* @__PURE__ */ __name(async (json, workflowName) => {
- if (!json) return false;
- const workflow = JSON.parse(json);
- await app.loadGraphData(workflow, true, true, workflowName);
- return true;
- }, "loadWorkflowFromStorage");
- const loadPreviousWorkflowFromStorage = /* @__PURE__ */ __name(async () => {
- const workflowName = getStorageValue("Comfy.PreviousWorkflow");
- const clientId = api.initialClientId ?? api.clientId;
- if (clientId) {
- const sessionWorkflow = sessionStorage.getItem(`workflow:${clientId}`);
- if (await loadWorkflowFromStorage(sessionWorkflow, workflowName)) {
- return true;
- }
- }
- const localWorkflow = localStorage.getItem("workflow");
- return await loadWorkflowFromStorage(localWorkflow, workflowName);
- }, "loadPreviousWorkflowFromStorage");
- const loadDefaultWorkflow = /* @__PURE__ */ __name(async () => {
- if (!settingStore.get("Comfy.TutorialCompleted")) {
- await settingStore.set("Comfy.TutorialCompleted", true);
- await useModelStore().loadModelFolders();
- await useWorkflowService().loadTutorialWorkflow();
- } else {
- await app.loadGraphData();
- }
- }, "loadDefaultWorkflow");
- const restorePreviousWorkflow = /* @__PURE__ */ __name(async () => {
- try {
- const restored = await loadPreviousWorkflowFromStorage();
- if (!restored) {
- await loadDefaultWorkflow();
- }
- } catch (err) {
- console.error("Error loading previous workflow", err);
- await loadDefaultWorkflow();
- }
- }, "restorePreviousWorkflow");
- watchEffect(() => {
- if (workflowStore.activeWorkflow) {
- const workflow = workflowStore.activeWorkflow;
- setStorageValue("Comfy.PreviousWorkflow", workflow.key);
- persistCurrentWorkflow();
- }
- });
- api.addEventListener("graphChanged", persistCurrentWorkflow);
- const openWorkflows = computed(() => workflowStore.openWorkflows);
- const activeWorkflow = computed(() => workflowStore.activeWorkflow);
- const restoreState = computed(
- () => {
- if (!openWorkflows.value || !activeWorkflow.value) {
- return { paths: [], activeIndex: -1 };
- }
- const paths = openWorkflows.value.filter((workflow) => workflow?.isPersisted && !workflow.isModified).map((workflow) => workflow.path);
- const activeIndex = openWorkflows.value.findIndex(
- (workflow) => workflow.path === activeWorkflow.value?.path
- );
- return { paths, activeIndex };
- }
- );
- const storedWorkflows = JSON.parse(
- getStorageValue("Comfy.OpenWorkflowsPaths") || "[]"
- );
- const storedActiveIndex = JSON.parse(
- getStorageValue("Comfy.ActiveWorkflowIndex") || "-1"
- );
- watch(restoreState, ({ paths, activeIndex }) => {
- setStorageValue("Comfy.OpenWorkflowsPaths", JSON.stringify(paths));
- setStorageValue("Comfy.ActiveWorkflowIndex", JSON.stringify(activeIndex));
- });
- const restoreWorkflowTabsState = /* @__PURE__ */ __name(() => {
- const isRestorable = storedWorkflows?.length > 0 && storedActiveIndex >= 0;
- if (isRestorable) {
- workflowStore.openWorkflowsInBackground({
- left: storedWorkflows.slice(0, storedActiveIndex),
- right: storedWorkflows.slice(storedActiveIndex)
- });
- }
- }, "restoreWorkflowTabsState");
- return {
- restorePreviousWorkflow,
- restoreWorkflowTabsState
- };
-}
-__name(useWorkflowPersistence, "useWorkflowPersistence");
-const CORE_SETTINGS = [
- {
- id: "Comfy.Validation.Workflows",
- name: "Validate workflows",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.NodeSearchBoxImpl",
- category: ["Comfy", "Node Search Box", "Implementation"],
- experimental: true,
- name: "Node search box implementation",
- type: "combo",
- options: ["default", "litegraph (legacy)"],
- defaultValue: "default"
- },
- {
- id: "Comfy.LinkRelease.Action",
- category: ["LiteGraph", "LinkRelease", "Action"],
- name: "Action on link release (No modifier)",
- type: "combo",
- options: Object.values(LinkReleaseTriggerAction),
- defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU
- },
- {
- id: "Comfy.LinkRelease.ActionShift",
- category: ["LiteGraph", "LinkRelease", "ActionShift"],
- name: "Action on link release (Shift)",
- type: "combo",
- options: Object.values(LinkReleaseTriggerAction),
- defaultValue: LinkReleaseTriggerAction.SEARCH_BOX
- },
- {
- id: "Comfy.NodeSearchBoxImpl.NodePreview",
- category: ["Comfy", "Node Search Box", "NodePreview"],
- name: "Node preview",
- tooltip: "Only applies to the default implementation",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.NodeSearchBoxImpl.ShowCategory",
- category: ["Comfy", "Node Search Box", "ShowCategory"],
- name: "Show node category in search results",
- tooltip: "Only applies to the default implementation",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.NodeSearchBoxImpl.ShowIdName",
- category: ["Comfy", "Node Search Box", "ShowIdName"],
- name: "Show node id name in search results",
- tooltip: "Only applies to the default implementation",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.NodeSearchBoxImpl.ShowNodeFrequency",
- category: ["Comfy", "Node Search Box", "ShowNodeFrequency"],
- name: "Show node frequency in search results",
- tooltip: "Only applies to the default implementation",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.Sidebar.Location",
- category: ["Appearance", "Sidebar", "Location"],
- name: "Sidebar location",
- type: "combo",
- options: ["left", "right"],
- defaultValue: "left"
- },
- {
- id: "Comfy.Sidebar.Size",
- category: ["Appearance", "Sidebar", "Size"],
- name: "Sidebar size",
- type: "combo",
- options: ["normal", "small"],
- // Default to small if the window is less than 1536px(2xl) wide.
- defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "small" : "normal", "defaultValue")
- },
- {
- id: "Comfy.TextareaWidget.FontSize",
- category: ["Appearance", "Node Widget", "TextareaWidget", "FontSize"],
- name: "Textarea widget font size",
- type: "slider",
- defaultValue: 10,
- attrs: {
- min: 8,
- max: 24
- }
- },
- {
- id: "Comfy.TextareaWidget.Spellcheck",
- category: ["Comfy", "Node Widget", "TextareaWidget", "Spellcheck"],
- name: "Textarea widget spellcheck",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.Workflow.SortNodeIdOnSave",
- name: "Sort node IDs when saving workflow",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.Graph.CanvasInfo",
- category: ["LiteGraph", "Canvas", "CanvasInfo"],
- name: "Show canvas info on bottom left corner (fps, etc.)",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Node.ShowDeprecated",
- name: "Show deprecated nodes in search",
- tooltip: "Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.Node.ShowExperimental",
- name: "Show experimental nodes in search",
- tooltip: "Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Node.Opacity",
- category: ["Appearance", "Node", "Opacity"],
- name: "Node opacity",
- type: "slider",
- defaultValue: 1,
- attrs: {
- min: 0.01,
- max: 1,
- step: 0.01
- }
- },
- {
- id: "Comfy.Workflow.ShowMissingNodesWarning",
- name: "Show missing nodes warning",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Workflow.ShowMissingModelsWarning",
- name: "Show missing models warning",
- type: "boolean",
- defaultValue: true,
- experimental: true
- },
- {
- id: "Comfy.Graph.ZoomSpeed",
- category: ["LiteGraph", "Canvas", "ZoomSpeed"],
- name: "Canvas zoom speed",
- type: "slider",
- defaultValue: 1.1,
- attrs: {
- min: 1.01,
- max: 2.5,
- step: 0.01
- }
- },
- // Bookmarks are stored in the settings store.
- // Bookmarks are in format of category/display_name. e.g. "conditioning/CLIPTextEncode"
- {
- id: "Comfy.NodeLibrary.Bookmarks",
- name: "Node library bookmarks with display name (deprecated)",
- type: "hidden",
- defaultValue: [],
- deprecated: true
- },
- {
- id: "Comfy.NodeLibrary.Bookmarks.V2",
- name: "Node library bookmarks v2 with unique name",
- type: "hidden",
- defaultValue: []
- },
- // Stores mapping from bookmark folder name to its customization.
- {
- id: "Comfy.NodeLibrary.BookmarksCustomization",
- name: "Node library bookmarks customization",
- type: "hidden",
- defaultValue: {}
- },
- // Hidden setting used by the queue for how to fit images
- {
- id: "Comfy.Queue.ImageFit",
- name: "Queue image fit",
- type: "hidden",
- defaultValue: "cover"
- },
- {
- id: "Comfy.GroupSelectedNodes.Padding",
- category: ["LiteGraph", "Group", "Padding"],
- name: "Group selected nodes padding",
- type: "slider",
- defaultValue: 10,
- attrs: {
- min: 0,
- max: 100
- }
- },
- {
- id: "Comfy.Node.DoubleClickTitleToEdit",
- category: ["LiteGraph", "Node", "DoubleClickTitleToEdit"],
- name: "Double click node title to edit",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Group.DoubleClickTitleToEdit",
- category: ["LiteGraph", "Group", "DoubleClickTitleToEdit"],
- name: "Double click group title to edit",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Window.UnloadConfirmation",
- name: "Show confirmation when closing window",
- type: "boolean",
- defaultValue: true,
- versionModified: "1.7.12"
- },
- {
- id: "Comfy.TreeExplorer.ItemPadding",
- category: ["Appearance", "Tree Explorer", "ItemPadding"],
- name: "Tree explorer item padding",
- type: "slider",
- defaultValue: 2,
- attrs: {
- min: 0,
- max: 8,
- step: 1
- }
- },
- {
- id: "Comfy.ModelLibrary.AutoLoadAll",
- name: "Automatically load all model folders",
- tooltip: "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.ModelLibrary.NameFormat",
- name: "What name to display in the model library tree view",
- tooltip: 'Select "filename" to render a simplified view of the raw filename (without directory or ".safetensors" extension) in the model list. Select "title" to display the configurable model metadata title.',
- type: "combo",
- options: ["filename", "title"],
- defaultValue: "title"
- },
- {
- id: "Comfy.Locale",
- name: "Language",
- type: "combo",
- options: [
- { value: "en", text: "English" },
- { value: "zh", text: "中文" },
- { value: "ru", text: "Русский" },
- { value: "ja", text: "日本語" },
- { value: "ko", text: "한국어" },
- { value: "fr", text: "Français" }
- ],
- defaultValue: /* @__PURE__ */ __name(() => navigator.language.split("-")[0] || "en", "defaultValue")
- },
- {
- id: "Comfy.NodeBadge.NodeSourceBadgeMode",
- category: ["LiteGraph", "Node", "NodeSourceBadgeMode"],
- name: "Node source badge mode",
- type: "combo",
- options: Object.values(NodeBadgeMode),
- defaultValue: NodeBadgeMode.HideBuiltIn
- },
- {
- id: "Comfy.NodeBadge.NodeIdBadgeMode",
- category: ["LiteGraph", "Node", "NodeIdBadgeMode"],
- name: "Node ID badge mode",
- type: "combo",
- options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll],
- defaultValue: NodeBadgeMode.None
- },
- {
- id: "Comfy.NodeBadge.NodeLifeCycleBadgeMode",
- category: ["LiteGraph", "Node", "NodeLifeCycleBadgeMode"],
- name: "Node life cycle badge mode",
- type: "combo",
- options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll],
- defaultValue: NodeBadgeMode.ShowAll
- },
- {
- id: "Comfy.ConfirmClear",
- category: ["Comfy", "Workflow", "ConfirmClear"],
- name: "Require confirmation when clearing workflow",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.PromptFilename",
- category: ["Comfy", "Workflow", "PromptFilename"],
- name: "Prompt for filename when saving workflow",
- type: "boolean",
- defaultValue: true
- },
- /**
- * file format for preview
- *
- * format;quality
- *
- * ex)
- * webp;50 -> webp, quality 50
- * jpeg;80 -> rgb, jpeg, quality 80
- *
- * @type {string}
- */
- {
- id: "Comfy.PreviewFormat",
- category: ["LiteGraph", "Node Widget", "PreviewFormat"],
- name: "Preview image format",
- tooltip: "When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.",
- type: "text",
- defaultValue: ""
- },
- {
- id: "Comfy.DisableSliders",
- category: ["LiteGraph", "Node Widget", "DisableSliders"],
- name: "Disable node widget sliders",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.DisableFloatRounding",
- category: ["LiteGraph", "Node Widget", "DisableFloatRounding"],
- name: "Disable default float widget rounding.",
- tooltip: "(requires page reload) Cannot disable round when round is set by the node in the backend.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "Comfy.FloatRoundingPrecision",
- category: ["LiteGraph", "Node Widget", "FloatRoundingPrecision"],
- name: "Float widget rounding decimal places [0 = auto].",
- tooltip: "(requires page reload)",
- type: "slider",
- attrs: {
- min: 0,
- max: 6,
- step: 1
- },
- defaultValue: 0
- },
- {
- id: "LiteGraph.Node.TooltipDelay",
- name: "Tooltip Delay",
- type: "number",
- attrs: {
- min: 100,
- max: 3e3,
- step: 50
- },
- defaultValue: 500,
- versionAdded: "1.9.0"
- },
- {
- id: "Comfy.EnableTooltips",
- category: ["LiteGraph", "Node", "EnableTooltips"],
- name: "Enable Tooltips",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.DevMode",
- name: "Enable dev mode options (API save, etc.)",
- type: "boolean",
- defaultValue: false,
- onChange: /* @__PURE__ */ __name((value) => {
- const element = document.getElementById("comfy-dev-save-api-button");
- if (element) {
- element.style.display = value ? "flex" : "none";
- }
- }, "onChange")
- },
- {
- id: "Comfy.UseNewMenu",
- category: ["Comfy", "Menu", "UseNewMenu"],
- defaultValue: "Top",
- name: "Use new menu",
- type: "combo",
- options: ["Disabled", "Top", "Bottom"],
- migrateDeprecatedValue: /* @__PURE__ */ __name((value) => {
- if (value === "Floating") {
- return "Top";
- }
- return value;
- }, "migrateDeprecatedValue")
- },
- {
- id: "Comfy.Workflow.WorkflowTabsPosition",
- name: "Opened workflows position",
- type: "combo",
- options: ["Sidebar", "Topbar", "Topbar (2nd-row)"],
- // Default to topbar (2nd-row) if the window is less than 1536px(2xl) wide.
- defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "Topbar (2nd-row)" : "Topbar", "defaultValue")
- },
- {
- id: "Comfy.Graph.CanvasMenu",
- category: ["LiteGraph", "Canvas", "CanvasMenu"],
- name: "Show graph canvas menu",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.QueueButton.BatchCountLimit",
- name: "Batch count limit",
- tooltip: "The maximum number of tasks added to the queue at one button click",
- type: "number",
- defaultValue: 100,
- versionAdded: "1.3.5"
- },
- {
- id: "Comfy.Keybinding.UnsetBindings",
- name: "Keybindings unset by the user",
- type: "hidden",
- defaultValue: [],
- versionAdded: "1.3.7",
- versionModified: "1.7.3",
- migrateDeprecatedValue: /* @__PURE__ */ __name((value) => {
- return value.map((keybinding) => {
- if (keybinding["targetSelector"] === "#graph-canvas") {
- keybinding["targetElementId"] = "graph-canvas";
- }
- return keybinding;
- });
- }, "migrateDeprecatedValue")
- },
- {
- id: "Comfy.Keybinding.NewBindings",
- name: "Keybindings set by the user",
- type: "hidden",
- defaultValue: [],
- versionAdded: "1.3.7"
- },
- {
- id: "Comfy.Extension.Disabled",
- name: "Disabled extension names",
- type: "hidden",
- defaultValue: [],
- versionAdded: "1.3.11"
- },
- {
- id: "Comfy.Validation.NodeDefs",
- name: "Validate node definitions (slow)",
- type: "boolean",
- tooltip: "Recommended for node developers. This will validate all node definitions on startup.",
- defaultValue: false,
- versionAdded: "1.3.14"
- },
- {
- id: "Comfy.LinkRenderMode",
- category: ["LiteGraph", "Graph", "LinkRenderMode"],
- name: "Link Render Mode",
- defaultValue: 2,
- type: "combo",
- options: [
- { value: LiteGraph.STRAIGHT_LINK, text: "Straight" },
- { value: LiteGraph.LINEAR_LINK, text: "Linear" },
- { value: LiteGraph.SPLINE_LINK, text: "Spline" },
- { value: LiteGraph.HIDDEN_LINK, text: "Hidden" }
- ]
- },
- {
- id: "Comfy.Node.AutoSnapLinkToSlot",
- category: ["LiteGraph", "Node", "AutoSnapLinkToSlot"],
- name: "Auto snap link to node slot",
- tooltip: "When dragging a link over a node, the link automatically snap to a viable input slot on the node",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.3.29"
- },
- {
- id: "Comfy.Node.SnapHighlightsNode",
- category: ["LiteGraph", "Node", "SnapHighlightsNode"],
- name: "Snap highlights node",
- tooltip: "When dragging a link over a node with viable input slot, highlight the node",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.3.29"
- },
- {
- id: "Comfy.Node.BypassAllLinksOnDelete",
- category: ["LiteGraph", "Node", "BypassAllLinksOnDelete"],
- name: "Keep all links when deleting nodes",
- tooltip: "When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.3.40"
- },
- {
- id: "Comfy.Node.MiddleClickRerouteNode",
- category: ["LiteGraph", "Node", "MiddleClickRerouteNode"],
- name: "Middle-click creates a new Reroute node",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.3.42"
- },
- {
- id: "Comfy.RerouteBeta",
- category: ["LiteGraph", "RerouteBeta"],
- name: "Opt-in to the reroute beta test",
- tooltip: "Enables the new native reroutes.\n\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\n\nDisabling this option is non-destructive - reroutes are hidden.",
- experimental: true,
- type: "boolean",
- defaultValue: false,
- versionAdded: "1.3.42"
- },
- {
- id: "Comfy.Graph.LinkMarkers",
- category: ["LiteGraph", "Link", "LinkMarkers"],
- name: "Link midpoint markers",
- defaultValue: LinkMarkerShape.Circle,
- type: "combo",
- options: [
- { value: LinkMarkerShape.None, text: "None" },
- { value: LinkMarkerShape.Circle, text: "Circle" },
- { value: LinkMarkerShape.Arrow, text: "Arrow" }
- ],
- versionAdded: "1.3.42"
- },
- {
- id: "Comfy.DOMClippingEnabled",
- category: ["LiteGraph", "Node", "DOMClippingEnabled"],
- name: "Enable DOM element clipping (enabling may reduce performance)",
- type: "boolean",
- defaultValue: true
- },
- {
- id: "Comfy.Graph.CtrlShiftZoom",
- category: ["LiteGraph", "Canvas", "CtrlShiftZoom"],
- name: "Enable fast-zoom shortcut (Ctrl + Shift + Drag)",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.4.0"
- },
- {
- id: "Comfy.Pointer.ClickDrift",
- category: ["LiteGraph", "Pointer", "ClickDrift"],
- name: "Pointer click drift (maximum distance)",
- tooltip: "If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.",
- experimental: true,
- type: "slider",
- attrs: {
- min: 0,
- max: 20,
- step: 1
- },
- defaultValue: 6,
- versionAdded: "1.4.3"
- },
- {
- id: "Comfy.Pointer.ClickBufferTime",
- category: ["LiteGraph", "Pointer", "ClickBufferTime"],
- name: "Pointer click drift delay",
- tooltip: "After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.",
- experimental: true,
- type: "slider",
- attrs: {
- min: 0,
- max: 1e3,
- step: 25
- },
- defaultValue: 150,
- versionAdded: "1.4.3"
- },
- {
- id: "Comfy.Pointer.DoubleClickTime",
- category: ["LiteGraph", "Pointer", "DoubleClickTime"],
- name: "Double click interval (maximum)",
- tooltip: "The maximum time in milliseconds between the two clicks of a double-click. Increasing this value may assist if double-clicks are sometimes not registered.",
- type: "slider",
- attrs: {
- min: 100,
- max: 1e3,
- step: 50
- },
- defaultValue: 300,
- versionAdded: "1.4.3"
- },
- {
- id: "Comfy.SnapToGrid.GridSize",
- category: ["LiteGraph", "Canvas", "GridSize"],
- name: "Snap to grid size",
- type: "slider",
- attrs: {
- min: 1,
- max: 500
- },
- tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.",
- defaultValue: LiteGraph.CANVAS_GRID_SIZE
- },
- // Keep the 'pysssss.SnapToGrid' setting id so we don't need to migrate setting values.
- // Using a new setting id can cause existing users to lose their existing settings.
- {
- id: "pysssss.SnapToGrid",
- category: ["LiteGraph", "Canvas", "AlwaysSnapToGrid"],
- name: "Always snap to grid",
- type: "boolean",
- defaultValue: false,
- versionAdded: "1.3.13"
- },
- {
- id: "Comfy.Server.ServerConfigValues",
- name: "Server config values for frontend display",
- tooltip: "Server config values used for frontend display only",
- type: "hidden",
- // Mapping from server config id to value.
- defaultValue: {},
- versionAdded: "1.4.8"
- },
- {
- id: "Comfy.Server.LaunchArgs",
- name: "Server launch arguments",
- tooltip: "These are the actual arguments that are passed to the server when it is launched.",
- type: "hidden",
- defaultValue: {},
- versionAdded: "1.4.8"
- },
- {
- id: "Comfy.Queue.MaxHistoryItems",
- name: "Queue history size",
- tooltip: "The maximum number of tasks that show in the queue history.",
- type: "slider",
- attrs: {
- min: 16,
- max: 256,
- step: 16
- },
- defaultValue: 64,
- versionAdded: "1.4.12"
- },
- {
- id: "LiteGraph.Canvas.MaximumFps",
- name: "Maximum FPS",
- tooltip: "The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0",
- type: "slider",
- attrs: {
- min: 0,
- max: 120
- },
- defaultValue: 0,
- versionAdded: "1.5.1"
- },
- {
- id: "Comfy.EnableWorkflowViewRestore",
- category: ["Comfy", "Workflow", "EnableWorkflowViewRestore"],
- name: "Save and restore canvas position and zoom level in workflows",
- type: "boolean",
- defaultValue: true,
- versionModified: "1.5.4"
- },
- {
- id: "Comfy.Workflow.ConfirmDelete",
- name: "Show confirmation when deleting workflows",
- type: "boolean",
- defaultValue: true,
- versionAdded: "1.5.6"
- },
- {
- id: "Comfy.ColorPalette",
- name: "The active color palette id",
- type: "hidden",
- defaultValue: "dark",
- versionModified: "1.6.7",
- migrateDeprecatedValue(value) {
- return value.startsWith("custom_") ? value.replace("custom_", "") : value;
- }
- },
- {
- id: "Comfy.CustomColorPalettes",
- name: "Custom color palettes",
- type: "hidden",
- defaultValue: {},
- versionModified: "1.6.7"
- },
- {
- id: "Comfy.WidgetControlMode",
- category: ["Comfy", "Node Widget", "WidgetControlMode"],
- name: "Widget control mode",
- tooltip: "Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.",
- type: "combo",
- defaultValue: "after",
- options: ["before", "after"],
- versionModified: "1.6.10"
- },
- {
- id: "Comfy.TutorialCompleted",
- name: "Tutorial completed",
- type: "hidden",
- defaultValue: false,
- versionAdded: "1.8.7"
- },
- {
- id: "LiteGraph.ContextMenu.Scaling",
- name: "Scale node combo widget menus (lists) when zoomed in",
- defaultValue: false,
- type: "boolean",
- versionAdded: "1.8.8"
- },
- {
- id: "LiteGraph.Canvas.LowQualityRenderingZoomThreshold",
- name: "Low quality rendering zoom threshold",
- tooltip: "Render low quality shapes when zoomed out",
- type: "slider",
- attrs: {
- min: 0.1,
- max: 1,
- step: 0.01
- },
- defaultValue: 0.6,
- versionAdded: "1.9.1"
- }
-];
-const _sfc_main$8 = /* @__PURE__ */ defineComponent({
- __name: "GraphCanvas",
- emits: ["ready"],
- setup(__props, { emit: __emit }) {
- const emit = __emit;
- const canvasRef = ref(null);
- const settingStore = useSettingStore();
- const nodeDefStore = useNodeDefStore();
- const workspaceStore = useWorkspaceStore();
- const canvasStore = useCanvasStore();
- const betaMenuEnabled = computed(
- () => settingStore.get("Comfy.UseNewMenu") !== "Disabled"
- );
- const workflowTabsPosition = computed(
- () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition")
- );
- const canvasMenuEnabled = computed(
- () => settingStore.get("Comfy.Graph.CanvasMenu")
- );
- const tooltipEnabled = computed(() => settingStore.get("Comfy.EnableTooltips"));
- watchEffect(() => {
- nodeDefStore.showDeprecated = settingStore.get("Comfy.Node.ShowDeprecated");
- });
- watchEffect(() => {
- nodeDefStore.showExperimental = settingStore.get(
- "Comfy.Node.ShowExperimental"
- );
- });
- watchEffect(() => {
- const spellcheckEnabled = settingStore.get("Comfy.TextareaWidget.Spellcheck");
- const textareas = document.querySelectorAll("textarea.comfy-multiline-input");
- textareas.forEach((textarea) => {
- textarea.spellcheck = spellcheckEnabled;
- textarea.focus();
- textarea.blur();
- });
- });
- watch(
- () => settingStore.get("Comfy.WidgetControlMode"),
- () => {
- if (!canvasStore.canvas) return;
- for (const n of app.graph.nodes) {
- if (!n.widgets) continue;
- for (const w of n.widgets) {
- if (w[IS_CONTROL_WIDGET]) {
- updateControlWidgetLabel(w);
- if (w.linkedWidgets) {
- for (const l of w.linkedWidgets) {
- updateControlWidgetLabel(l);
- }
- }
- }
- }
- }
- app.graph.setDirtyCanvas(true);
- }
- );
- const colorPaletteService = useColorPaletteService();
- const colorPaletteStore = useColorPaletteStore();
- watch(
- [() => canvasStore.canvas, () => settingStore.get("Comfy.ColorPalette")],
- ([canvas, currentPaletteId]) => {
- if (!canvas) return;
- colorPaletteService.loadColorPalette(currentPaletteId);
- }
- );
- watch(
- () => colorPaletteStore.activePaletteId,
- (newValue) => {
- settingStore.set("Comfy.ColorPalette", newValue);
- }
- );
- const loadCustomNodesI18n = /* @__PURE__ */ __name(async () => {
- try {
- const i18nData = await api.getCustomNodesI18n();
- Object.entries(i18nData).forEach(([locale, message]) => {
- i18n.global.mergeLocaleMessage(locale, message);
- });
- } catch (error) {
- console.error("Failed to load custom nodes i18n", error);
- }
- }, "loadCustomNodesI18n");
- const comfyAppReady = ref(false);
- const workflowPersistence = useWorkflowPersistence();
- useCanvasDrop(canvasRef);
- useLitegraphSettings();
- onMounted(async () => {
- useGlobalLitegraph();
- useContextMenuTranslation();
- useCopy();
- usePaste();
- app.vueAppReady = true;
- workspaceStore.spinner = true;
- ChangeTracker.init(app);
- await loadCustomNodesI18n();
- await settingStore.loadSettingValues();
- CORE_SETTINGS.forEach((setting) => {
- settingStore.addSetting(setting);
- });
- await app.setup(canvasRef.value);
- canvasStore.canvas = app.canvas;
- canvasStore.canvas.render_canvas_border = false;
- workspaceStore.spinner = false;
- window["app"] = app;
- window["graph"] = app.graph;
- comfyAppReady.value = true;
- colorPaletteStore.customPalettes = settingStore.get(
- "Comfy.CustomColorPalettes"
- );
- await workflowPersistence.restorePreviousWorkflow();
- workflowPersistence.restoreWorkflowTabsState();
- watch(
- () => settingStore.get("Comfy.Locale"),
- async () => {
- await useCommandStore().execute("Comfy.RefreshNodeDefinitions");
- useWorkflowService().reloadCurrentWorkflow();
- }
- );
- emit("ready");
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock(Fragment, null, [
- comfyAppReady.value && betaMenuEnabled.value && !unref(workspaceStore).focusMode ? (openBlock(), createBlock(LiteGraphCanvasSplitterOverlay, { key: 0 }, {
- "side-bar-panel": withCtx(() => [
- createVNode(SideToolbar)
- ]),
- "bottom-panel": withCtx(() => [
- createVNode(_sfc_main$p)
- ]),
- "graph-canvas-panel": withCtx(() => [
- workflowTabsPosition.value === "Topbar (2nd-row)" ? (openBlock(), createBlock(SecondRowWorkflowTabs, {
- key: 0,
- class: "pointer-events-auto"
- })) : createCommentVNode("", true),
- canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, {
- key: 1,
- class: "pointer-events-auto"
- })) : createCommentVNode("", true)
- ]),
- _: 1
- })) : createCommentVNode("", true),
- createVNode(TitleEditor),
- !betaMenuEnabled.value && canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 1 })) : createCommentVNode("", true),
- createBaseVNode("canvas", {
- ref_key: "canvasRef",
- ref: canvasRef,
- id: "graph-canvas",
- tabindex: "1",
- class: "w-full h-full touch-none"
- }, null, 512),
- createVNode(_sfc_main$h),
- tooltipEnabled.value ? (openBlock(), createBlock(NodeTooltip, { key: 2 })) : createCommentVNode("", true),
- createVNode(_sfc_main$n)
- ], 64);
- };
- }
-});
-const _sfc_main$7 = /* @__PURE__ */ defineComponent({
- __name: "GlobalToast",
- setup(__props) {
- const toast = useToast();
- const toastStore = useToastStore();
- const settingStore = useSettingStore();
- watch(
- () => toastStore.messagesToAdd,
- (newMessages) => {
- if (newMessages.length === 0) {
- return;
- }
- newMessages.forEach((message) => {
- toast.add(message);
- });
- toastStore.messagesToAdd = [];
- },
- { deep: true }
- );
- watch(
- () => toastStore.messagesToRemove,
- (messagesToRemove) => {
- if (messagesToRemove.length === 0) {
- return;
- }
- messagesToRemove.forEach((message) => {
- toast.remove(message);
- });
- toastStore.messagesToRemove = [];
- },
- { deep: true }
- );
- watch(
- () => toastStore.removeAllRequested,
- (requested) => {
- if (requested) {
- toast.removeAllGroups();
- toastStore.removeAllRequested = false;
- }
- }
- );
- function updateToastPosition() {
- const styleElement = document.getElementById("dynamic-toast-style") || createStyleElement();
- const rect = document.querySelector(".graph-canvas-container").getBoundingClientRect();
- styleElement.textContent = `
- .p-toast.p-component.p-toast-top-right {
- top: ${rect.top + 20}px !important;
- right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important;
- }
- `;
- }
- __name(updateToastPosition, "updateToastPosition");
- function createStyleElement() {
- const style = document.createElement("style");
- style.id = "dynamic-toast-style";
- document.head.appendChild(style);
- return style;
- }
- __name(createStyleElement, "createStyleElement");
- watch(
- () => settingStore.get("Comfy.UseNewMenu"),
- () => nextTick(updateToastPosition),
- { immediate: true }
- );
- watch(
- () => settingStore.get("Comfy.Sidebar.Location"),
- () => nextTick(updateToastPosition),
- { immediate: true }
- );
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$f));
- };
- }
-});
-const _hoisted_1$a = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$5(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$a, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "none",
- stroke: "currentColor",
- "stroke-linecap": "round",
- "stroke-linejoin": "round",
- "stroke-width": "2",
- d: "M6 4v16m4-16l10 8l-10 8z"
- }, null, -1)
- ]));
-}
-__name(render$5, "render$5");
-const __unplugin_components_3 = markRaw({ name: "lucide-step-forward", render: render$5 });
-const _hoisted_1$9 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$4(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$9, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "none",
- stroke: "currentColor",
- "stroke-linecap": "round",
- "stroke-linejoin": "round",
- "stroke-width": "2",
- d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z"
- }, null, -1)
- ]));
-}
-__name(render$4, "render$4");
-const __unplugin_components_2 = markRaw({ name: "lucide-fast-forward", render: render$4 });
-const _hoisted_1$8 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$3(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "none",
- stroke: "currentColor",
- "stroke-linecap": "round",
- "stroke-linejoin": "round",
- "stroke-width": "2",
- d: "m6 3l14 9l-14 9z"
- }, null, -1)
- ]));
-}
-__name(render$3, "render$3");
-const __unplugin_components_1$1 = markRaw({ name: "lucide-play", render: render$3 });
-const _hoisted_1$7 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$2(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [
- createBaseVNode("g", {
- fill: "none",
- stroke: "currentColor",
- "stroke-linecap": "round",
- "stroke-linejoin": "round",
- "stroke-width": "2"
- }, [
- createBaseVNode("path", { d: "M16 12H3m13 6H3m7-12H3m18 12V8a2 2 0 0 0-2-2h-5" }),
- createBaseVNode("path", { d: "m16 8l-2-2l2-2" })
- ], -1)
- ]));
-}
-__name(render$2, "render$2");
-const __unplugin_components_0$1 = markRaw({ name: "lucide-list-start", render: render$2 });
-const _hoisted_1$6 = ["aria-label"];
-const minQueueCount = 1;
-const _sfc_main$6 = /* @__PURE__ */ defineComponent({
- __name: "BatchCountEdit",
- props: {
- class: { default: "" }
- },
- setup(__props) {
- const props = __props;
- const queueSettingsStore = useQueueSettingsStore();
- const { batchCount } = storeToRefs(queueSettingsStore);
- const settingStore = useSettingStore();
- const maxQueueCount = computed(
- () => settingStore.get("Comfy.QueueButton.BatchCountLimit")
- );
- const handleClick = /* @__PURE__ */ __name((increment) => {
- let newCount;
- if (increment) {
- const originalCount = batchCount.value - 1;
- newCount = Math.min(originalCount * 2, maxQueueCount.value);
- } else {
- const originalCount = batchCount.value + 1;
- newCount = Math.floor(originalCount / 2);
- }
- batchCount.value = newCount;
- }, "handleClick");
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return withDirectives((openBlock(), createElementBlock("div", {
- class: normalizeClass(["batch-count", props.class]),
- "aria-label": _ctx.$t("menu.batchCount")
- }, [
- createVNode(unref(script$g), {
- class: "w-14",
- modelValue: unref(batchCount),
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(batchCount) ? batchCount.value = $event : null),
- min: minQueueCount,
- max: maxQueueCount.value,
- fluid: "",
- showButtons: "",
- pt: {
- incrementButton: {
- class: "w-6",
- onmousedown: /* @__PURE__ */ __name(() => {
- handleClick(true);
- }, "onmousedown")
- },
- decrementButton: {
- class: "w-6",
- onmousedown: /* @__PURE__ */ __name(() => {
- handleClick(false);
- }, "onmousedown")
- }
- }
- }, null, 8, ["modelValue", "max", "pt"])
- ], 10, _hoisted_1$6)), [
- [
- _directive_tooltip,
- _ctx.$t("menu.batchCount"),
- void 0,
- { bottom: true }
- ]
- ]);
- };
- }
-});
-const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-26957f1f"]]);
-const _hoisted_1$5 = { class: "queue-button-group flex" };
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
- __name: "ComfyQueueButton",
- setup(__props) {
- const workspaceStore = useWorkspaceStore();
- const queueCountStore = storeToRefs(useQueuePendingTaskCountStore());
- const { mode: queueMode } = storeToRefs(useQueueSettingsStore());
- const { t: t2 } = useI18n();
- const queueModeMenuItemLookup = computed(() => ({
- disabled: {
- key: "disabled",
- label: t2("menu.queue"),
- tooltip: t2("menu.disabledTooltip"),
- command: /* @__PURE__ */ __name(() => {
- queueMode.value = "disabled";
- }, "command")
- },
- instant: {
- key: "instant",
- label: `${t2("menu.queue")} (${t2("menu.instant")})`,
- tooltip: t2("menu.instantTooltip"),
- command: /* @__PURE__ */ __name(() => {
- queueMode.value = "instant";
- }, "command")
- },
- change: {
- key: "change",
- label: `${t2("menu.queue")} (${t2("menu.onChange")})`,
- tooltip: t2("menu.onChangeTooltip"),
- command: /* @__PURE__ */ __name(() => {
- queueMode.value = "change";
- }, "command")
- }
- }));
- const activeQueueModeMenuItem = computed(
- () => queueModeMenuItemLookup.value[queueMode.value]
- );
- const queueModeMenuItems = computed(
- () => Object.values(queueModeMenuItemLookup.value)
- );
- const executingPrompt = computed(() => !!queueCountStore.count.value);
- const hasPendingTasks = computed(() => queueCountStore.count.value > 1);
- const commandStore = useCommandStore();
- const queuePrompt = /* @__PURE__ */ __name((e) => {
- const commandId = e.shiftKey ? "Comfy.QueuePromptFront" : "Comfy.QueuePrompt";
- commandStore.execute(commandId);
- }, "queuePrompt");
- return (_ctx, _cache) => {
- const _component_i_lucide58list_start = __unplugin_components_0$1;
- const _component_i_lucide58play = __unplugin_components_1$1;
- const _component_i_lucide58fast_forward = __unplugin_components_2;
- const _component_i_lucide58step_forward = __unplugin_components_3;
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
- withDirectives((openBlock(), createBlock(unref(script$h), {
- class: "comfyui-queue-button",
- label: activeQueueModeMenuItem.value.label,
- severity: "primary",
- size: "small",
- onClick: queuePrompt,
- model: queueModeMenuItems.value,
- "data-testid": "queue-button"
- }, {
- icon: withCtx(() => [
- unref(workspaceStore).shiftDown ? (openBlock(), createBlock(_component_i_lucide58list_start, { key: 0 })) : unref(queueMode) === "disabled" ? (openBlock(), createBlock(_component_i_lucide58play, { key: 1 })) : unref(queueMode) === "instant" ? (openBlock(), createBlock(_component_i_lucide58fast_forward, { key: 2 })) : unref(queueMode) === "change" ? (openBlock(), createBlock(_component_i_lucide58step_forward, { key: 3 })) : createCommentVNode("", true)
- ]),
- item: withCtx(({ item }) => [
- withDirectives(createVNode(unref(script), {
- label: String(item.label),
- icon: item.icon,
- severity: item.key === unref(queueMode) ? "primary" : "secondary",
- size: "small",
- text: ""
- }, null, 8, ["label", "icon", "severity"]), [
- [_directive_tooltip, item.tooltip]
- ])
- ]),
- _: 1
- }, 8, ["label", "model"])), [
- [
- _directive_tooltip,
- unref(workspaceStore).shiftDown ? _ctx.$t("menu.queueWorkflowFront") : _ctx.$t("menu.queueWorkflow"),
- void 0,
- { bottom: true }
- ]
- ]),
- createVNode(BatchCountEdit),
- createVNode(unref(script$6), { class: "execution-actions flex flex-nowrap" }, {
- default: withCtx(() => [
- withDirectives(createVNode(unref(script), {
- icon: "pi pi-times",
- severity: executingPrompt.value ? "danger" : "secondary",
- disabled: !executingPrompt.value,
- text: "",
- "aria-label": _ctx.$t("menu.interrupt"),
- onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.Interrupt"))
- }, null, 8, ["severity", "disabled", "aria-label"]), [
- [
- _directive_tooltip,
- _ctx.$t("menu.interrupt"),
- void 0,
- { bottom: true }
- ]
- ]),
- withDirectives(createVNode(unref(script), {
- icon: "pi pi-stop",
- severity: hasPendingTasks.value ? "danger" : "secondary",
- disabled: !hasPendingTasks.value,
- text: "",
- "aria-label": _ctx.$t("sideToolbar.queueTab.clearPendingTasks"),
- onClick: _cache[1] || (_cache[1] = () => unref(commandStore).execute("Comfy.ClearPendingTasks"))
- }, null, 8, ["severity", "disabled", "aria-label"]), [
- [
- _directive_tooltip,
- _ctx.$t("sideToolbar.queueTab.clearPendingTasks"),
- void 0,
- { bottom: true }
- ]
- ])
- ]),
- _: 1
- })
- ]);
- };
- }
-});
-const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-91a628af"]]);
-const overlapThreshold = 20;
-const _sfc_main$4 = /* @__PURE__ */ defineComponent({
- __name: "ComfyActionbar",
- setup(__props) {
- const settingsStore = useSettingStore();
- const visible = computed(
- () => settingsStore.get("Comfy.UseNewMenu") !== "Disabled"
- );
- const panelRef = ref(null);
- const dragHandleRef = ref(null);
- const isDocked = useLocalStorage("Comfy.MenuPosition.Docked", false);
- const storedPosition = useLocalStorage("Comfy.MenuPosition.Floating", {
- x: 0,
- y: 0
- });
- const {
- x,
- y,
- style,
- isDragging
- } = useDraggable(panelRef, {
- initialValue: { x: 0, y: 0 },
- handle: dragHandleRef,
- containerElement: document.body
- });
- watchDebounced(
- [x, y],
- ([newX, newY]) => {
- storedPosition.value = { x: newX, y: newY };
- },
- { debounce: 300 }
- );
- const setInitialPosition = /* @__PURE__ */ __name(() => {
- if (x.value !== 0 || y.value !== 0) {
- return;
- }
- if (storedPosition.value.x !== 0 || storedPosition.value.y !== 0) {
- x.value = storedPosition.value.x;
- y.value = storedPosition.value.y;
- captureLastDragState();
- return;
- }
- if (panelRef.value) {
- const screenWidth = window.innerWidth;
- const screenHeight = window.innerHeight;
- const menuWidth = panelRef.value.offsetWidth;
- const menuHeight = panelRef.value.offsetHeight;
- if (menuWidth === 0 || menuHeight === 0) {
- return;
- }
- x.value = (screenWidth - menuWidth) / 2;
- y.value = screenHeight - menuHeight - 10;
- captureLastDragState();
- }
- }, "setInitialPosition");
- onMounted(setInitialPosition);
- watch(visible, (newVisible) => {
- if (newVisible) {
- nextTick(setInitialPosition);
- }
- });
- const lastDragState = ref({
- x: x.value,
- y: y.value,
- windowWidth: window.innerWidth,
- windowHeight: window.innerHeight
- });
- const captureLastDragState = /* @__PURE__ */ __name(() => {
- lastDragState.value = {
- x: x.value,
- y: y.value,
- windowWidth: window.innerWidth,
- windowHeight: window.innerHeight
- };
- }, "captureLastDragState");
- watch(
- isDragging,
- (newIsDragging) => {
- if (!newIsDragging) {
- captureLastDragState();
- }
- },
- { immediate: true }
- );
- const adjustMenuPosition = /* @__PURE__ */ __name(() => {
- if (panelRef.value) {
- const screenWidth = window.innerWidth;
- const screenHeight = window.innerHeight;
- const menuWidth = panelRef.value.offsetWidth;
- const menuHeight = panelRef.value.offsetHeight;
- const distanceLeft = lastDragState.value.x;
- const distanceRight = lastDragState.value.windowWidth - (lastDragState.value.x + menuWidth);
- const distanceTop = lastDragState.value.y;
- const distanceBottom = lastDragState.value.windowHeight - (lastDragState.value.y + menuHeight);
- const distances = [
- { edge: "left", distance: distanceLeft },
- { edge: "right", distance: distanceRight },
- { edge: "top", distance: distanceTop },
- { edge: "bottom", distance: distanceBottom }
- ];
- const closestEdge = distances.reduce(
- (min, curr) => curr.distance < min.distance ? curr : min
- );
- const verticalRatio = lastDragState.value.y / lastDragState.value.windowHeight;
- const horizontalRatio = lastDragState.value.x / lastDragState.value.windowWidth;
- if (closestEdge.edge === "left") {
- x.value = closestEdge.distance;
- y.value = verticalRatio * screenHeight;
- } else if (closestEdge.edge === "right") {
- x.value = screenWidth - menuWidth - closestEdge.distance;
- y.value = verticalRatio * screenHeight;
- } else if (closestEdge.edge === "top") {
- x.value = horizontalRatio * screenWidth;
- y.value = closestEdge.distance;
- } else {
- x.value = horizontalRatio * screenWidth;
- y.value = screenHeight - menuHeight - closestEdge.distance;
- }
- x.value = lodashExports.clamp(x.value, 0, screenWidth - menuWidth);
- y.value = lodashExports.clamp(y.value, 0, screenHeight - menuHeight);
- }
- }, "adjustMenuPosition");
- useEventListener(window, "resize", adjustMenuPosition);
- const topMenuRef = inject("topMenuRef");
- const topMenuBounds = useElementBounding(topMenuRef);
- const isOverlappingWithTopMenu = computed(() => {
- if (!panelRef.value) {
- return false;
- }
- const { height } = panelRef.value.getBoundingClientRect();
- const actionbarBottom = y.value + height;
- const topMenuBottom = topMenuBounds.bottom.value;
- const overlapPixels = Math.min(actionbarBottom, topMenuBottom) - Math.max(y.value, topMenuBounds.top.value);
- return overlapPixels > overlapThreshold;
- });
- watch(isDragging, (newIsDragging) => {
- if (!newIsDragging) {
- isDocked.value = isOverlappingWithTopMenu.value;
- } else {
- isDocked.value = false;
- }
- });
- const eventBus = useEventBus("topMenu");
- watch([isDragging, isOverlappingWithTopMenu], ([dragging, overlapping]) => {
- eventBus.emit("updateHighlight", {
- isDragging: dragging,
- isOverlapping: overlapping
- });
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$i), {
- class: normalizeClass(["actionbar w-fit", { "is-dragging": unref(isDragging), "is-docked": unref(isDocked) }]),
- style: normalizeStyle(unref(style))
- }, {
- default: withCtx(() => [
- createBaseVNode("div", {
- class: "actionbar-content flex items-center select-none",
- ref_key: "panelRef",
- ref: panelRef
- }, [
- createBaseVNode("span", {
- class: "drag-handle cursor-move mr-2 p-0!",
- ref_key: "dragHandleRef",
- ref: dragHandleRef
- }, null, 512),
- createVNode(ComfyQueueButton)
- ], 512)
- ]),
- _: 1
- }, 8, ["style", "class"]);
- };
- }
-});
-const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ebd56d51"]]);
-const _hoisted_1$4 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render$1(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "currentColor",
- d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z"
- }, null, -1)
- ]));
-}
-__name(render$1, "render$1");
-const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$1 });
-const _hoisted_1$3 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "currentColor",
- d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z"
- }, null, -1)
- ]));
-}
-__name(render, "render");
-const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render });
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
- __name: "BottomPanelToggleButton",
- setup(__props) {
- const bottomPanelStore = useBottomPanelStore();
- return (_ctx, _cache) => {
- const _component_i_material_symbols58dock_to_bottom = __unplugin_components_0;
- const _component_i_material_symbols58dock_to_bottom_outline = __unplugin_components_1;
- const _directive_tooltip = resolveDirective("tooltip");
- return withDirectives((openBlock(), createBlock(unref(script), {
- severity: "secondary",
- text: "",
- "aria-label": _ctx.$t("menu.toggleBottomPanel"),
- onClick: unref(bottomPanelStore).toggleBottomPanel
- }, {
- icon: withCtx(() => [
- unref(bottomPanelStore).bottomPanelVisible ? (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom, { key: 0 })) : (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom_outline, { key: 1 }))
- ]),
- _: 1
- }, 8, ["aria-label", "onClick"])), [
- [vShow, unref(bottomPanelStore).bottomPanelTabs.length > 0],
- [_directive_tooltip, { value: _ctx.$t("menu.toggleBottomPanel"), showDelay: 300 }]
- ]);
- };
- }
-});
-const _hoisted_1$2 = ["href"];
-const _hoisted_2$2 = { class: "p-menubar-item-label" };
-const _hoisted_3$2 = {
- key: 1,
- class: "ml-auto border border-surface rounded text-muted text-xs text-nowrap p-1 keybinding-tag"
-};
-const _sfc_main$2 = /* @__PURE__ */ defineComponent({
- __name: "CommandMenubar",
- setup(__props) {
- const settingStore = useSettingStore();
- const dropdownDirection = computed(
- () => settingStore.get("Comfy.UseNewMenu") === "Top" ? "down" : "up"
- );
- const menuItemsStore = useMenuItemStore();
- const { t: t2 } = useI18n();
- const translateMenuItem = /* @__PURE__ */ __name((item) => {
- const label = typeof item.label === "function" ? item.label() : item.label;
- const translatedLabel = label ? t2(`menuLabels.${normalizeI18nKey(label)}`, label) : void 0;
- return {
- ...item,
- label: translatedLabel,
- items: item.items?.map(translateMenuItem)
- };
- }, "translateMenuItem");
- const translatedItems = computed(
- () => menuItemsStore.menuItems.map(translateMenuItem)
- );
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$j), {
- model: translatedItems.value,
- class: "top-menubar border-none p-0 bg-transparent",
- pt: {
- rootList: "gap-0 flex-nowrap w-auto",
- submenu: `dropdown-direction-${dropdownDirection.value}`,
- item: "relative"
- }
- }, {
- item: withCtx(({ item, props }) => [
- createBaseVNode("a", mergeProps({ class: "p-menubar-item-link" }, props.action, {
- href: item.url,
- target: "_blank"
- }), [
- item.icon ? (openBlock(), createElementBlock("span", {
- key: 0,
- class: normalizeClass(["p-menubar-item-icon", item.icon])
- }, null, 2)) : createCommentVNode("", true),
- createBaseVNode("span", _hoisted_2$2, toDisplayString(item.label), 1),
- item?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(item.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true)
- ], 16, _hoisted_1$2)
- ]),
- _: 1
- }, 8, ["model", "pt"]);
- };
- }
-});
-const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-56df69d2"]]);
-const _hoisted_1$1 = { class: "flex-grow min-w-0 app-drag h-full" };
-const _hoisted_2$1 = { class: "window-actions-spacer flex-shrink-0" };
-const _hoisted_3$1 = { class: "fixed top-0 left-0 app-drag w-full h-[var(--comfy-topbar-height)]" };
-const _sfc_main$1 = /* @__PURE__ */ defineComponent({
- __name: "TopMenubar",
- setup(__props) {
- const workspaceState = useWorkspaceStore();
- const settingStore = useSettingStore();
- const workflowTabsPosition = computed(
- () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition")
- );
- const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu"));
- const betaMenuEnabled = computed(() => menuSetting.value !== "Disabled");
- const showTopMenu = computed(
- () => betaMenuEnabled.value && !workspaceState.focusMode
- );
- const menuRight = ref(null);
- onMounted(() => {
- if (menuRight.value) {
- menuRight.value.appendChild(app.menu.element);
- }
- });
- const topMenuRef = ref(null);
- provide("topMenuRef", topMenuRef);
- const eventBus = useEventBus("topMenu");
- const isDropZone = ref(false);
- const isDroppable = ref(false);
- eventBus.on((event, payload) => {
- if (event === "updateHighlight") {
- isDropZone.value = payload.isDragging;
- isDroppable.value = payload.isOverlapping && payload.isDragging;
- }
- });
- onMounted(() => {
- if (isElectron()) {
- electronAPI().changeTheme({
- height: topMenuRef.value.getBoundingClientRect().height
- });
- }
- });
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock(Fragment, null, [
- withDirectives(createBaseVNode("div", {
- ref_key: "topMenuRef",
- ref: topMenuRef,
- class: normalizeClass(["comfyui-menu flex items-center", { dropzone: isDropZone.value, "dropzone-active": isDroppable.value }])
- }, [
- _cache[1] || (_cache[1] = createBaseVNode("h1", { class: "comfyui-logo mx-2 app-drag" }, "ComfyUI", -1)),
- createVNode(CommandMenubar),
- createBaseVNode("div", _hoisted_1$1, [
- workflowTabsPosition.value === "Topbar" ? (openBlock(), createBlock(WorkflowTabs, { key: 0 })) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", {
- class: "comfyui-menu-right flex-shrink-0",
- ref_key: "menuRight",
- ref: menuRight
- }, null, 512),
- createVNode(Actionbar),
- createVNode(_sfc_main$3, { class: "flex-shrink-0" }),
- withDirectives(createVNode(unref(script), {
- class: "flex-shrink-0",
- icon: "pi pi-bars",
- severity: "secondary",
- text: "",
- "aria-label": _ctx.$t("menu.hideMenu"),
- onClick: _cache[0] || (_cache[0] = ($event) => unref(workspaceState).focusMode = true),
- onContextmenu: unref(showNativeMenu)
- }, null, 8, ["aria-label", "onContextmenu"]), [
- [_directive_tooltip, { value: _ctx.$t("menu.hideMenu"), showDelay: 300 }]
- ]),
- withDirectives(createBaseVNode("div", _hoisted_2$1, null, 512), [
- [vShow, menuSetting.value !== "Bottom"]
- ])
- ], 2), [
- [vShow, showTopMenu.value]
- ]),
- withDirectives(createBaseVNode("div", _hoisted_3$1, null, 512), [
- [vShow, unref(isNativeWindow)() && !showTopMenu.value]
- ])
- ], 64);
- };
- }
-});
-const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-68d3b5b9"]]);
-function useCoreCommands() {
- const workflowService = useWorkflowService();
- const workflowStore = useWorkflowStore();
- const dialogService = useDialogService();
- const colorPaletteStore = useColorPaletteStore();
- const getTracker = /* @__PURE__ */ __name(() => workflowStore.activeWorkflow?.changeTracker, "getTracker");
- const getSelectedNodes = /* @__PURE__ */ __name(() => {
- const selectedNodes = app.canvas.selected_nodes;
- const result = [];
- if (selectedNodes) {
- for (const i in selectedNodes) {
- const node = selectedNodes[i];
- result.push(node);
- }
- }
- return result;
- }, "getSelectedNodes");
- const toggleSelectedNodesMode = /* @__PURE__ */ __name((mode) => {
- getSelectedNodes().forEach((node) => {
- if (node.mode === mode) {
- node.mode = LGraphEventMode.ALWAYS;
- } else {
- node.mode = mode;
- }
- });
- }, "toggleSelectedNodesMode");
- return [
- {
- id: "Comfy.NewBlankWorkflow",
- icon: "pi pi-plus",
- label: "New Blank Workflow",
- menubarLabel: "New",
- function: /* @__PURE__ */ __name(() => workflowService.loadBlankWorkflow(), "function")
- },
- {
- id: "Comfy.OpenWorkflow",
- icon: "pi pi-folder-open",
- label: "Open Workflow",
- menubarLabel: "Open",
- function: /* @__PURE__ */ __name(() => {
- app.ui.loadFile();
- }, "function")
- },
- {
- id: "Comfy.LoadDefaultWorkflow",
- icon: "pi pi-code",
- label: "Load Default Workflow",
- function: /* @__PURE__ */ __name(() => workflowService.loadDefaultWorkflow(), "function")
- },
- {
- id: "Comfy.SaveWorkflow",
- icon: "pi pi-save",
- label: "Save Workflow",
- menubarLabel: "Save",
- function: /* @__PURE__ */ __name(async () => {
- const workflow = useWorkflowStore().activeWorkflow;
- if (!workflow) return;
- await workflowService.saveWorkflow(workflow);
- }, "function")
- },
- {
- id: "Comfy.SaveWorkflowAs",
- icon: "pi pi-save",
- label: "Save Workflow As",
- menubarLabel: "Save As",
- function: /* @__PURE__ */ __name(async () => {
- const workflow = useWorkflowStore().activeWorkflow;
- if (!workflow) return;
- await workflowService.saveWorkflowAs(workflow);
- }, "function")
- },
- {
- id: "Comfy.ExportWorkflow",
- icon: "pi pi-download",
- label: "Export Workflow",
- menubarLabel: "Export",
- function: /* @__PURE__ */ __name(() => {
- workflowService.exportWorkflow("workflow", "workflow");
- }, "function")
- },
- {
- id: "Comfy.ExportWorkflowAPI",
- icon: "pi pi-download",
- label: "Export Workflow (API Format)",
- menubarLabel: "Export (API)",
- function: /* @__PURE__ */ __name(() => {
- workflowService.exportWorkflow("workflow_api", "output");
- }, "function")
- },
- {
- id: "Comfy.Undo",
- icon: "pi pi-undo",
- label: "Undo",
- function: /* @__PURE__ */ __name(async () => {
- await getTracker()?.undo?.();
- }, "function")
- },
- {
- id: "Comfy.Redo",
- icon: "pi pi-refresh",
- label: "Redo",
- function: /* @__PURE__ */ __name(async () => {
- await getTracker()?.redo?.();
- }, "function")
- },
- {
- id: "Comfy.ClearWorkflow",
- icon: "pi pi-trash",
- label: "Clear Workflow",
- function: /* @__PURE__ */ __name(() => {
- const settingStore = useSettingStore();
- if (!settingStore.get("Comfy.ComfirmClear") || confirm("Clear workflow?")) {
- app.clean();
- app.graph.clear();
- api.dispatchCustomEvent("graphCleared");
- }
- }, "function")
- },
- {
- id: "Comfy.Canvas.ResetView",
- icon: "pi pi-expand",
- label: "Reset View",
- function: /* @__PURE__ */ __name(() => {
- useLitegraphService().resetView();
- }, "function")
- },
- {
- id: "Comfy.OpenClipspace",
- icon: "pi pi-clipboard",
- label: "Clipspace",
- function: /* @__PURE__ */ __name(() => {
- app.openClipspace();
- }, "function")
- },
- {
- id: "Comfy.RefreshNodeDefinitions",
- icon: "pi pi-refresh",
- label: "Refresh Node Definitions",
- function: /* @__PURE__ */ __name(async () => {
- await app.refreshComboInNodes();
- }, "function")
- },
- {
- id: "Comfy.Interrupt",
- icon: "pi pi-stop",
- label: "Interrupt",
- function: /* @__PURE__ */ __name(async () => {
- await api.interrupt();
- useToastStore().add({
- severity: "info",
- summary: "Interrupted",
- detail: "Execution has been interrupted",
- life: 1e3
- });
- }, "function")
- },
- {
- id: "Comfy.ClearPendingTasks",
- icon: "pi pi-stop",
- label: "Clear Pending Tasks",
- function: /* @__PURE__ */ __name(async () => {
- await useQueueStore().clear(["queue"]);
- useToastStore().add({
- severity: "info",
- summary: "Confirmed",
- detail: "Pending tasks deleted",
- life: 3e3
- });
- }, "function")
- },
- {
- id: "Comfy.BrowseTemplates",
- icon: "pi pi-folder-open",
- label: "Browse Templates",
- function: /* @__PURE__ */ __name(() => {
- dialogService.showTemplateWorkflowsDialog();
- }, "function")
- },
- {
- id: "Comfy.Canvas.ZoomIn",
- icon: "pi pi-plus",
- label: "Zoom In",
- function: /* @__PURE__ */ __name(() => {
- const ds = app.canvas.ds;
- ds.changeScale(
- ds.scale * 1.1,
- ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0
- );
- app.canvas.setDirty(true, true);
- }, "function")
- },
- {
- id: "Comfy.Canvas.ZoomOut",
- icon: "pi pi-minus",
- label: "Zoom Out",
- function: /* @__PURE__ */ __name(() => {
- const ds = app.canvas.ds;
- ds.changeScale(
- ds.scale / 1.1,
- ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0
- );
- app.canvas.setDirty(true, true);
- }, "function")
- },
- {
- id: "Comfy.Canvas.FitView",
- icon: "pi pi-expand",
- label: "Fit view to selected nodes",
- function: /* @__PURE__ */ __name(() => {
- if (app.canvas.empty) {
- useToastStore().add({
- severity: "error",
- summary: "Empty canvas",
- life: 3e3
- });
- return;
- }
- app.canvas.fitViewToSelectionAnimated();
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleLock",
- icon: "pi pi-lock",
- label: "Canvas Toggle Lock",
- function: /* @__PURE__ */ __name(() => {
- app.canvas["read_only"] = !app.canvas["read_only"];
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleLinkVisibility",
- icon: "pi pi-eye",
- label: "Canvas Toggle Link Visibility",
- versionAdded: "1.3.6",
- function: (() => {
- const settingStore = useSettingStore();
- let lastLinksRenderMode = LiteGraph.SPLINE_LINK;
- return () => {
- const currentMode = settingStore.get("Comfy.LinkRenderMode");
- if (currentMode === LiteGraph.HIDDEN_LINK) {
- settingStore.set("Comfy.LinkRenderMode", lastLinksRenderMode);
- } else {
- lastLinksRenderMode = currentMode;
- settingStore.set("Comfy.LinkRenderMode", LiteGraph.HIDDEN_LINK);
- }
- };
- })()
- },
- {
- id: "Comfy.QueuePrompt",
- icon: "pi pi-play",
- label: "Queue Prompt",
- versionAdded: "1.3.7",
- function: /* @__PURE__ */ __name(() => {
- const batchCount = useQueueSettingsStore().batchCount;
- app.queuePrompt(0, batchCount);
- }, "function")
- },
- {
- id: "Comfy.QueuePromptFront",
- icon: "pi pi-play",
- label: "Queue Prompt (Front)",
- versionAdded: "1.3.7",
- function: /* @__PURE__ */ __name(() => {
- const batchCount = useQueueSettingsStore().batchCount;
- app.queuePrompt(-1, batchCount);
- }, "function")
- },
- {
- id: "Comfy.ShowSettingsDialog",
- icon: "pi pi-cog",
- label: "Show Settings Dialog",
- versionAdded: "1.3.7",
- function: /* @__PURE__ */ __name(() => {
- dialogService.showSettingsDialog();
- }, "function")
- },
- {
- id: "Comfy.Graph.GroupSelectedNodes",
- icon: "pi pi-sitemap",
- label: "Group Selected Nodes",
- versionAdded: "1.3.7",
- function: /* @__PURE__ */ __name(() => {
- const { canvas } = app;
- if (!canvas.selectedItems?.size) {
- useToastStore().add({
- severity: "error",
- summary: "Nothing to group",
- detail: "Please select the nodes (or other groups) to create a group for",
- life: 3e3
- });
- return;
- }
- const group = new LGraphGroup();
- const padding = useSettingStore().get(
- "Comfy.GroupSelectedNodes.Padding"
- );
- group.resizeTo(canvas.selectedItems, padding);
- canvas.graph.add(group);
- useTitleEditorStore().titleEditorTarget = group;
- }, "function")
- },
- {
- id: "Workspace.NextOpenedWorkflow",
- icon: "pi pi-step-forward",
- label: "Next Opened Workflow",
- versionAdded: "1.3.9",
- function: /* @__PURE__ */ __name(() => {
- workflowService.loadNextOpenedWorkflow();
- }, "function")
- },
- {
- id: "Workspace.PreviousOpenedWorkflow",
- icon: "pi pi-step-backward",
- label: "Previous Opened Workflow",
- versionAdded: "1.3.9",
- function: /* @__PURE__ */ __name(() => {
- workflowService.loadPreviousOpenedWorkflow();
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleSelectedNodes.Mute",
- icon: "pi pi-volume-off",
- label: "Mute/Unmute Selected Nodes",
- versionAdded: "1.3.11",
- function: /* @__PURE__ */ __name(() => {
- toggleSelectedNodesMode(LGraphEventMode.NEVER);
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleSelectedNodes.Bypass",
- icon: "pi pi-shield",
- label: "Bypass/Unbypass Selected Nodes",
- versionAdded: "1.3.11",
- function: /* @__PURE__ */ __name(() => {
- toggleSelectedNodesMode(LGraphEventMode.BYPASS);
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleSelectedNodes.Pin",
- icon: "pi pi-pin",
- label: "Pin/Unpin Selected Nodes",
- versionAdded: "1.3.11",
- function: /* @__PURE__ */ __name(() => {
- getSelectedNodes().forEach((node) => {
- node.pin(!node.pinned);
- });
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleSelected.Pin",
- icon: "pi pi-pin",
- label: "Pin/Unpin Selected Items",
- versionAdded: "1.3.33",
- function: /* @__PURE__ */ __name(() => {
- for (const item of app.canvas.selectedItems) {
- if (item instanceof LGraphNode || item instanceof LGraphGroup) {
- item.pin(!item.pinned);
- }
- }
- }, "function")
- },
- {
- id: "Comfy.Canvas.ToggleSelectedNodes.Collapse",
- icon: "pi pi-minus",
- label: "Collapse/Expand Selected Nodes",
- versionAdded: "1.3.11",
- function: /* @__PURE__ */ __name(() => {
- getSelectedNodes().forEach((node) => {
- node.collapse();
- });
- }, "function")
- },
- {
- id: "Comfy.ToggleTheme",
- icon: "pi pi-moon",
- label: "Toggle Theme (Dark/Light)",
- versionAdded: "1.3.12",
- function: (() => {
- let previousDarkTheme = DEFAULT_DARK_COLOR_PALETTE.id;
- let previousLightTheme = DEFAULT_LIGHT_COLOR_PALETTE.id;
- return () => {
- const settingStore = useSettingStore();
- const theme = colorPaletteStore.completedActivePalette;
- if (theme.light_theme) {
- previousLightTheme = theme.id;
- settingStore.set("Comfy.ColorPalette", previousDarkTheme);
- } else {
- previousDarkTheme = theme.id;
- settingStore.set("Comfy.ColorPalette", previousLightTheme);
- }
- };
- })()
- },
- {
- id: "Workspace.ToggleBottomPanel",
- icon: "pi pi-list",
- label: "Toggle Bottom Panel",
- versionAdded: "1.3.22",
- function: /* @__PURE__ */ __name(() => {
- useBottomPanelStore().toggleBottomPanel();
- }, "function")
- },
- {
- id: "Workspace.ToggleFocusMode",
- icon: "pi pi-eye",
- label: "Toggle Focus Mode",
- versionAdded: "1.3.27",
- function: /* @__PURE__ */ __name(() => {
- useWorkspaceStore().toggleFocusMode();
- }, "function")
- },
- {
- id: "Comfy.Graph.FitGroupToContents",
- icon: "pi pi-expand",
- label: "Fit Group To Contents",
- versionAdded: "1.4.9",
- function: /* @__PURE__ */ __name(() => {
- for (const group of app.canvas.selectedItems) {
- if (group instanceof LGraphGroup) {
- group.recomputeInsideNodes();
- const padding = useSettingStore().get(
- "Comfy.GroupSelectedNodes.Padding"
- );
- group.resizeTo(group.children, padding);
- app.graph.change();
- }
- }
- }, "function")
- },
- {
- id: "Comfy.Help.OpenComfyUIIssues",
- icon: "pi pi-github",
- label: "Open ComfyUI Issues",
- menubarLabel: "ComfyUI Issues",
- versionAdded: "1.5.5",
- function: /* @__PURE__ */ __name(() => {
- window.open(
- "https://github.com/comfyanonymous/ComfyUI/issues",
- "_blank"
- );
- }, "function")
- },
- {
- id: "Comfy.Help.OpenComfyUIDocs",
- icon: "pi pi-info-circle",
- label: "Open ComfyUI Docs",
- menubarLabel: "ComfyUI Docs",
- versionAdded: "1.5.5",
- function: /* @__PURE__ */ __name(() => {
- window.open("https://docs.comfy.org/", "_blank");
- }, "function")
- },
- {
- id: "Comfy.Help.OpenComfyOrgDiscord",
- icon: "pi pi-discord",
- label: "Open Comfy-Org Discord",
- menubarLabel: "Comfy-Org Discord",
- versionAdded: "1.5.5",
- function: /* @__PURE__ */ __name(() => {
- window.open("https://www.comfy.org/discord", "_blank");
- }, "function")
- },
- {
- id: "Workspace.SearchBox.Toggle",
- icon: "pi pi-search",
- label: "Toggle Search Box",
- versionAdded: "1.5.7",
- function: /* @__PURE__ */ __name(() => {
- useSearchBoxStore().toggleVisible();
- }, "function")
- },
- {
- id: "Comfy.Help.AboutComfyUI",
- icon: "pi pi-info-circle",
- label: "Open About ComfyUI",
- menubarLabel: "About ComfyUI",
- versionAdded: "1.6.4",
- function: /* @__PURE__ */ __name(() => {
- dialogService.showSettingsDialog("about");
- }, "function")
- },
- {
- id: "Comfy.DuplicateWorkflow",
- icon: "pi pi-clone",
- label: "Duplicate Current Workflow",
- versionAdded: "1.6.15",
- function: /* @__PURE__ */ __name(() => {
- workflowService.duplicateWorkflow(workflowStore.activeWorkflow);
- }, "function")
- },
- {
- id: "Workspace.CloseWorkflow",
- icon: "pi pi-times",
- label: "Close Current Workflow",
- versionAdded: "1.7.3",
- function: /* @__PURE__ */ __name(() => {
- if (workflowStore.activeWorkflow)
- workflowService.closeWorkflow(workflowStore.activeWorkflow);
- }, "function")
- },
- {
- id: "Comfy.Feedback",
- icon: "pi pi-megaphone",
- label: "Give Feedback",
- versionAdded: "1.8.2",
- function: /* @__PURE__ */ __name(() => {
- dialogService.showIssueReportDialog({
- title: t("g.feedback"),
- subtitle: t("issueReport.feedbackTitle"),
- panelProps: {
- errorType: "Feedback",
- defaultFields: ["SystemStats", "Settings"]
- }
- });
- }, "function")
- },
- {
- id: "Comfy.Help.OpenComfyUIForum",
- icon: "pi pi-comments",
- label: "Open ComfyUI Forum",
- menubarLabel: "ComfyUI Forum",
- versionAdded: "1.8.2",
- function: /* @__PURE__ */ __name(() => {
- window.open("https://forum.comfy.org/", "_blank");
- }, "function")
- }
- ];
-}
-__name(useCoreCommands, "useCoreCommands");
-var LatentPreviewMethod = /* @__PURE__ */ ((LatentPreviewMethod2) => {
- LatentPreviewMethod2["NoPreviews"] = "none";
- LatentPreviewMethod2["Auto"] = "auto";
- LatentPreviewMethod2["Latent2RGB"] = "latent2rgb";
- LatentPreviewMethod2["TAESD"] = "taesd";
- return LatentPreviewMethod2;
-})(LatentPreviewMethod || {});
-var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
- LogLevel2["DEBUG"] = "DEBUG";
- LogLevel2["INFO"] = "INFO";
- LogLevel2["WARNING"] = "WARNING";
- LogLevel2["ERROR"] = "ERROR";
- LogLevel2["CRITICAL"] = "CRITICAL";
- return LogLevel2;
-})(LogLevel || {});
-var HashFunction = /* @__PURE__ */ ((HashFunction2) => {
- HashFunction2["MD5"] = "md5";
- HashFunction2["SHA1"] = "sha1";
- HashFunction2["SHA256"] = "sha256";
- HashFunction2["SHA512"] = "sha512";
- return HashFunction2;
-})(HashFunction || {});
-var AutoLaunch = /* @__PURE__ */ ((AutoLaunch2) => {
- AutoLaunch2["Auto"] = "auto";
- AutoLaunch2["Disable"] = "disable";
- AutoLaunch2["Enable"] = "enable";
- return AutoLaunch2;
-})(AutoLaunch || {});
-var CudaMalloc = /* @__PURE__ */ ((CudaMalloc2) => {
- CudaMalloc2["Auto"] = "auto";
- CudaMalloc2["Disable"] = "disable";
- CudaMalloc2["Enable"] = "enable";
- return CudaMalloc2;
-})(CudaMalloc || {});
-var FloatingPointPrecision = /* @__PURE__ */ ((FloatingPointPrecision2) => {
- FloatingPointPrecision2["AUTO"] = "auto";
- FloatingPointPrecision2["FP64"] = "fp64";
- FloatingPointPrecision2["FP32"] = "fp32";
- FloatingPointPrecision2["FP16"] = "fp16";
- FloatingPointPrecision2["BF16"] = "bf16";
- FloatingPointPrecision2["FP8E4M3FN"] = "fp8_e4m3fn";
- FloatingPointPrecision2["FP8E5M2"] = "fp8_e5m2";
- return FloatingPointPrecision2;
-})(FloatingPointPrecision || {});
-var CrossAttentionMethod = /* @__PURE__ */ ((CrossAttentionMethod2) => {
- CrossAttentionMethod2["Auto"] = "auto";
- CrossAttentionMethod2["Split"] = "split";
- CrossAttentionMethod2["Quad"] = "quad";
- CrossAttentionMethod2["Pytorch"] = "pytorch";
- return CrossAttentionMethod2;
-})(CrossAttentionMethod || {});
-var VramManagement = /* @__PURE__ */ ((VramManagement2) => {
- VramManagement2["Auto"] = "auto";
- VramManagement2["GPUOnly"] = "gpu-only";
- VramManagement2["HighVram"] = "highvram";
- VramManagement2["NormalVram"] = "normalvram";
- VramManagement2["LowVram"] = "lowvram";
- VramManagement2["NoVram"] = "novram";
- VramManagement2["CPU"] = "cpu";
- return VramManagement2;
-})(VramManagement || {});
-const WEB_ONLY_CONFIG_ITEMS = [
- // Launch behavior
- {
- id: "auto-launch",
- name: "Automatically opens in the browser on startup",
- category: ["Launch"],
- type: "combo",
- options: Object.values(AutoLaunch),
- defaultValue: AutoLaunch.Auto,
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case AutoLaunch.Auto:
- return {};
- case AutoLaunch.Enable:
- return {
- ["auto-launch"]: true
- };
- case AutoLaunch.Disable:
- return {
- ["disable-auto-launch"]: true
- };
- }
- }, "getValue")
- }
-];
-const SERVER_CONFIG_ITEMS = [
- // Network settings
- {
- id: "listen",
- name: "Host: The IP address to listen on",
- category: ["Network"],
- type: "text",
- defaultValue: "127.0.0.1"
- },
- {
- id: "port",
- name: "Port: The port to listen on",
- category: ["Network"],
- type: "number",
- // The default launch port for desktop app is 8000 instead of 8188.
- defaultValue: 8e3
- },
- {
- id: "tls-keyfile",
- name: "TLS Key File: Path to TLS key file for HTTPS",
- category: ["Network"],
- type: "text",
- defaultValue: ""
- },
- {
- id: "tls-certfile",
- name: "TLS Certificate File: Path to TLS certificate file for HTTPS",
- category: ["Network"],
- type: "text",
- defaultValue: ""
- },
- {
- id: "enable-cors-header",
- name: 'Enable CORS header: Use "*" for all origins or specify domain',
- category: ["Network"],
- type: "text",
- defaultValue: ""
- },
- {
- id: "max-upload-size",
- name: "Maximum upload size (MB)",
- category: ["Network"],
- type: "number",
- defaultValue: 100
- },
- // CUDA settings
- {
- id: "cuda-device",
- name: "CUDA device index to use",
- category: ["CUDA"],
- type: "number",
- defaultValue: null
- },
- {
- id: "cuda-malloc",
- name: "Use CUDA malloc for memory allocation",
- category: ["CUDA"],
- type: "combo",
- options: Object.values(CudaMalloc),
- defaultValue: CudaMalloc.Auto,
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case CudaMalloc.Auto:
- return {};
- case CudaMalloc.Enable:
- return {
- ["cuda-malloc"]: true
- };
- case CudaMalloc.Disable:
- return {
- ["disable-cuda-malloc"]: true
- };
- }
- }, "getValue")
- },
- // Precision settings
- {
- id: "global-precision",
- name: "Global floating point precision",
- category: ["Inference"],
- type: "combo",
- options: [
- FloatingPointPrecision.AUTO,
- FloatingPointPrecision.FP32,
- FloatingPointPrecision.FP16
- ],
- defaultValue: FloatingPointPrecision.AUTO,
- tooltip: "Global floating point precision",
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case FloatingPointPrecision.AUTO:
- return {};
- case FloatingPointPrecision.FP32:
- return {
- ["force-fp32"]: true
- };
- case FloatingPointPrecision.FP16:
- return {
- ["force-fp16"]: true
- };
- default:
- return {};
- }
- }, "getValue")
- },
- // UNET precision
- {
- id: "unet-precision",
- name: "UNET precision",
- category: ["Inference"],
- type: "combo",
- options: [
- FloatingPointPrecision.AUTO,
- FloatingPointPrecision.FP64,
- FloatingPointPrecision.FP32,
- FloatingPointPrecision.FP16,
- FloatingPointPrecision.BF16,
- FloatingPointPrecision.FP8E4M3FN,
- FloatingPointPrecision.FP8E5M2
- ],
- defaultValue: FloatingPointPrecision.AUTO,
- tooltip: "UNET precision",
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case FloatingPointPrecision.AUTO:
- return {};
- default:
- return {
- [`${value.toLowerCase()}-unet`]: true
- };
- }
- }, "getValue")
- },
- // VAE settings
- {
- id: "vae-precision",
- name: "VAE precision",
- category: ["Inference"],
- type: "combo",
- options: [
- FloatingPointPrecision.AUTO,
- FloatingPointPrecision.FP16,
- FloatingPointPrecision.FP32,
- FloatingPointPrecision.BF16
- ],
- defaultValue: FloatingPointPrecision.AUTO,
- tooltip: "VAE precision",
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case FloatingPointPrecision.AUTO:
- return {};
- default:
- return {
- [`${value.toLowerCase()}-vae`]: true
- };
- }
- }, "getValue")
- },
- {
- id: "cpu-vae",
- name: "Run VAE on CPU",
- category: ["Inference"],
- type: "boolean",
- defaultValue: false
- },
- // Text Encoder settings
- {
- id: "text-encoder-precision",
- name: "Text Encoder precision",
- category: ["Inference"],
- type: "combo",
- options: [
- FloatingPointPrecision.AUTO,
- FloatingPointPrecision.FP8E4M3FN,
- FloatingPointPrecision.FP8E5M2,
- FloatingPointPrecision.FP16,
- FloatingPointPrecision.FP32
- ],
- defaultValue: FloatingPointPrecision.AUTO,
- tooltip: "Text Encoder precision",
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case FloatingPointPrecision.AUTO:
- return {};
- default:
- return {
- [`${value.toLowerCase()}-text-enc`]: true
- };
- }
- }, "getValue")
- },
- // Memory and performance settings
- {
- id: "force-channels-last",
- name: "Force channels-last memory format",
- category: ["Memory"],
- type: "boolean",
- defaultValue: false
- },
- {
- id: "directml",
- name: "DirectML device index",
- category: ["Memory"],
- type: "number",
- defaultValue: null
- },
- {
- id: "disable-ipex-optimize",
- name: "Disable IPEX optimization",
- category: ["Memory"],
- type: "boolean",
- defaultValue: false
- },
- // Preview settings
- {
- id: "preview-method",
- name: "Method used for latent previews",
- category: ["Preview"],
- type: "combo",
- options: Object.values(LatentPreviewMethod),
- defaultValue: LatentPreviewMethod.NoPreviews
- },
- {
- id: "preview-size",
- name: "Size of preview images",
- category: ["Preview"],
- type: "slider",
- defaultValue: 512,
- attrs: {
- min: 128,
- max: 2048,
- step: 128
- }
- },
- // Cache settings
- {
- id: "cache-classic",
- name: "Use classic cache system",
- category: ["Cache"],
- type: "boolean",
- defaultValue: false
- },
- {
- id: "cache-lru",
- name: "Use LRU caching with a maximum of N node results cached.",
- category: ["Cache"],
- type: "number",
- defaultValue: null,
- tooltip: "May use more RAM/VRAM."
- },
- // Attention settings
- {
- id: "cross-attention-method",
- name: "Cross attention method",
- category: ["Attention"],
- type: "combo",
- options: Object.values(CrossAttentionMethod),
- defaultValue: CrossAttentionMethod.Auto,
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case CrossAttentionMethod.Auto:
- return {};
- default:
- return {
- [`use-${value.toLowerCase()}-cross-attention`]: true
- };
- }
- }, "getValue")
- },
- {
- id: "disable-xformers",
- name: "Disable xFormers optimization",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "force-upcast-attention",
- name: "Force attention upcast",
- category: ["Attention"],
- type: "boolean",
- defaultValue: false
- },
- {
- id: "dont-upcast-attention",
- name: "Prevent attention upcast",
- category: ["Attention"],
- type: "boolean",
- defaultValue: false
- },
- // VRAM management
- {
- id: "vram-management",
- name: "VRAM management mode",
- category: ["Memory"],
- type: "combo",
- options: Object.values(VramManagement),
- defaultValue: VramManagement.Auto,
- getValue: /* @__PURE__ */ __name((value) => {
- switch (value) {
- case VramManagement.Auto:
- return {};
- default:
- return {
- [value]: true
- };
- }
- }, "getValue")
- },
- {
- id: "reserve-vram",
- name: "Reserved VRAM (GB)",
- category: ["Memory"],
- type: "number",
- defaultValue: null,
- tooltip: "Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reverved depending on your OS."
- },
- // Misc settings
- {
- id: "default-hashing-function",
- name: "Default hashing function for model files",
- type: "combo",
- options: Object.values(HashFunction),
- defaultValue: HashFunction.SHA256
- },
- {
- id: "disable-smart-memory",
- name: "Disable smart memory management",
- tooltip: "Force ComfyUI to aggressively offload to regular ram instead of keeping models in vram when it can.",
- category: ["Memory"],
- type: "boolean",
- defaultValue: false
- },
- {
- id: "deterministic",
- name: "Make pytorch use slower deterministic algorithms when it can.",
- type: "boolean",
- defaultValue: false,
- tooltip: "Note that this might not make images deterministic in all cases."
- },
- {
- id: "fast",
- name: "Enable some untested and potentially quality deteriorating optimizations.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "dont-print-server",
- name: "Don't print server output to console.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "disable-metadata",
- name: "Disable saving prompt metadata in files.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "disable-all-custom-nodes",
- name: "Disable loading all custom nodes.",
- type: "boolean",
- defaultValue: false
- },
- {
- id: "log-level",
- name: "Logging verbosity level",
- type: "combo",
- options: Object.values(LogLevel),
- defaultValue: LogLevel.INFO,
- getValue: /* @__PURE__ */ __name((value) => {
- return {
- verbose: value
- };
- }, "getValue")
- },
- // Directories
- {
- id: "input-directory",
- name: "Input directory",
- category: ["Directories"],
- type: "text",
- defaultValue: ""
- },
- {
- id: "output-directory",
- name: "Output directory",
- category: ["Directories"],
- type: "text",
- defaultValue: ""
- }
-];
-function setupAutoQueueHandler() {
- const queueCountStore = useQueuePendingTaskCountStore();
- const queueSettingsStore = useQueueSettingsStore();
- let graphHasChanged = false;
- let internalCount = 0;
- api.addEventListener("graphChanged", () => {
- if (queueSettingsStore.mode === "change") {
- if (internalCount) {
- graphHasChanged = true;
- } else {
- graphHasChanged = false;
- app.queuePrompt(0, queueSettingsStore.batchCount);
- internalCount++;
- }
- }
- });
- queueCountStore.$subscribe(
- () => {
- internalCount = queueCountStore.count;
- if (!internalCount && !app.lastExecutionError) {
- if (queueSettingsStore.mode === "instant" || queueSettingsStore.mode === "change" && graphHasChanged) {
- graphHasChanged = false;
- app.queuePrompt(0, queueSettingsStore.batchCount);
- }
- }
- },
- { detached: true }
- );
-}
-__name(setupAutoQueueHandler, "setupAutoQueueHandler");
-const _hoisted_1 = { class: "comfyui-body grid h-screen w-screen overflow-hidden" };
-const _hoisted_2 = {
- class: "comfyui-body-top",
- id: "comfyui-body-top"
-};
-const _hoisted_3 = {
- class: "comfyui-body-bottom",
- id: "comfyui-body-bottom"
-};
-const _hoisted_4 = {
- class: "graph-canvas-container",
- id: "graph-canvas-container"
-};
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "GraphView",
- setup(__props) {
- setupAutoQueueHandler();
- const { t: t2 } = useI18n();
- const toast = useToast();
- const settingStore = useSettingStore();
- const executionStore = useExecutionStore();
- const colorPaletteStore = useColorPaletteStore();
- const queueStore = useQueueStore();
- watch(
- () => colorPaletteStore.completedActivePalette,
- (newTheme) => {
- const DARK_THEME_CLASS = "dark-theme";
- if (newTheme.light_theme) {
- document.body.classList.remove(DARK_THEME_CLASS);
- } else {
- document.body.classList.add(DARK_THEME_CLASS);
- }
- if (isElectron()) {
- electronAPI().changeTheme({
- color: "rgba(0, 0, 0, 0)",
- symbolColor: newTheme.colors.comfy_base["input-text"]
- });
- }
- },
- { immediate: true }
- );
- if (isElectron()) {
- watch(
- () => queueStore.tasks,
- (newTasks, oldTasks) => {
- const oldRunningTaskIds = new Set(
- oldTasks.filter((task) => task.isRunning).map((task) => task.promptId)
- );
- newTasks.filter(
- (task) => oldRunningTaskIds.has(task.promptId) && task.isHistory
- ).forEach((task) => {
- electronAPI().Events.incrementUserProperty(
- `execution:${task.displayStatus.toLowerCase()}`,
- 1
- );
- electronAPI().Events.trackEvent("execution", {
- status: task.displayStatus.toLowerCase()
- });
- });
- },
- { deep: true }
- );
- }
- watchEffect(() => {
- const fontSize = settingStore.get("Comfy.TextareaWidget.FontSize");
- document.documentElement.style.setProperty(
- "--comfy-textarea-font-size",
- `${fontSize}px`
- );
- });
- watchEffect(() => {
- const padding = settingStore.get("Comfy.TreeExplorer.ItemPadding");
- document.documentElement.style.setProperty(
- "--comfy-tree-explorer-item-padding",
- `${padding}px`
- );
- });
- watchEffect(() => {
- const locale = settingStore.get("Comfy.Locale");
- if (locale) {
- i18n.global.locale.value = locale;
- }
- });
- const useNewMenu = computed(() => {
- return settingStore.get("Comfy.UseNewMenu");
- });
- watchEffect(() => {
- if (useNewMenu.value === "Disabled") {
- app.ui.menuContainer.style.setProperty("display", "block");
- app.ui.restoreMenuPosition();
- } else {
- app.ui.menuContainer.style.setProperty("display", "none");
- }
- });
- watchEffect(() => {
- queueStore.maxHistoryItems = settingStore.get("Comfy.Queue.MaxHistoryItems");
- });
- const init = /* @__PURE__ */ __name(() => {
- const coreCommands = useCoreCommands();
- useCommandStore().registerCommands(coreCommands);
- useMenuItemStore().registerCoreMenuCommands();
- useKeybindingService().registerCoreKeybindings();
- useSidebarTabStore().registerCoreSidebarTabs();
- useBottomPanelStore().registerCoreBottomPanelTabs();
- app.extensionManager = useWorkspaceStore();
- }, "init");
- const queuePendingTaskCountStore = useQueuePendingTaskCountStore();
- const onStatus = /* @__PURE__ */ __name(async (e) => {
- queuePendingTaskCountStore.update(e);
- await queueStore.update();
- }, "onStatus");
- const reconnectingMessage = {
- severity: "error",
- summary: t2("g.reconnecting")
- };
- const onReconnecting = /* @__PURE__ */ __name(() => {
- toast.remove(reconnectingMessage);
- toast.add(reconnectingMessage);
- }, "onReconnecting");
- const onReconnected = /* @__PURE__ */ __name(() => {
- toast.remove(reconnectingMessage);
- toast.add({
- severity: "success",
- summary: t2("g.reconnected"),
- life: 2e3
- });
- }, "onReconnected");
- onMounted(() => {
- api.addEventListener("status", onStatus);
- api.addEventListener("reconnecting", onReconnecting);
- api.addEventListener("reconnected", onReconnected);
- executionStore.bindExecutionEvents();
- try {
- init();
- } catch (e) {
- console.error("Failed to init ComfyUI frontend", e);
- }
- });
- onBeforeUnmount(() => {
- api.removeEventListener("status", onStatus);
- api.removeEventListener("reconnecting", onReconnecting);
- api.removeEventListener("reconnected", onReconnected);
- executionStore.unbindExecutionEvents();
- });
- useEventListener(window, "keydown", useKeybindingService().keybindHandler);
- const { wrapWithErrorHandling, wrapWithErrorHandlingAsync } = useErrorHandling();
- const onGraphReady = /* @__PURE__ */ __name(() => {
- requestIdleCallback(
- () => {
- wrapWithErrorHandling(useKeybindingService().registerUserKeybindings)();
- wrapWithErrorHandling(useServerConfigStore().loadServerConfig)(
- SERVER_CONFIG_ITEMS,
- settingStore.get("Comfy.Server.ServerConfigValues")
- );
- wrapWithErrorHandlingAsync(useModelStore().loadModelFolders)();
- wrapWithErrorHandlingAsync(useNodeFrequencyStore().loadNodeFrequencies)();
- useNodeDefStore().nodeSearchService.endsWithFilterStartSequence("");
- },
- { timeout: 1e3 }
- );
- }, "onGraphReady");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock(Fragment, null, [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("div", _hoisted_2, [
- useNewMenu.value === "Top" ? (openBlock(), createBlock(TopMenubar, { key: 0 })) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", _hoisted_3, [
- useNewMenu.value === "Bottom" ? (openBlock(), createBlock(TopMenubar, { key: 0 })) : createCommentVNode("", true)
- ]),
- _cache[0] || (_cache[0] = createBaseVNode("div", {
- class: "comfyui-body-left",
- id: "comfyui-body-left"
- }, null, -1)),
- _cache[1] || (_cache[1] = createBaseVNode("div", {
- class: "comfyui-body-right",
- id: "comfyui-body-right"
- }, null, -1)),
- createBaseVNode("div", _hoisted_4, [
- createVNode(_sfc_main$8, { onReady: onGraphReady })
- ])
- ]),
- createVNode(_sfc_main$7),
- !unref(isElectron)() ? (openBlock(), createBlock(_sfc_main$s, { key: 0 })) : createCommentVNode("", true),
- createVNode(_sfc_main$u),
- createVNode(MenuHamburger)
- ], 64);
- };
- }
-});
-const GraphView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e89d9273"]]);
-export {
- GraphView as default
-};
-//# sourceMappingURL=GraphView-B_UDZi95.js.map
diff --git a/web/assets/GraphView-Bo28XDd0.css b/web/assets/GraphView-Bo28XDd0.css
deleted file mode 100644
index aab80799..00000000
--- a/web/assets/GraphView-Bo28XDd0.css
+++ /dev/null
@@ -1,383 +0,0 @@
-
-.comfy-menu-hamburger[data-v-82120b51] {
- position: fixed;
- z-index: 9999;
- display: flex;
- flex-direction: row
-}
-
-[data-v-e50caa15] .p-splitter-gutter {
- pointer-events: auto;
-}
-[data-v-e50caa15] .p-splitter-gutter:hover,[data-v-e50caa15] .p-splitter-gutter[data-p-gutter-resizing='true'] {
- transition: background-color 0.2s ease 300ms;
- background-color: var(--p-primary-color);
-}
-.side-bar-panel[data-v-e50caa15] {
- background-color: var(--bg-color);
- pointer-events: auto;
-}
-.bottom-panel[data-v-e50caa15] {
- background-color: var(--bg-color);
- pointer-events: auto;
-}
-.splitter-overlay[data-v-e50caa15] {
- pointer-events: none;
- border-style: none;
- background-color: transparent;
-}
-.splitter-overlay-root[data-v-e50caa15] {
- position: absolute;
- top: 0px;
- left: 0px;
- height: 100%;
- width: 100%;
-
- /* Set it the same as the ComfyUI menu */
- /* Note: Lite-graph DOM widgets have the same z-index as the node id, so
- 999 should be sufficient to make sure splitter overlays on node's DOM
- widgets */
- z-index: 999;
-}
-
-.p-buttongroup-vertical[data-v-27a9500c] {
- display: flex;
- flex-direction: column;
- border-radius: var(--p-button-border-radius);
- overflow: hidden;
- border: 1px solid var(--p-panel-border-color);
-}
-.p-buttongroup-vertical .p-button[data-v-27a9500c] {
- margin: 0;
- border-radius: 0;
-}
-
-.node-tooltip[data-v-f03142eb] {
- background: var(--comfy-input-bg);
- border-radius: 5px;
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
- color: var(--input-text);
- font-family: sans-serif;
- left: 0;
- max-width: 30vw;
- padding: 4px 8px;
- position: absolute;
- top: 0;
- transform: translate(5px, calc(-100% - 5px));
- white-space: pre-wrap;
- z-index: 99999;
-}
-
-.group-title-editor.node-title-editor[data-v-12d3fd12] {
- z-index: 9999;
- padding: 0.25rem;
-}
-[data-v-12d3fd12] .editable-text {
- width: 100%;
- height: 100%;
-}
-[data-v-12d3fd12] .editable-text input {
- width: 100%;
- height: 100%;
- /* Override the default font size */
- font-size: inherit;
-}
-
-[data-v-fd0a74bd] .highlight {
- background-color: var(--p-primary-color);
- color: var(--p-primary-contrast-color);
- font-weight: bold;
- border-radius: 0.25rem;
- padding: 0rem 0.125rem;
- margin: -0.125rem 0.125rem;
-}
-
-.invisible-dialog-root {
- width: 60%;
- min-width: 24rem;
- max-width: 48rem;
- border: 0 !important;
- background-color: transparent !important;
- margin-top: 25vh;
- margin-left: 400px;
-}
-@media all and (max-width: 768px) {
-.invisible-dialog-root {
- margin-left: 0px;
-}
-}
-.node-search-box-dialog-mask {
- align-items: flex-start !important;
-}
-
-.side-bar-button-icon {
- font-size: var(--sidebar-icon-size) !important;
-}
-.side-bar-button-selected .side-bar-button-icon {
- font-size: var(--sidebar-icon-size) !important;
- font-weight: bold;
-}
-
-.side-bar-button[data-v-6ab4daa6] {
- width: var(--sidebar-width);
- height: var(--sidebar-width);
- border-radius: 0;
-}
-.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6],
-.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover {
- border-left: 4px solid var(--p-button-text-primary-color);
-}
-.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6],
-.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover {
- border-right: 4px solid var(--p-button-text-primary-color);
-}
-
-.side-tool-bar-container[data-v-04875455] {
- display: flex;
- flex-direction: column;
- align-items: center;
-
- width: var(--sidebar-width);
- height: 100%;
-
- background-color: var(--comfy-menu-secondary-bg);
- color: var(--fg-color);
- box-shadow: var(--bar-shadow);
-
- --sidebar-width: 4rem;
- --sidebar-icon-size: 1.5rem;
-}
-.side-tool-bar-container.small-sidebar[data-v-04875455] {
- --sidebar-width: 2.5rem;
- --sidebar-icon-size: 1rem;
-}
-.side-tool-bar-end[data-v-04875455] {
- align-self: flex-end;
- margin-top: auto;
-}
-
-.status-indicator[data-v-fd6ae3af] {
- position: absolute;
- font-weight: 700;
- font-size: 1.5rem;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%)
-}
-
-[data-v-54fadc45] .p-togglebutton {
- position: relative;
- flex-shrink: 0;
- border-radius: 0px;
- border-width: 0px;
- border-right-width: 1px;
- border-style: solid;
- background-color: transparent;
- padding: 0px;
- border-right-color: var(--border-color)
-}
-[data-v-54fadc45] .p-togglebutton::before {
- display: none
-}
-[data-v-54fadc45] .p-togglebutton:first-child {
- border-left-width: 1px;
- border-style: solid;
- border-left-color: var(--border-color)
-}
-[data-v-54fadc45] .p-togglebutton:not(:first-child) {
- border-left-width: 0px
-}
-[data-v-54fadc45] .p-togglebutton.p-togglebutton-checked {
- height: 100%;
- border-bottom-width: 1px;
- border-style: solid;
- border-bottom-color: var(--p-button-text-primary-color)
-}
-[data-v-54fadc45] .p-togglebutton:not(.p-togglebutton-checked) {
- opacity: 0.75
-}
-[data-v-54fadc45] .p-togglebutton-checked .close-button,[data-v-54fadc45] .p-togglebutton:hover .close-button {
- visibility: visible
-}
-[data-v-54fadc45] .p-togglebutton:hover .status-indicator {
- display: none
-}
-[data-v-54fadc45] .p-togglebutton .close-button {
- visibility: hidden
-}
-[data-v-54fadc45] .p-scrollpanel-content {
- height: 100%
-}
-
-/* Scrollbar half opacity to avoid blocking the active tab bottom border */
-[data-v-54fadc45] .p-scrollpanel:hover .p-scrollpanel-bar,[data-v-54fadc45] .p-scrollpanel:active .p-scrollpanel-bar {
- opacity: 0.5
-}
-[data-v-54fadc45] .p-selectbutton {
- height: 100%;
- border-radius: 0px
-}
-
-[data-v-6ab68035] .workflow-tabs {
- background-color: var(--comfy-menu-bg);
-}
-
-[data-v-26957f1f] .p-inputtext {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.comfyui-queue-button[data-v-91a628af] .p-splitbutton-dropdown {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-.actionbar[data-v-ebd56d51] {
- pointer-events: all;
- position: fixed;
- z-index: 1000;
-}
-.actionbar.is-docked[data-v-ebd56d51] {
- position: static;
- border-style: none;
- background-color: transparent;
- padding: 0px;
-}
-.actionbar.is-dragging[data-v-ebd56d51] {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-[data-v-ebd56d51] .p-panel-content {
- padding: 0.25rem;
-}
-.is-docked[data-v-ebd56d51] .p-panel-content {
- padding: 0px;
-}
-[data-v-ebd56d51] .p-panel-header {
- display: none;
-}
-.drag-handle[data-v-ebd56d51] {
- height: -moz-max-content;
- height: max-content;
- width: 0.75rem;
-}
-
-.top-menubar[data-v-56df69d2] .p-menubar-item-link svg {
- display: none;
-}
-[data-v-56df69d2] .p-menubar-submenu.dropdown-direction-up {
- top: auto;
- bottom: 100%;
- flex-direction: column-reverse;
-}
-.keybinding-tag[data-v-56df69d2] {
- background: var(--p-content-hover-background);
- border-color: var(--p-content-border-color);
- border-style: solid;
-}
-
-.comfyui-menu[data-v-68d3b5b9] {
- width: 100vw;
- height: var(--comfy-topbar-height);
- background: var(--comfy-menu-bg);
- color: var(--fg-color);
- box-shadow: var(--bar-shadow);
- font-family: Arial, Helvetica, sans-serif;
- font-size: 0.8em;
- box-sizing: border-box;
- z-index: 1000;
- order: 0;
- grid-column: 1/-1;
-}
-.comfyui-menu.dropzone[data-v-68d3b5b9] {
- background: var(--p-highlight-background);
-}
-.comfyui-menu.dropzone-active[data-v-68d3b5b9] {
- background: var(--p-highlight-background-focus);
-}
-[data-v-68d3b5b9] .p-menubar-item-label {
- line-height: revert;
-}
-.comfyui-logo[data-v-68d3b5b9] {
- font-size: 1.2em;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- cursor: default;
-}
-
-.comfyui-body[data-v-e89d9273] {
- grid-template-columns: auto 1fr auto;
- grid-template-rows: auto 1fr auto;
-}
-
-/**
- +------------------+------------------+------------------+
- | |
- | .comfyui-body- |
- | top |
- | (spans all cols) |
- | |
- +------------------+------------------+------------------+
- | | | |
- | .comfyui-body- | #graph-canvas | .comfyui-body- |
- | left | | right |
- | | | |
- | | | |
- +------------------+------------------+------------------+
- | |
- | .comfyui-body- |
- | bottom |
- | (spans all cols) |
- | |
- +------------------+------------------+------------------+
-*/
-.comfyui-body-top[data-v-e89d9273] {
- order: -5;
- /* Span across all columns */
- grid-column: 1/-1;
- /* Position at the first row */
- grid-row: 1;
- /* Top menu bar dropdown needs to be above of graph canvas splitter overlay which is z-index: 999 */
- /* Top menu bar z-index needs to be higher than bottom menu bar z-index as by default
- pysssss's image feed is located at body-bottom, and it can overlap with the queue button, which
- is located in body-top. */
- z-index: 1001;
- display: flex;
- flex-direction: column;
-}
-.comfyui-body-left[data-v-e89d9273] {
- order: -4;
- /* Position in the first column */
- grid-column: 1;
- /* Position below the top element */
- grid-row: 2;
- z-index: 10;
- display: flex;
-}
-.graph-canvas-container[data-v-e89d9273] {
- width: 100%;
- height: 100%;
- order: -3;
- grid-column: 2;
- grid-row: 2;
- position: relative;
- overflow: hidden;
-}
-.comfyui-body-right[data-v-e89d9273] {
- order: -2;
- z-index: 10;
- grid-column: 3;
- grid-row: 2;
-}
-.comfyui-body-bottom[data-v-e89d9273] {
- order: 4;
- /* Span across all columns */
- grid-column: 1/-1;
- grid-row: 3;
- /* Bottom menu bar dropdown needs to be above of graph canvas splitter overlay which is z-index: 999 */
- z-index: 1000;
- display: flex;
- flex-direction: column;
-}
diff --git a/web/assets/InstallView-DW9xwU_F.js b/web/assets/InstallView-DW9xwU_F.js
deleted file mode 100644
index e7e2509e..00000000
--- a/web/assets/InstallView-DW9xwU_F.js
+++ /dev/null
@@ -1,971 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, T as ref, bq as useModel, o as openBlock, f as createElementBlock, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, br as script, bl as script$1, as as withModifiers, z as withCtx, ac as script$2, I as useI18n, c as computed, aj as normalizeClass, B as createCommentVNode, a5 as script$3, a8 as createTextVNode, b9 as electronAPI, _ as _export_sfc, p as onMounted, r as resolveDirective, bk as script$4, i as withDirectives, bs as script$5, bt as script$6, l as script$7, y as createBlock, bn as script$8, bu as MigrationItems, w as watchEffect, F as Fragment, D as renderList, bv as script$9, bw as mergeModels, bx as ValidationState, X as normalizeI18nKey, N as watch, by as checkMirrorReachable, bz as _sfc_main$7, bA as isInChina, bB as mergeValidationStates, bg as t, b3 as script$a, bC as CUDA_TORCH_URL, bD as NIGHTLY_CPU_TORCH_URL, bi as useRouter, ah as toRaw } from "./index-Bv0b06LE.js";
-import { s as script$b, a as script$c, b as script$d, c as script$e, d as script$f } from "./index-SeIZOWJp.js";
-import { P as PYTHON_MIRROR, a as PYPI_MIRROR } from "./uvMirrors-B-HKMf6X.js";
-import { _ as _sfc_main$8 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1$5 = { class: "flex flex-col gap-6 w-[600px]" };
-const _hoisted_2$5 = { class: "flex flex-col gap-4" };
-const _hoisted_3$5 = { class: "text-2xl font-semibold text-neutral-100" };
-const _hoisted_4$5 = { class: "text-neutral-400 my-0" };
-const _hoisted_5$3 = { class: "flex flex-col bg-neutral-800 p-4 rounded-lg" };
-const _hoisted_6$3 = { class: "flex items-center gap-4" };
-const _hoisted_7$3 = { class: "flex-1" };
-const _hoisted_8$3 = { class: "text-lg font-medium text-neutral-100" };
-const _hoisted_9$3 = { class: "text-sm text-neutral-400 mt-1" };
-const _hoisted_10$3 = { class: "flex items-center gap-4" };
-const _hoisted_11$3 = { class: "flex-1" };
-const _hoisted_12$3 = { class: "text-lg font-medium text-neutral-100" };
-const _hoisted_13$1 = { class: "text-sm text-neutral-400 mt-1" };
-const _hoisted_14$1 = { class: "text-neutral-300" };
-const _hoisted_15 = { class: "font-medium mb-2" };
-const _hoisted_16 = { class: "list-disc pl-6 space-y-1" };
-const _hoisted_17 = { class: "font-medium mt-4 mb-2" };
-const _hoisted_18 = { class: "list-disc pl-6 space-y-1" };
-const _hoisted_19 = { class: "mt-4" };
-const _hoisted_20 = {
- href: "https://comfy.org/privacy",
- target: "_blank",
- class: "text-blue-400 hover:text-blue-300 underline"
-};
-const _sfc_main$6 = /* @__PURE__ */ defineComponent({
- __name: "DesktopSettingsConfiguration",
- props: {
- "autoUpdate": { type: Boolean, ...{ required: true } },
- "autoUpdateModifiers": {},
- "allowMetrics": { type: Boolean, ...{ required: true } },
- "allowMetricsModifiers": {}
- },
- emits: ["update:autoUpdate", "update:allowMetrics"],
- setup(__props) {
- const showDialog = ref(false);
- const autoUpdate = useModel(__props, "autoUpdate");
- const allowMetrics = useModel(__props, "allowMetrics");
- const showMetricsInfo = /* @__PURE__ */ __name(() => {
- showDialog.value = true;
- }, "showMetricsInfo");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
- createBaseVNode("div", _hoisted_2$5, [
- createBaseVNode("h2", _hoisted_3$5, toDisplayString(_ctx.$t("install.desktopAppSettings")), 1),
- createBaseVNode("p", _hoisted_4$5, toDisplayString(_ctx.$t("install.desktopAppSettingsDescription")), 1)
- ]),
- createBaseVNode("div", _hoisted_5$3, [
- createBaseVNode("div", _hoisted_6$3, [
- createBaseVNode("div", _hoisted_7$3, [
- createBaseVNode("h3", _hoisted_8$3, toDisplayString(_ctx.$t("install.settings.autoUpdate")), 1),
- createBaseVNode("p", _hoisted_9$3, toDisplayString(_ctx.$t("install.settings.autoUpdateDescription")), 1)
- ]),
- createVNode(unref(script), {
- modelValue: autoUpdate.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => autoUpdate.value = $event)
- }, null, 8, ["modelValue"])
- ]),
- createVNode(unref(script$1)),
- createBaseVNode("div", _hoisted_10$3, [
- createBaseVNode("div", _hoisted_11$3, [
- createBaseVNode("h3", _hoisted_12$3, toDisplayString(_ctx.$t("install.settings.allowMetrics")), 1),
- createBaseVNode("p", _hoisted_13$1, toDisplayString(_ctx.$t("install.settings.allowMetricsDescription")), 1),
- createBaseVNode("a", {
- href: "#",
- class: "text-sm text-blue-400 hover:text-blue-300 mt-1 inline-block",
- onClick: withModifiers(showMetricsInfo, ["prevent"])
- }, toDisplayString(_ctx.$t("install.settings.learnMoreAboutData")), 1)
- ]),
- createVNode(unref(script), {
- modelValue: allowMetrics.value,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => allowMetrics.value = $event)
- }, null, 8, ["modelValue"])
- ])
- ]),
- createVNode(unref(script$2), {
- visible: showDialog.value,
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showDialog.value = $event),
- modal: "",
- header: _ctx.$t("install.settings.dataCollectionDialog.title")
- }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_14$1, [
- createBaseVNode("h4", _hoisted_15, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1),
- createBaseVNode("ul", _hoisted_16, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.errorReports")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.systemInfo")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.collect.userJourneyEvents"
- )), 1)
- ]),
- createBaseVNode("h4", _hoisted_17, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1),
- createBaseVNode("ul", _hoisted_18, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.doNotCollect.personalInformation"
- )), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.doNotCollect.workflowContents"
- )), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.doNotCollect.fileSystemInformation"
- )), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.doNotCollect.customNodeConfigurations"
- )), 1)
- ]),
- createBaseVNode("div", _hoisted_19, [
- createBaseVNode("a", _hoisted_20, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.viewFullPolicy")), 1)
- ])
- ])
- ]),
- _: 1
- }, 8, ["visible", "header"])
- ]);
- };
- }
-});
-const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href;
-const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href;
-const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href;
-const _hoisted_1$4 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" };
-const _hoisted_2$4 = { class: "grow flex flex-col gap-4 text-neutral-300" };
-const _hoisted_3$4 = { class: "text-2xl font-semibold text-neutral-100" };
-const _hoisted_4$4 = { class: "m-1 text-neutral-400" };
-const _hoisted_5$2 = {
- key: 0,
- class: "m-1"
-};
-const _hoisted_6$2 = {
- key: 1,
- class: "m-1"
-};
-const _hoisted_7$2 = {
- key: 2,
- class: "text-neutral-300"
-};
-const _hoisted_8$2 = { class: "m-1" };
-const _hoisted_9$2 = { key: 3 };
-const _hoisted_10$2 = { class: "m-1" };
-const _hoisted_11$2 = { class: "m-1" };
-const _hoisted_12$2 = {
- for: "cpu-mode",
- class: "select-none"
-};
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
- __name: "GpuPicker",
- props: {
- "device": {
- required: true
- },
- "deviceModifiers": {}
- },
- emits: ["update:device"],
- setup(__props) {
- const { t: t2 } = useI18n();
- const cpuMode = computed({
- get: /* @__PURE__ */ __name(() => selected.value === "cpu", "get"),
- set: /* @__PURE__ */ __name((value) => {
- selected.value = value ? "cpu" : null;
- }, "set")
- });
- const selected = useModel(__props, "device");
- const electron = electronAPI();
- const platform = electron.getPlatform();
- const pickGpu = /* @__PURE__ */ __name((value) => {
- const newValue = selected.value === value ? null : value;
- selected.value = newValue;
- }, "pickGpu");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
- createBaseVNode("div", _hoisted_2$4, [
- createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.gpuSelection.selectGpu")), 1),
- createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.gpuSelection.selectGpuDescription")) + ": ", 1),
- createBaseVNode("div", {
- class: normalizeClass(["flex gap-2 text-center transition-opacity", { selected: selected.value }])
- }, [
- unref(platform) !== "darwin" ? (openBlock(), createElementBlock("div", {
- key: 0,
- class: normalizeClass(["gpu-button", { selected: selected.value === "nvidia" }]),
- role: "button",
- onClick: _cache[0] || (_cache[0] = ($event) => pickGpu("nvidia"))
- }, _cache[4] || (_cache[4] = [
- createBaseVNode("img", {
- class: "m-12",
- alt: "NVIDIA logo",
- width: "196",
- height: "32",
- src: _imports_0
- }, null, -1)
- ]), 2)) : createCommentVNode("", true),
- unref(platform) === "darwin" ? (openBlock(), createElementBlock("div", {
- key: 1,
- class: normalizeClass(["gpu-button", { selected: selected.value === "mps" }]),
- role: "button",
- onClick: _cache[1] || (_cache[1] = ($event) => pickGpu("mps"))
- }, _cache[5] || (_cache[5] = [
- createBaseVNode("img", {
- class: "rounded-lg hover-brighten",
- alt: "Apple Metal Performance Shaders Logo",
- width: "292",
- ratio: "",
- src: _imports_1
- }, null, -1)
- ]), 2)) : createCommentVNode("", true),
- createBaseVNode("div", {
- class: normalizeClass(["gpu-button", { selected: selected.value === "unsupported" }]),
- role: "button",
- onClick: _cache[2] || (_cache[2] = ($event) => pickGpu("unsupported"))
- }, _cache[6] || (_cache[6] = [
- createBaseVNode("img", {
- class: "m-12",
- alt: "Manual configuration",
- width: "196",
- src: _imports_2
- }, null, -1)
- ]), 2)
- ], 2),
- selected.value === "nvidia" ? (openBlock(), createElementBlock("p", _hoisted_5$2, [
- createVNode(unref(script$3), {
- icon: "pi pi-check",
- severity: "success",
- value: "CUDA"
- }),
- createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.nvidiaDescription")), 1)
- ])) : createCommentVNode("", true),
- selected.value === "mps" ? (openBlock(), createElementBlock("p", _hoisted_6$2, [
- createVNode(unref(script$3), {
- icon: "pi pi-check",
- severity: "success",
- value: "MPS"
- }),
- createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.mpsDescription")), 1)
- ])) : createCommentVNode("", true),
- selected.value === "unsupported" ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
- createBaseVNode("p", _hoisted_8$2, [
- createVNode(unref(script$3), {
- icon: "pi pi-exclamation-triangle",
- severity: "warn",
- value: unref(t2)("icon.exclamation-triangle")
- }, null, 8, ["value"]),
- createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.customSkipsPython")), 1)
- ]),
- createBaseVNode("ul", null, [
- createBaseVNode("li", null, [
- createBaseVNode("strong", null, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1)
- ]),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customMayNotWork")), 1)
- ])
- ])) : createCommentVNode("", true),
- selected.value === "cpu" ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
- createBaseVNode("p", _hoisted_10$2, [
- createVNode(unref(script$3), {
- icon: "pi pi-exclamation-triangle",
- severity: "warn",
- value: unref(t2)("icon.exclamation-triangle")
- }, null, 8, ["value"]),
- createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription")), 1)
- ]),
- createBaseVNode("p", _hoisted_11$2, toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription2")), 1)
- ])) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", {
- class: normalizeClass(["transition-opacity flex gap-3 h-0", {
- "opacity-40": selected.value && selected.value !== "cpu"
- }])
- }, [
- createVNode(unref(script), {
- modelValue: cpuMode.value,
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => cpuMode.value = $event),
- inputId: "cpu-mode",
- class: "-translate-y-40"
- }, null, 8, ["modelValue"]),
- createBaseVNode("label", _hoisted_12$2, toDisplayString(_ctx.$t("install.gpuSelection.enableCpuMode")), 1)
- ], 2)
- ]);
- };
- }
-});
-const GpuPicker = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-79125ff6"]]);
-const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px]" };
-const _hoisted_2$3 = { class: "flex flex-col gap-4" };
-const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" };
-const _hoisted_4$3 = { class: "text-neutral-400 my-0" };
-const _hoisted_5$1 = { class: "flex gap-2" };
-const _hoisted_6$1 = { class: "bg-neutral-800 p-4 rounded-lg" };
-const _hoisted_7$1 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" };
-const _hoisted_8$1 = { class: "flex flex-col gap-2" };
-const _hoisted_9$1 = { class: "flex items-center gap-2" };
-const _hoisted_10$1 = { class: "text-neutral-200" };
-const _hoisted_11$1 = { class: "pi pi-info-circle" };
-const _hoisted_12$1 = { class: "flex items-center gap-2" };
-const _hoisted_13 = { class: "text-neutral-200" };
-const _hoisted_14 = { class: "pi pi-info-circle" };
-const _sfc_main$4 = /* @__PURE__ */ defineComponent({
- __name: "InstallLocationPicker",
- props: {
- "installPath": { required: true },
- "installPathModifiers": {},
- "pathError": { required: true },
- "pathErrorModifiers": {}
- },
- emits: ["update:installPath", "update:pathError"],
- setup(__props) {
- const { t: t2 } = useI18n();
- const installPath = useModel(__props, "installPath");
- const pathError = useModel(__props, "pathError");
- const pathExists = ref(false);
- const appData = ref("");
- const appPath = ref("");
- const inputTouched = ref(false);
- const electron = electronAPI();
- onMounted(async () => {
- const paths = await electron.getSystemPaths();
- appData.value = paths.appData;
- appPath.value = paths.appPath;
- installPath.value = paths.defaultInstallPath;
- await validatePath(paths.defaultInstallPath);
- });
- const validatePath = /* @__PURE__ */ __name(async (path) => {
- try {
- pathError.value = "";
- pathExists.value = false;
- const validation = await electron.validateInstallPath(path);
- if (!validation.isValid) {
- const errors = [];
- if (validation.cannotWrite) errors.push(t2("install.cannotWrite"));
- if (validation.freeSpace < validation.requiredSpace) {
- const requiredGB = validation.requiredSpace / 1024 / 1024 / 1024;
- errors.push(`${t2("install.insufficientFreeSpace")}: ${requiredGB} GB`);
- }
- if (validation.parentMissing) errors.push(t2("install.parentMissing"));
- if (validation.error)
- errors.push(`${t2("install.unhandledError")}: ${validation.error}`);
- pathError.value = errors.join("\n");
- }
- if (validation.exists) pathExists.value = true;
- } catch (error) {
- pathError.value = t2("install.pathValidationFailed");
- }
- }, "validatePath");
- const browsePath = /* @__PURE__ */ __name(async () => {
- try {
- const result = await electron.showDirectoryPicker();
- if (result) {
- installPath.value = result;
- await validatePath(result);
- }
- } catch (error) {
- pathError.value = t2("install.failedToSelectDirectory");
- }
- }, "browsePath");
- const onFocus = /* @__PURE__ */ __name(() => {
- if (!inputTouched.value) {
- inputTouched.value = true;
- return;
- }
- validatePath(installPath.value);
- }, "onFocus");
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
- createBaseVNode("div", _hoisted_2$3, [
- createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1),
- createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.installLocationDescription")), 1),
- createBaseVNode("div", _hoisted_5$1, [
- createVNode(unref(script$6), { class: "flex-1" }, {
- default: withCtx(() => [
- createVNode(unref(script$4), {
- modelValue: installPath.value,
- "onUpdate:modelValue": [
- _cache[0] || (_cache[0] = ($event) => installPath.value = $event),
- validatePath
- ],
- class: normalizeClass(["w-full", { "p-invalid": pathError.value }]),
- onFocus
- }, null, 8, ["modelValue", "class"]),
- withDirectives(createVNode(unref(script$5), { class: "pi pi-info-circle" }, null, 512), [
- [
- _directive_tooltip,
- _ctx.$t("install.installLocationTooltip"),
- void 0,
- { top: true }
- ]
- ])
- ]),
- _: 1
- }),
- createVNode(unref(script$7), {
- icon: "pi pi-folder",
- onClick: browsePath,
- class: "w-12"
- })
- ]),
- pathError.value ? (openBlock(), createBlock(unref(script$8), {
- key: 0,
- severity: "error",
- class: "whitespace-pre-line"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(pathError.value), 1)
- ]),
- _: 1
- })) : createCommentVNode("", true),
- pathExists.value ? (openBlock(), createBlock(unref(script$8), {
- key: 1,
- severity: "warn"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.$t("install.pathExists")), 1)
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", _hoisted_6$1, [
- createBaseVNode("h3", _hoisted_7$1, toDisplayString(_ctx.$t("install.systemLocations")), 1),
- createBaseVNode("div", _hoisted_8$1, [
- createBaseVNode("div", _hoisted_9$1, [
- _cache[1] || (_cache[1] = createBaseVNode("i", { class: "pi pi-folder text-neutral-400" }, null, -1)),
- _cache[2] || (_cache[2] = createBaseVNode("span", { class: "text-neutral-400" }, "App Data:", -1)),
- createBaseVNode("span", _hoisted_10$1, toDisplayString(appData.value), 1),
- withDirectives(createBaseVNode("span", _hoisted_11$1, null, 512), [
- [_directive_tooltip, _ctx.$t("install.appDataLocationTooltip")]
- ])
- ]),
- createBaseVNode("div", _hoisted_12$1, [
- _cache[3] || (_cache[3] = createBaseVNode("i", { class: "pi pi-desktop text-neutral-400" }, null, -1)),
- _cache[4] || (_cache[4] = createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1)),
- createBaseVNode("span", _hoisted_13, toDisplayString(appPath.value), 1),
- withDirectives(createBaseVNode("span", _hoisted_14, null, 512), [
- [_directive_tooltip, _ctx.$t("install.appPathLocationTooltip")]
- ])
- ])
- ])
- ])
- ]);
- };
- }
-});
-const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" };
-const _hoisted_2$2 = { class: "flex flex-col gap-4" };
-const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" };
-const _hoisted_4$2 = { class: "text-neutral-400 my-0" };
-const _hoisted_5 = { class: "flex gap-2" };
-const _hoisted_6 = {
- key: 0,
- class: "flex flex-col gap-4 bg-neutral-800 p-4 rounded-lg"
-};
-const _hoisted_7 = { class: "text-lg mt-0 font-medium text-neutral-100" };
-const _hoisted_8 = { class: "flex flex-col gap-3" };
-const _hoisted_9 = ["onClick"];
-const _hoisted_10 = ["for"];
-const _hoisted_11 = { class: "text-sm text-neutral-400 my-1" };
-const _hoisted_12 = {
- key: 1,
- class: "text-neutral-400 italic"
-};
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
- __name: "MigrationPicker",
- props: {
- "sourcePath": { required: false },
- "sourcePathModifiers": {},
- "migrationItemIds": {
- required: false
- },
- "migrationItemIdsModifiers": {}
- },
- emits: ["update:sourcePath", "update:migrationItemIds"],
- setup(__props) {
- const { t: t2 } = useI18n();
- const electron = electronAPI();
- const sourcePath = useModel(__props, "sourcePath");
- const migrationItemIds = useModel(__props, "migrationItemIds");
- const migrationItems = ref(
- MigrationItems.map((item) => ({
- ...item,
- selected: true
- }))
- );
- const pathError = ref("");
- const isValidSource = computed(
- () => sourcePath.value !== "" && pathError.value === ""
- );
- const validateSource = /* @__PURE__ */ __name(async (sourcePath2) => {
- if (!sourcePath2) {
- pathError.value = "";
- return;
- }
- try {
- pathError.value = "";
- const validation = await electron.validateComfyUISource(sourcePath2);
- if (!validation.isValid) pathError.value = validation.error;
- } catch (error) {
- console.error(error);
- pathError.value = t2("install.pathValidationFailed");
- }
- }, "validateSource");
- const browsePath = /* @__PURE__ */ __name(async () => {
- try {
- const result = await electron.showDirectoryPicker();
- if (result) {
- sourcePath.value = result;
- await validateSource(result);
- }
- } catch (error) {
- console.error(error);
- pathError.value = t2("install.failedToSelectDirectory");
- }
- }, "browsePath");
- watchEffect(() => {
- migrationItemIds.value = migrationItems.value.filter((item) => item.selected).map((item) => item.id);
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
- createBaseVNode("div", _hoisted_2$2, [
- createBaseVNode("h2", _hoisted_3$2, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1),
- createBaseVNode("p", _hoisted_4$2, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1),
- createBaseVNode("div", _hoisted_5, [
- createVNode(unref(script$4), {
- modelValue: sourcePath.value,
- "onUpdate:modelValue": [
- _cache[0] || (_cache[0] = ($event) => sourcePath.value = $event),
- validateSource
- ],
- placeholder: "Select existing ComfyUI installation (optional)",
- class: normalizeClass(["flex-1", { "p-invalid": pathError.value }])
- }, null, 8, ["modelValue", "class"]),
- createVNode(unref(script$7), {
- icon: "pi pi-folder",
- onClick: browsePath,
- class: "w-12"
- })
- ]),
- pathError.value ? (openBlock(), createBlock(unref(script$8), {
- key: 0,
- severity: "error"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(pathError.value), 1)
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ]),
- isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6, [
- createBaseVNode("h3", _hoisted_7, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1),
- createBaseVNode("div", _hoisted_8, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(migrationItems.value, (item) => {
- return openBlock(), createElementBlock("div", {
- key: item.id,
- class: "flex items-center gap-3 p-2 hover:bg-neutral-700 rounded",
- onClick: /* @__PURE__ */ __name(($event) => item.selected = !item.selected, "onClick")
- }, [
- createVNode(unref(script$9), {
- modelValue: item.selected,
- "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => item.selected = $event, "onUpdate:modelValue"),
- inputId: item.id,
- binary: true,
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {
- }, ["stop"]))
- }, null, 8, ["modelValue", "onUpdate:modelValue", "inputId"]),
- createBaseVNode("div", null, [
- createBaseVNode("label", {
- for: item.id,
- class: "text-neutral-200 font-medium"
- }, toDisplayString(item.label), 9, _hoisted_10),
- createBaseVNode("p", _hoisted_11, toDisplayString(item.description), 1)
- ])
- ], 8, _hoisted_9);
- }), 128))
- ])
- ])) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(_ctx.$t("install.migrationOptional")), 1))
- ]);
- };
- }
-});
-const _hoisted_1$1 = { class: "flex flex-col items-center gap-4" };
-const _hoisted_2$1 = { class: "w-full" };
-const _hoisted_3$1 = { class: "text-lg font-medium text-neutral-100" };
-const _hoisted_4$1 = { class: "text-sm text-neutral-400 mt-1" };
-const _sfc_main$2 = /* @__PURE__ */ defineComponent({
- __name: "MirrorItem",
- props: /* @__PURE__ */ mergeModels({
- item: {}
- }, {
- "modelValue": { required: true },
- "modelModifiers": {}
- }),
- emits: /* @__PURE__ */ mergeModels(["state-change"], ["update:modelValue"]),
- setup(__props, { emit: __emit }) {
- const emit = __emit;
- const modelValue = useModel(__props, "modelValue");
- const validationState = ref(ValidationState.IDLE);
- const normalizedSettingId = computed(() => {
- return normalizeI18nKey(__props.item.settingId);
- });
- onMounted(() => {
- modelValue.value = __props.item.mirror;
- });
- watch(validationState, (newState) => {
- emit("state-change", newState);
- if (newState === ValidationState.INVALID && modelValue.value === __props.item.mirror) {
- modelValue.value = __props.item.fallbackMirror;
- }
- });
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
- createBaseVNode("div", _hoisted_2$1, [
- createBaseVNode("h3", _hoisted_3$1, toDisplayString(_ctx.$t(`settings.${normalizedSettingId.value}.name`)), 1),
- createBaseVNode("p", _hoisted_4$1, toDisplayString(_ctx.$t(`settings.${normalizedSettingId.value}.tooltip`)), 1)
- ]),
- createVNode(_sfc_main$7, {
- modelValue: modelValue.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
- "validate-url-fn": /* @__PURE__ */ __name((mirror) => unref(checkMirrorReachable)(mirror + (_ctx.item.validationPathSuffix ?? "")), "validate-url-fn"),
- onStateChange: _cache[1] || (_cache[1] = ($event) => validationState.value = $event)
- }, null, 8, ["modelValue", "validate-url-fn"])
- ]);
- };
- }
-});
-const _sfc_main$1 = /* @__PURE__ */ defineComponent({
- __name: "MirrorsConfiguration",
- props: /* @__PURE__ */ mergeModels({
- device: {}
- }, {
- "pythonMirror": { required: true },
- "pythonMirrorModifiers": {},
- "pypiMirror": { required: true },
- "pypiMirrorModifiers": {},
- "torchMirror": { required: true },
- "torchMirrorModifiers": {}
- }),
- emits: ["update:pythonMirror", "update:pypiMirror", "update:torchMirror"],
- setup(__props) {
- const showMirrorInputs = ref(false);
- const pythonMirror = useModel(__props, "pythonMirror");
- const pypiMirror = useModel(__props, "pypiMirror");
- const torchMirror = useModel(__props, "torchMirror");
- const getTorchMirrorItem = /* @__PURE__ */ __name((device) => {
- const settingId = "Comfy-Desktop.UV.TorchInstallMirror";
- switch (device) {
- case "mps":
- return {
- settingId,
- mirror: NIGHTLY_CPU_TORCH_URL,
- fallbackMirror: NIGHTLY_CPU_TORCH_URL
- };
- case "nvidia":
- return {
- settingId,
- mirror: CUDA_TORCH_URL,
- fallbackMirror: CUDA_TORCH_URL
- };
- case "cpu":
- default:
- return {
- settingId,
- mirror: PYPI_MIRROR.mirror,
- fallbackMirror: PYPI_MIRROR.fallbackMirror
- };
- }
- }, "getTorchMirrorItem");
- const userIsInChina = ref(false);
- onMounted(async () => {
- userIsInChina.value = await isInChina();
- });
- const useFallbackMirror = /* @__PURE__ */ __name((mirror) => ({
- ...mirror,
- mirror: mirror.fallbackMirror
- }), "useFallbackMirror");
- const mirrors = computed(
- () => [
- [PYTHON_MIRROR, pythonMirror],
- [PYPI_MIRROR, pypiMirror],
- [getTorchMirrorItem(__props.device), torchMirror]
- ].map(([item, modelValue]) => [
- userIsInChina.value ? useFallbackMirror(item) : item,
- modelValue
- ])
- );
- const validationStates = ref(
- mirrors.value.map(() => ValidationState.IDLE)
- );
- const validationState = computed(() => {
- return mergeValidationStates(validationStates.value);
- });
- const validationStateTooltip = computed(() => {
- switch (validationState.value) {
- case ValidationState.INVALID:
- return t("install.settings.mirrorsUnreachable");
- case ValidationState.VALID:
- return t("install.settings.mirrorsReachable");
- default:
- return t("install.settings.checkingMirrors");
- }
- });
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createBlock(unref(script$a), {
- header: _ctx.$t("install.settings.mirrorSettings"),
- toggleable: "",
- collapsed: !showMirrorInputs.value,
- "pt:root": "bg-neutral-800 border-none w-[600px]"
- }, {
- icons: withCtx(() => [
- withDirectives(createBaseVNode("i", {
- class: normalizeClass({
- "pi pi-spin pi-spinner text-neutral-400": validationState.value === unref(ValidationState).LOADING,
- "pi pi-check text-green-500": validationState.value === unref(ValidationState).VALID,
- "pi pi-times text-red-500": validationState.value === unref(ValidationState).INVALID
- })
- }, null, 2), [
- [_directive_tooltip, validationStateTooltip.value]
- ])
- ]),
- default: withCtx(() => [
- (openBlock(true), createElementBlock(Fragment, null, renderList(mirrors.value, ([item, modelValue], index) => {
- return openBlock(), createElementBlock(Fragment, {
- key: item.settingId + item.mirror
- }, [
- index > 0 ? (openBlock(), createBlock(unref(script$1), { key: 0 })) : createCommentVNode("", true),
- createVNode(_sfc_main$2, {
- item,
- modelValue: modelValue.value,
- "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => modelValue.value = $event, "onUpdate:modelValue"),
- onStateChange: /* @__PURE__ */ __name(($event) => validationStates.value[index] = $event, "onStateChange")
- }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "onStateChange"])
- ], 64);
- }), 128))
- ]),
- _: 1
- }, 8, ["header", "collapsed"]);
- };
- }
-});
-const _hoisted_1 = { class: "flex pt-6 justify-end" };
-const _hoisted_2 = { class: "flex pt-6 justify-between" };
-const _hoisted_3 = { class: "flex pt-6 justify-between" };
-const _hoisted_4 = { class: "flex mt-6 justify-between" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "InstallView",
- setup(__props) {
- const device = ref(null);
- const installPath = ref("");
- const pathError = ref("");
- const migrationSourcePath = ref("");
- const migrationItemIds = ref([]);
- const autoUpdate = ref(true);
- const allowMetrics = ref(true);
- const pythonMirror = ref("");
- const pypiMirror = ref("");
- const torchMirror = ref("");
- const highestStep = ref(0);
- const handleStepChange = /* @__PURE__ */ __name((value) => {
- setHighestStep(value);
- electronAPI().Events.trackEvent("install_stepper_change", {
- step: value
- });
- }, "handleStepChange");
- const setHighestStep = /* @__PURE__ */ __name((value) => {
- const int = typeof value === "number" ? value : parseInt(value, 10);
- if (!isNaN(int) && int > highestStep.value) highestStep.value = int;
- }, "setHighestStep");
- const hasError = computed(() => pathError.value !== "");
- const noGpu = computed(() => typeof device.value !== "string");
- const electron = electronAPI();
- const router = useRouter();
- const install = /* @__PURE__ */ __name(() => {
- const options = {
- installPath: installPath.value,
- autoUpdate: autoUpdate.value,
- allowMetrics: allowMetrics.value,
- migrationSourcePath: migrationSourcePath.value,
- migrationItemIds: toRaw(migrationItemIds.value),
- pythonMirror: pythonMirror.value,
- pypiMirror: pypiMirror.value,
- torchMirror: torchMirror.value,
- device: device.value
- };
- electron.installComfyUI(options);
- const nextPage = options.device === "unsupported" ? "/manual-configuration" : "/server-start";
- router.push(nextPage);
- }, "install");
- onMounted(async () => {
- if (!electron) return;
- const detectedGpu = await electron.Config.getDetectedGpu();
- if (detectedGpu === "mps" || detectedGpu === "nvidia") {
- device.value = detectedGpu;
- }
- electronAPI().Events.trackEvent("install_stepper_change", {
- step: "0",
- gpu: detectedGpu
- });
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$8, { dark: "" }, {
- default: withCtx(() => [
- createVNode(unref(script$f), {
- class: "h-full p-8 2xl:p-16",
- value: "0",
- "onUpdate:value": handleStepChange
- }, {
- default: withCtx(() => [
- createVNode(unref(script$b), { class: "select-none" }, {
- default: withCtx(() => [
- createVNode(unref(script$c), { value: "0" }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.$t("install.gpu")), 1)
- ]),
- _: 1
- }),
- createVNode(unref(script$c), {
- value: "1",
- disabled: noGpu.value
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.$t("install.installLocation")), 1)
- ]),
- _: 1
- }, 8, ["disabled"]),
- createVNode(unref(script$c), {
- value: "2",
- disabled: noGpu.value || hasError.value || highestStep.value < 1
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.$t("install.migration")), 1)
- ]),
- _: 1
- }, 8, ["disabled"]),
- createVNode(unref(script$c), {
- value: "3",
- disabled: noGpu.value || hasError.value || highestStep.value < 2
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.$t("install.desktopSettings")), 1)
- ]),
- _: 1
- }, 8, ["disabled"])
- ]),
- _: 1
- }),
- createVNode(unref(script$d), null, {
- default: withCtx(() => [
- createVNode(unref(script$e), { value: "0" }, {
- default: withCtx(({ activateCallback }) => [
- createVNode(GpuPicker, {
- device: device.value,
- "onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event)
- }, null, 8, ["device"]),
- createBaseVNode("div", _hoisted_1, [
- createVNode(unref(script$7), {
- label: _ctx.$t("g.next"),
- icon: "pi pi-arrow-right",
- iconPos: "right",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick"),
- disabled: typeof device.value !== "string"
- }, null, 8, ["label", "onClick", "disabled"])
- ])
- ]),
- _: 1
- }),
- createVNode(unref(script$e), { value: "1" }, {
- default: withCtx(({ activateCallback }) => [
- createVNode(_sfc_main$4, {
- installPath: installPath.value,
- "onUpdate:installPath": _cache[1] || (_cache[1] = ($event) => installPath.value = $event),
- pathError: pathError.value,
- "onUpdate:pathError": _cache[2] || (_cache[2] = ($event) => pathError.value = $event)
- }, null, 8, ["installPath", "pathError"]),
- createBaseVNode("div", _hoisted_2, [
- createVNode(unref(script$7), {
- label: _ctx.$t("g.back"),
- severity: "secondary",
- icon: "pi pi-arrow-left",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("0"), "onClick")
- }, null, 8, ["label", "onClick"]),
- createVNode(unref(script$7), {
- label: _ctx.$t("g.next"),
- icon: "pi pi-arrow-right",
- iconPos: "right",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick"),
- disabled: pathError.value !== ""
- }, null, 8, ["label", "onClick", "disabled"])
- ])
- ]),
- _: 1
- }),
- createVNode(unref(script$e), { value: "2" }, {
- default: withCtx(({ activateCallback }) => [
- createVNode(_sfc_main$3, {
- sourcePath: migrationSourcePath.value,
- "onUpdate:sourcePath": _cache[3] || (_cache[3] = ($event) => migrationSourcePath.value = $event),
- migrationItemIds: migrationItemIds.value,
- "onUpdate:migrationItemIds": _cache[4] || (_cache[4] = ($event) => migrationItemIds.value = $event)
- }, null, 8, ["sourcePath", "migrationItemIds"]),
- createBaseVNode("div", _hoisted_3, [
- createVNode(unref(script$7), {
- label: _ctx.$t("g.back"),
- severity: "secondary",
- icon: "pi pi-arrow-left",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick")
- }, null, 8, ["label", "onClick"]),
- createVNode(unref(script$7), {
- label: _ctx.$t("g.next"),
- icon: "pi pi-arrow-right",
- iconPos: "right",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("3"), "onClick")
- }, null, 8, ["label", "onClick"])
- ])
- ]),
- _: 1
- }),
- createVNode(unref(script$e), { value: "3" }, {
- default: withCtx(({ activateCallback }) => [
- createVNode(_sfc_main$6, {
- autoUpdate: autoUpdate.value,
- "onUpdate:autoUpdate": _cache[5] || (_cache[5] = ($event) => autoUpdate.value = $event),
- allowMetrics: allowMetrics.value,
- "onUpdate:allowMetrics": _cache[6] || (_cache[6] = ($event) => allowMetrics.value = $event)
- }, null, 8, ["autoUpdate", "allowMetrics"]),
- createVNode(_sfc_main$1, {
- device: device.value,
- pythonMirror: pythonMirror.value,
- "onUpdate:pythonMirror": _cache[7] || (_cache[7] = ($event) => pythonMirror.value = $event),
- pypiMirror: pypiMirror.value,
- "onUpdate:pypiMirror": _cache[8] || (_cache[8] = ($event) => pypiMirror.value = $event),
- torchMirror: torchMirror.value,
- "onUpdate:torchMirror": _cache[9] || (_cache[9] = ($event) => torchMirror.value = $event),
- class: "mt-6"
- }, null, 8, ["device", "pythonMirror", "pypiMirror", "torchMirror"]),
- createBaseVNode("div", _hoisted_4, [
- createVNode(unref(script$7), {
- label: _ctx.$t("g.back"),
- severity: "secondary",
- icon: "pi pi-arrow-left",
- onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick")
- }, null, 8, ["label", "onClick"]),
- createVNode(unref(script$7), {
- label: _ctx.$t("g.install"),
- icon: "pi pi-check",
- iconPos: "right",
- disabled: hasError.value,
- onClick: _cache[10] || (_cache[10] = ($event) => install())
- }, null, 8, ["label", "disabled"])
- ])
- ]),
- _: 1
- })
- ]),
- _: 1
- })
- ]),
- _: 1
- })
- ]),
- _: 1
- });
- };
- }
-});
-const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cd6731d2"]]);
-export {
- InstallView as default
-};
-//# sourceMappingURL=InstallView-DW9xwU_F.js.map
diff --git a/web/assets/InstallView-DbJ2cGfL.css b/web/assets/InstallView-DbJ2cGfL.css
deleted file mode 100644
index 5bbebb80..00000000
--- a/web/assets/InstallView-DbJ2cGfL.css
+++ /dev/null
@@ -1,81 +0,0 @@
-
-.p-tag[data-v-79125ff6] {
- --p-tag-gap: 0.5rem;
-}
-.hover-brighten {
-&[data-v-79125ff6] {
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
- transition-duration: 150ms;
- transition-property: filter, box-shadow;
- }
-&[data-v-79125ff6]:hover {
- filter: brightness(107%) contrast(105%);
- box-shadow: 0 0 0.25rem #ffffff79;
-}
-}
-.p-accordioncontent-content[data-v-79125ff6] {
- border-radius: 0.5rem;
- --tw-bg-opacity: 1;
- background-color: rgb(23 23 23 / var(--tw-bg-opacity));
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
- transition-duration: 150ms;
-}
-div.selected {
-.gpu-button[data-v-79125ff6]:not(.selected) {
- opacity: 0.5;
-}
-.gpu-button[data-v-79125ff6]:not(.selected):hover {
- opacity: 1;
-}
-}
-.gpu-button[data-v-79125ff6] {
- margin: 0px;
- display: flex;
- width: 50%;
- cursor: pointer;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
- border-radius: 0.5rem;
- background-color: rgb(38 38 38 / var(--tw-bg-opacity));
- --tw-bg-opacity: 0.5;
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
- transition-duration: 150ms;
-}
-.gpu-button[data-v-79125ff6]:hover {
- --tw-bg-opacity: 0.75;
-}
-.gpu-button {
-&.selected[data-v-79125ff6] {
- --tw-bg-opacity: 1;
- background-color: rgb(64 64 64 / var(--tw-bg-opacity));
-}
-&.selected[data-v-79125ff6] {
- --tw-bg-opacity: 0.5;
-}
-&.selected[data-v-79125ff6] {
- opacity: 1;
-}
-&.selected[data-v-79125ff6]:hover {
- --tw-bg-opacity: 0.6;
-}
-}
-.disabled[data-v-79125ff6] {
- pointer-events: none;
- opacity: 0.4;
-}
-.p-card-header[data-v-79125ff6] {
- flex-grow: 1;
- text-align: center;
-}
-.p-card-body[data-v-79125ff6] {
- padding-top: 0px;
- text-align: center;
-}
-
-[data-v-cd6731d2] .p-steppanel {
- background-color: transparent
-}
diff --git a/web/assets/KeybindingPanel-CDYVPYDp.css b/web/assets/KeybindingPanel-CDYVPYDp.css
deleted file mode 100644
index 2392e4f5..00000000
--- a/web/assets/KeybindingPanel-CDYVPYDp.css
+++ /dev/null
@@ -1,8 +0,0 @@
-
-[data-v-8454e24f] .p-datatable-tbody > tr > td {
- padding: 0.25rem;
- min-height: 2rem
-}
-[data-v-8454e24f] .p-datatable-row-selected .actions,[data-v-8454e24f] .p-datatable-selectable-row:hover .actions {
- visibility: visible
-}
diff --git a/web/assets/KeybindingPanel-oavhFdkz.js b/web/assets/KeybindingPanel-oavhFdkz.js
deleted file mode 100644
index aa3739dc..00000000
--- a/web/assets/KeybindingPanel-oavhFdkz.js
+++ /dev/null
@@ -1,292 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, D as renderList, k as createVNode, z as withCtx, a8 as createTextVNode, E as toDisplayString, j as unref, a5 as script, B as createCommentVNode, T as ref, dx as FilterMatchMode, ao as useKeybindingStore, J as useCommandStore, I as useI18n, X as normalizeI18nKey, w as watchEffect, aV as useToast, r as resolveDirective, y as createBlock, dy as SearchBox, m as createBaseVNode, l as script$2, bk as script$4, as as withModifiers, bn as script$5, ac as script$6, i as withDirectives, dz as _sfc_main$2, dA as KeyComboImpl, dB as KeybindingImpl, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { g as script$1, h as script$3 } from "./index-CgMyWf7n.js";
-import { u as useKeybindingService } from "./keybindingService-DyjX-nxF.js";
-import "./index-Dzu9WL4p.js";
-const _hoisted_1$1 = {
- key: 0,
- class: "px-2"
-};
-const _sfc_main$1 = /* @__PURE__ */ defineComponent({
- __name: "KeyComboDisplay",
- props: {
- keyCombo: {},
- isModified: { type: Boolean, default: false }
- },
- setup(__props) {
- const props = __props;
- const keySequences = computed(() => props.keyCombo.getKeySequences());
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("span", null, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(keySequences.value, (sequence, index) => {
- return openBlock(), createElementBlock(Fragment, { key: index }, [
- createVNode(unref(script), {
- severity: _ctx.isModified ? "info" : "secondary"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(sequence), 1)
- ]),
- _: 2
- }, 1032, ["severity"]),
- index < keySequences.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_1$1, "+")) : createCommentVNode("", true)
- ], 64);
- }), 128))
- ]);
- };
- }
-});
-const _hoisted_1 = { class: "actions invisible flex flex-row" };
-const _hoisted_2 = ["title"];
-const _hoisted_3 = { key: 1 };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "KeybindingPanel",
- setup(__props) {
- const filters = ref({
- global: { value: "", matchMode: FilterMatchMode.CONTAINS }
- });
- const keybindingStore = useKeybindingStore();
- const keybindingService = useKeybindingService();
- const commandStore = useCommandStore();
- const { t } = useI18n();
- const commandsData = computed(() => {
- return Object.values(commandStore.commands).map((command) => ({
- id: command.id,
- label: t(`commands.${normalizeI18nKey(command.id)}.label`, command.label),
- keybinding: keybindingStore.getKeybindingByCommandId(command.id)
- }));
- });
- const selectedCommandData = ref(null);
- const editDialogVisible = ref(false);
- const newBindingKeyCombo = ref(null);
- const currentEditingCommand = ref(null);
- const keybindingInput = ref(null);
- const existingKeybindingOnCombo = computed(() => {
- if (!currentEditingCommand.value) {
- return null;
- }
- if (currentEditingCommand.value.keybinding?.combo?.equals(
- newBindingKeyCombo.value
- )) {
- return null;
- }
- if (!newBindingKeyCombo.value) {
- return null;
- }
- return keybindingStore.getKeybinding(newBindingKeyCombo.value);
- });
- function editKeybinding(commandData) {
- currentEditingCommand.value = commandData;
- newBindingKeyCombo.value = commandData.keybinding ? commandData.keybinding.combo : null;
- editDialogVisible.value = true;
- }
- __name(editKeybinding, "editKeybinding");
- watchEffect(() => {
- if (editDialogVisible.value) {
- setTimeout(() => {
- keybindingInput.value?.$el?.focus();
- }, 300);
- }
- });
- function removeKeybinding(commandData) {
- if (commandData.keybinding) {
- keybindingStore.unsetKeybinding(commandData.keybinding);
- keybindingService.persistUserKeybindings();
- }
- }
- __name(removeKeybinding, "removeKeybinding");
- function captureKeybinding(event) {
- if (!event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
- switch (event.key) {
- case "Escape":
- cancelEdit();
- return;
- case "Enter":
- saveKeybinding();
- return;
- }
- }
- const keyCombo = KeyComboImpl.fromEvent(event);
- newBindingKeyCombo.value = keyCombo;
- }
- __name(captureKeybinding, "captureKeybinding");
- function cancelEdit() {
- editDialogVisible.value = false;
- currentEditingCommand.value = null;
- newBindingKeyCombo.value = null;
- }
- __name(cancelEdit, "cancelEdit");
- function saveKeybinding() {
- if (currentEditingCommand.value && newBindingKeyCombo.value) {
- const updated = keybindingStore.updateKeybindingOnCommand(
- new KeybindingImpl({
- commandId: currentEditingCommand.value.id,
- combo: newBindingKeyCombo.value
- })
- );
- if (updated) {
- keybindingService.persistUserKeybindings();
- }
- }
- cancelEdit();
- }
- __name(saveKeybinding, "saveKeybinding");
- const toast = useToast();
- async function resetKeybindings() {
- keybindingStore.resetKeybindings();
- await keybindingService.persistUserKeybindings();
- toast.add({
- severity: "info",
- summary: "Info",
- detail: "Keybindings reset",
- life: 3e3
- });
- }
- __name(resetKeybindings, "resetKeybindings");
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createBlock(_sfc_main$2, {
- value: "Keybinding",
- class: "keybinding-panel"
- }, {
- header: withCtx(() => [
- createVNode(SearchBox, {
- modelValue: filters.value["global"].value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event),
- placeholder: _ctx.$t("g.searchKeybindings") + "..."
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- default: withCtx(() => [
- createVNode(unref(script$3), {
- value: commandsData.value,
- selection: selectedCommandData.value,
- "onUpdate:selection": _cache[1] || (_cache[1] = ($event) => selectedCommandData.value = $event),
- "global-filter-fields": ["id", "label"],
- filters: filters.value,
- selectionMode: "single",
- stripedRows: "",
- pt: {
- header: "px-0"
- }
- }, {
- default: withCtx(() => [
- createVNode(unref(script$1), {
- field: "actions",
- header: ""
- }, {
- body: withCtx((slotProps) => [
- createBaseVNode("div", _hoisted_1, [
- createVNode(unref(script$2), {
- icon: "pi pi-pencil",
- class: "p-button-text",
- onClick: /* @__PURE__ */ __name(($event) => editKeybinding(slotProps.data), "onClick")
- }, null, 8, ["onClick"]),
- createVNode(unref(script$2), {
- icon: "pi pi-trash",
- class: "p-button-text p-button-danger",
- onClick: /* @__PURE__ */ __name(($event) => removeKeybinding(slotProps.data), "onClick"),
- disabled: !slotProps.data.keybinding
- }, null, 8, ["onClick", "disabled"])
- ])
- ]),
- _: 1
- }),
- createVNode(unref(script$1), {
- field: "id",
- header: _ctx.$t("g.command"),
- sortable: "",
- class: "max-w-64 2xl:max-w-full"
- }, {
- body: withCtx((slotProps) => [
- createBaseVNode("div", {
- class: "overflow-hidden text-ellipsis whitespace-nowrap",
- title: slotProps.data.id
- }, toDisplayString(slotProps.data.label), 9, _hoisted_2)
- ]),
- _: 1
- }, 8, ["header"]),
- createVNode(unref(script$1), {
- field: "keybinding",
- header: _ctx.$t("g.keybinding")
- }, {
- body: withCtx((slotProps) => [
- slotProps.data.keybinding ? (openBlock(), createBlock(_sfc_main$1, {
- key: 0,
- keyCombo: slotProps.data.keybinding.combo,
- isModified: unref(keybindingStore).isCommandKeybindingModified(slotProps.data.id)
- }, null, 8, ["keyCombo", "isModified"])) : (openBlock(), createElementBlock("span", _hoisted_3, "-"))
- ]),
- _: 1
- }, 8, ["header"])
- ]),
- _: 1
- }, 8, ["value", "selection", "filters"]),
- createVNode(unref(script$6), {
- class: "min-w-96",
- visible: editDialogVisible.value,
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => editDialogVisible.value = $event),
- modal: "",
- header: currentEditingCommand.value?.label,
- onHide: cancelEdit
- }, {
- footer: withCtx(() => [
- createVNode(unref(script$2), {
- label: "Save",
- icon: "pi pi-check",
- onClick: saveKeybinding,
- disabled: !!existingKeybindingOnCombo.value,
- autofocus: ""
- }, null, 8, ["disabled"])
- ]),
- default: withCtx(() => [
- createBaseVNode("div", null, [
- createVNode(unref(script$4), {
- class: "mb-2 text-center",
- ref_key: "keybindingInput",
- ref: keybindingInput,
- modelValue: newBindingKeyCombo.value?.toString() ?? "",
- placeholder: "Press keys for new binding",
- onKeydown: withModifiers(captureKeybinding, ["stop", "prevent"]),
- autocomplete: "off",
- fluid: "",
- invalid: !!existingKeybindingOnCombo.value
- }, null, 8, ["modelValue", "invalid"]),
- existingKeybindingOnCombo.value ? (openBlock(), createBlock(unref(script$5), {
- key: 0,
- severity: "error"
- }, {
- default: withCtx(() => [
- _cache[3] || (_cache[3] = createTextVNode(" Keybinding already exists on ")),
- createVNode(unref(script), {
- severity: "secondary",
- value: existingKeybindingOnCombo.value.commandId
- }, null, 8, ["value"])
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ])
- ]),
- _: 1
- }, 8, ["visible", "header"]),
- withDirectives(createVNode(unref(script$2), {
- class: "mt-4",
- label: _ctx.$t("g.reset"),
- icon: "pi pi-trash",
- severity: "danger",
- fluid: "",
- text: "",
- onClick: resetKeybindings
- }, null, 8, ["label"]), [
- [_directive_tooltip, _ctx.$t("g.resetKeybindingsTooltip")]
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8454e24f"]]);
-export {
- KeybindingPanel as default
-};
-//# sourceMappingURL=KeybindingPanel-oavhFdkz.js.map
diff --git a/web/assets/MaintenanceView-Bh8OZpgl.js b/web/assets/MaintenanceView-Bh8OZpgl.js
deleted file mode 100644
index 4f3d99c3..00000000
--- a/web/assets/MaintenanceView-Bh8OZpgl.js
+++ /dev/null
@@ -1,25635 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true });
-import { d as defineComponent, bw as mergeModels, bq as useModel, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, aj as normalizeClass, i as withDirectives, v as vShow, k as createVNode, j as unref, bE as script$1c, l as script$1d, c as computed, bF as PrimeIcons, bg as t, a5 as script$1e, b1 as inject, bG as BaseStyle, bH as script$1f, at as mergeProps, bI as Transition, C as resolveDynamicComponent, A as renderSlot, B as createCommentVNode, bJ as findSingle, bK as getAttribute, bL as focus, bM as script$1g, bN as script$1h, bO as Ripple, r as resolveDirective, bP as UniqueComponentId, bQ as script$1i, bR as resolveComponent, f as createElementBlock, F as Fragment, D as renderList, E as toDisplayString, bS as BaseDirective, bT as removeClass, bU as addClass, bV as createElement, bW as hasClass, bX as script$1j, bY as script$1k, bZ as ZIndex, b_ as addStyle, b$ as ConnectedOverlayScrollHandler, c0 as isTouchDevice, c1 as relativePosition, c2 as getOuterWidth, c3 as absolutePosition, c4 as find, c5 as getIndex, c6 as getFocusableElements, c7 as OverlayEventBus, c8 as setAttribute, c9 as localeComparator, bk as script$1l, ca as script$1m, cb as script$1n, n as normalizeStyle, a8 as createTextVNode, bj as withKeys, cc as resolveFieldData, cd as isNotEmpty, ce as equals, cf as script$1o, cg as isString, ch as isPrintableCharacter, ci as isEmpty, cj as findLastIndex, ck as script$1p, cl as script$1q, cm as script$1r, cn as uuid, a9 as script$1s, co as sort, cp as createSlots, cq as EventBus, H as markRaw, cr as resolve, cs as Tooltip, bm as script$1u, ac as script$1v, ct as script$1w, cu as script$1x, cv as script$1y, cw as script$1z, bn as script$1A, cx as normalizeProps, cy as blockBodyScroll, cz as isAttributeEquals, cA as unblockBodyScroll, cB as FocusTrap, cC as guardReactiveProps, cD as setCSSProperty, cE as $dt, cF as script$1C, cG as script$1E, cH as getUserAgent, br as script$1F, cI as script$1G, cJ as getFirstFocusableElement, cK as getLastFocusableElement, cL as FilterService, bv as script$1I, cM as script$1J, bt as script$1K, bs as script$1L, cN as script$1M, cO as findIndexInList, cP as scrollInView, cQ as script$1N, cR as script$1O, cS as script$1P, cT as findLast, cU as getWindowScrollTop, cV as getWidth, cW as getOffset, cX as vModelText, cY as script$1U, as as withModifiers, cZ as getVNodeProp, c_ as getNextElementSibling, c$ as getPreviousElementSibling, d0 as isClickable, d1 as _default, d2 as clearSelection, d3 as isRTL, b9 as electronAPI, a1 as defineStore, T as ref, d4 as useTimeout, N as watch, d5 as script$1Y, _ as _export_sfc, aV as useToast, d6 as useConfirm, bl as script$1Z, d7 as script$1_, p as onMounted, d8 as onUnmounted, aw as script$1$, ag as isRef } from "./index-Bv0b06LE.js";
-import { a as script$1B, b as script$1D, s as script$20 } from "./index-A_bXPJCN.js";
-import "./index-C068lYT4.js";
-import { s as script$1t, a as script$1Q, b as script$1R, c as script$1S, d as script$1V, e as script$1W, f as script$1X } from "./index-CgMyWf7n.js";
-import { s as script$1T, _ as _sfc_main$7 } from "./TerminalOutputDrawer-CKr7Br7O.js";
-import { s as script$1H } from "./index-Dzu9WL4p.js";
-import "./index-SeIZOWJp.js";
-import { _ as _sfc_main$8 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _sfc_main$6 = /* @__PURE__ */ defineComponent({
- __name: "RefreshButton",
- props: /* @__PURE__ */ mergeModels({
- outlined: { type: Boolean, default: true },
- disabled: { type: Boolean },
- severity: { default: "secondary" }
- }, {
- "modelValue": { type: Boolean, ...{ required: true } },
- "modelModifiers": {}
- }),
- emits: /* @__PURE__ */ mergeModels(["refresh"], ["update:modelValue"]),
- setup(__props) {
- const props = __props;
- const active3 = useModel(__props, "modelValue");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$1d), {
- class: "relative p-button-icon-only",
- outlined: props.outlined,
- severity: props.severity,
- disabled: active3.value || props.disabled,
- onClick: _cache[0] || (_cache[0] = (event2) => _ctx.$emit("refresh", event2))
- }, {
- default: withCtx(() => [
- createBaseVNode("span", {
- class: normalizeClass(["p-button-icon pi pi-refresh transition-all", { "opacity-0": active3.value }]),
- "data-pc-section": "icon"
- }, null, 2),
- _cache[1] || (_cache[1] = createBaseVNode("span", {
- class: "p-button-label",
- "data-pc-section": "label"
- }, " ", -1)),
- withDirectives(createVNode(unref(script$1c), { class: "absolute w-1/2 h-1/2" }, null, 512), [
- [vShow, active3.value]
- ])
- ]),
- _: 1
- }, 8, ["outlined", "severity", "disabled"]);
- };
- }
-});
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
- __name: "StatusTag",
- props: {
- error: { type: Boolean },
- refreshing: { type: Boolean }
- },
- setup(__props) {
- const props = __props;
- const icon2 = computed(() => {
- if (props.refreshing) return PrimeIcons.QUESTION;
- if (props.error) return PrimeIcons.TIMES;
- return PrimeIcons.CHECK;
- });
- const severity = computed(() => {
- if (props.refreshing) return "info";
- if (props.error) return "danger";
- return "success";
- });
- const value2 = computed(() => {
- if (props.refreshing) return t("maintenance.refreshing");
- if (props.error) return t("g.error");
- return t("maintenance.OK");
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$1e), {
- icon: icon2.value,
- severity: severity.value,
- value: value2.value
- }, null, 8, ["icon", "severity", "value"]);
- };
- }
-});
-var PrimeVueDialogSymbol = Symbol();
-function useDialog() {
- var PrimeVueDialog = inject(PrimeVueDialogSymbol);
- if (!PrimeVueDialog) {
- throw new Error("No PrimeVue Dialog provided!");
- }
- return PrimeVueDialog;
-}
-__name(useDialog, "useDialog");
-var classes$L = {
- root: "p-accordioncontent",
- content: "p-accordioncontent-content"
-};
-var AccordionContentStyle = BaseStyle.extend({
- name: "accordioncontent",
- classes: classes$L
-});
-var script$1$N = {
- name: "BaseAccordionContent",
- "extends": script$1f,
- props: {
- as: {
- type: [String, Object],
- "default": "DIV"
- },
- asChild: {
- type: Boolean,
- "default": false
- }
- },
- style: AccordionContentStyle,
- provide: /* @__PURE__ */ __name(function provide() {
- return {
- $pcAccordionContent: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1b = {
- name: "AccordionContent",
- "extends": script$1$N,
- inheritAttrs: false,
- inject: ["$pcAccordion", "$pcAccordionPanel"],
- computed: {
- id: /* @__PURE__ */ __name(function id() {
- return "".concat(this.$pcAccordion.id, "_accordioncontent_").concat(this.$pcAccordionPanel.value);
- }, "id"),
- ariaLabelledby: /* @__PURE__ */ __name(function ariaLabelledby() {
- return "".concat(this.$pcAccordion.id, "_accordionheader_").concat(this.$pcAccordionPanel.value);
- }, "ariaLabelledby"),
- attrs: /* @__PURE__ */ __name(function attrs() {
- return mergeProps(this.a11yAttrs, this.ptmi("root", this.ptParams));
- }, "attrs"),
- a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() {
- return {
- id: this.id,
- role: "region",
- "aria-labelledby": this.ariaLabelledby,
- "data-pc-name": "accordioncontent",
- "data-p-active": this.$pcAccordionPanel.active
- };
- }, "a11yAttrs"),
- ptParams: /* @__PURE__ */ __name(function ptParams() {
- return {
- context: {
- active: this.$pcAccordionPanel.active
- }
- };
- }, "ptParams")
- }
-};
-function render$12(_ctx, _cache, $props, $setup, $data, $options) {
- return !_ctx.asChild ? (openBlock(), createBlock(Transition, mergeProps({
- key: 0,
- name: "p-toggleable-content"
- }, _ctx.ptm("transition", $options.ptParams)), {
- "default": withCtx(function() {
- return [($options.$pcAccordion.lazy ? $options.$pcAccordionPanel.active : true) ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
- key: 0,
- "class": _ctx.cx("root")
- }, $options.attrs), {
- "default": withCtx(function() {
- return [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("content")
- }, _ctx.ptm("content", $options.ptParams)), [renderSlot(_ctx.$slots, "default")], 16)];
- }),
- _: 3
- }, 16, ["class"])), [[vShow, $options.$pcAccordion.lazy ? true : $options.$pcAccordionPanel.active]]) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16)) : renderSlot(_ctx.$slots, "default", {
- key: 1,
- "class": normalizeClass(_ctx.cx("root")),
- active: $options.$pcAccordionPanel.active,
- a11yAttrs: $options.a11yAttrs
- });
-}
-__name(render$12, "render$12");
-script$1b.render = render$12;
-var classes$K = {
- root: "p-accordionheader",
- toggleicon: "p-accordionheader-toggle-icon"
-};
-var AccordionHeaderStyle = BaseStyle.extend({
- name: "accordionheader",
- classes: classes$K
-});
-var script$1$M = {
- name: "BaseAccordionHeader",
- "extends": script$1f,
- props: {
- as: {
- type: [String, Object],
- "default": "BUTTON"
- },
- asChild: {
- type: Boolean,
- "default": false
- }
- },
- style: AccordionHeaderStyle,
- provide: /* @__PURE__ */ __name(function provide2() {
- return {
- $pcAccordionHeader: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1a = {
- name: "AccordionHeader",
- "extends": script$1$M,
- inheritAttrs: false,
- inject: ["$pcAccordion", "$pcAccordionPanel"],
- methods: {
- onFocus: /* @__PURE__ */ __name(function onFocus() {
- this.$pcAccordion.selectOnFocus && this.changeActiveValue();
- }, "onFocus"),
- onClick: /* @__PURE__ */ __name(function onClick() {
- this.changeActiveValue();
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown(event2) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space":
- this.onEnterKey(event2);
- break;
- }
- }, "onKeydown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey(event2) {
- var nextPanel = this.findNextPanel(this.findPanel(event2.currentTarget));
- nextPanel ? this.changeFocusedPanel(event2, nextPanel) : this.onHomeKey(event2);
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey(event2) {
- var prevPanel = this.findPrevPanel(this.findPanel(event2.currentTarget));
- prevPanel ? this.changeFocusedPanel(event2, prevPanel) : this.onEndKey(event2);
- event2.preventDefault();
- }, "onArrowUpKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event2) {
- var firstPanel = this.findFirstPanel();
- this.changeFocusedPanel(event2, firstPanel);
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey(event2) {
- var lastPanel = this.findLastPanel();
- this.changeFocusedPanel(event2, lastPanel);
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event2) {
- this.changeActiveValue();
- event2.preventDefault();
- }, "onEnterKey"),
- findPanel: /* @__PURE__ */ __name(function findPanel(headerElement) {
- return headerElement === null || headerElement === void 0 ? void 0 : headerElement.closest('[data-pc-name="accordionpanel"]');
- }, "findPanel"),
- findHeader: /* @__PURE__ */ __name(function findHeader(panelElement) {
- return findSingle(panelElement, '[data-pc-name="accordionheader"]');
- }, "findHeader"),
- findNextPanel: /* @__PURE__ */ __name(function findNextPanel(panelElement) {
- var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var element = selfCheck ? panelElement : panelElement.nextElementSibling;
- return element ? getAttribute(element, "data-p-disabled") ? this.findNextPanel(element) : this.findHeader(element) : null;
- }, "findNextPanel"),
- findPrevPanel: /* @__PURE__ */ __name(function findPrevPanel(panelElement) {
- var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var element = selfCheck ? panelElement : panelElement.previousElementSibling;
- return element ? getAttribute(element, "data-p-disabled") ? this.findPrevPanel(element) : this.findHeader(element) : null;
- }, "findPrevPanel"),
- findFirstPanel: /* @__PURE__ */ __name(function findFirstPanel() {
- return this.findNextPanel(this.$pcAccordion.$el.firstElementChild, true);
- }, "findFirstPanel"),
- findLastPanel: /* @__PURE__ */ __name(function findLastPanel() {
- return this.findPrevPanel(this.$pcAccordion.$el.lastElementChild, true);
- }, "findLastPanel"),
- changeActiveValue: /* @__PURE__ */ __name(function changeActiveValue() {
- this.$pcAccordion.updateValue(this.$pcAccordionPanel.value);
- }, "changeActiveValue"),
- changeFocusedPanel: /* @__PURE__ */ __name(function changeFocusedPanel(event2, element) {
- focus(this.findHeader(element));
- }, "changeFocusedPanel")
- },
- computed: {
- id: /* @__PURE__ */ __name(function id2() {
- return "".concat(this.$pcAccordion.id, "_accordionheader_").concat(this.$pcAccordionPanel.value);
- }, "id"),
- ariaControls: /* @__PURE__ */ __name(function ariaControls() {
- return "".concat(this.$pcAccordion.id, "_accordioncontent_").concat(this.$pcAccordionPanel.value);
- }, "ariaControls"),
- attrs: /* @__PURE__ */ __name(function attrs2() {
- return mergeProps(this.asAttrs, this.a11yAttrs, this.ptmi("root", this.ptParams));
- }, "attrs"),
- asAttrs: /* @__PURE__ */ __name(function asAttrs() {
- return this.as === "BUTTON" ? {
- type: "button",
- disabled: this.$pcAccordionPanel.disabled
- } : void 0;
- }, "asAttrs"),
- a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs2() {
- return {
- id: this.id,
- tabindex: this.$pcAccordion.tabindex,
- "aria-expanded": this.$pcAccordionPanel.active,
- "aria-controls": this.ariaControls,
- "data-pc-name": "accordionheader",
- "data-p-disabled": this.$pcAccordionPanel.disabled,
- "data-p-active": this.$pcAccordionPanel.active,
- onFocus: this.onFocus,
- onKeydown: this.onKeydown
- };
- }, "a11yAttrs"),
- ptParams: /* @__PURE__ */ __name(function ptParams2() {
- return {
- context: {
- active: this.$pcAccordionPanel.active
- }
- };
- }, "ptParams")
- },
- components: {
- ChevronUpIcon: script$1g,
- ChevronDownIcon: script$1h
- },
- directives: {
- ripple: Ripple
- }
-};
-function render$11(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- return !_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
- key: 0,
- "class": _ctx.cx("root"),
- onClick: $options.onClick
- }, $options.attrs), {
- "default": withCtx(function() {
- return [renderSlot(_ctx.$slots, "default", {
- active: $options.$pcAccordionPanel.active
- }), renderSlot(_ctx.$slots, "toggleicon", {
- active: $options.$pcAccordionPanel.active,
- "class": normalizeClass(_ctx.cx("toggleicon"))
- }, function() {
- return [$options.$pcAccordionPanel.active ? (openBlock(), createBlock(resolveDynamicComponent($options.$pcAccordion.$slots.collapseicon ? $options.$pcAccordion.$slots.collapseicon : $options.$pcAccordion.collapseIcon ? "span" : "ChevronDownIcon"), mergeProps({
- key: 0,
- "class": [$options.$pcAccordion.collapseIcon, _ctx.cx("toggleicon")],
- "aria-hidden": "true"
- }, _ctx.ptm("toggleicon", $options.ptParams)), null, 16, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent($options.$pcAccordion.$slots.expandicon ? $options.$pcAccordion.$slots.expandicon : $options.$pcAccordion.expandIcon ? "span" : "ChevronUpIcon"), mergeProps({
- key: 1,
- "class": [$options.$pcAccordion.expandIcon, _ctx.cx("toggleicon")],
- "aria-hidden": "true"
- }, _ctx.ptm("toggleicon", $options.ptParams)), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "onClick"])), [[_directive_ripple]]) : renderSlot(_ctx.$slots, "default", {
- key: 1,
- "class": normalizeClass(_ctx.cx("root")),
- active: $options.$pcAccordionPanel.active,
- a11yAttrs: $options.a11yAttrs,
- onClick: $options.onClick
- });
-}
-__name(render$11, "render$11");
-script$1a.render = render$11;
-var classes$J = {
- root: /* @__PURE__ */ __name(function root(_ref) {
- var instance = _ref.instance, props = _ref.props;
- return ["p-accordionpanel", {
- "p-accordionpanel-active": instance.active,
- "p-disabled": props.disabled
- }];
- }, "root")
-};
-var AccordionPanelStyle = BaseStyle.extend({
- name: "accordionpanel",
- classes: classes$J
-});
-var script$1$L = {
- name: "BaseAccordionPanel",
- "extends": script$1f,
- props: {
- value: {
- type: [String, Number],
- "default": void 0
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- as: {
- type: [String, Object],
- "default": "DIV"
- },
- asChild: {
- type: Boolean,
- "default": false
- }
- },
- style: AccordionPanelStyle,
- provide: /* @__PURE__ */ __name(function provide3() {
- return {
- $pcAccordionPanel: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$19 = {
- name: "AccordionPanel",
- "extends": script$1$L,
- inheritAttrs: false,
- inject: ["$pcAccordion"],
- computed: {
- active: /* @__PURE__ */ __name(function active() {
- return this.$pcAccordion.isItemActive(this.value);
- }, "active"),
- attrs: /* @__PURE__ */ __name(function attrs3() {
- return mergeProps(this.a11yAttrs, this.ptmi("root", this.ptParams));
- }, "attrs"),
- a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs3() {
- return {
- "data-pc-name": "accordionpanel",
- "data-p-disabled": this.disabled,
- "data-p-active": this.active
- };
- }, "a11yAttrs"),
- ptParams: /* @__PURE__ */ __name(function ptParams3() {
- return {
- context: {
- active: this.active
- }
- };
- }, "ptParams")
- }
-};
-function render$10(_ctx, _cache, $props, $setup, $data, $options) {
- return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({
- key: 0,
- "class": _ctx.cx("root")
- }, $options.attrs), {
- "default": withCtx(function() {
- return [renderSlot(_ctx.$slots, "default")];
- }),
- _: 3
- }, 16, ["class"])) : renderSlot(_ctx.$slots, "default", {
- key: 1,
- "class": normalizeClass(_ctx.cx("root")),
- active: $options.active,
- a11yAttrs: $options.a11yAttrs
- });
-}
-__name(render$10, "render$10");
-script$19.render = render$10;
-var theme$C = /* @__PURE__ */ __name(function theme(_ref) {
- var dt = _ref.dt;
- return "\n.p-accordionpanel {\n display: flex;\n flex-direction: column;\n border-style: solid;\n border-width: ".concat(dt("accordion.panel.border.width"), ";\n border-color: ").concat(dt("accordion.panel.border.color"), ";\n}\n\n.p-accordionheader {\n all: unset;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ").concat(dt("accordion.header.padding"), ";\n color: ").concat(dt("accordion.header.color"), ";\n background: ").concat(dt("accordion.header.background"), ";\n border-style: solid;\n border-width: ").concat(dt("accordion.header.border.width"), ";\n border-color: ").concat(dt("accordion.header.border.color"), ";\n font-weight: ").concat(dt("accordion.header.font.weight"), ";\n border-radius: ").concat(dt("accordion.header.border.radius"), ";\n transition: background ").concat(dt("accordion.transition.duration"), "; color ").concat(dt("accordion.transition.duration"), "color ").concat(dt("accordion.transition.duration"), ", outline-color ").concat(dt("accordion.transition.duration"), ", box-shadow ").concat(dt("accordion.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-accordionpanel:first-child > .p-accordionheader {\n border-width: ").concat(dt("accordion.header.first.border.width"), ";\n border-start-start-radius: ").concat(dt("accordion.header.first.top.border.radius"), ";\n border-start-end-radius: ").concat(dt("accordion.header.first.top.border.radius"), ";\n}\n\n.p-accordionpanel:last-child > .p-accordionheader {\n border-end-start-radius: ").concat(dt("accordion.header.last.bottom.border.radius"), ";\n border-end-end-radius: ").concat(dt("accordion.header.last.bottom.border.radius"), ";\n}\n\n.p-accordionpanel:last-child.p-accordionpanel-active > .p-accordionheader {\n border-end-start-radius: ").concat(dt("accordion.header.last.active.bottom.border.radius"), ";\n border-end-end-radius: ").concat(dt("accordion.header.last.active.bottom.border.radius"), ";\n}\n\n.p-accordionheader-toggle-icon {\n color: ").concat(dt("accordion.header.toggle.icon.color"), ";\n}\n\n.p-accordionpanel:not(.p-disabled) .p-accordionheader:focus-visible {\n box-shadow: ").concat(dt("accordion.header.focus.ring.shadow"), ";\n outline: ").concat(dt("accordion.header.focus.ring.width"), " ").concat(dt("accordion.header.focus.ring.style"), " ").concat(dt("accordion.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("accordion.header.focus.ring.offset"), ";\n}\n\n.p-accordionpanel:not(.p-accordionpanel-active):not(.p-disabled) > .p-accordionheader:hover {\n background: ").concat(dt("accordion.header.hover.background"), ";\n color: ").concat(dt("accordion.header.hover.color"), ";\n}\n\n.p-accordionpanel:not(.p-accordionpanel-active):not(.p-disabled) .p-accordionheader:hover .p-accordionheader-toggle-icon {\n color: ").concat(dt("accordion.header.toggle.icon.hover.color"), ";\n}\n\n.p-accordionpanel:not(.p-disabled).p-accordionpanel-active > .p-accordionheader {\n background: ").concat(dt("accordion.header.active.background"), ";\n color: ").concat(dt("accordion.header.active.color"), ";\n}\n\n.p-accordionpanel:not(.p-disabled).p-accordionpanel-active > .p-accordionheader .p-accordionheader-toggle-icon {\n color: ").concat(dt("accordion.header.toggle.icon.active.color"), ";\n}\n\n.p-accordionpanel:not(.p-disabled).p-accordionpanel-active > .p-accordionheader:hover {\n background: ").concat(dt("accordion.header.active.hover.background"), ";\n color: ").concat(dt("accordion.header.active.hover.color"), ";\n}\n\n.p-accordionpanel:not(.p-disabled).p-accordionpanel-active > .p-accordionheader:hover .p-accordionheader-toggle-icon {\n color: ").concat(dt("accordion.header.toggle.icon.active.hover.color"), ";\n}\n\n.p-accordioncontent-content {\n border-style: solid;\n border-width: ").concat(dt("accordion.content.border.width"), ";\n border-color: ").concat(dt("accordion.content.border.color"), ";\n background-color: ").concat(dt("accordion.content.background"), ";\n color: ").concat(dt("accordion.content.color"), ";\n padding: ").concat(dt("accordion.content.padding"), ";\n}\n");
-}, "theme");
-var classes$I = {
- root: "p-accordion p-component"
-};
-var AccordionStyle = BaseStyle.extend({
- name: "accordion",
- theme: theme$C,
- classes: classes$I
-});
-var script$1$K = {
- name: "BaseAccordion",
- "extends": script$1f,
- props: {
- value: {
- type: [String, Number, Array],
- "default": void 0
- },
- multiple: {
- type: Boolean,
- "default": false
- },
- lazy: {
- type: Boolean,
- "default": false
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- selectOnFocus: {
- type: Boolean,
- "default": false
- },
- expandIcon: {
- type: String,
- "default": void 0
- },
- collapseIcon: {
- type: String,
- "default": void 0
- },
- // @deprecated since v4.
- activeIndex: {
- type: [Number, Array],
- "default": null
- }
- },
- style: AccordionStyle,
- provide: /* @__PURE__ */ __name(function provide4() {
- return {
- $pcAccordion: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$18 = {
- name: "Accordion",
- "extends": script$1$K,
- inheritAttrs: false,
- emits: ["update:value", "update:activeIndex", "tab-open", "tab-close", "tab-click"],
- data: /* @__PURE__ */ __name(function data() {
- return {
- id: this.$attrs.id,
- d_value: this.value
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- value: /* @__PURE__ */ __name(function value(newValue) {
- this.d_value = newValue;
- }, "value"),
- activeIndex: {
- immediate: true,
- handler: /* @__PURE__ */ __name(function handler(newValue) {
- if (this.hasAccordionTab) {
- this.d_value = this.multiple ? newValue === null || newValue === void 0 ? void 0 : newValue.map(String) : newValue === null || newValue === void 0 ? void 0 : newValue.toString();
- }
- }, "handler")
- }
- },
- mounted: /* @__PURE__ */ __name(function mounted() {
- this.id = this.id || UniqueComponentId();
- }, "mounted"),
- methods: {
- isItemActive: /* @__PURE__ */ __name(function isItemActive(value2) {
- var _this$d_value;
- return this.multiple ? (_this$d_value = this.d_value) === null || _this$d_value === void 0 ? void 0 : _this$d_value.includes(value2) : this.d_value === value2;
- }, "isItemActive"),
- updateValue: /* @__PURE__ */ __name(function updateValue(newValue) {
- var _this$d_value2;
- var active3 = this.isItemActive(newValue);
- if (this.multiple) {
- if (active3) {
- this.d_value = this.d_value.filter(function(v) {
- return v !== newValue;
- });
- } else {
- if (this.d_value) this.d_value.push(newValue);
- else this.d_value = [newValue];
- }
- } else {
- this.d_value = active3 ? null : newValue;
- }
- this.$emit("update:value", this.d_value);
- this.$emit("update:activeIndex", this.multiple ? (_this$d_value2 = this.d_value) === null || _this$d_value2 === void 0 ? void 0 : _this$d_value2.map(Number) : Number(this.d_value));
- this.$emit(active3 ? "tab-close" : "tab-open", {
- originalEvent: void 0,
- index: Number(newValue)
- });
- }, "updateValue"),
- // @deprecated since v4. Use new structure instead.
- isAccordionTab: /* @__PURE__ */ __name(function isAccordionTab(child) {
- return child.type.name === "AccordionTab";
- }, "isAccordionTab"),
- getTabProp: /* @__PURE__ */ __name(function getTabProp(tab, name4) {
- return tab.props ? tab.props[name4] : void 0;
- }, "getTabProp"),
- getKey: /* @__PURE__ */ __name(function getKey(tab, index) {
- return this.getTabProp(tab, "header") || index;
- }, "getKey"),
- getHeaderPT: /* @__PURE__ */ __name(function getHeaderPT(tab, index) {
- var _this = this;
- return {
- root: mergeProps({
- onClick: /* @__PURE__ */ __name(function onClick11(event2) {
- return _this.onTabClick(event2, index);
- }, "onClick")
- }, this.getTabProp(tab, "headerProps"), this.getTabPT(tab, "header", index)),
- toggleicon: mergeProps(this.getTabProp(tab, "headeractionprops"), this.getTabPT(tab, "headeraction", index))
- };
- }, "getHeaderPT"),
- getContentPT: /* @__PURE__ */ __name(function getContentPT(tab, index) {
- return {
- root: mergeProps(this.getTabProp(tab, "contentProps"), this.getTabPT(tab, "toggleablecontent", index)),
- transition: this.getTabPT(tab, "transition", index),
- content: this.getTabPT(tab, "content", index)
- };
- }, "getContentPT"),
- getTabPT: /* @__PURE__ */ __name(function getTabPT(tab, key, index) {
- var count = this.tabs.length;
- var tabMetaData = {
- props: tab.props || {},
- parent: {
- instance: this,
- props: this.$props,
- state: this.$data
- },
- context: {
- index,
- count,
- first: index === 0,
- last: index === count - 1,
- active: this.isItemActive("".concat(index))
- }
- };
- return mergeProps(this.ptm("accordiontab.".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, "pt"), key, tabMetaData));
- }, "getTabPT"),
- onTabClick: /* @__PURE__ */ __name(function onTabClick(event2, index) {
- this.$emit("tab-click", {
- originalEvent: event2,
- index
- });
- }, "onTabClick")
- },
- computed: {
- // @deprecated since v4.
- tabs: /* @__PURE__ */ __name(function tabs() {
- var _this2 = this;
- return this.$slots["default"]().reduce(function(tabs2, child) {
- if (_this2.isAccordionTab(child)) {
- tabs2.push(child);
- } else if (child.children && child.children instanceof Array) {
- child.children.forEach(function(nestedChild) {
- if (_this2.isAccordionTab(nestedChild)) {
- tabs2.push(nestedChild);
- }
- });
- }
- return tabs2;
- }, []);
- }, "tabs"),
- hasAccordionTab: /* @__PURE__ */ __name(function hasAccordionTab() {
- return this.tabs.length;
- }, "hasAccordionTab")
- },
- components: {
- AccordionPanel: script$19,
- AccordionHeader: script$1a,
- AccordionContent: script$1b,
- ChevronUpIcon: script$1g,
- ChevronRightIcon: script$1i
- }
-};
-function render$$(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_AccordionHeader = resolveComponent("AccordionHeader");
- var _component_AccordionContent = resolveComponent("AccordionContent");
- var _component_AccordionPanel = resolveComponent("AccordionPanel");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [$options.hasAccordionTab ? (openBlock(true), createElementBlock(Fragment, {
- key: 0
- }, renderList($options.tabs, function(tab, i) {
- return openBlock(), createBlock(_component_AccordionPanel, {
- key: $options.getKey(tab, i),
- value: "".concat(i),
- pt: {
- root: $options.getTabPT(tab, "root", i)
- },
- disabled: $options.getTabProp(tab, "disabled")
- }, {
- "default": withCtx(function() {
- return [createVNode(_component_AccordionHeader, {
- "class": normalizeClass($options.getTabProp(tab, "headerClass")),
- pt: $options.getHeaderPT(tab, i)
- }, {
- toggleicon: withCtx(function(slotProps) {
- return [slotProps.active ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.collapseicon ? _ctx.$slots.collapseicon : _ctx.collapseIcon ? "span" : "ChevronDownIcon"), mergeProps({
- key: 0,
- "class": [_ctx.collapseIcon, slotProps["class"]],
- "aria-hidden": "true",
- ref_for: true
- }, $options.getTabPT(tab, "headericon", i)), null, 16, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.expandicon ? _ctx.$slots.expandicon : _ctx.expandIcon ? "span" : "ChevronUpIcon"), mergeProps({
- key: 1,
- "class": [_ctx.expandIcon, slotProps["class"]],
- "aria-hidden": "true",
- ref_for: true
- }, $options.getTabPT(tab, "headericon", i)), null, 16, ["class"]))];
- }),
- "default": withCtx(function() {
- return [tab.children && tab.children.headericon ? (openBlock(), createBlock(resolveDynamicComponent(tab.children.headericon), {
- key: 0,
- isTabActive: $options.isItemActive("".concat(i)),
- active: $options.isItemActive("".concat(i)),
- index: i
- }, null, 8, ["isTabActive", "active", "index"])) : createCommentVNode("", true), tab.props && tab.props.header ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- ref_for: true
- }, $options.getTabPT(tab, "headertitle", i)), toDisplayString(tab.props.header), 17)) : createCommentVNode("", true), tab.children && tab.children.header ? (openBlock(), createBlock(resolveDynamicComponent(tab.children.header), {
- key: 2
- })) : createCommentVNode("", true)];
- }),
- _: 2
- }, 1032, ["class", "pt"]), createVNode(_component_AccordionContent, {
- pt: $options.getContentPT(tab, i)
- }, {
- "default": withCtx(function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(tab)))];
- }),
- _: 2
- }, 1032, ["pt"])];
- }),
- _: 2
- }, 1032, ["value", "pt", "disabled"]);
- }), 128)) : renderSlot(_ctx.$slots, "default", {
- key: 1
- })], 16);
-}
-__name(render$$, "render$$");
-script$18.render = render$$;
-var AccordionTabStyle = BaseStyle.extend({
- name: "accordiontab"
-});
-var script$1$J = {
- name: "BaseAccordionTab",
- "extends": script$1f,
- props: {
- header: null,
- headerStyle: null,
- headerClass: null,
- headerProps: null,
- headerActionProps: null,
- contentStyle: null,
- contentClass: null,
- contentProps: null,
- disabled: Boolean
- },
- style: AccordionTabStyle,
- provide: /* @__PURE__ */ __name(function provide5() {
- return {
- $pcAccordionTab: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$17 = {
- name: "AccordionTab",
- "extends": script$1$J,
- inheritAttrs: false,
- mounted: /* @__PURE__ */ __name(function mounted2() {
- console.warn("Deprecated since v4. Use the new structure of Accordion instead.");
- }, "mounted")
-};
-function render$_(_ctx, _cache, $props, $setup, $data, $options) {
- return renderSlot(_ctx.$slots, "default");
-}
-__name(render$_, "render$_");
-script$17.render = render$_;
-var AnimateOnScrollStyle = BaseStyle.extend({
- name: "animateonscroll-directive"
-});
-var BaseAnimateOnScroll = BaseDirective.extend({
- style: AnimateOnScrollStyle
-});
-function _typeof$n(o) {
- "@babel/helpers - typeof";
- return _typeof$n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$n(o);
-}
-__name(_typeof$n, "_typeof$n");
-function ownKeys$k(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$k, "ownKeys$k");
-function _objectSpread$k(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$k(Object(t2), true).forEach(function(r2) {
- _defineProperty$l(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$k(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$k, "_objectSpread$k");
-function _defineProperty$l(e, r, t2) {
- return (r = _toPropertyKey$l(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$l, "_defineProperty$l");
-function _toPropertyKey$l(t2) {
- var i = _toPrimitive$l(t2, "string");
- return "symbol" == _typeof$n(i) ? i : i + "";
-}
-__name(_toPropertyKey$l, "_toPropertyKey$l");
-function _toPrimitive$l(t2, r) {
- if ("object" != _typeof$n(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$n(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$l, "_toPrimitive$l");
-function _slicedToArray$1(r, e) {
- return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$f(r, e) || _nonIterableRest$1();
-}
-__name(_slicedToArray$1, "_slicedToArray$1");
-function _nonIterableRest$1() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableRest$1, "_nonIterableRest$1");
-function _unsupportedIterableToArray$f(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$f(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$f(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$f, "_unsupportedIterableToArray$f");
-function _arrayLikeToArray$f(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$f, "_arrayLikeToArray$f");
-function _iterableToArrayLimit$1(r, l) {
- var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t2) {
- var e, n, i, u, a = [], f = true, o = false;
- try {
- if (i = (t2 = t2.call(r)).next, 0 === l) ;
- else for (; !(f = (e = i.call(t2)).done) && (a.push(e.value), a.length !== l); f = true) ;
- } catch (r2) {
- o = true, n = r2;
- } finally {
- try {
- if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
- } finally {
- if (o) throw n;
- }
- }
- return a;
- }
-}
-__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1");
-function _arrayWithHoles$1(r) {
- if (Array.isArray(r)) return r;
-}
-__name(_arrayWithHoles$1, "_arrayWithHoles$1");
-var AnimateOnScroll = BaseAnimateOnScroll.extend("animateonscroll", {
- created: /* @__PURE__ */ __name(function created() {
- this.$value = this.$value || {};
- this.$el.style.opacity = this.$value.enterClass ? "0" : "";
- }, "created"),
- mounted: /* @__PURE__ */ __name(function mounted3() {
- this.$el.setAttribute("data-pd-animateonscroll", true);
- this.bindIntersectionObserver();
- }, "mounted"),
- unmounted: /* @__PURE__ */ __name(function unmounted() {
- this.unbindAnimationEvents();
- this.unbindIntersectionObserver();
- }, "unmounted"),
- observer: void 0,
- resetObserver: void 0,
- isObserverActive: false,
- animationState: void 0,
- animationEndListener: void 0,
- methods: {
- bindAnimationEvents: /* @__PURE__ */ __name(function bindAnimationEvents() {
- var _this = this;
- if (!this.animationEndListener) {
- this.animationEndListener = function() {
- removeClass(_this.$el, [_this.$value.enterClass, _this.$value.leaveClass]);
- !_this.$modifiers.once && _this.resetObserver.observe(_this.$el);
- _this.unbindAnimationEvents();
- };
- this.$el.addEventListener("animationend", this.animationEndListener);
- }
- }, "bindAnimationEvents"),
- bindIntersectionObserver: /* @__PURE__ */ __name(function bindIntersectionObserver() {
- var _this2 = this;
- var _this$$value = this.$value, root34 = _this$$value.root, rootMargin = _this$$value.rootMargin, _this$$value$threshol = _this$$value.threshold, threshold = _this$$value$threshol === void 0 ? 0.5 : _this$$value$threshol;
- var options4 = {
- root: root34,
- rootMargin,
- threshold
- };
- this.observer = new IntersectionObserver(function(_ref) {
- var _ref2 = _slicedToArray$1(_ref, 1), entry = _ref2[0];
- if (_this2.isObserverActive) {
- if (entry.boundingClientRect.top > 0) {
- entry.isIntersecting ? _this2.enter() : _this2.leave();
- }
- } else if (entry.isIntersecting) {
- _this2.enter();
- }
- _this2.isObserverActive = true;
- }, options4);
- setTimeout(function() {
- return _this2.observer.observe(_this2.$el);
- }, 0);
- this.resetObserver = new IntersectionObserver(function(_ref3) {
- var _ref4 = _slicedToArray$1(_ref3, 1), entry = _ref4[0];
- if (entry.boundingClientRect.top > 0 && !entry.isIntersecting) {
- _this2.$el.style.opacity = _this2.$value.enterClass ? "0" : "";
- removeClass(_this2.$el, [_this2.$value.enterClass, _this2.$value.leaveClass]);
- _this2.resetObserver.unobserve(_this2.$el);
- }
- _this2.animationState = void 0;
- }, _objectSpread$k(_objectSpread$k({}, options4), {}, {
- threshold: 0
- }));
- }, "bindIntersectionObserver"),
- enter: /* @__PURE__ */ __name(function enter() {
- if (this.animationState !== "enter" && this.$value.enterClass) {
- this.$el.style.opacity = "";
- removeClass(this.$el, this.$value.leaveClass);
- addClass(this.$el, this.$value.enterClass);
- this.$modifiers.once && this.unbindIntersectionObserver(this.$el);
- this.bindAnimationEvents();
- this.animationState = "enter";
- }
- }, "enter"),
- leave: /* @__PURE__ */ __name(function leave() {
- if (this.animationState !== "leave" && this.$value.leaveClass) {
- this.$el.style.opacity = this.$value.enterClass ? "0" : "";
- removeClass(this.$el, this.$value.enterClass);
- addClass(this.$el, this.$value.leaveClass);
- this.bindAnimationEvents();
- this.animationState = "leave";
- }
- }, "leave"),
- unbindAnimationEvents: /* @__PURE__ */ __name(function unbindAnimationEvents() {
- if (this.animationEndListener) {
- this.$el.removeEventListener("animationend", this.animationEndListener);
- this.animationEndListener = void 0;
- }
- }, "unbindAnimationEvents"),
- unbindIntersectionObserver: /* @__PURE__ */ __name(function unbindIntersectionObserver() {
- var _this$observer, _this$resetObserver;
- (_this$observer = this.observer) === null || _this$observer === void 0 || _this$observer.unobserve(this.$el);
- (_this$resetObserver = this.resetObserver) === null || _this$resetObserver === void 0 || _this$resetObserver.unobserve(this.$el);
- this.isObserverActive = false;
- }, "unbindIntersectionObserver")
- }
-});
-var theme$B = /* @__PURE__ */ __name(function theme2(_ref) {
- var dt = _ref.dt;
- return "\n.p-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ".concat(dt("avatar.width"), ";\n height: ").concat(dt("avatar.height"), ";\n font-size: ").concat(dt("avatar.font.size"), ";\n background: ").concat(dt("avatar.background"), ";\n color: ").concat(dt("avatar.color"), ";\n border-radius: ").concat(dt("avatar.border.radius"), ";\n}\n\n.p-avatar-image {\n background: transparent;\n}\n\n.p-avatar-circle {\n border-radius: 50%;\n}\n\n.p-avatar-circle img {\n border-radius: 50%;\n}\n\n.p-avatar-icon {\n font-size: ").concat(dt("avatar.icon.size"), ";\n width: ").concat(dt("avatar.icon.size"), ";\n height: ").concat(dt("avatar.icon.size"), ";\n}\n\n.p-avatar img {\n width: 100%;\n height: 100%;\n}\n\n.p-avatar-lg {\n width: ").concat(dt("avatar.lg.width"), ";\n height: ").concat(dt("avatar.lg.width"), ";\n font-size: ").concat(dt("avatar.lg.font.size"), ";\n}\n\n.p-avatar-lg .p-avatar-icon {\n font-size: ").concat(dt("avatar.lg.icon.size"), ";\n width: ").concat(dt("avatar.lg.icon.size"), ";\n height: ").concat(dt("avatar.lg.icon.size"), ";\n}\n\n.p-avatar-xl {\n width: ").concat(dt("avatar.xl.width"), ";\n height: ").concat(dt("avatar.xl.width"), ";\n font-size: ").concat(dt("avatar.xl.font.size"), ";\n}\n\n.p-avatar-xl .p-avatar-icon {\n font-size: ").concat(dt("avatar.xl.icon.size"), ";\n width: ").concat(dt("avatar.xl.icon.size"), ";\n height: ").concat(dt("avatar.xl.icon.size"), ";\n}\n\n.p-avatar-group {\n display: flex;\n align-items: center;\n}\n\n.p-avatar-group .p-avatar + .p-avatar {\n margin-inline-start: ").concat(dt("avatar.group.offset"), ";\n}\n\n.p-avatar-group .p-avatar {\n border: 2px solid ").concat(dt("avatar.group.border.color"), ";\n}\n\n.p-avatar-group .p-avatar-lg + .p-avatar-lg {\n margin-inline-start: ").concat(dt("avatar.lg.group.offset"), ";\n}\n\n.p-avatar-group .p-avatar-xl + .p-avatar-xl {\n margin-inline-start: ").concat(dt("avatar.xl.group.offset"), ";\n}\n");
-}, "theme");
-var classes$H = {
- root: /* @__PURE__ */ __name(function root2(_ref2) {
- var props = _ref2.props;
- return ["p-avatar p-component", {
- "p-avatar-image": props.image != null,
- "p-avatar-circle": props.shape === "circle",
- "p-avatar-lg": props.size === "large",
- "p-avatar-xl": props.size === "xlarge"
- }];
- }, "root"),
- label: "p-avatar-label",
- icon: "p-avatar-icon"
-};
-var AvatarStyle = BaseStyle.extend({
- name: "avatar",
- theme: theme$B,
- classes: classes$H
-});
-var script$1$I = {
- name: "BaseAvatar",
- "extends": script$1f,
- props: {
- label: {
- type: String,
- "default": null
- },
- icon: {
- type: String,
- "default": null
- },
- image: {
- type: String,
- "default": null
- },
- size: {
- type: String,
- "default": "normal"
- },
- shape: {
- type: String,
- "default": "square"
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: AvatarStyle,
- provide: /* @__PURE__ */ __name(function provide6() {
- return {
- $pcAvatar: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$16 = {
- name: "Avatar",
- "extends": script$1$I,
- inheritAttrs: false,
- emits: ["error"],
- methods: {
- onError: /* @__PURE__ */ __name(function onError(event2) {
- this.$emit("error", event2);
- }, "onError")
- }
-};
-var _hoisted_1$u = ["aria-labelledby", "aria-label"];
-var _hoisted_2$m = ["src", "alt"];
-function render$Z(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default", {}, function() {
- return [_ctx.label ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("label")
- }, _ctx.ptm("label")), toDisplayString(_ctx.label), 17)) : _ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), {
- key: 1,
- "class": normalizeClass(_ctx.cx("icon"))
- }, null, 8, ["class"])) : _ctx.icon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- "class": [_ctx.cx("icon"), _ctx.icon]
- }, _ctx.ptm("icon")), null, 16)) : _ctx.image ? (openBlock(), createElementBlock("img", mergeProps({
- key: 3,
- src: _ctx.image,
- alt: _ctx.ariaLabel,
- onError: _cache[0] || (_cache[0] = function() {
- return $options.onError && $options.onError.apply($options, arguments);
- })
- }, _ctx.ptm("image")), null, 16, _hoisted_2$m)) : createCommentVNode("", true)];
- })], 16, _hoisted_1$u);
-}
-__name(render$Z, "render$Z");
-script$16.render = render$Z;
-var classes$G = {
- root: "p-avatar-group p-component"
-};
-var AvatarGroupStyle = BaseStyle.extend({
- name: "avatargroup",
- classes: classes$G
-});
-var script$1$H = {
- name: "BaseAvatarGroup",
- "extends": script$1f,
- style: AvatarGroupStyle,
- provide: /* @__PURE__ */ __name(function provide7() {
- return {
- $pcAvatarGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$15 = {
- name: "AvatarGroup",
- "extends": script$1$H,
- inheritAttrs: false
-};
-function render$Y(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$Y, "render$Y");
-script$15.render = render$Y;
-var classes$F = {
- root: "p-badge p-component"
-};
-var BadgeDirectiveStyle = BaseStyle.extend({
- name: "badge-directive",
- classes: classes$F
-});
-var BaseBadgeDirective = BaseDirective.extend({
- style: BadgeDirectiveStyle
-});
-function _typeof$m(o) {
- "@babel/helpers - typeof";
- return _typeof$m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$m(o);
-}
-__name(_typeof$m, "_typeof$m");
-function ownKeys$j(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$j, "ownKeys$j");
-function _objectSpread$j(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$j(Object(t2), true).forEach(function(r2) {
- _defineProperty$k(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$j(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$j, "_objectSpread$j");
-function _defineProperty$k(e, r, t2) {
- return (r = _toPropertyKey$k(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$k, "_defineProperty$k");
-function _toPropertyKey$k(t2) {
- var i = _toPrimitive$k(t2, "string");
- return "symbol" == _typeof$m(i) ? i : i + "";
-}
-__name(_toPropertyKey$k, "_toPropertyKey$k");
-function _toPrimitive$k(t2, r) {
- if ("object" != _typeof$m(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$m(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$k, "_toPrimitive$k");
-var BadgeDirective = BaseBadgeDirective.extend("badge", {
- mounted: /* @__PURE__ */ __name(function mounted4(el, binding) {
- console.warn("Deprecated since v4. Use OverlayBadge component instead.");
- var id4 = UniqueComponentId() + "_badge";
- var badge = createElement("span", _defineProperty$k(_defineProperty$k({
- id: id4,
- "class": !this.isUnstyled() && this.cx("root")
- }, this.$attrSelector, ""), "p-bind", this.ptm("root", {
- context: _objectSpread$j(_objectSpread$j({}, binding.modifiers), {}, {
- nogutter: String(binding.value).length === 1,
- dot: binding.value == null
- })
- })));
- el.$_pbadgeId = badge.getAttribute("id");
- for (var modifier in binding.modifiers) {
- !this.isUnstyled() && addClass(badge, "p-badge-" + modifier);
- }
- if (binding.value != null) {
- if (_typeof$m(binding.value) === "object") el.$_badgeValue = binding.value.value;
- else el.$_badgeValue = binding.value;
- badge.appendChild(document.createTextNode(el.$_badgeValue));
- if (String(el.$_badgeValue).length === 1 && !this.isUnstyled()) {
- !this.isUnstyled() && addClass(badge, "p-badge-circle");
- }
- } else {
- !this.isUnstyled() && addClass(badge, "p-badge-dot");
- }
- el.setAttribute("data-pd-badge", true);
- !this.isUnstyled() && addClass(el, "p-overlay-badge");
- el.setAttribute("data-p-overlay-badge", "true");
- el.appendChild(badge);
- this.$el = badge;
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated(el, binding) {
- !this.isUnstyled() && addClass(el, "p-overlay-badge");
- el.setAttribute("data-p-overlay-badge", "true");
- if (binding.oldValue !== binding.value) {
- var badge = document.getElementById(el.$_pbadgeId);
- if (_typeof$m(binding.value) === "object") el.$_badgeValue = binding.value.value;
- else el.$_badgeValue = binding.value;
- if (!this.isUnstyled()) {
- if (el.$_badgeValue) {
- if (hasClass(badge, "p-badge-dot")) removeClass(badge, "p-badge-dot");
- if (el.$_badgeValue.length === 1) addClass(badge, "p-badge-circle");
- else removeClass(badge, "p-badge-circle");
- } else if (!el.$_badgeValue && !hasClass(badge, "p-badge-dot")) {
- addClass(badge, "p-badge-dot");
- }
- }
- badge.innerHTML = "";
- badge.appendChild(document.createTextNode(el.$_badgeValue));
- }
- }, "updated")
-});
-var theme$A = /* @__PURE__ */ __name(function theme3(_ref) {
- var dt = _ref.dt;
- return "\n.p-breadcrumb {\n background: ".concat(dt("breadcrumb.background"), ";\n padding: ").concat(dt("breadcrumb.padding"), ";\n overflow-x: auto;\n}\n\n.p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n gap: ").concat(dt("breadcrumb.gap"), ";\n}\n\n.p-breadcrumb-separator {\n display: flex;\n align-items: center;\n color: ").concat(dt("breadcrumb.separator.color"), ";\n}\n\n.p-breadcrumb-separator-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n\n.p-breadcrumb-item-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n gap: ").concat(dt("breadcrumb.item.gap"), ";\n transition: background ").concat(dt("breadcrumb.transition.duration"), ", color ").concat(dt("breadcrumb.transition.duration"), ", outline-color ").concat(dt("breadcrumb.transition.duration"), ", box-shadow ").concat(dt("breadcrumb.transition.duration"), ";\n border-radius: ").concat(dt("breadcrumb.item.border.radius"), ";\n outline-color: transparent;\n color: ").concat(dt("breadcrumb.item.color"), ";\n}\n\n.p-breadcrumb-item-link:focus-visible {\n box-shadow: ").concat(dt("breadcrumb.item.focus.ring.shadow"), ";\n outline: ").concat(dt("breadcrumb.item.focus.ring.width"), " ").concat(dt("breadcrumb.item.focus.ring.style"), " ").concat(dt("breadcrumb.item.focus.ring.color"), ";\n outline-offset: ").concat(dt("breadcrumb.item.focus.ring.offset"), ";\n}\n\n.p-breadcrumb-item-link:hover .p-breadcrumb-item-label {\n color: ").concat(dt("breadcrumb.item.hover.color"), ";\n}\n\n.p-breadcrumb-item-label {\n transition: inherit;\n}\n\n.p-breadcrumb-item-icon {\n color: ").concat(dt("breadcrumb.item.icon.color"), ";\n transition: inherit;\n}\n\n.p-breadcrumb-item-link:hover .p-breadcrumb-item-icon {\n color: ").concat(dt("breadcrumb.item.icon.hover.color"), ";\n}\n");
-}, "theme");
-var classes$E = {
- root: "p-breadcrumb p-component",
- list: "p-breadcrumb-list",
- homeItem: "p-breadcrumb-home-item",
- separator: "p-breadcrumb-separator",
- separatorIcon: "p-breadcrumb-separator-icon",
- item: /* @__PURE__ */ __name(function item(_ref2) {
- var instance = _ref2.instance;
- return ["p-breadcrumb-item", {
- "p-disabled": instance.disabled()
- }];
- }, "item"),
- itemLink: "p-breadcrumb-item-link",
- itemIcon: "p-breadcrumb-item-icon",
- itemLabel: "p-breadcrumb-item-label"
-};
-var BreadcrumbStyle = BaseStyle.extend({
- name: "breadcrumb",
- theme: theme$A,
- classes: classes$E
-});
-var script$2$9 = {
- name: "BaseBreadcrumb",
- "extends": script$1f,
- props: {
- model: {
- type: Array,
- "default": null
- },
- home: {
- type: null,
- "default": null
- }
- },
- style: BreadcrumbStyle,
- provide: /* @__PURE__ */ __name(function provide8() {
- return {
- $pcBreadcrumb: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$G = {
- name: "BreadcrumbItem",
- hostName: "Breadcrumb",
- "extends": script$1f,
- props: {
- item: null,
- templates: null,
- index: null
- },
- methods: {
- onClick: /* @__PURE__ */ __name(function onClick2(event2) {
- if (this.item.command) {
- this.item.command({
- originalEvent: event2,
- item: this.item
- });
- }
- }, "onClick"),
- visible: /* @__PURE__ */ __name(function visible() {
- return typeof this.item.visible === "function" ? this.item.visible() : this.item.visible !== false;
- }, "visible"),
- disabled: /* @__PURE__ */ __name(function disabled() {
- return typeof this.item.disabled === "function" ? this.item.disabled() : this.item.disabled;
- }, "disabled"),
- label: /* @__PURE__ */ __name(function label() {
- return typeof this.item.label === "function" ? this.item.label() : this.item.label;
- }, "label"),
- isCurrentUrl: /* @__PURE__ */ __name(function isCurrentUrl() {
- var _this$item = this.item, to = _this$item.to, url = _this$item.url;
- var lastPath = typeof window !== "undefined" ? window.location.pathname : "";
- return to === lastPath || url === lastPath ? "page" : void 0;
- }, "isCurrentUrl")
- },
- computed: {
- ptmOptions: /* @__PURE__ */ __name(function ptmOptions() {
- return {
- context: {
- item: this.item,
- index: this.index
- }
- };
- }, "ptmOptions"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps() {
- var _this = this;
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- "aria-current": this.isCurrentUrl(),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return _this.onClick($event);
- }, "onClick")
- }, this.ptm("itemLink", this.ptmOptions)),
- icon: mergeProps({
- "class": [this.cx("icon"), this.item.icon]
- }, this.ptm("icon", this.ptmOptions)),
- label: mergeProps({
- "class": this.cx("label")
- }, this.ptm("label", this.ptmOptions))
- };
- }, "getMenuItemProps")
- }
-};
-var _hoisted_1$t = ["href", "target", "aria-current"];
-function render$1$9(_ctx, _cache, $props, $setup, $data, $options) {
- return $options.visible() ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- "class": [_ctx.cx("item"), $props.item["class"]]
- }, _ctx.ptm("item", $options.ptmOptions)), [!$props.templates.item ? (openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: $props.item.url || "#",
- "class": _ctx.cx("itemLink"),
- target: $props.item.target,
- "aria-current": $options.isCurrentUrl(),
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- })
- }, _ctx.ptm("itemLink", $options.ptmOptions)), [$props.templates && $props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), {
- key: 0,
- item: $props.item,
- "class": normalizeClass(_ctx.cx("itemIcon", $options.ptmOptions))
- }, null, 8, ["item", "class"])) : $props.item.icon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": [_ctx.cx("itemIcon"), $props.item.icon]
- }, _ctx.ptm("itemIcon", $options.ptmOptions)), null, 16)) : createCommentVNode("", true), $props.item.label ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- "class": _ctx.cx("itemLabel")
- }, _ctx.ptm("itemLabel", $options.ptmOptions)), toDisplayString($options.label()), 17)) : createCommentVNode("", true)], 16, _hoisted_1$t)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
- key: 1,
- item: $props.item,
- label: $options.label(),
- props: $options.getMenuItemProps
- }, null, 8, ["item", "label", "props"]))], 16)) : createCommentVNode("", true);
-}
-__name(render$1$9, "render$1$9");
-script$1$G.render = render$1$9;
-var script$14 = {
- name: "Breadcrumb",
- "extends": script$2$9,
- inheritAttrs: false,
- components: {
- BreadcrumbItem: script$1$G,
- ChevronRightIcon: script$1i
- }
-};
-function render$X(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_BreadcrumbItem = resolveComponent("BreadcrumbItem");
- var _component_ChevronRightIcon = resolveComponent("ChevronRightIcon");
- return openBlock(), createElementBlock("nav", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("ol", mergeProps({
- "class": _ctx.cx("list")
- }, _ctx.ptm("list")), [_ctx.home ? (openBlock(), createBlock(_component_BreadcrumbItem, mergeProps({
- key: 0,
- item: _ctx.home,
- "class": _ctx.cx("homeItem"),
- templates: _ctx.$slots,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, _ctx.ptm("homeItem")), null, 16, ["item", "class", "templates", "pt", "unstyled"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: item8.label + "_" + i
- }, [_ctx.home || i !== 0 ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- "class": _ctx.cx("separator"),
- ref_for: true
- }, _ctx.ptm("separator")), [renderSlot(_ctx.$slots, "separator", {}, function() {
- return [createVNode(_component_ChevronRightIcon, mergeProps({
- "aria-hidden": "true",
- "class": _ctx.cx("separatorIcon"),
- ref_for: true
- }, _ctx.ptm("separatorIcon")), null, 16, ["class"])];
- })], 16)) : createCommentVNode("", true), createVNode(_component_BreadcrumbItem, {
- item: item8,
- index: i,
- templates: _ctx.$slots,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["item", "index", "templates", "pt", "unstyled"])], 64);
- }), 128))], 16)], 16);
-}
-__name(render$X, "render$X");
-script$14.render = render$X;
-var script$13 = {
- name: "CalendarIcon",
- "extends": script$1j
-};
-function render$W(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- d: "M10.7838 1.51351H9.83783V0.567568C9.83783 0.417039 9.77804 0.272676 9.6716 0.166237C9.56516 0.0597971 9.42079 0 9.27027 0C9.11974 0 8.97538 0.0597971 8.86894 0.166237C8.7625 0.272676 8.7027 0.417039 8.7027 0.567568V1.51351H5.29729V0.567568C5.29729 0.417039 5.2375 0.272676 5.13106 0.166237C5.02462 0.0597971 4.88025 0 4.72973 0C4.5792 0 4.43484 0.0597971 4.3284 0.166237C4.22196 0.272676 4.16216 0.417039 4.16216 0.567568V1.51351H3.21621C2.66428 1.51351 2.13494 1.73277 1.74467 2.12305C1.35439 2.51333 1.13513 3.04266 1.13513 3.59459V11.9189C1.13513 12.4709 1.35439 13.0002 1.74467 13.3905C2.13494 13.7807 2.66428 14 3.21621 14H10.7838C11.3357 14 11.865 13.7807 12.2553 13.3905C12.6456 13.0002 12.8649 12.4709 12.8649 11.9189V3.59459C12.8649 3.04266 12.6456 2.51333 12.2553 2.12305C11.865 1.73277 11.3357 1.51351 10.7838 1.51351ZM3.21621 2.64865H4.16216V3.59459C4.16216 3.74512 4.22196 3.88949 4.3284 3.99593C4.43484 4.10237 4.5792 4.16216 4.72973 4.16216C4.88025 4.16216 5.02462 4.10237 5.13106 3.99593C5.2375 3.88949 5.29729 3.74512 5.29729 3.59459V2.64865H8.7027V3.59459C8.7027 3.74512 8.7625 3.88949 8.86894 3.99593C8.97538 4.10237 9.11974 4.16216 9.27027 4.16216C9.42079 4.16216 9.56516 4.10237 9.6716 3.99593C9.77804 3.88949 9.83783 3.74512 9.83783 3.59459V2.64865H10.7838C11.0347 2.64865 11.2753 2.74831 11.4527 2.92571C11.6301 3.10311 11.7297 3.34371 11.7297 3.59459V5.67568H2.27027V3.59459C2.27027 3.34371 2.36993 3.10311 2.54733 2.92571C2.72473 2.74831 2.96533 2.64865 3.21621 2.64865ZM10.7838 12.8649H3.21621C2.96533 12.8649 2.72473 12.7652 2.54733 12.5878C2.36993 12.4104 2.27027 12.1698 2.27027 11.9189V6.81081H11.7297V11.9189C11.7297 12.1698 11.6301 12.4104 11.4527 12.5878C11.2753 12.7652 11.0347 12.8649 10.7838 12.8649Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$W, "render$W");
-script$13.render = render$W;
-var theme$z = /* @__PURE__ */ __name(function theme4(_ref) {
- var dt = _ref.dt;
- return "\n.p-datepicker {\n display: inline-flex;\n max-width: 100%;\n}\n\n.p-datepicker-input {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-datepicker:has(.p-datepicker-dropdown) .p-datepicker-input {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.p-datepicker-dropdown {\n cursor: pointer;\n display: inline-flex;\n user-select: none;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ".concat(dt("datepicker.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("datepicker.dropdown.border.radius"), ";\n border-end-end-radius: ").concat(dt("datepicker.dropdown.border.radius"), ";\n background: ").concat(dt("datepicker.dropdown.background"), ";\n border: 1px solid ").concat(dt("datepicker.dropdown.border.color"), ";\n border-inline-start: 0 none;\n color: ").concat(dt("datepicker.dropdown.color"), ";\n transition: background ").concat(dt("datepicker.transition.duration"), ", color ").concat(dt("datepicker.transition.duration"), ", border-color ").concat(dt("datepicker.transition.duration"), ", outline-color ").concat(dt("datepicker.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-datepicker-dropdown:not(:disabled):hover {\n background: ").concat(dt("datepicker.dropdown.hover.background"), ";\n border-color: ").concat(dt("datepicker.dropdown.hover.border.color"), ";\n color: ").concat(dt("datepicker.dropdown.hover.color"), ";\n}\n\n.p-datepicker-dropdown:not(:disabled):active {\n background: ").concat(dt("datepicker.dropdown.active.background"), ";\n border-color: ").concat(dt("datepicker.dropdown.active.border.color"), ";\n color: ").concat(dt("datepicker.dropdown.active.color"), ";\n}\n\n.p-datepicker-dropdown:focus-visible {\n box-shadow: ").concat(dt("datepicker.dropdown.focus.ring.shadow"), ";\n outline: ").concat(dt("datepicker.dropdown.focus.ring.width"), " ").concat(dt("datepicker.dropdown.focus.ring.style"), " ").concat(dt("datepicker.dropdown.focus.ring.color"), ";\n outline-offset: ").concat(dt("datepicker.dropdown.focus.ring.offset"), ";\n}\n\n.p-datepicker:has(.p-datepicker-input-icon-container) {\n position: relative;\n}\n\n.p-datepicker:has(.p-datepicker-input-icon-container) .p-datepicker-input {\n padding-inline-end: calc((").concat(dt("form.field.padding.x"), " * 2) + ").concat(dt("icon.size"), ");\n}\n\n.p-datepicker-input-icon-container {\n cursor: pointer;\n position: absolute;\n top: 50%;\n inset-inline-end: ").concat(dt("form.field.padding.x"), ";\n margin-block-start: calc(-1 * (").concat(dt("icon.size"), " / 2));\n color: ").concat(dt("datepicker.input.icon.color"), ";\n line-height: 1;\n}\n\n.p-datepicker-fluid {\n display: flex;\n}\n\n.p-datepicker-fluid .p-datepicker-input {\n width: 1%;\n}\n\n.p-datepicker .p-datepicker-panel {\n min-width: 100%;\n}\n\n.p-datepicker-panel {\n width: auto;\n padding: ").concat(dt("datepicker.panel.padding"), ";\n background: ").concat(dt("datepicker.panel.background"), ";\n color: ").concat(dt("datepicker.panel.color"), ";\n border: 1px solid ").concat(dt("datepicker.panel.border.color"), ";\n border-radius: ").concat(dt("datepicker.panel.border.radius"), ";\n box-shadow: ").concat(dt("datepicker.panel.shadow"), ";\n}\n\n.p-datepicker-panel-inline {\n display: inline-block;\n overflow-x: auto;\n box-shadow: none;\n}\n\n.p-datepicker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ").concat(dt("datepicker.header.padding"), ";\n background: ").concat(dt("datepicker.header.background"), ";\n color: ").concat(dt("datepicker.header.color"), ";\n border-block-end: 1px solid ").concat(dt("datepicker.header.border.color"), ";\n}\n\n.p-datepicker-next-button:dir(rtl) {\n order: -1;\n}\n\n.p-datepicker-prev-button:dir(rtl) {\n order: 1;\n}\n\n.p-datepicker-title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ").concat(dt("datepicker.title.gap"), ";\n font-weight: ").concat(dt("datepicker.title.font.weight"), ";\n}\n\n.p-datepicker-select-year,\n.p-datepicker-select-month {\n border: none;\n background: transparent;\n margin: 0;\n cursor: pointer;\n font-weight: inherit;\n transition: background ").concat(dt("datepicker.transition.duration"), ", color ").concat(dt("datepicker.transition.duration"), ", border-color ").concat(dt("datepicker.transition.duration"), ", outline-color ").concat(dt("datepicker.transition.duration"), ", box-shadow ").concat(dt("datepicker.transition.duration"), ";\n}\n\n.p-datepicker-select-month {\n padding: ").concat(dt("datepicker.select.month.padding"), ";\n color: ").concat(dt("datepicker.select.month.color"), ";\n border-radius: ").concat(dt("datepicker.select.month.border.radius"), ";\n}\n\n.p-datepicker-select-year {\n padding: ").concat(dt("datepicker.select.year.padding"), ";\n color: ").concat(dt("datepicker.select.year.color"), ";\n border-radius: ").concat(dt("datepicker.select.year.border.radius"), ";\n}\n\n.p-datepicker-select-month:enabled:hover {\n background: ").concat(dt("datepicker.select.month.hover.background"), ";\n color: ").concat(dt("datepicker.select.month.hover.color"), ";\n}\n\n.p-datepicker-select-year:enabled:hover {\n background: ").concat(dt("datepicker.select.year.hover.background"), ";\n color: ").concat(dt("datepicker.select.year.hover.color"), ";\n}\n\n.p-datepicker-select-month:focus-visible,\n.p-datepicker-select-year:focus-visible {\n box-shadow: ").concat(dt("datepicker.date.focus.ring.shadow"), ";\n outline: ").concat(dt("datepicker.date.focus.ring.width"), " ").concat(dt("datepicker.date.focus.ring.style"), " ").concat(dt("datepicker.date.focus.ring.color"), ";\n outline-offset: ").concat(dt("datepicker.date.focus.ring.offset"), ";\n}\n\n.p-datepicker-calendar-container {\n display: flex;\n}\n\n.p-datepicker-calendar-container .p-datepicker-calendar {\n flex: 1 1 auto;\n border-inline-start: 1px solid ").concat(dt("datepicker.group.border.color"), ";\n padding-inline-end: ").concat(dt("datepicker.group.gap"), ";\n padding-inline-start: ").concat(dt("datepicker.group.gap"), ";\n}\n\n.p-datepicker-calendar-container .p-datepicker-calendar:first-child {\n padding-inline-start: 0;\n border-inline-start: 0 none;\n}\n\n.p-datepicker-calendar-container .p-datepicker-calendar:last-child {\n padding-inline-end: 0;\n}\n\n.p-datepicker-day-view {\n width: 100%;\n border-collapse: collapse;\n font-size: 1rem;\n margin: ").concat(dt("datepicker.day.view.margin"), ";\n}\n\n.p-datepicker-weekday-cell {\n padding: ").concat(dt("datepicker.week.day.padding"), ";\n}\n\n.p-datepicker-weekday {\n font-weight: ").concat(dt("datepicker.week.day.font.weight"), ";\n color: ").concat(dt("datepicker.week.day.color"), ";\n}\n\n.p-datepicker-day-cell {\n padding: ").concat(dt("datepicker.date.padding"), ";\n}\n\n.p-datepicker-day {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin: 0 auto;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("datepicker.date.width"), ";\n height: ").concat(dt("datepicker.date.height"), ";\n border-radius: ").concat(dt("datepicker.date.border.radius"), ";\n transition: background ").concat(dt("datepicker.transition.duration"), ", color ").concat(dt("datepicker.transition.duration"), ", border-color ").concat(dt("datepicker.transition.duration"), ", box-shadow ").concat(dt("datepicker.transition.duration"), ", outline-color ").concat(dt("datepicker.transition.duration"), ";\n border: 1px solid transparent;\n outline-color: transparent;\n color: ").concat(dt("datepicker.date.color"), ";\n}\n\n.p-datepicker-day:not(.p-datepicker-day-selected):not(.p-disabled):hover {\n background: ").concat(dt("datepicker.date.hover.background"), ";\n color: ").concat(dt("datepicker.date.hover.color"), ";\n}\n\n.p-datepicker-day:focus-visible {\n box-shadow: ").concat(dt("datepicker.date.focus.ring.shadow"), ";\n outline: ").concat(dt("datepicker.date.focus.ring.width"), " ").concat(dt("datepicker.date.focus.ring.style"), " ").concat(dt("datepicker.date.focus.ring.color"), ";\n outline-offset: ").concat(dt("datepicker.date.focus.ring.offset"), ";\n}\n\n.p-datepicker-day-selected {\n background: ").concat(dt("datepicker.date.selected.background"), ";\n color: ").concat(dt("datepicker.date.selected.color"), ";\n}\n\n.p-datepicker-day-selected-range {\n background: ").concat(dt("datepicker.date.range.selected.background"), ";\n color: ").concat(dt("datepicker.date.range.selected.color"), ";\n}\n\n.p-datepicker-today > .p-datepicker-day {\n background: ").concat(dt("datepicker.today.background"), ";\n color: ").concat(dt("datepicker.today.color"), ";\n}\n\n.p-datepicker-today > .p-datepicker-day-selected {\n background: ").concat(dt("datepicker.date.selected.background"), ";\n color: ").concat(dt("datepicker.date.selected.color"), ";\n}\n\n.p-datepicker-today > .p-datepicker-day-selected-range {\n background: ").concat(dt("datepicker.date.range.selected.background"), ";\n color: ").concat(dt("datepicker.date.range.selected.color"), ";\n}\n\n.p-datepicker-weeknumber {\n text-align: center;\n}\n\n.p-datepicker-month-view {\n margin: ").concat(dt("datepicker.month.view.margin"), ";\n}\n\n.p-datepicker-month {\n width: 33.3%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n padding: ").concat(dt("datepicker.month.padding"), ";\n transition: background ").concat(dt("datepicker.transition.duration"), ", color ").concat(dt("datepicker.transition.duration"), ", border-color ").concat(dt("datepicker.transition.duration"), ", box-shadow ").concat(dt("datepicker.transition.duration"), ", outline-color ").concat(dt("datepicker.transition.duration"), ";\n border-radius: ").concat(dt("datepicker.month.border.radius"), ";\n outline-color: transparent;\n color: ").concat(dt("datepicker.date.color"), ";\n}\n\n.p-datepicker-month:not(.p-disabled):not(.p-datepicker-month-selected):hover {\n color: ").concat(dt("datepicker.date.hover.color"), ";\n background: ").concat(dt("datepicker.date.hover.background"), ";\n}\n\n.p-datepicker-month-selected {\n color: ").concat(dt("datepicker.date.selected.color"), ";\n background: ").concat(dt("datepicker.date.selected.background"), ";\n}\n\n.p-datepicker-month:not(.p-disabled):focus-visible {\n box-shadow: ").concat(dt("datepicker.date.focus.ring.shadow"), ";\n outline: ").concat(dt("datepicker.date.focus.ring.width"), " ").concat(dt("datepicker.date.focus.ring.style"), " ").concat(dt("datepicker.date.focus.ring.color"), ";\n outline-offset: ").concat(dt("datepicker.date.focus.ring.offset"), ";\n}\n\n.p-datepicker-year-view {\n margin: ").concat(dt("datepicker.year.view.margin"), ";\n}\n\n.p-datepicker-year {\n width: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n overflow: hidden;\n position: relative;\n padding: ").concat(dt("datepicker.year.padding"), ";\n transition: background ").concat(dt("datepicker.transition.duration"), ", color ").concat(dt("datepicker.transition.duration"), ", border-color ").concat(dt("datepicker.transition.duration"), ", box-shadow ").concat(dt("datepicker.transition.duration"), ", outline-color ").concat(dt("datepicker.transition.duration"), ";\n border-radius: ").concat(dt("datepicker.year.border.radius"), ";\n outline-color: transparent;\n color: ").concat(dt("datepicker.date.color"), ";\n}\n\n.p-datepicker-year:not(.p-disabled):not(.p-datepicker-year-selected):hover {\n color: ").concat(dt("datepicker.date.hover.color"), ";\n background: ").concat(dt("datepicker.date.hover.background"), ";\n}\n\n.p-datepicker-year-selected {\n color: ").concat(dt("datepicker.date.selected.color"), ";\n background: ").concat(dt("datepicker.date.selected.background"), ";\n}\n\n.p-datepicker-year:not(.p-disabled):focus-visible {\n box-shadow: ").concat(dt("datepicker.date.focus.ring.shadow"), ";\n outline: ").concat(dt("datepicker.date.focus.ring.width"), " ").concat(dt("datepicker.date.focus.ring.style"), " ").concat(dt("datepicker.date.focus.ring.color"), ";\n outline-offset: ").concat(dt("datepicker.date.focus.ring.offset"), ";\n}\n\n.p-datepicker-buttonbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: ").concat(dt("datepicker.buttonbar.padding"), ";\n border-block-start: 1px solid ").concat(dt("datepicker.buttonbar.border.color"), ";\n}\n\n.p-datepicker-buttonbar .p-button {\n width: auto;\n}\n\n.p-datepicker-time-picker {\n display: flex;\n justify-content: center;\n align-items: center;\n border-block-start: 1px solid ").concat(dt("datepicker.time.picker.border.color"), ";\n padding: 0;\n gap: ").concat(dt("datepicker.time.picker.gap"), ";\n}\n\n.p-datepicker-calendar-container + .p-datepicker-time-picker {\n padding: ").concat(dt("datepicker.time.picker.padding"), ";\n}\n\n.p-datepicker-time-picker > div {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: ").concat(dt("datepicker.time.picker.button.gap"), ";\n}\n\n.p-datepicker-time-picker span {\n font-size: 1rem;\n}\n\n.p-datepicker-timeonly .p-datepicker-time-picker {\n border-block-start: 0 none;\n}\n\n.p-datepicker:has(.p-inputtext-sm) .p-datepicker-dropdown {\n width: ").concat(dt("datepicker.dropdown.sm.width"), ";\n}\n\n.p-datepicker:has(.p-inputtext-sm) .p-datepicker-dropdown .p-icon,\n.p-datepicker:has(.p-inputtext-sm) .p-datepicker-input-icon {\n font-size: ").concat(dt("form.field.sm.font.size"), ";\n width: ").concat(dt("form.field.sm.font.size"), ";\n height: ").concat(dt("form.field.sm.font.size"), ";\n}\n\n.p-datepicker:has(.p-inputtext-lg) .p-datepicker-dropdown {\n width: ").concat(dt("datepicker.dropdown.lg.width"), ";\n}\n\n.p-datepicker:has(.p-inputtext-lg) .p-datepicker-dropdown .p-icon,\n.p-datepicker:has(.p-inputtext-lg) .p-datepicker-input-icon {\n font-size: ").concat(dt("form.field.lg.font.size"), ";\n width: ").concat(dt("form.field.lg.font.size"), ";\n height: ").concat(dt("form.field.lg.font.size"), ";\n}\n");
-}, "theme");
-var inlineStyles$8 = {
- root: /* @__PURE__ */ __name(function root3(_ref2) {
- var props = _ref2.props;
- return {
- position: props.appendTo === "self" ? "relative" : void 0
- };
- }, "root")
-};
-var classes$D = {
- root: /* @__PURE__ */ __name(function root4(_ref3) {
- var instance = _ref3.instance, state = _ref3.state;
- return ["p-datepicker p-component p-inputwrapper", {
- "p-invalid": instance.$invalid,
- "p-inputwrapper-filled": instance.$filled,
- "p-inputwrapper-focus": state.focused || state.overlayVisible,
- "p-focus": state.focused || state.overlayVisible,
- "p-datepicker-fluid": instance.$fluid
- }];
- }, "root"),
- pcInputText: "p-datepicker-input",
- dropdown: "p-datepicker-dropdown",
- inputIconContainer: "p-datepicker-input-icon-container",
- inputIcon: "p-datepicker-input-icon",
- panel: /* @__PURE__ */ __name(function panel(_ref4) {
- var props = _ref4.props;
- return ["p-datepicker-panel p-component", {
- "p-datepicker-panel-inline": props.inline,
- "p-disabled": props.disabled,
- "p-datepicker-timeonly": props.timeOnly
- }];
- }, "panel"),
- calendarContainer: "p-datepicker-calendar-container",
- calendar: "p-datepicker-calendar",
- header: "p-datepicker-header",
- pcPrevButton: "p-datepicker-prev-button",
- title: "p-datepicker-title",
- selectMonth: "p-datepicker-select-month",
- selectYear: "p-datepicker-select-year",
- decade: "p-datepicker-decade",
- pcNextButton: "p-datepicker-next-button",
- dayView: "p-datepicker-day-view",
- weekHeader: "p-datepicker-weekheader p-disabled",
- weekNumber: "p-datepicker-weeknumber",
- weekLabelContainer: "p-datepicker-weeklabel-container p-disabled",
- weekDayCell: "p-datepicker-weekday-cell",
- weekDay: "p-datepicker-weekday",
- dayCell: /* @__PURE__ */ __name(function dayCell(_ref5) {
- var date = _ref5.date;
- return ["p-datepicker-day-cell", {
- "p-datepicker-other-month": date.otherMonth,
- "p-datepicker-today": date.today
- }];
- }, "dayCell"),
- day: /* @__PURE__ */ __name(function day(_ref6) {
- var instance = _ref6.instance, props = _ref6.props, date = _ref6.date;
- var selectedDayClass = "";
- if (instance.isRangeSelection() && instance.isSelected(date) && date.selectable) {
- selectedDayClass = instance.isDateEquals(props.modelValue[0], date) || instance.isDateEquals(props.modelValue[1], date) ? "p-datepicker-day-selected" : "p-datepicker-day-selected-range";
- }
- return ["p-datepicker-day", {
- "p-datepicker-day-selected": !instance.isRangeSelection() && instance.isSelected(date) && date.selectable,
- "p-disabled": props.disabled || !date.selectable
- }, selectedDayClass];
- }, "day"),
- monthView: "p-datepicker-month-view",
- month: /* @__PURE__ */ __name(function month(_ref7) {
- var instance = _ref7.instance, props = _ref7.props, _month = _ref7.month, index = _ref7.index;
- return ["p-datepicker-month", {
- "p-datepicker-month-selected": instance.isMonthSelected(index),
- "p-disabled": props.disabled || !_month.selectable
- }];
- }, "month"),
- yearView: "p-datepicker-year-view",
- year: /* @__PURE__ */ __name(function year(_ref8) {
- var instance = _ref8.instance, props = _ref8.props, _year = _ref8.year;
- return ["p-datepicker-year", {
- "p-datepicker-year-selected": instance.isYearSelected(_year.value),
- "p-disabled": props.disabled || !_year.selectable
- }];
- }, "year"),
- timePicker: "p-datepicker-time-picker",
- hourPicker: "p-datepicker-hour-picker",
- pcIncrementButton: "p-datepicker-increment-button",
- pcDecrementButton: "p-datepicker-decrement-button",
- separator: "p-datepicker-separator",
- minutePicker: "p-datepicker-minute-picker",
- secondPicker: "p-datepicker-second-picker",
- ampmPicker: "p-datepicker-ampm-picker",
- buttonbar: "p-datepicker-buttonbar",
- pcTodayButton: "p-datepicker-today-button",
- pcClearButton: "p-datepicker-clear-button"
-};
-var DatePickerStyle = BaseStyle.extend({
- name: "datepicker",
- theme: theme$z,
- classes: classes$D,
- inlineStyles: inlineStyles$8
-});
-var script$1$F = {
- name: "BaseDatePicker",
- "extends": script$1k,
- props: {
- selectionMode: {
- type: String,
- "default": "single"
- },
- dateFormat: {
- type: String,
- "default": null
- },
- inline: {
- type: Boolean,
- "default": false
- },
- showOtherMonths: {
- type: Boolean,
- "default": true
- },
- selectOtherMonths: {
- type: Boolean,
- "default": false
- },
- showIcon: {
- type: Boolean,
- "default": false
- },
- iconDisplay: {
- type: String,
- "default": "button"
- },
- icon: {
- type: String,
- "default": void 0
- },
- prevIcon: {
- type: String,
- "default": void 0
- },
- nextIcon: {
- type: String,
- "default": void 0
- },
- incrementIcon: {
- type: String,
- "default": void 0
- },
- decrementIcon: {
- type: String,
- "default": void 0
- },
- numberOfMonths: {
- type: Number,
- "default": 1
- },
- responsiveOptions: Array,
- breakpoint: {
- type: String,
- "default": "769px"
- },
- view: {
- type: String,
- "default": "date"
- },
- minDate: {
- type: Date,
- value: null
- },
- maxDate: {
- type: Date,
- value: null
- },
- disabledDates: {
- type: Array,
- value: null
- },
- disabledDays: {
- type: Array,
- value: null
- },
- maxDateCount: {
- type: Number,
- value: null
- },
- showOnFocus: {
- type: Boolean,
- "default": true
- },
- autoZIndex: {
- type: Boolean,
- "default": true
- },
- baseZIndex: {
- type: Number,
- "default": 0
- },
- showButtonBar: {
- type: Boolean,
- "default": false
- },
- shortYearCutoff: {
- type: String,
- "default": "+10"
- },
- showTime: {
- type: Boolean,
- "default": false
- },
- timeOnly: {
- type: Boolean,
- "default": false
- },
- hourFormat: {
- type: String,
- "default": "24"
- },
- stepHour: {
- type: Number,
- "default": 1
- },
- stepMinute: {
- type: Number,
- "default": 1
- },
- stepSecond: {
- type: Number,
- "default": 1
- },
- showSeconds: {
- type: Boolean,
- "default": false
- },
- hideOnDateTimeSelect: {
- type: Boolean,
- "default": false
- },
- hideOnRangeSelection: {
- type: Boolean,
- "default": false
- },
- timeSeparator: {
- type: String,
- "default": ":"
- },
- showWeek: {
- type: Boolean,
- "default": false
- },
- manualInput: {
- type: Boolean,
- "default": true
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- readonly: {
- type: Boolean,
- "default": false
- },
- placeholder: {
- type: String,
- "default": null
- },
- id: {
- type: String,
- "default": null
- },
- inputId: {
- type: String,
- "default": null
- },
- inputClass: {
- type: [String, Object],
- "default": null
- },
- inputStyle: {
- type: Object,
- "default": null
- },
- panelClass: {
- type: [String, Object],
- "default": null
- },
- panelStyle: {
- type: Object,
- "default": null
- },
- todayButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default2() {
- return {
- severity: "secondary",
- text: true,
- size: "small"
- };
- }, "_default")
- },
- clearButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default3() {
- return {
- severity: "secondary",
- text: true,
- size: "small"
- };
- }, "_default")
- },
- navigatorButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default4() {
- return {
- severity: "secondary",
- text: true,
- rounded: true
- };
- }, "_default")
- },
- timepickerButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default5() {
- return {
- severity: "secondary",
- text: true,
- rounded: true
- };
- }, "_default")
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: DatePickerStyle,
- provide: /* @__PURE__ */ __name(function provide9() {
- return {
- $pcDatePicker: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _typeof$l(o) {
- "@babel/helpers - typeof";
- return _typeof$l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$l(o);
-}
-__name(_typeof$l, "_typeof$l");
-function _toConsumableArray$d(r) {
- return _arrayWithoutHoles$d(r) || _iterableToArray$d(r) || _unsupportedIterableToArray$e(r) || _nonIterableSpread$d();
-}
-__name(_toConsumableArray$d, "_toConsumableArray$d");
-function _nonIterableSpread$d() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$d, "_nonIterableSpread$d");
-function _iterableToArray$d(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$d, "_iterableToArray$d");
-function _arrayWithoutHoles$d(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$e(r);
-}
-__name(_arrayWithoutHoles$d, "_arrayWithoutHoles$d");
-function _createForOfIteratorHelper$4(r, e) {
- var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t2) {
- if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$e(r)) || e) {
- t2 && (r = t2);
- var _n = 0, F = /* @__PURE__ */ __name(function F2() {
- }, "F");
- return { s: F, n: /* @__PURE__ */ __name(function n() {
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- throw r2;
- }, "e"), f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o, a = true, u = false;
- return { s: /* @__PURE__ */ __name(function s() {
- t2 = t2.call(r);
- }, "s"), n: /* @__PURE__ */ __name(function n() {
- var r2 = t2.next();
- return a = r2.done, r2;
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- u = true, o = r2;
- }, "e"), f: /* @__PURE__ */ __name(function f() {
- try {
- a || null == t2["return"] || t2["return"]();
- } finally {
- if (u) throw o;
- }
- }, "f") };
-}
-__name(_createForOfIteratorHelper$4, "_createForOfIteratorHelper$4");
-function _unsupportedIterableToArray$e(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$e(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$e(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$e, "_unsupportedIterableToArray$e");
-function _arrayLikeToArray$e(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$e, "_arrayLikeToArray$e");
-var script$12 = {
- name: "DatePicker",
- "extends": script$1$F,
- inheritAttrs: false,
- emits: ["show", "hide", "input", "month-change", "year-change", "date-select", "today-click", "clear-click", "focus", "blur", "keydown"],
- inject: {
- $pcFluid: {
- "default": null
- }
- },
- navigationState: null,
- timePickerChange: false,
- scrollHandler: null,
- outsideClickListener: null,
- resizeListener: null,
- matchMediaListener: null,
- overlay: null,
- input: null,
- previousButton: null,
- nextButton: null,
- timePickerTimer: null,
- preventFocus: false,
- typeUpdate: false,
- data: /* @__PURE__ */ __name(function data2() {
- return {
- d_id: this.id,
- currentMonth: null,
- currentYear: null,
- currentHour: null,
- currentMinute: null,
- currentSecond: null,
- pm: null,
- focused: false,
- overlayVisible: false,
- currentView: this.view,
- query: null,
- queryMatches: false
- };
- }, "data"),
- watch: {
- id: /* @__PURE__ */ __name(function id3(newValue) {
- this.d_id = newValue || UniqueComponentId();
- }, "id"),
- modelValue: /* @__PURE__ */ __name(function modelValue(newValue) {
- this.updateCurrentMetaData();
- if (!this.typeUpdate && !this.inline && this.input) {
- this.input.value = this.inputFieldValue;
- }
- this.typeUpdate = false;
- }, "modelValue"),
- showTime: /* @__PURE__ */ __name(function showTime() {
- this.updateCurrentMetaData();
- }, "showTime"),
- minDate: /* @__PURE__ */ __name(function minDate() {
- this.updateCurrentMetaData();
- }, "minDate"),
- maxDate: /* @__PURE__ */ __name(function maxDate() {
- this.updateCurrentMetaData();
- }, "maxDate"),
- months: /* @__PURE__ */ __name(function months() {
- if (this.overlay) {
- if (!this.focused) {
- if (this.inline) {
- this.preventFocus = true;
- }
- setTimeout(this.updateFocus, 0);
- }
- }
- }, "months"),
- numberOfMonths: /* @__PURE__ */ __name(function numberOfMonths() {
- this.destroyResponsiveStyleElement();
- this.createResponsiveStyle();
- }, "numberOfMonths"),
- responsiveOptions: /* @__PURE__ */ __name(function responsiveOptions() {
- this.destroyResponsiveStyleElement();
- this.createResponsiveStyle();
- }, "responsiveOptions"),
- currentView: /* @__PURE__ */ __name(function currentView() {
- var _this = this;
- Promise.resolve(null).then(function() {
- return _this.alignOverlay();
- });
- }, "currentView"),
- view: /* @__PURE__ */ __name(function view(newValue) {
- this.currentView = newValue;
- }, "view")
- },
- created: /* @__PURE__ */ __name(function created2() {
- this.updateCurrentMetaData();
- }, "created"),
- mounted: /* @__PURE__ */ __name(function mounted5() {
- this.d_id = this.d_id || UniqueComponentId();
- this.createResponsiveStyle();
- this.bindMatchMediaListener();
- if (this.inline) {
- if (!this.disabled) {
- this.preventFocus = true;
- this.initFocusableCell();
- }
- } else {
- this.input.value = this.inputFieldValue;
- }
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated2() {
- if (this.overlay) {
- this.preventFocus = true;
- setTimeout(this.updateFocus, 0);
- }
- if (this.input && this.selectionStart != null && this.selectionEnd != null) {
- this.input.selectionStart = this.selectionStart;
- this.input.selectionEnd = this.selectionEnd;
- this.selectionStart = null;
- this.selectionEnd = null;
- }
- }, "updated"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() {
- if (this.timePickerTimer) {
- clearTimeout(this.timePickerTimer);
- }
- this.destroyResponsiveStyleElement();
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- this.unbindMatchMediaListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- if (this.overlay && this.autoZIndex) {
- ZIndex.clear(this.overlay);
- }
- this.overlay = null;
- }, "beforeUnmount"),
- methods: {
- isComparable: /* @__PURE__ */ __name(function isComparable() {
- return this.d_value != null && typeof this.d_value !== "string";
- }, "isComparable"),
- isSelected: /* @__PURE__ */ __name(function isSelected(dateMeta) {
- if (!this.isComparable()) {
- return false;
- }
- if (this.d_value) {
- if (this.isSingleSelection()) {
- return this.isDateEquals(this.d_value, dateMeta);
- } else if (this.isMultipleSelection()) {
- var selected3 = false;
- var _iterator = _createForOfIteratorHelper$4(this.d_value), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var date = _step.value;
- selected3 = this.isDateEquals(date, dateMeta);
- if (selected3) {
- break;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return selected3;
- } else if (this.isRangeSelection()) {
- if (this.d_value[1]) return this.isDateEquals(this.d_value[0], dateMeta) || this.isDateEquals(this.d_value[1], dateMeta) || this.isDateBetween(this.d_value[0], this.d_value[1], dateMeta);
- else {
- return this.isDateEquals(this.d_value[0], dateMeta);
- }
- }
- }
- return false;
- }, "isSelected"),
- isMonthSelected: /* @__PURE__ */ __name(function isMonthSelected(month2) {
- var _this2 = this;
- if (!this.isComparable()) return false;
- if (this.isMultipleSelection()) {
- return this.d_value.some(function(currentValue) {
- return currentValue.getMonth() === month2 && currentValue.getFullYear() === _this2.currentYear;
- });
- } else if (this.isRangeSelection()) {
- if (!this.d_value[1]) {
- var _this$d_value$, _this$d_value$2;
- return ((_this$d_value$ = this.d_value[0]) === null || _this$d_value$ === void 0 ? void 0 : _this$d_value$.getFullYear()) === this.currentYear && ((_this$d_value$2 = this.d_value[0]) === null || _this$d_value$2 === void 0 ? void 0 : _this$d_value$2.getMonth()) === month2;
- } else {
- var currentDate = new Date(this.currentYear, month2, 1);
- var startDate = new Date(this.d_value[0].getFullYear(), this.d_value[0].getMonth(), 1);
- var endDate = new Date(this.d_value[1].getFullYear(), this.d_value[1].getMonth(), 1);
- return currentDate >= startDate && currentDate <= endDate;
- }
- } else {
- return this.d_value.getMonth() === month2 && this.d_value.getFullYear() === this.currentYear;
- }
- }, "isMonthSelected"),
- isYearSelected: /* @__PURE__ */ __name(function isYearSelected(year2) {
- if (!this.isComparable()) return false;
- if (this.isMultipleSelection()) {
- return this.d_value.some(function(currentValue) {
- return currentValue.getFullYear() === year2;
- });
- } else if (this.isRangeSelection()) {
- var start = this.d_value[0] ? this.d_value[0].getFullYear() : null;
- var end = this.d_value[1] ? this.d_value[1].getFullYear() : null;
- return start === year2 || end === year2 || start < year2 && end > year2;
- } else {
- return this.d_value.getFullYear() === year2;
- }
- }, "isYearSelected"),
- isDateEquals: /* @__PURE__ */ __name(function isDateEquals(value2, dateMeta) {
- if (value2) return value2.getDate() === dateMeta.day && value2.getMonth() === dateMeta.month && value2.getFullYear() === dateMeta.year;
- else return false;
- }, "isDateEquals"),
- isDateBetween: /* @__PURE__ */ __name(function isDateBetween(start, end, dateMeta) {
- var between = false;
- if (start && end) {
- var date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
- return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
- }
- return between;
- }, "isDateBetween"),
- getFirstDayOfMonthIndex: /* @__PURE__ */ __name(function getFirstDayOfMonthIndex(month2, year2) {
- var day2 = /* @__PURE__ */ new Date();
- day2.setDate(1);
- day2.setMonth(month2);
- day2.setFullYear(year2);
- var dayIndex = day2.getDay() + this.sundayIndex;
- return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
- }, "getFirstDayOfMonthIndex"),
- getDaysCountInMonth: /* @__PURE__ */ __name(function getDaysCountInMonth(month2, year2) {
- return 32 - this.daylightSavingAdjust(new Date(year2, month2, 32)).getDate();
- }, "getDaysCountInMonth"),
- getDaysCountInPrevMonth: /* @__PURE__ */ __name(function getDaysCountInPrevMonth(month2, year2) {
- var prev = this.getPreviousMonthAndYear(month2, year2);
- return this.getDaysCountInMonth(prev.month, prev.year);
- }, "getDaysCountInPrevMonth"),
- getPreviousMonthAndYear: /* @__PURE__ */ __name(function getPreviousMonthAndYear(month2, year2) {
- var m, y;
- if (month2 === 0) {
- m = 11;
- y = year2 - 1;
- } else {
- m = month2 - 1;
- y = year2;
- }
- return {
- month: m,
- year: y
- };
- }, "getPreviousMonthAndYear"),
- getNextMonthAndYear: /* @__PURE__ */ __name(function getNextMonthAndYear(month2, year2) {
- var m, y;
- if (month2 === 11) {
- m = 0;
- y = year2 + 1;
- } else {
- m = month2 + 1;
- y = year2;
- }
- return {
- month: m,
- year: y
- };
- }, "getNextMonthAndYear"),
- daylightSavingAdjust: /* @__PURE__ */ __name(function daylightSavingAdjust(date) {
- if (!date) {
- return null;
- }
- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
- return date;
- }, "daylightSavingAdjust"),
- isToday: /* @__PURE__ */ __name(function isToday(today, day2, month2, year2) {
- return today.getDate() === day2 && today.getMonth() === month2 && today.getFullYear() === year2;
- }, "isToday"),
- isSelectable: /* @__PURE__ */ __name(function isSelectable(day2, month2, year2, otherMonth) {
- var validMin = true;
- var validMax = true;
- var validDate = true;
- var validDay = true;
- if (otherMonth && !this.selectOtherMonths) {
- return false;
- }
- if (this.minDate) {
- if (this.minDate.getFullYear() > year2) {
- validMin = false;
- } else if (this.minDate.getFullYear() === year2) {
- if (this.minDate.getMonth() > month2) {
- validMin = false;
- } else if (this.minDate.getMonth() === month2) {
- if (this.minDate.getDate() > day2) {
- validMin = false;
- }
- }
- }
- }
- if (this.maxDate) {
- if (this.maxDate.getFullYear() < year2) {
- validMax = false;
- } else if (this.maxDate.getFullYear() === year2) {
- if (this.maxDate.getMonth() < month2) {
- validMax = false;
- } else if (this.maxDate.getMonth() === month2) {
- if (this.maxDate.getDate() < day2) {
- validMax = false;
- }
- }
- }
- }
- if (this.disabledDates) {
- validDate = !this.isDateDisabled(day2, month2, year2);
- }
- if (this.disabledDays) {
- validDay = !this.isDayDisabled(day2, month2, year2);
- }
- return validMin && validMax && validDate && validDay;
- }, "isSelectable"),
- onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter(el) {
- var styles = !this.inline ? {
- position: "absolute",
- top: "0",
- left: "0"
- } : void 0;
- addStyle(el, styles);
- if (this.autoZIndex) {
- ZIndex.set("overlay", el, this.baseZIndex || this.$primevue.config.zIndex.overlay);
- }
- this.alignOverlay();
- this.$emit("show");
- }, "onOverlayEnter"),
- onOverlayEnterComplete: /* @__PURE__ */ __name(function onOverlayEnterComplete() {
- this.bindOutsideClickListener();
- this.bindScrollListener();
- this.bindResizeListener();
- }, "onOverlayEnterComplete"),
- onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave(el) {
- if (this.autoZIndex) {
- ZIndex.clear(el);
- }
- }, "onOverlayAfterLeave"),
- onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave() {
- this.currentView = this.view;
- this.unbindOutsideClickListener();
- this.unbindScrollListener();
- this.unbindResizeListener();
- this.$emit("hide");
- this.overlay = null;
- }, "onOverlayLeave"),
- onPrevButtonClick: /* @__PURE__ */ __name(function onPrevButtonClick(event2) {
- this.navigationState = {
- backward: true,
- button: true
- };
- this.navBackward(event2);
- }, "onPrevButtonClick"),
- onNextButtonClick: /* @__PURE__ */ __name(function onNextButtonClick(event2) {
- this.navigationState = {
- backward: false,
- button: true
- };
- this.navForward(event2);
- }, "onNextButtonClick"),
- navBackward: /* @__PURE__ */ __name(function navBackward(event2) {
- event2.preventDefault();
- if (!this.isEnabled()) {
- return;
- }
- if (this.currentView === "month") {
- this.decrementYear();
- this.$emit("year-change", {
- month: this.currentMonth,
- year: this.currentYear
- });
- } else if (this.currentView === "year") {
- this.decrementDecade();
- } else {
- if (event2.shiftKey) {
- this.decrementYear();
- } else {
- if (this.currentMonth === 0) {
- this.currentMonth = 11;
- this.decrementYear();
- } else {
- this.currentMonth--;
- }
- this.$emit("month-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }
- }
- }, "navBackward"),
- navForward: /* @__PURE__ */ __name(function navForward(event2) {
- event2.preventDefault();
- if (!this.isEnabled()) {
- return;
- }
- if (this.currentView === "month") {
- this.incrementYear();
- this.$emit("year-change", {
- month: this.currentMonth,
- year: this.currentYear
- });
- } else if (this.currentView === "year") {
- this.incrementDecade();
- } else {
- if (event2.shiftKey) {
- this.incrementYear();
- } else {
- if (this.currentMonth === 11) {
- this.currentMonth = 0;
- this.incrementYear();
- } else {
- this.currentMonth++;
- }
- this.$emit("month-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }
- }
- }, "navForward"),
- decrementYear: /* @__PURE__ */ __name(function decrementYear() {
- this.currentYear--;
- }, "decrementYear"),
- decrementDecade: /* @__PURE__ */ __name(function decrementDecade() {
- this.currentYear = this.currentYear - 10;
- }, "decrementDecade"),
- incrementYear: /* @__PURE__ */ __name(function incrementYear() {
- this.currentYear++;
- }, "incrementYear"),
- incrementDecade: /* @__PURE__ */ __name(function incrementDecade() {
- this.currentYear = this.currentYear + 10;
- }, "incrementDecade"),
- switchToMonthView: /* @__PURE__ */ __name(function switchToMonthView(event2) {
- this.currentView = "month";
- setTimeout(this.updateFocus, 0);
- event2.preventDefault();
- }, "switchToMonthView"),
- switchToYearView: /* @__PURE__ */ __name(function switchToYearView(event2) {
- this.currentView = "year";
- setTimeout(this.updateFocus, 0);
- event2.preventDefault();
- }, "switchToYearView"),
- isEnabled: /* @__PURE__ */ __name(function isEnabled() {
- return !this.disabled && !this.readonly;
- }, "isEnabled"),
- updateCurrentTimeMeta: /* @__PURE__ */ __name(function updateCurrentTimeMeta(date) {
- var currentHour = date.getHours();
- if (this.hourFormat === "12") {
- this.pm = currentHour > 11;
- if (currentHour >= 12) currentHour = currentHour == 12 ? 12 : currentHour - 12;
- }
- this.currentHour = Math.floor(currentHour / this.stepHour) * this.stepHour;
- this.currentMinute = Math.floor(date.getMinutes() / this.stepMinute) * this.stepMinute;
- this.currentSecond = Math.floor(date.getSeconds() / this.stepSecond) * this.stepSecond;
- }, "updateCurrentTimeMeta"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() {
- var _this3 = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- if (_this3.overlayVisible && _this3.isOutsideClicked(event2)) {
- _this3.overlayVisible = false;
- }
- };
- document.addEventListener("mousedown", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() {
- if (this.outsideClickListener) {
- document.removeEventListener("mousedown", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener() {
- var _this4 = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
- if (_this4.overlayVisible) {
- _this4.overlayVisible = false;
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener() {
- var _this5 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this5.overlayVisible && !isTouchDevice()) {
- _this5.overlayVisible = false;
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener() {
- var _this6 = this;
- if (!this.matchMediaListener) {
- var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
- this.query = query;
- this.queryMatches = query.matches;
- this.matchMediaListener = function() {
- _this6.queryMatches = query.matches;
- _this6.mobileActive = false;
- };
- this.query.addEventListener("change", this.matchMediaListener);
- }
- }, "bindMatchMediaListener"),
- unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener() {
- if (this.matchMediaListener) {
- this.query.removeEventListener("change", this.matchMediaListener);
- this.matchMediaListener = null;
- }
- }, "unbindMatchMediaListener"),
- isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(event2) {
- return !(this.$el.isSameNode(event2.target) || this.isNavIconClicked(event2) || this.$el.contains(event2.target) || this.overlay && this.overlay.contains(event2.target));
- }, "isOutsideClicked"),
- isNavIconClicked: /* @__PURE__ */ __name(function isNavIconClicked(event2) {
- return this.previousButton && (this.previousButton.isSameNode(event2.target) || this.previousButton.contains(event2.target)) || this.nextButton && (this.nextButton.isSameNode(event2.target) || this.nextButton.contains(event2.target));
- }, "isNavIconClicked"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay() {
- if (this.overlay) {
- if (this.appendTo === "self" || this.inline) {
- relativePosition(this.overlay, this.$el);
- } else {
- if (this.view === "date") {
- this.overlay.style.width = getOuterWidth(this.overlay) + "px";
- this.overlay.style.minWidth = getOuterWidth(this.$el) + "px";
- } else {
- this.overlay.style.width = getOuterWidth(this.$el) + "px";
- }
- absolutePosition(this.overlay, this.$el);
- }
- }
- }, "alignOverlay"),
- onButtonClick: /* @__PURE__ */ __name(function onButtonClick() {
- if (this.isEnabled()) {
- if (!this.overlayVisible) {
- this.input.focus();
- this.overlayVisible = true;
- } else {
- this.overlayVisible = false;
- }
- }
- }, "onButtonClick"),
- isDateDisabled: /* @__PURE__ */ __name(function isDateDisabled(day2, month2, year2) {
- if (this.disabledDates) {
- var _iterator2 = _createForOfIteratorHelper$4(this.disabledDates), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var disabledDate = _step2.value;
- if (disabledDate.getFullYear() === year2 && disabledDate.getMonth() === month2 && disabledDate.getDate() === day2) {
- return true;
- }
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- }
- return false;
- }, "isDateDisabled"),
- isDayDisabled: /* @__PURE__ */ __name(function isDayDisabled(day2, month2, year2) {
- if (this.disabledDays) {
- var weekday = new Date(year2, month2, day2);
- var weekdayNumber = weekday.getDay();
- return this.disabledDays.indexOf(weekdayNumber) !== -1;
- }
- return false;
- }, "isDayDisabled"),
- onMonthDropdownChange: /* @__PURE__ */ __name(function onMonthDropdownChange(value2) {
- this.currentMonth = parseInt(value2);
- this.$emit("month-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }, "onMonthDropdownChange"),
- onYearDropdownChange: /* @__PURE__ */ __name(function onYearDropdownChange(value2) {
- this.currentYear = parseInt(value2);
- this.$emit("year-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }, "onYearDropdownChange"),
- onDateSelect: /* @__PURE__ */ __name(function onDateSelect(event2, dateMeta) {
- var _this7 = this;
- if (this.disabled || !dateMeta.selectable) {
- return;
- }
- find(this.overlay, 'table td span:not([data-p-disabled="true"])').forEach(function(cell) {
- return cell.tabIndex = -1;
- });
- if (event2) {
- event2.currentTarget.focus();
- }
- if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
- var newValue = this.d_value.filter(function(date) {
- return !_this7.isDateEquals(date, dateMeta);
- });
- this.updateModel(newValue);
- } else {
- if (this.shouldSelectDate(dateMeta)) {
- if (dateMeta.otherMonth) {
- this.currentMonth = dateMeta.month;
- this.currentYear = dateMeta.year;
- this.selectDate(dateMeta);
- } else {
- this.selectDate(dateMeta);
- }
- }
- }
- if (this.isSingleSelection() && (!this.showTime || this.hideOnDateTimeSelect)) {
- if (this.input) {
- this.input.focus();
- }
- setTimeout(function() {
- _this7.overlayVisible = false;
- }, 150);
- }
- }, "onDateSelect"),
- selectDate: /* @__PURE__ */ __name(function selectDate(dateMeta) {
- var _this8 = this;
- var date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
- if (this.showTime) {
- this.hourFormat === "12" && this.currentHour !== 12 && this.pm ? date.setHours(this.currentHour + 12) : date.setHours(this.currentHour);
- date.setMinutes(this.currentMinute);
- date.setSeconds(this.currentSecond);
- }
- if (this.minDate && this.minDate > date) {
- date = this.minDate;
- this.currentHour = date.getHours();
- this.currentMinute = date.getMinutes();
- this.currentSecond = date.getSeconds();
- }
- if (this.maxDate && this.maxDate < date) {
- date = this.maxDate;
- this.currentHour = date.getHours();
- this.currentMinute = date.getMinutes();
- this.currentSecond = date.getSeconds();
- }
- var modelVal = null;
- if (this.isSingleSelection()) {
- modelVal = date;
- } else if (this.isMultipleSelection()) {
- modelVal = this.d_value ? [].concat(_toConsumableArray$d(this.d_value), [date]) : [date];
- } else if (this.isRangeSelection()) {
- if (this.d_value && this.d_value.length) {
- var startDate = this.d_value[0];
- var endDate = this.d_value[1];
- if (!endDate && date.getTime() >= startDate.getTime()) {
- endDate = date;
- } else {
- startDate = date;
- endDate = null;
- }
- modelVal = [startDate, endDate];
- } else {
- modelVal = [date, null];
- }
- }
- if (modelVal !== null) {
- this.updateModel(modelVal);
- }
- if (this.isRangeSelection() && this.hideOnRangeSelection && modelVal[1] !== null) {
- setTimeout(function() {
- _this8.overlayVisible = false;
- }, 150);
- }
- this.$emit("date-select", date);
- }, "selectDate"),
- updateModel: /* @__PURE__ */ __name(function updateModel(value2) {
- this.writeValue(value2);
- }, "updateModel"),
- shouldSelectDate: /* @__PURE__ */ __name(function shouldSelectDate() {
- if (this.isMultipleSelection()) return this.maxDateCount != null ? this.maxDateCount > (this.d_value ? this.d_value.length : 0) : true;
- else return true;
- }, "shouldSelectDate"),
- isSingleSelection: /* @__PURE__ */ __name(function isSingleSelection() {
- return this.selectionMode === "single";
- }, "isSingleSelection"),
- isRangeSelection: /* @__PURE__ */ __name(function isRangeSelection() {
- return this.selectionMode === "range";
- }, "isRangeSelection"),
- isMultipleSelection: /* @__PURE__ */ __name(function isMultipleSelection() {
- return this.selectionMode === "multiple";
- }, "isMultipleSelection"),
- formatValue: /* @__PURE__ */ __name(function formatValue(value2) {
- if (typeof value2 === "string") {
- return this.dateFormat ? this.formatDate(new Date(value2), this.dateFormat) : value2;
- }
- var formattedValue = "";
- if (value2) {
- try {
- if (this.isSingleSelection()) {
- formattedValue = this.formatDateTime(value2);
- } else if (this.isMultipleSelection()) {
- for (var i = 0; i < value2.length; i++) {
- var dateAsString = this.formatDateTime(value2[i]);
- formattedValue += dateAsString;
- if (i !== value2.length - 1) {
- formattedValue += ", ";
- }
- }
- } else if (this.isRangeSelection()) {
- if (value2 && value2.length) {
- var startDate = value2[0];
- var endDate = value2[1];
- formattedValue = this.formatDateTime(startDate);
- if (endDate) {
- formattedValue += " - " + this.formatDateTime(endDate);
- }
- }
- }
- } catch (err) {
- formattedValue = value2;
- }
- }
- return formattedValue;
- }, "formatValue"),
- formatDateTime: /* @__PURE__ */ __name(function formatDateTime(date) {
- var formattedValue = null;
- if (date) {
- if (this.timeOnly) {
- formattedValue = this.formatTime(date);
- } else {
- formattedValue = this.formatDate(date, this.datePattern);
- if (this.showTime) {
- formattedValue += " " + this.formatTime(date);
- }
- }
- }
- return formattedValue;
- }, "formatDateTime"),
- formatDate: /* @__PURE__ */ __name(function formatDate(date, format) {
- if (!date) {
- return "";
- }
- var iFormat;
- var lookAhead = /* @__PURE__ */ __name(function lookAhead2(match) {
- var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
- if (matches) {
- iFormat++;
- }
- return matches;
- }, "lookAhead"), formatNumber = /* @__PURE__ */ __name(function formatNumber2(match, value2, len) {
- var num = "" + value2;
- if (lookAhead(match)) {
- while (num.length < len) {
- num = "0" + num;
- }
- }
- return num;
- }, "formatNumber"), formatName = /* @__PURE__ */ __name(function formatName2(match, value2, shortNames, longNames) {
- return lookAhead(match) ? longNames[value2] : shortNames[value2];
- }, "formatName");
- var output = "";
- var literal = false;
- if (date) {
- for (iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal) {
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
- literal = false;
- } else {
- output += format.charAt(iFormat);
- }
- } else {
- switch (format.charAt(iFormat)) {
- case "d":
- output += formatNumber("d", date.getDate(), 2);
- break;
- case "D":
- output += formatName("D", date.getDay(), this.$primevue.config.locale.dayNamesShort, this.$primevue.config.locale.dayNames);
- break;
- case "o":
- output += formatNumber("o", Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 864e5), 3);
- break;
- case "m":
- output += formatNumber("m", date.getMonth() + 1, 2);
- break;
- case "M":
- output += formatName("M", date.getMonth(), this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
- break;
- case "y":
- output += lookAhead("y") ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? "0" : "") + date.getFullYear() % 100;
- break;
- case "@":
- output += date.getTime();
- break;
- case "!":
- output += date.getTime() * 1e4 + this.ticksTo1970;
- break;
- case "'":
- if (lookAhead("'")) {
- output += "'";
- } else {
- literal = true;
- }
- break;
- default:
- output += format.charAt(iFormat);
- }
- }
- }
- }
- return output;
- }, "formatDate"),
- formatTime: /* @__PURE__ */ __name(function formatTime(date) {
- if (!date) {
- return "";
- }
- var output = "";
- var hours = date.getHours();
- var minutes = date.getMinutes();
- var seconds = date.getSeconds();
- if (this.hourFormat === "12" && hours > 11 && hours !== 12) {
- hours -= 12;
- }
- if (this.hourFormat === "12") {
- output += hours === 0 ? 12 : hours < 10 ? "0" + hours : hours;
- } else {
- output += hours < 10 ? "0" + hours : hours;
- }
- output += ":";
- output += minutes < 10 ? "0" + minutes : minutes;
- if (this.showSeconds) {
- output += ":";
- output += seconds < 10 ? "0" + seconds : seconds;
- }
- if (this.hourFormat === "12") {
- output += date.getHours() > 11 ? " ".concat(this.$primevue.config.locale.pm) : " ".concat(this.$primevue.config.locale.am);
- }
- return output;
- }, "formatTime"),
- onTodayButtonClick: /* @__PURE__ */ __name(function onTodayButtonClick(event2) {
- var date = /* @__PURE__ */ new Date();
- var dateMeta = {
- day: date.getDate(),
- month: date.getMonth(),
- year: date.getFullYear(),
- otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear,
- today: true,
- selectable: true
- };
- this.onDateSelect(null, dateMeta);
- this.$emit("today-click", date);
- event2.preventDefault();
- }, "onTodayButtonClick"),
- onClearButtonClick: /* @__PURE__ */ __name(function onClearButtonClick(event2) {
- this.updateModel(null);
- this.overlayVisible = false;
- this.$emit("clear-click", event2);
- event2.preventDefault();
- }, "onClearButtonClick"),
- onTimePickerElementMouseDown: /* @__PURE__ */ __name(function onTimePickerElementMouseDown(event2, type, direction) {
- if (this.isEnabled()) {
- this.repeat(event2, null, type, direction);
- event2.preventDefault();
- }
- }, "onTimePickerElementMouseDown"),
- onTimePickerElementMouseUp: /* @__PURE__ */ __name(function onTimePickerElementMouseUp(event2) {
- if (this.isEnabled()) {
- this.clearTimePickerTimer();
- this.updateModelTime();
- event2.preventDefault();
- }
- }, "onTimePickerElementMouseUp"),
- onTimePickerElementMouseLeave: /* @__PURE__ */ __name(function onTimePickerElementMouseLeave() {
- this.clearTimePickerTimer();
- }, "onTimePickerElementMouseLeave"),
- repeat: /* @__PURE__ */ __name(function repeat(event2, interval, type, direction) {
- var _this9 = this;
- var i = interval || 500;
- this.clearTimePickerTimer();
- this.timePickerTimer = setTimeout(function() {
- _this9.repeat(event2, 100, type, direction);
- }, i);
- switch (type) {
- case 0:
- if (direction === 1) this.incrementHour(event2);
- else this.decrementHour(event2);
- break;
- case 1:
- if (direction === 1) this.incrementMinute(event2);
- else this.decrementMinute(event2);
- break;
- case 2:
- if (direction === 1) this.incrementSecond(event2);
- else this.decrementSecond(event2);
- break;
- }
- }, "repeat"),
- convertTo24Hour: /* @__PURE__ */ __name(function convertTo24Hour(hours, pm) {
- if (this.hourFormat == "12") {
- if (hours === 12) {
- return pm ? 12 : 0;
- } else {
- return pm ? hours + 12 : hours;
- }
- }
- return hours;
- }, "convertTo24Hour"),
- validateTime: /* @__PURE__ */ __name(function validateTime(hour, minute, second, pm) {
- var value2 = this.isComparable() ? this.d_value : this.viewDate;
- var convertedHour = this.convertTo24Hour(hour, pm);
- if (this.isRangeSelection()) {
- value2 = this.d_value[1] || this.d_value[0];
- }
- if (this.isMultipleSelection()) {
- value2 = this.d_value[this.d_value.length - 1];
- }
- var valueDateString = value2 ? value2.toDateString() : null;
- if (this.minDate && valueDateString && this.minDate.toDateString() === valueDateString) {
- if (this.minDate.getHours() > convertedHour) {
- return false;
- }
- if (this.minDate.getHours() === convertedHour) {
- if (this.minDate.getMinutes() > minute) {
- return false;
- }
- if (this.minDate.getMinutes() === minute) {
- if (this.minDate.getSeconds() > second) {
- return false;
- }
- }
- }
- }
- if (this.maxDate && valueDateString && this.maxDate.toDateString() === valueDateString) {
- if (this.maxDate.getHours() < convertedHour) {
- return false;
- }
- if (this.maxDate.getHours() === convertedHour) {
- if (this.maxDate.getMinutes() < minute) {
- return false;
- }
- if (this.maxDate.getMinutes() === minute) {
- if (this.maxDate.getSeconds() < second) {
- return false;
- }
- }
- }
- }
- return true;
- }, "validateTime"),
- incrementHour: /* @__PURE__ */ __name(function incrementHour(event2) {
- var prevHour = this.currentHour;
- var newHour = this.currentHour + Number(this.stepHour);
- var newPM = this.pm;
- if (this.hourFormat == "24") newHour = newHour >= 24 ? newHour - 24 : newHour;
- else if (this.hourFormat == "12") {
- if (prevHour < 12 && newHour > 11) {
- newPM = !this.pm;
- }
- newHour = newHour >= 13 ? newHour - 12 : newHour;
- }
- if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
- this.currentHour = newHour;
- this.pm = newPM;
- }
- event2.preventDefault();
- }, "incrementHour"),
- decrementHour: /* @__PURE__ */ __name(function decrementHour(event2) {
- var newHour = this.currentHour - this.stepHour;
- var newPM = this.pm;
- if (this.hourFormat == "24") newHour = newHour < 0 ? 24 + newHour : newHour;
- else if (this.hourFormat == "12") {
- if (this.currentHour === 12) {
- newPM = !this.pm;
- }
- newHour = newHour <= 0 ? 12 + newHour : newHour;
- }
- if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
- this.currentHour = newHour;
- this.pm = newPM;
- }
- event2.preventDefault();
- }, "decrementHour"),
- incrementMinute: /* @__PURE__ */ __name(function incrementMinute(event2) {
- var newMinute = this.currentMinute + Number(this.stepMinute);
- if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {
- this.currentMinute = newMinute > 59 ? newMinute - 60 : newMinute;
- }
- event2.preventDefault();
- }, "incrementMinute"),
- decrementMinute: /* @__PURE__ */ __name(function decrementMinute(event2) {
- var newMinute = this.currentMinute - this.stepMinute;
- newMinute = newMinute < 0 ? 60 + newMinute : newMinute;
- if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {
- this.currentMinute = newMinute;
- }
- event2.preventDefault();
- }, "decrementMinute"),
- incrementSecond: /* @__PURE__ */ __name(function incrementSecond(event2) {
- var newSecond = this.currentSecond + Number(this.stepSecond);
- if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {
- this.currentSecond = newSecond > 59 ? newSecond - 60 : newSecond;
- }
- event2.preventDefault();
- }, "incrementSecond"),
- decrementSecond: /* @__PURE__ */ __name(function decrementSecond(event2) {
- var newSecond = this.currentSecond - this.stepSecond;
- newSecond = newSecond < 0 ? 60 + newSecond : newSecond;
- if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {
- this.currentSecond = newSecond;
- }
- event2.preventDefault();
- }, "decrementSecond"),
- updateModelTime: /* @__PURE__ */ __name(function updateModelTime() {
- var _this10 = this;
- this.timePickerChange = true;
- var value2 = this.isComparable() ? this.d_value : this.viewDate;
- if (this.isRangeSelection()) {
- value2 = this.d_value[1] || this.d_value[0];
- }
- if (this.isMultipleSelection()) {
- value2 = this.d_value[this.d_value.length - 1];
- }
- value2 = value2 ? new Date(value2.getTime()) : /* @__PURE__ */ new Date();
- if (this.hourFormat == "12") {
- if (this.currentHour === 12) value2.setHours(this.pm ? 12 : 0);
- else value2.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
- } else {
- value2.setHours(this.currentHour);
- }
- value2.setMinutes(this.currentMinute);
- value2.setSeconds(this.currentSecond);
- if (this.isRangeSelection()) {
- if (this.d_value[1]) value2 = [this.d_value[0], value2];
- else value2 = [value2, null];
- }
- if (this.isMultipleSelection()) {
- value2 = [].concat(_toConsumableArray$d(this.d_value.slice(0, -1)), [value2]);
- }
- this.updateModel(value2);
- this.$emit("date-select", value2);
- setTimeout(function() {
- return _this10.timePickerChange = false;
- }, 0);
- }, "updateModelTime"),
- toggleAMPM: /* @__PURE__ */ __name(function toggleAMPM(event2) {
- var validHour = this.validateTime(this.currentHour, this.currentMinute, this.currentSecond, !this.pm);
- if (!validHour && (this.maxDate || this.minDate)) return;
- this.pm = !this.pm;
- this.updateModelTime();
- event2.preventDefault();
- }, "toggleAMPM"),
- clearTimePickerTimer: /* @__PURE__ */ __name(function clearTimePickerTimer() {
- if (this.timePickerTimer) {
- clearInterval(this.timePickerTimer);
- }
- }, "clearTimePickerTimer"),
- onMonthSelect: /* @__PURE__ */ __name(function onMonthSelect(event2, _ref) {
- _ref.month;
- var index = _ref.index;
- if (this.view === "month") {
- this.onDateSelect(event2, {
- year: this.currentYear,
- month: index,
- day: 1,
- selectable: true
- });
- } else {
- this.currentMonth = index;
- this.currentView = "date";
- this.$emit("month-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }
- setTimeout(this.updateFocus, 0);
- }, "onMonthSelect"),
- onYearSelect: /* @__PURE__ */ __name(function onYearSelect(event2, year2) {
- if (this.view === "year") {
- this.onDateSelect(event2, {
- year: year2.value,
- month: 0,
- day: 1,
- selectable: true
- });
- } else {
- this.currentYear = year2.value;
- this.currentView = "month";
- this.$emit("year-change", {
- month: this.currentMonth + 1,
- year: this.currentYear
- });
- }
- setTimeout(this.updateFocus, 0);
- }, "onYearSelect"),
- updateCurrentMetaData: /* @__PURE__ */ __name(function updateCurrentMetaData() {
- var viewDate2 = this.viewDate;
- this.currentMonth = viewDate2.getMonth();
- this.currentYear = viewDate2.getFullYear();
- if (this.showTime || this.timeOnly) {
- this.updateCurrentTimeMeta(viewDate2);
- }
- }, "updateCurrentMetaData"),
- isValidSelection: /* @__PURE__ */ __name(function isValidSelection(value2) {
- var _this11 = this;
- if (value2 == null) {
- return true;
- }
- var isValid = true;
- if (this.isSingleSelection()) {
- if (!this.isSelectable(value2.getDate(), value2.getMonth(), value2.getFullYear(), false)) {
- isValid = false;
- }
- } else if (value2.every(function(v) {
- return _this11.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false);
- })) {
- if (this.isRangeSelection()) {
- isValid = value2.length > 1 && value2[1] >= value2[0];
- }
- }
- return isValid;
- }, "isValidSelection"),
- parseValue: /* @__PURE__ */ __name(function parseValue(text) {
- if (!text || text.trim().length === 0) {
- return null;
- }
- var value2;
- if (this.isSingleSelection()) {
- value2 = this.parseDateTime(text);
- } else if (this.isMultipleSelection()) {
- var tokens = text.split(",");
- value2 = [];
- var _iterator3 = _createForOfIteratorHelper$4(tokens), _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- var token = _step3.value;
- value2.push(this.parseDateTime(token.trim()));
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- } else if (this.isRangeSelection()) {
- var _tokens = text.split(" - ");
- value2 = [];
- for (var i = 0; i < _tokens.length; i++) {
- value2[i] = this.parseDateTime(_tokens[i].trim());
- }
- }
- return value2;
- }, "parseValue"),
- parseDateTime: /* @__PURE__ */ __name(function parseDateTime(text) {
- var date;
- var parts = text.split(" ");
- if (this.timeOnly) {
- date = /* @__PURE__ */ new Date();
- this.populateTime(date, parts[0], parts[1]);
- } else {
- var dateFormat = this.datePattern;
- if (this.showTime) {
- date = this.parseDate(parts[0], dateFormat);
- this.populateTime(date, parts[1], parts[2]);
- } else {
- date = this.parseDate(text, dateFormat);
- }
- }
- return date;
- }, "parseDateTime"),
- populateTime: /* @__PURE__ */ __name(function populateTime(value2, timeString, ampm) {
- if (this.hourFormat == "12" && !ampm) {
- throw "Invalid Time";
- }
- this.pm = ampm === this.$primevue.config.locale.pm || ampm === this.$primevue.config.locale.pm.toLowerCase();
- var time = this.parseTime(timeString);
- value2.setHours(time.hour);
- value2.setMinutes(time.minute);
- value2.setSeconds(time.second);
- }, "populateTime"),
- parseTime: /* @__PURE__ */ __name(function parseTime(value2) {
- var tokens = value2.split(":");
- var validTokenLength = this.showSeconds ? 3 : 2;
- var regex = /^[0-9][0-9]$/;
- if (tokens.length !== validTokenLength || !tokens[0].match(regex) || !tokens[1].match(regex) || this.showSeconds && !tokens[2].match(regex)) {
- throw "Invalid time";
- }
- var h = parseInt(tokens[0]);
- var m = parseInt(tokens[1]);
- var s = this.showSeconds ? parseInt(tokens[2]) : null;
- if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || this.hourFormat == "12" && h > 12 || this.showSeconds && (isNaN(s) || s > 59)) {
- throw "Invalid time";
- } else {
- if (this.hourFormat == "12" && h !== 12 && this.pm) {
- h += 12;
- } else if (this.hourFormat == "12" && h == 12 && !this.pm) {
- h = 0;
- }
- return {
- hour: h,
- minute: m,
- second: s
- };
- }
- }, "parseTime"),
- parseDate: /* @__PURE__ */ __name(function parseDate(value2, format) {
- if (format == null || value2 == null) {
- throw "Invalid arguments";
- }
- value2 = _typeof$l(value2) === "object" ? value2.toString() : value2 + "";
- if (value2 === "") {
- return null;
- }
- var iFormat, dim, extra, iValue = 0, shortYearCutoff = typeof this.shortYearCutoff !== "string" ? this.shortYearCutoff : (/* @__PURE__ */ new Date()).getFullYear() % 100 + parseInt(this.shortYearCutoff, 10), year2 = -1, month2 = -1, day2 = -1, doy = -1, literal = false, date, lookAhead = /* @__PURE__ */ __name(function lookAhead2(match) {
- var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
- if (matches) {
- iFormat++;
- }
- return matches;
- }, "lookAhead"), getNumber = /* @__PURE__ */ __name(function getNumber2(match) {
- var isDoubled = lookAhead(match), size = match === "@" ? 14 : match === "!" ? 20 : match === "y" && isDoubled ? 4 : match === "o" ? 3 : 2, minSize = match === "y" ? size : 1, digits = new RegExp("^\\d{" + minSize + "," + size + "}"), num = value2.substring(iValue).match(digits);
- if (!num) {
- throw "Missing number at position " + iValue;
- }
- iValue += num[0].length;
- return parseInt(num[0], 10);
- }, "getNumber"), getName = /* @__PURE__ */ __name(function getName2(match, shortNames, longNames) {
- var index = -1;
- var arr = lookAhead(match) ? longNames : shortNames;
- var names = [];
- for (var i = 0; i < arr.length; i++) {
- names.push([i, arr[i]]);
- }
- names.sort(function(a, b) {
- return -(a[1].length - b[1].length);
- });
- for (var _i = 0; _i < names.length; _i++) {
- var name4 = names[_i][1];
- if (value2.substr(iValue, name4.length).toLowerCase() === name4.toLowerCase()) {
- index = names[_i][0];
- iValue += name4.length;
- break;
- }
- }
- if (index !== -1) {
- return index + 1;
- } else {
- throw "Unknown name at position " + iValue;
- }
- }, "getName"), checkLiteral = /* @__PURE__ */ __name(function checkLiteral2() {
- if (value2.charAt(iValue) !== format.charAt(iFormat)) {
- throw "Unexpected literal at position " + iValue;
- }
- iValue++;
- }, "checkLiteral");
- if (this.currentView === "month") {
- day2 = 1;
- }
- if (this.currentView === "year") {
- day2 = 1;
- month2 = 1;
- }
- for (iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal) {
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
- literal = false;
- } else {
- checkLiteral();
- }
- } else {
- switch (format.charAt(iFormat)) {
- case "d":
- day2 = getNumber("d");
- break;
- case "D":
- getName("D", this.$primevue.config.locale.dayNamesShort, this.$primevue.config.locale.dayNames);
- break;
- case "o":
- doy = getNumber("o");
- break;
- case "m":
- month2 = getNumber("m");
- break;
- case "M":
- month2 = getName("M", this.$primevue.config.locale.monthNamesShort, this.$primevue.config.locale.monthNames);
- break;
- case "y":
- year2 = getNumber("y");
- break;
- case "@":
- date = new Date(getNumber("@"));
- year2 = date.getFullYear();
- month2 = date.getMonth() + 1;
- day2 = date.getDate();
- break;
- case "!":
- date = new Date((getNumber("!") - this.ticksTo1970) / 1e4);
- year2 = date.getFullYear();
- month2 = date.getMonth() + 1;
- day2 = date.getDate();
- break;
- case "'":
- if (lookAhead("'")) {
- checkLiteral();
- } else {
- literal = true;
- }
- break;
- default:
- checkLiteral();
- }
- }
- }
- if (iValue < value2.length) {
- extra = value2.substr(iValue);
- if (!/^\s+/.test(extra)) {
- throw "Extra/unparsed characters found in date: " + extra;
- }
- }
- if (year2 === -1) {
- year2 = (/* @__PURE__ */ new Date()).getFullYear();
- } else if (year2 < 100) {
- year2 += (/* @__PURE__ */ new Date()).getFullYear() - (/* @__PURE__ */ new Date()).getFullYear() % 100 + (year2 <= shortYearCutoff ? 0 : -100);
- }
- if (doy > -1) {
- month2 = 1;
- day2 = doy;
- do {
- dim = this.getDaysCountInMonth(year2, month2 - 1);
- if (day2 <= dim) {
- break;
- }
- month2++;
- day2 -= dim;
- } while (true);
- }
- date = this.daylightSavingAdjust(new Date(year2, month2 - 1, day2));
- if (date.getFullYear() !== year2 || date.getMonth() + 1 !== month2 || date.getDate() !== day2) {
- throw "Invalid date";
- }
- return date;
- }, "parseDate"),
- getWeekNumber: /* @__PURE__ */ __name(function getWeekNumber(date) {
- var checkDate = new Date(date.getTime());
- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
- var time = checkDate.getTime();
- checkDate.setMonth(0);
- checkDate.setDate(1);
- return Math.floor(Math.round((time - checkDate.getTime()) / 864e5) / 7) + 1;
- }, "getWeekNumber"),
- onDateCellKeydown: /* @__PURE__ */ __name(function onDateCellKeydown(event2, date, groupIndex) {
- var cellContent = event2.currentTarget;
- var cell = cellContent.parentElement;
- var cellIndex = getIndex(cell);
- switch (event2.code) {
- case "ArrowDown": {
- cellContent.tabIndex = "-1";
- var nextRow = cell.parentElement.nextElementSibling;
- if (nextRow) {
- var tableRowIndex = getIndex(cell.parentElement);
- var tableRows = Array.from(cell.parentElement.parentElement.children);
- var nextTableRows = tableRows.slice(tableRowIndex + 1);
- var hasNextFocusableDate = nextTableRows.find(function(el) {
- var focusCell2 = el.children[cellIndex].children[0];
- return !getAttribute(focusCell2, "data-p-disabled");
- });
- if (hasNextFocusableDate) {
- var focusCell = hasNextFocusableDate.children[cellIndex].children[0];
- focusCell.tabIndex = "0";
- focusCell.focus();
- } else {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- }
- } else {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- }
- event2.preventDefault();
- break;
- }
- case "ArrowUp": {
- cellContent.tabIndex = "-1";
- if (event2.altKey) {
- this.overlayVisible = false;
- this.focused = true;
- } else {
- var prevRow = cell.parentElement.previousElementSibling;
- if (prevRow) {
- var _tableRowIndex = getIndex(cell.parentElement);
- var _tableRows = Array.from(cell.parentElement.parentElement.children);
- var prevTableRows = _tableRows.slice(0, _tableRowIndex).reverse();
- var _hasNextFocusableDate = prevTableRows.find(function(el) {
- var focusCell2 = el.children[cellIndex].children[0];
- return !getAttribute(focusCell2, "data-p-disabled");
- });
- if (_hasNextFocusableDate) {
- var _focusCell = _hasNextFocusableDate.children[cellIndex].children[0];
- _focusCell.tabIndex = "0";
- _focusCell.focus();
- } else {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- }
- } else {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- }
- }
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- cellContent.tabIndex = "-1";
- var prevCell = cell.previousElementSibling;
- if (prevCell) {
- var cells = Array.from(cell.parentElement.children);
- var prevCells = cells.slice(0, cellIndex).reverse();
- var _hasNextFocusableDate2 = prevCells.find(function(el) {
- var focusCell2 = el.children[0];
- return !getAttribute(focusCell2, "data-p-disabled");
- });
- if (_hasNextFocusableDate2) {
- var _focusCell2 = _hasNextFocusableDate2.children[0];
- _focusCell2.tabIndex = "0";
- _focusCell2.focus();
- } else {
- this.navigateToMonth(event2, true, groupIndex);
- }
- } else {
- this.navigateToMonth(event2, true, groupIndex);
- }
- event2.preventDefault();
- break;
- }
- case "ArrowRight": {
- cellContent.tabIndex = "-1";
- var nextCell = cell.nextElementSibling;
- if (nextCell) {
- var _cells = Array.from(cell.parentElement.children);
- var nextCells = _cells.slice(cellIndex + 1);
- var _hasNextFocusableDate3 = nextCells.find(function(el) {
- var focusCell2 = el.children[0];
- return !getAttribute(focusCell2, "data-p-disabled");
- });
- if (_hasNextFocusableDate3) {
- var _focusCell3 = _hasNextFocusableDate3.children[0];
- _focusCell3.tabIndex = "0";
- _focusCell3.focus();
- } else {
- this.navigateToMonth(event2, false, groupIndex);
- }
- } else {
- this.navigateToMonth(event2, false, groupIndex);
- }
- event2.preventDefault();
- break;
- }
- case "Enter":
- case "NumpadEnter":
- case "Space": {
- this.onDateSelect(event2, date);
- event2.preventDefault();
- break;
- }
- case "Escape": {
- this.overlayVisible = false;
- event2.preventDefault();
- break;
- }
- case "Tab": {
- if (!this.inline) {
- this.trapFocus(event2);
- }
- break;
- }
- case "Home": {
- cellContent.tabIndex = "-1";
- var currentRow = cell.parentElement;
- var _focusCell4 = currentRow.children[0].children[0];
- if (getAttribute(_focusCell4, "data-p-disabled")) {
- this.navigateToMonth(event2, true, groupIndex);
- } else {
- _focusCell4.tabIndex = "0";
- _focusCell4.focus();
- }
- event2.preventDefault();
- break;
- }
- case "End": {
- cellContent.tabIndex = "-1";
- var _currentRow = cell.parentElement;
- var _focusCell5 = _currentRow.children[_currentRow.children.length - 1].children[0];
- if (getAttribute(_focusCell5, "data-p-disabled")) {
- this.navigateToMonth(event2, false, groupIndex);
- } else {
- _focusCell5.tabIndex = "0";
- _focusCell5.focus();
- }
- event2.preventDefault();
- break;
- }
- case "PageUp": {
- cellContent.tabIndex = "-1";
- if (event2.shiftKey) {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- } else this.navigateToMonth(event2, true, groupIndex);
- event2.preventDefault();
- break;
- }
- case "PageDown": {
- cellContent.tabIndex = "-1";
- if (event2.shiftKey) {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- } else this.navigateToMonth(event2, false, groupIndex);
- event2.preventDefault();
- break;
- }
- }
- }, "onDateCellKeydown"),
- navigateToMonth: /* @__PURE__ */ __name(function navigateToMonth(event2, prev, groupIndex) {
- if (prev) {
- if (this.numberOfMonths === 1 || groupIndex === 0) {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- } else {
- var prevMonthContainer = this.overlay.children[groupIndex - 1];
- var cells = find(prevMonthContainer, 'table td span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- var focusCell = cells[cells.length - 1];
- focusCell.tabIndex = "0";
- focusCell.focus();
- }
- } else {
- if (this.numberOfMonths === 1 || groupIndex === this.numberOfMonths - 1) {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- } else {
- var nextMonthContainer = this.overlay.children[groupIndex + 1];
- var _focusCell6 = findSingle(nextMonthContainer, 'table td span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- _focusCell6.tabIndex = "0";
- _focusCell6.focus();
- }
- }
- }, "navigateToMonth"),
- onMonthCellKeydown: /* @__PURE__ */ __name(function onMonthCellKeydown(event2, index) {
- var cell = event2.currentTarget;
- switch (event2.code) {
- case "ArrowUp":
- case "ArrowDown": {
- cell.tabIndex = "-1";
- var cells = cell.parentElement.children;
- var cellIndex = getIndex(cell);
- var nextCell = cells[event2.code === "ArrowDown" ? cellIndex + 3 : cellIndex - 3];
- if (nextCell) {
- nextCell.tabIndex = "0";
- nextCell.focus();
- }
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- cell.tabIndex = "-1";
- var prevCell = cell.previousElementSibling;
- if (prevCell) {
- prevCell.tabIndex = "0";
- prevCell.focus();
- } else {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- }
- event2.preventDefault();
- break;
- }
- case "ArrowRight": {
- cell.tabIndex = "-1";
- var _nextCell = cell.nextElementSibling;
- if (_nextCell) {
- _nextCell.tabIndex = "0";
- _nextCell.focus();
- } else {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- }
- event2.preventDefault();
- break;
- }
- case "PageUp": {
- if (event2.shiftKey) return;
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- break;
- }
- case "PageDown": {
- if (event2.shiftKey) return;
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- break;
- }
- case "Enter":
- case "NumpadEnter":
- case "Space": {
- this.onMonthSelect(event2, index);
- event2.preventDefault();
- break;
- }
- case "Escape": {
- this.overlayVisible = false;
- event2.preventDefault();
- break;
- }
- case "Tab": {
- this.trapFocus(event2);
- break;
- }
- }
- }, "onMonthCellKeydown"),
- onYearCellKeydown: /* @__PURE__ */ __name(function onYearCellKeydown(event2, index) {
- var cell = event2.currentTarget;
- switch (event2.code) {
- case "ArrowUp":
- case "ArrowDown": {
- cell.tabIndex = "-1";
- var cells = cell.parentElement.children;
- var cellIndex = getIndex(cell);
- var nextCell = cells[event2.code === "ArrowDown" ? cellIndex + 2 : cellIndex - 2];
- if (nextCell) {
- nextCell.tabIndex = "0";
- nextCell.focus();
- }
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- cell.tabIndex = "-1";
- var prevCell = cell.previousElementSibling;
- if (prevCell) {
- prevCell.tabIndex = "0";
- prevCell.focus();
- } else {
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- }
- event2.preventDefault();
- break;
- }
- case "ArrowRight": {
- cell.tabIndex = "-1";
- var _nextCell2 = cell.nextElementSibling;
- if (_nextCell2) {
- _nextCell2.tabIndex = "0";
- _nextCell2.focus();
- } else {
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- }
- event2.preventDefault();
- break;
- }
- case "PageUp": {
- if (event2.shiftKey) return;
- this.navigationState = {
- backward: true
- };
- this.navBackward(event2);
- break;
- }
- case "PageDown": {
- if (event2.shiftKey) return;
- this.navigationState = {
- backward: false
- };
- this.navForward(event2);
- break;
- }
- case "Enter":
- case "NumpadEnter":
- case "Space": {
- this.onYearSelect(event2, index);
- event2.preventDefault();
- break;
- }
- case "Escape": {
- this.overlayVisible = false;
- event2.preventDefault();
- break;
- }
- case "Tab": {
- this.trapFocus(event2);
- break;
- }
- }
- }, "onYearCellKeydown"),
- updateFocus: /* @__PURE__ */ __name(function updateFocus() {
- var cell;
- if (this.navigationState) {
- if (this.navigationState.button) {
- this.initFocusableCell();
- if (this.navigationState.backward) this.previousButton.focus();
- else this.nextButton.focus();
- } else {
- if (this.navigationState.backward) {
- var cells;
- if (this.currentView === "month") {
- cells = find(this.overlay, '[data-pc-section="monthview"] [data-pc-section="month"]:not([data-p-disabled="true"])');
- } else if (this.currentView === "year") {
- cells = find(this.overlay, '[data-pc-section="yearview"] [data-pc-section="year"]:not([data-p-disabled="true"])');
- } else {
- cells = find(this.overlay, 'table td span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- }
- if (cells && cells.length > 0) {
- cell = cells[cells.length - 1];
- }
- } else {
- if (this.currentView === "month") {
- cell = findSingle(this.overlay, '[data-pc-section="monthview"] [data-pc-section="month"]:not([data-p-disabled="true"])');
- } else if (this.currentView === "year") {
- cell = findSingle(this.overlay, '[data-pc-section="yearview"] [data-pc-section="year"]:not([data-p-disabled="true"])');
- } else {
- cell = findSingle(this.overlay, 'table td span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- }
- }
- if (cell) {
- cell.tabIndex = "0";
- cell.focus();
- }
- }
- this.navigationState = null;
- } else {
- this.initFocusableCell();
- }
- }, "updateFocus"),
- initFocusableCell: /* @__PURE__ */ __name(function initFocusableCell() {
- var cell;
- if (this.currentView === "month") {
- var cells = find(this.overlay, '[data-pc-section="monthview"] [data-pc-section="month"]');
- var selectedCell = findSingle(this.overlay, '[data-pc-section="monthview"] [data-pc-section="month"][data-p-selected="true"]');
- cells.forEach(function(cell2) {
- return cell2.tabIndex = -1;
- });
- cell = selectedCell || cells[0];
- } else if (this.currentView === "year") {
- var _cells2 = find(this.overlay, '[data-pc-section="yearview"] [data-pc-section="year"]');
- var _selectedCell = findSingle(this.overlay, '[data-pc-section="yearview"] [data-pc-section="year"][data-p-selected="true"]');
- _cells2.forEach(function(cell2) {
- return cell2.tabIndex = -1;
- });
- cell = _selectedCell || _cells2[0];
- } else {
- cell = findSingle(this.overlay, 'span[data-p-selected="true"]');
- if (!cell) {
- var todayCell = findSingle(this.overlay, 'td[data-p-today="true"] span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- if (todayCell) cell = todayCell;
- else cell = findSingle(this.overlay, '.p-datepicker-calendar td span:not([data-p-disabled="true"]):not([data-p-ink="true"])');
- }
- }
- if (cell) {
- cell.tabIndex = "0";
- this.preventFocus = false;
- }
- }, "initFocusableCell"),
- trapFocus: /* @__PURE__ */ __name(function trapFocus(event2) {
- event2.preventDefault();
- var focusableElements = getFocusableElements(this.overlay);
- if (focusableElements && focusableElements.length > 0) {
- if (!document.activeElement) {
- focusableElements[0].focus();
- } else {
- var focusedIndex = focusableElements.indexOf(document.activeElement);
- if (event2.shiftKey) {
- if (focusedIndex === -1 || focusedIndex === 0) focusableElements[focusableElements.length - 1].focus();
- else focusableElements[focusedIndex - 1].focus();
- } else {
- if (focusedIndex === -1) {
- if (this.timeOnly) {
- focusableElements[0].focus();
- } else {
- var spanIndex = null;
- for (var i = 0; i < focusableElements.length; i++) {
- if (focusableElements[i].tagName === "SPAN") {
- spanIndex = i;
- break;
- }
- }
- focusableElements[spanIndex].focus();
- }
- } else if (focusedIndex === focusableElements.length - 1) focusableElements[0].focus();
- else focusableElements[focusedIndex + 1].focus();
- }
- }
- }
- }, "trapFocus"),
- onContainerButtonKeydown: /* @__PURE__ */ __name(function onContainerButtonKeydown(event2) {
- switch (event2.code) {
- case "Tab":
- this.trapFocus(event2);
- break;
- case "Escape":
- this.overlayVisible = false;
- event2.preventDefault();
- break;
- }
- this.$emit("keydown", event2);
- }, "onContainerButtonKeydown"),
- onInput: /* @__PURE__ */ __name(function onInput(event2) {
- try {
- this.selectionStart = this.input.selectionStart;
- this.selectionEnd = this.input.selectionEnd;
- var value2 = this.parseValue(event2.target.value);
- if (this.isValidSelection(value2)) {
- this.typeUpdate = true;
- this.updateModel(value2);
- this.updateCurrentMetaData();
- }
- } catch (err) {
- }
- this.$emit("input", event2);
- }, "onInput"),
- onInputClick: /* @__PURE__ */ __name(function onInputClick() {
- if (this.showOnFocus && this.isEnabled() && !this.overlayVisible) {
- this.overlayVisible = true;
- }
- }, "onInputClick"),
- onFocus: /* @__PURE__ */ __name(function onFocus2(event2) {
- if (this.showOnFocus && this.isEnabled()) {
- this.overlayVisible = true;
- }
- this.focused = true;
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur(event2) {
- var _this$formField$onBlu, _this$formField;
- this.$emit("blur", {
- originalEvent: event2,
- value: event2.target.value
- });
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
- this.focused = false;
- event2.target.value = this.formatValue(this.d_value);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown(event2) {
- if (event2.code === "ArrowDown" && this.overlay) {
- this.trapFocus(event2);
- } else if (event2.code === "ArrowDown" && !this.overlay) {
- this.overlayVisible = true;
- } else if (event2.code === "Escape") {
- if (this.overlayVisible) {
- this.overlayVisible = false;
- event2.preventDefault();
- }
- } else if (event2.code === "Tab") {
- if (this.overlay) {
- getFocusableElements(this.overlay).forEach(function(el) {
- return el.tabIndex = "-1";
- });
- }
- if (this.overlayVisible) {
- this.overlayVisible = false;
- }
- } else if (event2.code === "Enter") {
- var _event$target$value;
- if (this.manualInput && event2.target.value !== null && ((_event$target$value = event2.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.trim()) !== "") {
- try {
- var value2 = this.parseValue(event2.target.value);
- if (this.isValidSelection(value2)) {
- this.overlayVisible = false;
- }
- } catch (err) {
- }
- }
- this.$emit("keydown", event2);
- }
- }, "onKeyDown"),
- overlayRef: /* @__PURE__ */ __name(function overlayRef(el) {
- this.overlay = el;
- }, "overlayRef"),
- inputRef: /* @__PURE__ */ __name(function inputRef(el) {
- this.input = el ? el.$el : void 0;
- }, "inputRef"),
- previousButtonRef: /* @__PURE__ */ __name(function previousButtonRef(el) {
- this.previousButton = el ? el.$el : void 0;
- }, "previousButtonRef"),
- nextButtonRef: /* @__PURE__ */ __name(function nextButtonRef(el) {
- this.nextButton = el ? el.$el : void 0;
- }, "nextButtonRef"),
- getMonthName: /* @__PURE__ */ __name(function getMonthName(index) {
- return this.$primevue.config.locale.monthNames[index];
- }, "getMonthName"),
- getYear: /* @__PURE__ */ __name(function getYear(month2) {
- return this.currentView === "month" ? this.currentYear : month2.year;
- }, "getYear"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick(event2) {
- event2.stopPropagation();
- if (!this.inline) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.$el
- });
- }
- }, "onOverlayClick"),
- onOverlayKeyDown: /* @__PURE__ */ __name(function onOverlayKeyDown(event2) {
- switch (event2.code) {
- case "Escape":
- if (!this.inline) {
- this.input.focus();
- this.overlayVisible = false;
- }
- break;
- }
- }, "onOverlayKeyDown"),
- onOverlayMouseUp: /* @__PURE__ */ __name(function onOverlayMouseUp(event2) {
- this.onOverlayClick(event2);
- }, "onOverlayMouseUp"),
- createResponsiveStyle: /* @__PURE__ */ __name(function createResponsiveStyle() {
- if (this.numberOfMonths > 1 && this.responsiveOptions && !this.isUnstyled) {
- if (!this.responsiveStyleElement) {
- var _this$$primevue;
- this.responsiveStyleElement = document.createElement("style");
- this.responsiveStyleElement.type = "text/css";
- setAttribute(this.responsiveStyleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
- document.body.appendChild(this.responsiveStyleElement);
- }
- var innerHTML = "";
- if (this.responsiveOptions) {
- var comparer = localeComparator();
- var responsiveOptions2 = _toConsumableArray$d(this.responsiveOptions).filter(function(o) {
- return !!(o.breakpoint && o.numMonths);
- }).sort(function(o1, o2) {
- return -1 * comparer(o1.breakpoint, o2.breakpoint);
- });
- for (var i = 0; i < responsiveOptions2.length; i++) {
- var _responsiveOptions$i = responsiveOptions2[i], breakpoint2 = _responsiveOptions$i.breakpoint, numMonths = _responsiveOptions$i.numMonths;
- var styles = "\n .p-datepicker-panel[".concat(this.$attrSelector, "] .p-datepicker-calendar:nth-child(").concat(numMonths, ") .p-datepicker-next-button {\n display: inline-flex;\n }\n ");
- for (var j = numMonths; j < this.numberOfMonths; j++) {
- styles += "\n .p-datepicker-panel[".concat(this.$attrSelector, "] .p-datepicker-calendar:nth-child(").concat(j + 1, ") {\n display: none;\n }\n ");
- }
- innerHTML += "\n @media screen and (max-width: ".concat(breakpoint2, ") {\n ").concat(styles, "\n }\n ");
- }
- }
- this.responsiveStyleElement.innerHTML = innerHTML;
- }
- }, "createResponsiveStyle"),
- destroyResponsiveStyleElement: /* @__PURE__ */ __name(function destroyResponsiveStyleElement() {
- if (this.responsiveStyleElement) {
- this.responsiveStyleElement.remove();
- this.responsiveStyleElement = null;
- }
- }, "destroyResponsiveStyleElement")
- },
- computed: {
- viewDate: /* @__PURE__ */ __name(function viewDate() {
- var propValue = this.d_value;
- if (propValue && Array.isArray(propValue)) {
- if (this.isRangeSelection()) {
- propValue = this.inline ? propValue[0] : propValue[1] || propValue[0];
- } else if (this.isMultipleSelection()) {
- propValue = propValue[propValue.length - 1];
- }
- }
- if (propValue && typeof propValue !== "string") {
- return propValue;
- } else {
- var today = /* @__PURE__ */ new Date();
- if (this.maxDate && this.maxDate < today) {
- return this.maxDate;
- }
- if (this.minDate && this.minDate > today) {
- return this.minDate;
- }
- return today;
- }
- }, "viewDate"),
- inputFieldValue: /* @__PURE__ */ __name(function inputFieldValue() {
- return this.formatValue(this.d_value);
- }, "inputFieldValue"),
- months: /* @__PURE__ */ __name(function months2() {
- var months3 = [];
- for (var i = 0; i < this.numberOfMonths; i++) {
- var month2 = this.currentMonth + i;
- var year2 = this.currentYear;
- if (month2 > 11) {
- month2 = month2 % 11 - 1;
- year2 = year2 + 1;
- }
- var dates = [];
- var firstDay = this.getFirstDayOfMonthIndex(month2, year2);
- var daysLength = this.getDaysCountInMonth(month2, year2);
- var prevMonthDaysLength = this.getDaysCountInPrevMonth(month2, year2);
- var dayNo = 1;
- var today = /* @__PURE__ */ new Date();
- var weekNumbers = [];
- var monthRows = Math.ceil((daysLength + firstDay) / 7);
- for (var _i2 = 0; _i2 < monthRows; _i2++) {
- var week = [];
- if (_i2 == 0) {
- for (var j = prevMonthDaysLength - firstDay + 1; j <= prevMonthDaysLength; j++) {
- var prev = this.getPreviousMonthAndYear(month2, year2);
- week.push({
- day: j,
- month: prev.month,
- year: prev.year,
- otherMonth: true,
- today: this.isToday(today, j, prev.month, prev.year),
- selectable: this.isSelectable(j, prev.month, prev.year, true)
- });
- }
- var remainingDaysLength = 7 - week.length;
- for (var _j = 0; _j < remainingDaysLength; _j++) {
- week.push({
- day: dayNo,
- month: month2,
- year: year2,
- today: this.isToday(today, dayNo, month2, year2),
- selectable: this.isSelectable(dayNo, month2, year2, false)
- });
- dayNo++;
- }
- } else {
- for (var _j2 = 0; _j2 < 7; _j2++) {
- if (dayNo > daysLength) {
- var next = this.getNextMonthAndYear(month2, year2);
- week.push({
- day: dayNo - daysLength,
- month: next.month,
- year: next.year,
- otherMonth: true,
- today: this.isToday(today, dayNo - daysLength, next.month, next.year),
- selectable: this.isSelectable(dayNo - daysLength, next.month, next.year, true)
- });
- } else {
- week.push({
- day: dayNo,
- month: month2,
- year: year2,
- today: this.isToday(today, dayNo, month2, year2),
- selectable: this.isSelectable(dayNo, month2, year2, false)
- });
- }
- dayNo++;
- }
- }
- if (this.showWeek) {
- weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
- }
- dates.push(week);
- }
- months3.push({
- month: month2,
- year: year2,
- dates,
- weekNumbers
- });
- }
- return months3;
- }, "months"),
- weekDays: /* @__PURE__ */ __name(function weekDays() {
- var weekDays2 = [];
- var dayIndex = this.$primevue.config.locale.firstDayOfWeek;
- for (var i = 0; i < 7; i++) {
- weekDays2.push(this.$primevue.config.locale.dayNamesMin[dayIndex]);
- dayIndex = dayIndex == 6 ? 0 : ++dayIndex;
- }
- return weekDays2;
- }, "weekDays"),
- ticksTo1970: /* @__PURE__ */ __name(function ticksTo1970() {
- return ((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 1e7;
- }, "ticksTo1970"),
- sundayIndex: /* @__PURE__ */ __name(function sundayIndex() {
- return this.$primevue.config.locale.firstDayOfWeek > 0 ? 7 - this.$primevue.config.locale.firstDayOfWeek : 0;
- }, "sundayIndex"),
- datePattern: /* @__PURE__ */ __name(function datePattern() {
- return this.dateFormat || this.$primevue.config.locale.dateFormat;
- }, "datePattern"),
- monthPickerValues: /* @__PURE__ */ __name(function monthPickerValues() {
- var _this12 = this;
- var monthPickerValues2 = [];
- var isSelectableMonth = /* @__PURE__ */ __name(function isSelectableMonth2(baseMonth) {
- if (_this12.minDate) {
- var minMonth = _this12.minDate.getMonth();
- var minYear = _this12.minDate.getFullYear();
- if (_this12.currentYear < minYear || _this12.currentYear === minYear && baseMonth < minMonth) {
- return false;
- }
- }
- if (_this12.maxDate) {
- var maxMonth = _this12.maxDate.getMonth();
- var maxYear = _this12.maxDate.getFullYear();
- if (_this12.currentYear > maxYear || _this12.currentYear === maxYear && baseMonth > maxMonth) {
- return false;
- }
- }
- return true;
- }, "isSelectableMonth");
- for (var i = 0; i <= 11; i++) {
- monthPickerValues2.push({
- value: this.$primevue.config.locale.monthNamesShort[i],
- selectable: isSelectableMonth(i)
- });
- }
- return monthPickerValues2;
- }, "monthPickerValues"),
- yearPickerValues: /* @__PURE__ */ __name(function yearPickerValues() {
- var _this13 = this;
- var yearPickerValues2 = [];
- var base = this.currentYear - this.currentYear % 10;
- var isSelectableYear = /* @__PURE__ */ __name(function isSelectableYear2(baseYear) {
- if (_this13.minDate) {
- if (_this13.minDate.getFullYear() > baseYear) return false;
- }
- if (_this13.maxDate) {
- if (_this13.maxDate.getFullYear() < baseYear) return false;
- }
- return true;
- }, "isSelectableYear");
- for (var i = 0; i < 10; i++) {
- yearPickerValues2.push({
- value: base + i,
- selectable: isSelectableYear(base + i)
- });
- }
- return yearPickerValues2;
- }, "yearPickerValues"),
- formattedCurrentHour: /* @__PURE__ */ __name(function formattedCurrentHour() {
- if (this.currentHour == 0 && this.hourFormat == "12") {
- return this.currentHour + 12;
- }
- return this.currentHour < 10 ? "0" + this.currentHour : this.currentHour;
- }, "formattedCurrentHour"),
- formattedCurrentMinute: /* @__PURE__ */ __name(function formattedCurrentMinute() {
- return this.currentMinute < 10 ? "0" + this.currentMinute : this.currentMinute;
- }, "formattedCurrentMinute"),
- formattedCurrentSecond: /* @__PURE__ */ __name(function formattedCurrentSecond() {
- return this.currentSecond < 10 ? "0" + this.currentSecond : this.currentSecond;
- }, "formattedCurrentSecond"),
- todayLabel: /* @__PURE__ */ __name(function todayLabel() {
- return this.$primevue.config.locale.today;
- }, "todayLabel"),
- clearLabel: /* @__PURE__ */ __name(function clearLabel() {
- return this.$primevue.config.locale.clear;
- }, "clearLabel"),
- weekHeaderLabel: /* @__PURE__ */ __name(function weekHeaderLabel() {
- return this.$primevue.config.locale.weekHeader;
- }, "weekHeaderLabel"),
- monthNames: /* @__PURE__ */ __name(function monthNames() {
- return this.$primevue.config.locale.monthNames;
- }, "monthNames"),
- switchViewButtonDisabled: /* @__PURE__ */ __name(function switchViewButtonDisabled() {
- return this.numberOfMonths > 1 || this.disabled;
- }, "switchViewButtonDisabled"),
- panelId: /* @__PURE__ */ __name(function panelId() {
- return this.d_id + "_panel";
- }, "panelId")
- },
- components: {
- InputText: script$1l,
- Button: script$1d,
- Portal: script$1m,
- CalendarIcon: script$13,
- ChevronLeftIcon: script$1n,
- ChevronRightIcon: script$1i,
- ChevronUpIcon: script$1g,
- ChevronDownIcon: script$1h
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$s = ["id"];
-var _hoisted_2$l = ["disabled", "aria-label", "aria-expanded", "aria-controls"];
-var _hoisted_3$h = ["id", "role", "aria-modal", "aria-label"];
-var _hoisted_4$9 = ["disabled", "aria-label"];
-var _hoisted_5$4 = ["disabled", "aria-label"];
-var _hoisted_6$2 = ["disabled", "aria-label"];
-var _hoisted_7$2 = ["disabled", "aria-label"];
-var _hoisted_8$2 = ["data-p-disabled"];
-var _hoisted_9 = ["abbr"];
-var _hoisted_10 = ["data-p-disabled"];
-var _hoisted_11 = ["aria-label", "data-p-today", "data-p-other-month"];
-var _hoisted_12 = ["onClick", "onKeydown", "aria-selected", "aria-disabled", "data-p-disabled", "data-p-selected"];
-var _hoisted_13 = ["onClick", "onKeydown", "data-p-disabled", "data-p-selected"];
-var _hoisted_14 = ["onClick", "onKeydown", "data-p-disabled", "data-p-selected"];
-function render$V(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_InputText = resolveComponent("InputText");
- var _component_Button = resolveComponent("Button");
- var _component_Portal = resolveComponent("Portal");
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("span", mergeProps({
- ref: "container",
- id: $data.d_id,
- "class": _ctx.cx("root"),
- style: _ctx.sx("root")
- }, _ctx.ptmi("root")), [!_ctx.inline ? (openBlock(), createBlock(_component_InputText, {
- key: 0,
- ref: $options.inputRef,
- id: _ctx.inputId,
- role: "combobox",
- "class": normalizeClass([_ctx.inputClass, _ctx.cx("pcInputText")]),
- style: normalizeStyle(_ctx.inputStyle),
- defaultValue: $options.inputFieldValue,
- placeholder: _ctx.placeholder,
- name: _ctx.name,
- size: _ctx.size,
- invalid: _ctx.invalid,
- variant: _ctx.variant,
- fluid: _ctx.fluid,
- unstyled: _ctx.unstyled,
- autocomplete: "off",
- "aria-autocomplete": "none",
- "aria-haspopup": "dialog",
- "aria-expanded": $data.overlayVisible,
- "aria-controls": $options.panelId,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel,
- inputmode: "none",
- disabled: _ctx.disabled,
- readonly: !_ctx.manualInput || _ctx.readonly,
- tabindex: 0,
- onInput: $options.onInput,
- onClick: $options.onInputClick,
- onFocus: $options.onFocus,
- onBlur: $options.onBlur,
- onKeydown: $options.onKeyDown,
- pt: _ctx.ptm("pcInputText")
- }, null, 8, ["id", "class", "style", "defaultValue", "placeholder", "name", "size", "invalid", "variant", "fluid", "unstyled", "aria-expanded", "aria-controls", "aria-labelledby", "aria-label", "disabled", "readonly", "onInput", "onClick", "onFocus", "onBlur", "onKeydown", "pt"])) : createCommentVNode("", true), _ctx.showIcon && _ctx.iconDisplay === "button" && !_ctx.inline ? renderSlot(_ctx.$slots, "dropdownbutton", {
- key: 1,
- toggleCallback: $options.onButtonClick
- }, function() {
- return [createBaseVNode("button", mergeProps({
- "class": _ctx.cx("dropdown"),
- disabled: _ctx.disabled,
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.onButtonClick && $options.onButtonClick.apply($options, arguments);
- }),
- type: "button",
- "aria-label": _ctx.$primevue.config.locale.chooseDate,
- "aria-haspopup": "dialog",
- "aria-expanded": $data.overlayVisible,
- "aria-controls": $options.panelId
- }, _ctx.ptm("dropdown")), [renderSlot(_ctx.$slots, "dropdownicon", {
- "class": normalizeClass(_ctx.icon)
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ? "span" : "CalendarIcon"), mergeProps({
- "class": _ctx.icon
- }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
- })], 16, _hoisted_2$l)];
- }) : _ctx.showIcon && _ctx.iconDisplay === "input" && !_ctx.inline ? (openBlock(), createElementBlock(Fragment, {
- key: 2
- }, [_ctx.$slots.inputicon || _ctx.showIcon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("inputIconContainer")
- }, _ctx.ptm("inputIconContainer")), [renderSlot(_ctx.$slots, "inputicon", {
- "class": normalizeClass(_ctx.cx("inputIcon")),
- clickCallback: $options.onButtonClick
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ? "i" : "CalendarIcon"), mergeProps({
- "class": [_ctx.icon, _ctx.cx("inputIcon")],
- onClick: $options.onButtonClick
- }, _ctx.ptm("inputicon")), null, 16, ["class", "onClick"]))];
- })], 16)) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createVNode(_component_Portal, {
- appendTo: _ctx.appendTo,
- disabled: _ctx.inline
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: _cache[58] || (_cache[58] = function($event) {
- return $options.onOverlayEnter($event);
- }),
- onAfterEnter: $options.onOverlayEnterComplete,
- onAfterLeave: $options.onOverlayAfterLeave,
- onLeave: $options.onOverlayLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [_ctx.inline || $data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.overlayRef,
- id: $options.panelId,
- "class": [_ctx.cx("panel"), _ctx.panelClass],
- style: _ctx.panelStyle,
- role: _ctx.inline ? null : "dialog",
- "aria-modal": _ctx.inline ? null : "true",
- "aria-label": _ctx.$primevue.config.locale.chooseDate,
- onClick: _cache[55] || (_cache[55] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- }),
- onKeydown: _cache[56] || (_cache[56] = function() {
- return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
- }),
- onMouseup: _cache[57] || (_cache[57] = function() {
- return $options.onOverlayMouseUp && $options.onOverlayMouseUp.apply($options, arguments);
- })
- }, _ctx.ptm("panel")), [!_ctx.timeOnly ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("calendarContainer")
- }, _ctx.ptm("calendarContainer")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.months, function(month2, groupIndex) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: month2.month + month2.year,
- "class": _ctx.cx("calendar"),
- ref_for: true
- }, _ctx.ptm("calendar")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("header"),
- ref_for: true
- }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header"), withDirectives(createVNode(_component_Button, mergeProps({
- ref_for: true,
- ref: $options.previousButtonRef,
- "class": _ctx.cx("pcPrevButton"),
- disabled: _ctx.disabled,
- "aria-label": $data.currentView === "year" ? _ctx.$primevue.config.locale.prevDecade : $data.currentView === "month" ? _ctx.$primevue.config.locale.prevYear : _ctx.$primevue.config.locale.prevMonth,
- unstyled: _ctx.unstyled,
- onClick: $options.onPrevButtonClick,
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.navigatorButtonProps, {
- pt: _ctx.ptm("pcPrevButton"),
- "data-pc-group-section": "navigator"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "previcon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon ? "span" : "ChevronLeftIcon"), mergeProps({
- "class": [_ctx.prevIcon, slotProps["class"]],
- ref_for: true
- }, _ctx.ptm("pcPrevButton")["icon"]), null, 16, ["class"]))];
- })];
- }),
- _: 2
- }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, groupIndex === 0]]), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("title"),
- ref_for: true
- }, _ctx.ptm("title")), [_ctx.$primevue.config.locale.showMonthAfterYear ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [$data.currentView !== "year" ? (openBlock(), createElementBlock("button", mergeProps({
- key: 0,
- type: "button",
- onClick: _cache[1] || (_cache[1] = function() {
- return $options.switchToYearView && $options.switchToYearView.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onContainerButtonKeydown && $options.onContainerButtonKeydown.apply($options, arguments);
- }),
- "class": _ctx.cx("selectYear"),
- disabled: $options.switchViewButtonDisabled,
- "aria-label": _ctx.$primevue.config.locale.chooseYear,
- ref_for: true
- }, _ctx.ptm("selectYear"), {
- "data-pc-group-section": "view"
- }), toDisplayString($options.getYear(month2)), 17, _hoisted_4$9)) : createCommentVNode("", true), $data.currentView === "date" ? (openBlock(), createElementBlock("button", mergeProps({
- key: 1,
- type: "button",
- onClick: _cache[3] || (_cache[3] = function() {
- return $options.switchToMonthView && $options.switchToMonthView.apply($options, arguments);
- }),
- onKeydown: _cache[4] || (_cache[4] = function() {
- return $options.onContainerButtonKeydown && $options.onContainerButtonKeydown.apply($options, arguments);
- }),
- "class": _ctx.cx("selectMonth"),
- disabled: $options.switchViewButtonDisabled,
- "aria-label": _ctx.$primevue.config.locale.chooseMonth,
- ref_for: true
- }, _ctx.ptm("selectMonth"), {
- "data-pc-group-section": "view"
- }), toDisplayString($options.getMonthName(month2.month)), 17, _hoisted_5$4)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [$data.currentView === "date" ? (openBlock(), createElementBlock("button", mergeProps({
- key: 0,
- type: "button",
- onClick: _cache[5] || (_cache[5] = function() {
- return $options.switchToMonthView && $options.switchToMonthView.apply($options, arguments);
- }),
- onKeydown: _cache[6] || (_cache[6] = function() {
- return $options.onContainerButtonKeydown && $options.onContainerButtonKeydown.apply($options, arguments);
- }),
- "class": _ctx.cx("selectMonth"),
- disabled: $options.switchViewButtonDisabled,
- "aria-label": _ctx.$primevue.config.locale.chooseMonth,
- ref_for: true
- }, _ctx.ptm("selectMonth"), {
- "data-pc-group-section": "view"
- }), toDisplayString($options.getMonthName(month2.month)), 17, _hoisted_6$2)) : createCommentVNode("", true), $data.currentView !== "year" ? (openBlock(), createElementBlock("button", mergeProps({
- key: 1,
- type: "button",
- onClick: _cache[7] || (_cache[7] = function() {
- return $options.switchToYearView && $options.switchToYearView.apply($options, arguments);
- }),
- onKeydown: _cache[8] || (_cache[8] = function() {
- return $options.onContainerButtonKeydown && $options.onContainerButtonKeydown.apply($options, arguments);
- }),
- "class": _ctx.cx("selectYear"),
- disabled: $options.switchViewButtonDisabled,
- "aria-label": _ctx.$primevue.config.locale.chooseYear,
- ref_for: true
- }, _ctx.ptm("selectYear"), {
- "data-pc-group-section": "view"
- }), toDisplayString($options.getYear(month2)), 17, _hoisted_7$2)) : createCommentVNode("", true)], 64)), $data.currentView === "year" ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- "class": _ctx.cx("decade"),
- ref_for: true
- }, _ctx.ptm("decade")), [renderSlot(_ctx.$slots, "decade", {
- years: $options.yearPickerValues
- }, function() {
- return [createTextVNode(toDisplayString($options.yearPickerValues[0].value) + " - " + toDisplayString($options.yearPickerValues[$options.yearPickerValues.length - 1].value), 1)];
- })], 16)) : createCommentVNode("", true)], 16), withDirectives(createVNode(_component_Button, mergeProps({
- ref_for: true,
- ref: $options.nextButtonRef,
- "class": _ctx.cx("pcNextButton"),
- disabled: _ctx.disabled,
- "aria-label": $data.currentView === "year" ? _ctx.$primevue.config.locale.nextDecade : $data.currentView === "month" ? _ctx.$primevue.config.locale.nextYear : _ctx.$primevue.config.locale.nextMonth,
- unstyled: _ctx.unstyled,
- onClick: $options.onNextButtonClick,
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.navigatorButtonProps, {
- pt: _ctx.ptm("pcNextButton"),
- "data-pc-group-section": "navigator"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "nexticon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon ? "span" : "ChevronRightIcon"), mergeProps({
- "class": [_ctx.nextIcon, slotProps["class"]],
- ref_for: true
- }, _ctx.ptm("pcNextButton")["icon"]), null, 16, ["class"]))];
- })];
- }),
- _: 2
- }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, _ctx.numberOfMonths === 1 ? true : groupIndex === _ctx.numberOfMonths - 1]])], 16), $data.currentView === "date" ? (openBlock(), createElementBlock("table", mergeProps({
- key: 0,
- "class": _ctx.cx("dayView"),
- role: "grid",
- ref_for: true
- }, _ctx.ptm("dayView")), [createBaseVNode("thead", mergeProps({
- ref_for: true
- }, _ctx.ptm("tableHeader")), [createBaseVNode("tr", mergeProps({
- ref_for: true
- }, _ctx.ptm("tableHeaderRow")), [_ctx.showWeek ? (openBlock(), createElementBlock("th", mergeProps({
- key: 0,
- scope: "col",
- "class": _ctx.cx("weekHeader"),
- ref_for: true
- }, _ctx.ptm("weekHeader", {
- context: {
- disabled: _ctx.showWeek
- }
- }), {
- "data-p-disabled": _ctx.showWeek,
- "data-pc-group-section": "tableheadercell"
- }), [renderSlot(_ctx.$slots, "weekheaderlabel", {}, function() {
- return [createBaseVNode("span", mergeProps({
- ref_for: true
- }, _ctx.ptm("weekHeaderLabel", {
- context: {
- disabled: _ctx.showWeek
- }
- }), {
- "data-pc-group-section": "tableheadercelllabel"
- }), toDisplayString($options.weekHeaderLabel), 17)];
- })], 16, _hoisted_8$2)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList($options.weekDays, function(weekDay) {
- return openBlock(), createElementBlock("th", mergeProps({
- key: weekDay,
- scope: "col",
- abbr: weekDay,
- ref_for: true
- }, _ctx.ptm("tableHeaderCell"), {
- "data-pc-group-section": "tableheadercell",
- "class": _ctx.cx("weekDayCell")
- }), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("weekDay"),
- ref_for: true
- }, _ctx.ptm("weekDay"), {
- "data-pc-group-section": "tableheadercelllabel"
- }), toDisplayString(weekDay), 17)], 16, _hoisted_9);
- }), 128))], 16)], 16), createBaseVNode("tbody", mergeProps({
- ref_for: true
- }, _ctx.ptm("tableBody")), [(openBlock(true), createElementBlock(Fragment, null, renderList(month2.dates, function(week, i) {
- return openBlock(), createElementBlock("tr", mergeProps({
- key: week[0].day + "" + week[0].month,
- ref_for: true
- }, _ctx.ptm("tableBodyRow")), [_ctx.showWeek ? (openBlock(), createElementBlock("td", mergeProps({
- key: 0,
- "class": _ctx.cx("weekNumber"),
- ref_for: true
- }, _ctx.ptm("weekNumber"), {
- "data-pc-group-section": "tablebodycell"
- }), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("weekLabelContainer"),
- ref_for: true
- }, _ctx.ptm("weekLabelContainer", {
- context: {
- disabled: _ctx.showWeek
- }
- }), {
- "data-p-disabled": _ctx.showWeek,
- "data-pc-group-section": "tablebodycelllabel"
- }), [renderSlot(_ctx.$slots, "weeklabel", {
- weekNumber: month2.weekNumbers[i]
- }, function() {
- return [month2.weekNumbers[i] < 10 ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- style: {
- "visibility": "hidden"
- },
- ref_for: true
- }, _ctx.ptm("weekLabel")), "0", 16)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(month2.weekNumbers[i]), 1)];
- })], 16, _hoisted_10)], 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(week, function(date) {
- return openBlock(), createElementBlock("td", mergeProps({
- key: date.day + "" + date.month,
- "aria-label": date.day,
- "class": _ctx.cx("dayCell", {
- date
- }),
- ref_for: true
- }, _ctx.ptm("dayCell", {
- context: {
- date,
- today: date.today,
- otherMonth: date.otherMonth,
- selected: $options.isSelected(date),
- disabled: !date.selectable
- }
- }), {
- "data-p-today": date.today,
- "data-p-other-month": date.otherMonth,
- "data-pc-group-section": "tablebodycell"
- }), [_ctx.showOtherMonths || !date.otherMonth ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("day", {
- date
- }),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onDateSelect($event, date);
- }, "onClick"),
- draggable: "false",
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onDateCellKeydown($event, date, groupIndex);
- }, "onKeydown"),
- "aria-selected": $options.isSelected(date),
- "aria-disabled": !date.selectable,
- ref_for: true
- }, _ctx.ptm("day", {
- context: {
- date,
- today: date.today,
- otherMonth: date.otherMonth,
- selected: $options.isSelected(date),
- disabled: !date.selectable
- }
- }), {
- "data-p-disabled": !date.selectable,
- "data-p-selected": $options.isSelected(date),
- "data-pc-group-section": "tablebodycelllabel"
- }), [renderSlot(_ctx.$slots, "date", {
- date
- }, function() {
- return [createTextVNode(toDisplayString(date.day), 1)];
- })], 16, _hoisted_12)), [[_directive_ripple]]) : createCommentVNode("", true), $options.isSelected(date) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": "p-hidden-accessible",
- "aria-live": "polite",
- ref_for: true
- }, _ctx.ptm("hiddenSelectedDay"), {
- "data-p-hidden-accessible": true
- }), toDisplayString(date.day), 17)) : createCommentVNode("", true)], 16, _hoisted_11);
- }), 128))], 16);
- }), 128))], 16)], 16)) : createCommentVNode("", true)], 16);
- }), 128))], 16), $data.currentView === "month" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("monthView")
- }, _ctx.ptm("monthView")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.monthPickerValues, function(m, i) {
- return withDirectives((openBlock(), createElementBlock("span", mergeProps({
- key: m,
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onMonthSelect($event, {
- month: m,
- index: i
- });
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onMonthCellKeydown($event, {
- month: m,
- index: i
- });
- }, "onKeydown"),
- "class": _ctx.cx("month", {
- month: m,
- index: i
- }),
- ref_for: true
- }, _ctx.ptm("month", {
- context: {
- month: m,
- monthIndex: i,
- selected: $options.isMonthSelected(i),
- disabled: !m.selectable
- }
- }), {
- "data-p-disabled": !m.selectable,
- "data-p-selected": $options.isMonthSelected(i)
- }), [createTextVNode(toDisplayString(m.value) + " ", 1), $options.isMonthSelected(i) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": "p-hidden-accessible",
- "aria-live": "polite",
- ref_for: true
- }, _ctx.ptm("hiddenMonth"), {
- "data-p-hidden-accessible": true
- }), toDisplayString(m.value), 17)) : createCommentVNode("", true)], 16, _hoisted_13)), [[_directive_ripple]]);
- }), 128))], 16)) : createCommentVNode("", true), $data.currentView === "year" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("yearView")
- }, _ctx.ptm("yearView")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.yearPickerValues, function(y) {
- return withDirectives((openBlock(), createElementBlock("span", mergeProps({
- key: y.value,
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onYearSelect($event, y);
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onYearCellKeydown($event, y);
- }, "onKeydown"),
- "class": _ctx.cx("year", {
- year: y
- }),
- ref_for: true
- }, _ctx.ptm("year", {
- context: {
- year: y,
- selected: $options.isYearSelected(y.value),
- disabled: !y.selectable
- }
- }), {
- "data-p-disabled": !y.selectable,
- "data-p-selected": $options.isYearSelected(y.value)
- }), [createTextVNode(toDisplayString(y.value) + " ", 1), $options.isYearSelected(y.value) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": "p-hidden-accessible",
- "aria-live": "polite",
- ref_for: true
- }, _ctx.ptm("hiddenYear"), {
- "data-p-hidden-accessible": true
- }), toDisplayString(y.value), 17)) : createCommentVNode("", true)], 16, _hoisted_14)), [[_directive_ripple]]);
- }), 128))], 16)) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), (_ctx.showTime || _ctx.timeOnly) && $data.currentView === "date" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("timePicker")
- }, _ctx.ptm("timePicker")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("hourPicker")
- }, _ctx.ptm("hourPicker"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcIncrementButton"),
- "aria-label": _ctx.$primevue.config.locale.nextHour,
- unstyled: _ctx.unstyled,
- onMousedown: _cache[9] || (_cache[9] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, 1);
- }),
- onMouseup: _cache[10] || (_cache[10] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[12] || (_cache[12] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, 1);
- }, ["enter"])), _cache[13] || (_cache[13] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, 1);
- }, ["space"]))],
- onMouseleave: _cache[11] || (_cache[11] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[14] || (_cache[14] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[15] || (_cache[15] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcIncrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "incrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon ? "span" : "ChevronUpIcon"), mergeProps({
- "class": [_ctx.incrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcIncrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "unstyled", "onKeydown", "pt"]), createBaseVNode("span", mergeProps(_ctx.ptm("hour"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString($options.formattedCurrentHour), 17), createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcDecrementButton"),
- "aria-label": _ctx.$primevue.config.locale.prevHour,
- unstyled: _ctx.unstyled,
- onMousedown: _cache[16] || (_cache[16] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, -1);
- }),
- onMouseup: _cache[17] || (_cache[17] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[19] || (_cache[19] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, -1);
- }, ["enter"])), _cache[20] || (_cache[20] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 0, -1);
- }, ["space"]))],
- onMouseleave: _cache[18] || (_cache[18] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[21] || (_cache[21] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[22] || (_cache[22] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcDecrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "decrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.decrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcDecrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "unstyled", "onKeydown", "pt"])], 16), createBaseVNode("div", mergeProps(_ctx.ptm("separatorContainer"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createBaseVNode("span", mergeProps(_ctx.ptm("separator"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString(_ctx.timeSeparator), 17)], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("minutePicker")
- }, _ctx.ptm("minutePicker"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcIncrementButton"),
- "aria-label": _ctx.$primevue.config.locale.nextMinute,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onMousedown: _cache[23] || (_cache[23] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, 1);
- }),
- onMouseup: _cache[24] || (_cache[24] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[26] || (_cache[26] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, 1);
- }, ["enter"])), _cache[27] || (_cache[27] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, 1);
- }, ["space"]))],
- onMouseleave: _cache[25] || (_cache[25] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[28] || (_cache[28] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[29] || (_cache[29] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcIncrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "incrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon ? "span" : "ChevronUpIcon"), mergeProps({
- "class": [_ctx.incrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcIncrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "unstyled", "onKeydown", "pt"]), createBaseVNode("span", mergeProps(_ctx.ptm("minute"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString($options.formattedCurrentMinute), 17), createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcDecrementButton"),
- "aria-label": _ctx.$primevue.config.locale.prevMinute,
- disabled: _ctx.disabled,
- onMousedown: _cache[30] || (_cache[30] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, -1);
- }),
- onMouseup: _cache[31] || (_cache[31] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[33] || (_cache[33] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, -1);
- }, ["enter"])), _cache[34] || (_cache[34] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 1, -1);
- }, ["space"]))],
- onMouseleave: _cache[32] || (_cache[32] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[35] || (_cache[35] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[36] || (_cache[36] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcDecrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "decrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.decrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcDecrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "onKeydown", "pt"])], 16), _ctx.showSeconds ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("separatorContainer")
- }, _ctx.ptm("separatorContainer"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createBaseVNode("span", mergeProps(_ctx.ptm("separator"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString(_ctx.timeSeparator), 17)], 16)) : createCommentVNode("", true), _ctx.showSeconds ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("secondPicker")
- }, _ctx.ptm("secondPicker"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcIncrementButton"),
- "aria-label": _ctx.$primevue.config.locale.nextSecond,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onMousedown: _cache[37] || (_cache[37] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, 1);
- }),
- onMouseup: _cache[38] || (_cache[38] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[40] || (_cache[40] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, 1);
- }, ["enter"])), _cache[41] || (_cache[41] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, 1);
- }, ["space"]))],
- onMouseleave: _cache[39] || (_cache[39] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[42] || (_cache[42] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[43] || (_cache[43] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcIncrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "incrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon ? "span" : "ChevronUpIcon"), mergeProps({
- "class": [_ctx.incrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcIncrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "unstyled", "onKeydown", "pt"]), createBaseVNode("span", mergeProps(_ctx.ptm("second"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString($options.formattedCurrentSecond), 17), createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcDecrementButton"),
- "aria-label": _ctx.$primevue.config.locale.prevSecond,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onMousedown: _cache[44] || (_cache[44] = function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, -1);
- }),
- onMouseup: _cache[45] || (_cache[45] = function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }),
- onKeydown: [$options.onContainerButtonKeydown, _cache[47] || (_cache[47] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, -1);
- }, ["enter"])), _cache[48] || (_cache[48] = withKeys(function($event) {
- return $options.onTimePickerElementMouseDown($event, 2, -1);
- }, ["space"]))],
- onMouseleave: _cache[46] || (_cache[46] = function($event) {
- return $options.onTimePickerElementMouseLeave();
- }),
- onKeyup: [_cache[49] || (_cache[49] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["enter"])), _cache[50] || (_cache[50] = withKeys(function($event) {
- return $options.onTimePickerElementMouseUp($event);
- }, ["space"]))]
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcDecrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "decrementicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.decrementIcon, slotProps["class"]]
- }, _ctx.ptm("pcDecrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "unstyled", "onKeydown", "pt"])], 16)) : createCommentVNode("", true), _ctx.hourFormat == "12" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 2,
- "class": _ctx.cx("separatorContainer")
- }, _ctx.ptm("separatorContainer"), {
- "data-pc-group-section": "timepickerContainer"
- }), [createBaseVNode("span", mergeProps(_ctx.ptm("separator"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString(_ctx.timeSeparator), 17)], 16)) : createCommentVNode("", true), _ctx.hourFormat == "12" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 3,
- "class": _ctx.cx("ampmPicker")
- }, _ctx.ptm("ampmPicker")), [createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcIncrementButton"),
- "aria-label": _ctx.$primevue.config.locale.am,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onClick: _cache[51] || (_cache[51] = function($event) {
- return $options.toggleAMPM($event);
- }),
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcIncrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "incrementicon", {
- "class": normalizeClass(_ctx.cx("incrementIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon ? "span" : "ChevronUpIcon"), mergeProps({
- "class": [_ctx.cx("incrementIcon"), slotProps["class"]]
- }, _ctx.ptm("pcIncrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "unstyled", "onKeydown", "pt"]), createBaseVNode("span", mergeProps(_ctx.ptm("ampm"), {
- "data-pc-group-section": "timepickerlabel"
- }), toDisplayString($data.pm ? _ctx.$primevue.config.locale.pm : _ctx.$primevue.config.locale.am), 17), createVNode(_component_Button, mergeProps({
- "class": _ctx.cx("pcDecrementButton"),
- "aria-label": _ctx.$primevue.config.locale.pm,
- disabled: _ctx.disabled,
- onClick: _cache[52] || (_cache[52] = function($event) {
- return $options.toggleAMPM($event);
- }),
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.timepickerButtonProps, {
- pt: _ctx.ptm("pcDecrementButton"),
- "data-pc-group-section": "timepickerbutton"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "decrementicon", {
- "class": normalizeClass(_ctx.cx("decrementIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.cx("decrementIcon"), slotProps["class"]]
- }, _ctx.ptm("pcDecrementButton")["icon"], {
- "data-pc-group-section": "timepickerlabel"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "disabled", "onKeydown", "pt"])], 16)) : createCommentVNode("", true)], 16)) : createCommentVNode("", true), _ctx.showButtonBar ? (openBlock(), createElementBlock("div", mergeProps({
- key: 2,
- "class": _ctx.cx("buttonbar")
- }, _ctx.ptm("buttonbar")), [createVNode(_component_Button, mergeProps({
- label: $options.todayLabel,
- onClick: _cache[53] || (_cache[53] = function($event) {
- return $options.onTodayButtonClick($event);
- }),
- "class": _ctx.cx("pcTodayButton"),
- unstyled: _ctx.unstyled,
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.todayButtonProps, {
- pt: _ctx.ptm("pcTodayButton"),
- "data-pc-group-section": "button"
- }), null, 16, ["label", "class", "unstyled", "onKeydown", "pt"]), createVNode(_component_Button, mergeProps({
- label: $options.clearLabel,
- onClick: _cache[54] || (_cache[54] = function($event) {
- return $options.onClearButtonClick($event);
- }),
- "class": _ctx.cx("pcClearButton"),
- unstyled: _ctx.unstyled,
- onKeydown: $options.onContainerButtonKeydown
- }, _ctx.clearButtonProps, {
- pt: _ctx.ptm("pcClearButton"),
- "data-pc-group-section": "button"
- }), null, 16, ["label", "class", "unstyled", "onKeydown", "pt"])], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "footer")], 16, _hoisted_3$h)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onAfterEnter", "onAfterLeave", "onLeave"])];
- }),
- _: 3
- }, 8, ["appendTo", "disabled"])], 16, _hoisted_1$s);
-}
-__name(render$V, "render$V");
-script$12.render = render$V;
-var script$11 = {
- name: "Calendar",
- "extends": script$12,
- mounted: /* @__PURE__ */ __name(function mounted6() {
- console.warn("Deprecated since v4. Use DatePicker component instead.");
- }, "mounted")
-};
-var CalendarStyle = BaseStyle.extend({
- name: "calendar"
-});
-var theme$y = /* @__PURE__ */ __name(function theme5(_ref) {
- var dt = _ref.dt;
- return "\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n background: ".concat(dt("cascadeselect.background"), ";\n border: 1px solid ").concat(dt("cascadeselect.border.color"), ";\n transition: background ").concat(dt("cascadeselect.transition.duration"), ", color ").concat(dt("cascadeselect.transition.duration"), ", border-color ").concat(dt("cascadeselect.transition.duration"), ", outline-color ").concat(dt("cascadeselect.transition.duration"), ", box-shadow ").concat(dt("cascadeselect.transition.duration"), ";\n border-radius: ").concat(dt("cascadeselect.border.radius"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("cascadeselect.shadow"), ";\n}\n\n.p-cascadeselect:not(.p-disabled):hover {\n border-color: ").concat(dt("cascadeselect.hover.border.color"), ";\n}\n\n.p-cascadeselect:not(.p-disabled).p-focus {\n border-color: ").concat(dt("cascadeselect.focus.border.color"), ";\n box-shadow: ").concat(dt("cascadeselect.focus.ring.shadow"), ";\n outline: ").concat(dt("cascadeselect.focus.ring.width"), " ").concat(dt("cascadeselect.focus.ring.style"), " ").concat(dt("cascadeselect.focus.ring.color"), ";\n outline-offset: ").concat(dt("cascadeselect.focus.ring.offset"), ";\n}\n\n.p-cascadeselect.p-variant-filled {\n background: ").concat(dt("cascadeselect.filled.background"), ";\n}\n\n.p-cascadeselect.p-variant-filled:not(.p-disabled):hover {\n background: ").concat(dt("cascadeselect.filled.hover.background"), ";\n}\n\n.p-cascadeselect.p-variant-filled.p-focus {\n background: ").concat(dt("cascadeselect.filled.focus.background"), ";\n}\n\n.p-cascadeselect.p-invalid {\n border-color: ").concat(dt("cascadeselect.invalid.border.color"), ";\n}\n\n.p-cascadeselect.p-disabled {\n opacity: 1;\n background: ").concat(dt("cascadeselect.disabled.background"), ";\n}\n\n.p-cascadeselect-dropdown {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n background: transparent;\n color: ").concat(dt("cascadeselect.dropdown.color"), ";\n width: ").concat(dt("cascadeselect.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("border.radius.md"), ";\n border-end-end-radius: ").concat(dt("border.radius.md"), ";\n}\n\n.p-cascadeselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n color: ").concat(dt("cascadeselect.clear.icon.color"), ";\n inset-inline-end: ").concat(dt("cascadeselect.dropdown.width"), ";\n}\n\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n padding: ").concat(dt("cascadeselect.padding.y"), " ").concat(dt("cascadeselect.padding.x"), ";\n background: transparent;\n border: 0 none;\n outline: 0 none;\n}\n\n.p-cascadeselect-label.p-placeholder {\n color: ").concat(dt("cascadeselect.placeholder.color"), ";\n}\n\n.p-cascadeselect.p-invalid .p-cascadeselect-label.p-placeholder {\n color: ").concat(dt("cascadeselect.invalid.placeholder.color"), ";\n}\n\n.p-cascadeselect.p-disabled .p-cascadeselect-label {\n color: ").concat(dt("cascadeselect.disabled.color"), ";\n}\n\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-cascadeselect-fluid {\n display: flex;\n}\n\n.p-cascadeselect-fluid .p-cascadeselect-label {\n width: 1%;\n}\n\n.p-cascadeselect-overlay {\n background: ").concat(dt("cascadeselect.overlay.background"), ";\n color: ").concat(dt("cascadeselect.overlay.color"), ";\n border: 1px solid ").concat(dt("cascadeselect.overlay.border.color"), ";\n border-radius: ").concat(dt("cascadeselect.overlay.border.radius"), ";\n box-shadow: ").concat(dt("cascadeselect.overlay.shadow"), ";\n}\n\n.p-cascadeselect .p-cascadeselect-overlay {\n min-width: 100%;\n}\n\n.p-cascadeselect-option-list {\n display: none;\n min-width: 100%;\n position: absolute;\n z-index: 1;\n}\n\n.p-cascadeselect-list {\n min-width: 100%;\n margin: 0;\n padding: 0;\n list-style-type: none;\n padding: ").concat(dt("cascadeselect.list.padding"), ";\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("cascadeselect.list.gap"), ";\n}\n\n.p-cascadeselect-option {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n border: 0 none;\n color: ").concat(dt("cascadeselect.option.color"), ";\n background: transparent;\n border-radius: ").concat(dt("cascadeselect.option.border.radius"), ";\n}\n\n.p-cascadeselect-option-active {\n overflow: visible;\n}\n\n.p-cascadeselect-option-active > .p-cascadeselect-option-content {\n background: ").concat(dt("cascadeselect.option.focus.background"), ";\n color: ").concat(dt("cascadeselect.option.focus.color"), ";\n}\n\n.p-cascadeselect-option:not(.p-cascadeselect-option-selected):not(.p-disabled).p-focus > .p-cascadeselect-option-content {\n background: ").concat(dt("cascadeselect.option.focus.background"), ";\n color: ").concat(dt("cascadeselect.option.focus.color"), ";\n}\n\n.p-cascadeselect-option:not(.p-cascadeselect-option-selected):not(.p-disabled).p-focus > .p-cascadeselect-option-content > .p-cascadeselect-group-icon-container > .p-cascadeselect-group-icon {\n color: ").concat(dt("cascadeselect.option.icon.focus.color"), ";\n}\n\n.p-cascadeselect-option-selected > .p-cascadeselect-option-content {\n background: ").concat(dt("cascadeselect.option.selected.background"), ";\n color: ").concat(dt("cascadeselect.option.selected.color"), ";\n}\n\n.p-cascadeselect-option-selected.p-focus > .p-cascadeselect-option-content {\n background: ").concat(dt("cascadeselect.option.selected.focus.background"), ";\n color: ").concat(dt("cascadeselect.option.selected.focus.color"), ";\n}\n\n.p-cascadeselect-option-active > .p-cascadeselect-option-list {\n inset-inline-start: 100%;\n inset-block-start: 0;\n}\n\n.p-cascadeselect-option-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n overflow: hidden;\n position: relative;\n padding: ").concat(dt("cascadeselect.option.padding"), ";\n border-radius: ").concat(dt("cascadeselect.option.border.radius"), ";\n transition: background ").concat(dt("cascadeselect.transition.duration"), ", color ").concat(dt("cascadeselect.transition.duration"), ", border-color ").concat(dt("cascadeselect.transition.duration"), ", box-shadow ").concat(dt("cascadeselect.transition.duration"), ", outline-color ").concat(dt("cascadeselect.transition.duration"), ";\n}\n\n.p-cascadeselect-group-icon {\n font-size: ").concat(dt("cascadeselect.option.icon.size"), ";\n width: ").concat(dt("cascadeselect.option.icon.size"), ";\n height: ").concat(dt("cascadeselect.option.icon.size"), ";\n color: ").concat(dt("cascadeselect.option.icon.color"), ";\n}\n\n.p-cascadeselect-group-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n\n.p-cascadeselect-mobile-active .p-cascadeselect-option-list {\n position: static;\n box-shadow: none;\n border: 0 none;\n padding-inline-start: ").concat(dt("tieredmenu.submenu.mobile.indent"), ";\n padding-inline-end: 0;\n}\n\n.p-cascadeselect-mobile-active .p-cascadeselect-group-icon {\n transition: transform 0.2s;\n transform: rotate(90deg);\n}\n\n.p-cascadeselect-mobile-active .p-cascadeselect-option-active > .p-cascadeselect-option-content .p-cascadeselect-group-icon {\n transform: rotate(-90deg);\n}\n\n.p-cascadeselect-sm .p-cascadeselect-label {\n font-size: ").concat(dt("cascadeselect.sm.font.size"), ";\n padding-block: ").concat(dt("cascadeselect.sm.padding.y"), ";\n padding-inline: ").concat(dt("cascadeselect.sm.padding.x"), ";\n}\n\n.p-cascadeselect-sm .p-cascadeselect-dropdown .p-icon {\n font-size: ").concat(dt("cascadeselect.sm.font.size"), ";\n width: ").concat(dt("cascadeselect.sm.font.size"), ";\n height: ").concat(dt("cascadeselect.sm.font.size"), ";\n}\n\n.p-cascadeselect-lg .p-cascadeselect-label {\n font-size: ").concat(dt("cascadeselect.lg.font.size"), ";\n padding-block: ").concat(dt("cascadeselect.lg.padding.y"), ";\n padding-inline: ").concat(dt("cascadeselect.lg.padding.x"), ";\n}\n\n.p-cascadeselect-lg .p-cascadeselect-dropdown .p-icon {\n font-size: ").concat(dt("cascadeselect.lg.font.size"), ";\n width: ").concat(dt("cascadeselect.lg.font.size"), ";\n height: ").concat(dt("cascadeselect.lg.font.size"), ";\n}\n");
-}, "theme");
-var inlineStyles$7 = {
- root: /* @__PURE__ */ __name(function root5(_ref2) {
- var props = _ref2.props;
- return {
- position: props.appendTo === "self" ? "relative" : void 0
- };
- }, "root")
-};
-var classes$C = {
- root: /* @__PURE__ */ __name(function root6(_ref3) {
- var instance = _ref3.instance, props = _ref3.props;
- return ["p-cascadeselect p-component p-inputwrapper", {
- "p-cascadeselect-mobile": instance.queryMatches,
- "p-disabled": props.disabled,
- "p-invalid": instance.$invalid,
- "p-variant-filled": instance.$variant === "filled",
- "p-focus": instance.focused,
- "p-inputwrapper-filled": instance.$filled,
- "p-inputwrapper-focus": instance.focused || instance.overlayVisible,
- "p-cascadeselect-open": instance.overlayVisible,
- "p-cascadeselect-fluid": instance.$fluid,
- "p-cascadeselect-sm p-inputfield-sm": props.size === "small",
- "p-cascadeselect-lg p-inputfield-lg": props.size === "large"
- }];
- }, "root"),
- label: /* @__PURE__ */ __name(function label2(_ref4) {
- var instance = _ref4.instance, props = _ref4.props;
- return ["p-cascadeselect-label", {
- "p-placeholder": instance.label === props.placeholder,
- "p-cascadeselect-label-empty": !instance.$slots["value"] && (instance.label === "p-emptylabel" || instance.label.length === 0)
- }];
- }, "label"),
- clearIcon: "p-cascadeselect-clear-icon",
- dropdown: "p-cascadeselect-dropdown",
- loadingIcon: "p-cascadeselect-loading-icon",
- dropdownIcon: "p-cascadeselect-dropdown-icon",
- overlay: /* @__PURE__ */ __name(function overlay(_ref5) {
- var instance = _ref5.instance;
- return ["p-cascadeselect-overlay p-component", {
- "p-cascadeselect-mobile-active": instance.queryMatches
- }];
- }, "overlay"),
- listContainer: "p-cascadeselect-list-container",
- list: "p-cascadeselect-list",
- option: /* @__PURE__ */ __name(function option(_ref6) {
- var instance = _ref6.instance, processedOption = _ref6.processedOption;
- return ["p-cascadeselect-option", {
- "p-cascadeselect-option-active": instance.isOptionActive(processedOption),
- "p-cascadeselect-option-selected": instance.isOptionSelected(processedOption),
- "p-focus": instance.isOptionFocused(processedOption),
- "p-disabled": instance.isOptionDisabled(processedOption)
- }];
- }, "option"),
- optionContent: "p-cascadeselect-option-content",
- optionText: "p-cascadeselect-option-text",
- groupIconContainer: "p-cascadeselect-group-icon-container",
- groupIcon: "p-cascadeselect-group-icon",
- optionList: "p-cascadeselect-overlay p-cascadeselect-option-list"
-};
-var CascadeSelectStyle = BaseStyle.extend({
- name: "cascadeselect",
- theme: theme$y,
- classes: classes$C,
- inlineStyles: inlineStyles$7
-});
-var script$2$8 = {
- name: "BaseCascadeSelect",
- "extends": script$1k,
- props: {
- options: Array,
- optionLabel: null,
- optionValue: null,
- optionDisabled: null,
- optionGroupLabel: null,
- optionGroupChildren: null,
- placeholder: String,
- breakpoint: {
- type: String,
- "default": "960px"
- },
- dataKey: null,
- showClear: {
- type: Boolean,
- "default": false
- },
- clearIcon: {
- type: String,
- "default": void 0
- },
- inputId: {
- type: String,
- "default": null
- },
- inputClass: {
- type: [String, Object],
- "default": null
- },
- inputStyle: {
- type: Object,
- "default": null
- },
- inputProps: {
- type: null,
- "default": null
- },
- panelClass: {
- type: [String, Object],
- "default": null
- },
- panelStyle: {
- type: Object,
- "default": null
- },
- panelProps: {
- type: null,
- "default": null
- },
- overlayClass: {
- type: [String, Object],
- "default": null
- },
- overlayStyle: {
- type: Object,
- "default": null
- },
- overlayProps: {
- type: null,
- "default": null
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- loading: {
- type: Boolean,
- "default": false
- },
- dropdownIcon: {
- type: String,
- "default": void 0
- },
- loadingIcon: {
- type: String,
- "default": void 0
- },
- optionGroupIcon: {
- type: String,
- "default": void 0
- },
- autoOptionFocus: {
- type: Boolean,
- "default": false
- },
- selectOnFocus: {
- type: Boolean,
- "default": false
- },
- focusOnHover: {
- type: Boolean,
- "default": true
- },
- searchLocale: {
- type: String,
- "default": void 0
- },
- searchMessage: {
- type: String,
- "default": null
- },
- selectionMessage: {
- type: String,
- "default": null
- },
- emptySelectionMessage: {
- type: String,
- "default": null
- },
- emptySearchMessage: {
- type: String,
- "default": null
- },
- emptyMessage: {
- type: String,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: CascadeSelectStyle,
- provide: /* @__PURE__ */ __name(function provide10() {
- return {
- $pcCascadeSelect: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$E = {
- name: "CascadeSelectSub",
- hostName: "CascadeSelect",
- "extends": script$1f,
- emits: ["option-change", "option-focus-change", "option-focus-enter-change"],
- container: null,
- props: {
- selectId: String,
- focusedOptionId: String,
- options: Array,
- optionLabel: String,
- optionValue: String,
- optionDisabled: null,
- optionGroupIcon: String,
- optionGroupLabel: String,
- optionGroupChildren: {
- type: [String, Array],
- "default": null
- },
- activeOptionPath: Array,
- level: Number,
- templates: null,
- value: null
- },
- methods: {
- getOptionId: /* @__PURE__ */ __name(function getOptionId(processedOption) {
- return "".concat(this.selectId, "_").concat(processedOption.key);
- }, "getOptionId"),
- getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel(processedOption) {
- return this.optionLabel ? resolveFieldData(processedOption.option, this.optionLabel) : processedOption.option;
- }, "getOptionLabel"),
- getOptionValue: /* @__PURE__ */ __name(function getOptionValue(processedOption) {
- return this.optionValue ? resolveFieldData(processedOption.option, this.optionValue) : processedOption.option;
- }, "getOptionValue"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions(processedOption, index, key) {
- return this.ptm(key, {
- context: {
- option: processedOption,
- index,
- level: this.level,
- optionGroup: this.isOptionGroup(processedOption),
- active: this.isOptionActive(processedOption),
- focused: this.isOptionFocused(processedOption),
- disabled: this.isOptionDisabled(processedOption)
- }
- });
- }, "getPTOptions"),
- isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled(processedOption) {
- return this.optionDisabled ? resolveFieldData(processedOption.option, this.optionDisabled) : false;
- }, "isOptionDisabled"),
- getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel(processedOption) {
- return this.optionGroupLabel ? resolveFieldData(processedOption.option, this.optionGroupLabel) : null;
- }, "getOptionGroupLabel"),
- getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren(processedOption) {
- return processedOption.children;
- }, "getOptionGroupChildren"),
- isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup(processedOption) {
- return isNotEmpty(processedOption.children);
- }, "isOptionGroup"),
- isOptionSelected: /* @__PURE__ */ __name(function isOptionSelected(processedOption) {
- return equals(this.value, processedOption === null || processedOption === void 0 ? void 0 : processedOption.option);
- }, "isOptionSelected"),
- isOptionActive: /* @__PURE__ */ __name(function isOptionActive(processedOption) {
- return this.activeOptionPath.some(function(path) {
- return path.key === processedOption.key;
- });
- }, "isOptionActive"),
- isOptionFocused: /* @__PURE__ */ __name(function isOptionFocused(processedOption) {
- return this.focusedOptionId === this.getOptionId(processedOption);
- }, "isOptionFocused"),
- getOptionLabelToRender: /* @__PURE__ */ __name(function getOptionLabelToRender(processedOption) {
- return this.isOptionGroup(processedOption) ? this.getOptionGroupLabel(processedOption) : this.getOptionLabel(processedOption);
- }, "getOptionLabelToRender"),
- onOptionClick: /* @__PURE__ */ __name(function onOptionClick(event2, processedOption) {
- this.$emit("option-change", {
- originalEvent: event2,
- processedOption,
- isFocus: true
- });
- }, "onOptionClick"),
- onOptionMouseEnter: /* @__PURE__ */ __name(function onOptionMouseEnter(event2, processedOption) {
- this.$emit("option-focus-enter-change", {
- originalEvent: event2,
- processedOption
- });
- }, "onOptionMouseEnter"),
- onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove(event2, processedOption) {
- this.$emit("option-focus-change", {
- originalEvent: event2,
- processedOption
- });
- }, "onOptionMouseMove"),
- containerRef: /* @__PURE__ */ __name(function containerRef(el) {
- this.container = el;
- }, "containerRef"),
- listAriaLabel: /* @__PURE__ */ __name(function listAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.listLabel : void 0;
- }, "listAriaLabel")
- },
- directives: {
- ripple: Ripple
- },
- components: {
- AngleRightIcon: script$1o
- }
-};
-var _hoisted_1$1$6 = ["id", "aria-label", "aria-selected", "aria-expanded", "aria-level", "aria-setsize", "aria-posinset", "data-p-option-group", "data-p-active", "data-p-focus", "data-p-disabled"];
-var _hoisted_2$k = ["onClick", "onMouseenter", "onMousemove"];
-function render$1$8(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_AngleRightIcon = resolveComponent("AngleRightIcon");
- var _component_CascadeSelectSub = resolveComponent("CascadeSelectSub", true);
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("ul", mergeProps({
- ref: $options.containerRef,
- "class": _ctx.cx("list")
- }, $props.level === 0 ? _ctx.ptm("list") : _ctx.ptm("optionList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.options, function(processedOption, index) {
- return openBlock(), createElementBlock("li", mergeProps({
- key: $options.getOptionLabelToRender(processedOption),
- id: $options.getOptionId(processedOption),
- "class": _ctx.cx("option", {
- processedOption
- }),
- role: "treeitem",
- "aria-label": $options.getOptionLabelToRender(processedOption),
- "aria-selected": $options.isOptionGroup(processedOption) ? void 0 : $options.isOptionSelected(processedOption),
- "aria-expanded": $options.isOptionGroup(processedOption) ? $options.isOptionActive(processedOption) : void 0,
- "aria-level": $props.level + 1,
- "aria-setsize": $props.options.length,
- "aria-posinset": index + 1,
- ref_for: true
- }, $options.getPTOptions(processedOption, index, "option"), {
- "data-p-option-group": $options.isOptionGroup(processedOption),
- "data-p-active": $options.isOptionActive(processedOption),
- "data-p-focus": $options.isOptionFocused(processedOption),
- "data-p-disabled": $options.isOptionDisabled(processedOption)
- }), [withDirectives((openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("optionContent"),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onOptionClick($event, processedOption);
- }, "onClick"),
- onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) {
- return $options.onOptionMouseEnter($event, processedOption);
- }, "onMouseenter"),
- onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
- return $options.onOptionMouseMove($event, processedOption);
- }, "onMousemove"),
- ref_for: true
- }, $options.getPTOptions(processedOption, index, "optionContent")), [$props.templates["option"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["option"]), {
- key: 0,
- option: processedOption.option,
- selected: $options.isOptionGroup(processedOption) ? false : $options.isOptionSelected(processedOption)
- }, null, 8, ["option", "selected"])) : (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": _ctx.cx("optionText"),
- ref_for: true
- }, $options.getPTOptions(processedOption, index, "optionText")), toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (openBlock(), createElementBlock("span", {
- key: 2,
- "class": normalizeClass(_ctx.cx("groupIconContainer"))
- }, [$props.templates["optiongroupicon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["optiongroupicon"]), {
- key: 0,
- "class": normalizeClass(_ctx.cx("groupIcon"))
- }, null, 8, ["class"])) : $props.optionGroupIcon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": [_ctx.cx("groupIcon"), $props.optionGroupIcon],
- "aria-hidden": "true",
- ref_for: true
- }, $options.getPTOptions(processedOption, index, "groupIcon")), null, 16)) : (openBlock(), createBlock(_component_AngleRightIcon, mergeProps({
- key: 2,
- "class": _ctx.cx("groupIcon"),
- "aria-hidden": "true",
- ref_for: true
- }, $options.getPTOptions(processedOption, index, "groupIcon")), null, 16, ["class"]))], 2)) : createCommentVNode("", true)], 16, _hoisted_2$k)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (openBlock(), createBlock(_component_CascadeSelectSub, {
- key: 0,
- role: "group",
- "class": normalizeClass(_ctx.cx("optionList")),
- selectId: $props.selectId,
- focusedOptionId: $props.focusedOptionId,
- options: $options.getOptionGroupChildren(processedOption),
- activeOptionPath: $props.activeOptionPath,
- level: $props.level + 1,
- templates: $props.templates,
- optionLabel: $props.optionLabel,
- optionValue: $props.optionValue,
- optionDisabled: $props.optionDisabled,
- optionGroupIcon: $props.optionGroupIcon,
- optionGroupLabel: $props.optionGroupLabel,
- optionGroupChildren: $props.optionGroupChildren,
- value: $props.value,
- onOptionChange: _cache[0] || (_cache[0] = function($event) {
- return _ctx.$emit("option-change", $event);
- }),
- onOptionFocusChange: _cache[1] || (_cache[1] = function($event) {
- return _ctx.$emit("option-focus-change", $event);
- }),
- onOptionFocusEnterChange: _cache[2] || (_cache[2] = function($event) {
- return _ctx.$emit("option-focus-enter-change", $event);
- }),
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["class", "selectId", "focusedOptionId", "options", "activeOptionPath", "level", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "value", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1$6);
- }), 128))], 16);
-}
-__name(render$1$8, "render$1$8");
-script$1$E.render = render$1$8;
-function _typeof$1$3(o) {
- "@babel/helpers - typeof";
- return _typeof$1$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$1$3(o);
-}
-__name(_typeof$1$3, "_typeof$1$3");
-function ownKeys$1$2(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$1$2, "ownKeys$1$2");
-function _objectSpread$1$2(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$1$2(Object(t2), true).forEach(function(r2) {
- _defineProperty$1$3(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1$2(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$1$2, "_objectSpread$1$2");
-function _defineProperty$1$3(e, r, t2) {
- return (r = _toPropertyKey$1$3(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$1$3, "_defineProperty$1$3");
-function _toPropertyKey$1$3(t2) {
- var i = _toPrimitive$1$3(t2, "string");
- return "symbol" == _typeof$1$3(i) ? i : i + "";
-}
-__name(_toPropertyKey$1$3, "_toPropertyKey$1$3");
-function _toPrimitive$1$3(t2, r) {
- if ("object" != _typeof$1$3(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$1$3(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$1$3, "_toPrimitive$1$3");
-var script$10 = {
- name: "CascadeSelect",
- "extends": script$2$8,
- inheritAttrs: false,
- emits: ["change", "focus", "blur", "click", "group-change", "before-show", "before-hide", "hide", "show"],
- outsideClickListener: null,
- matchMediaListener: null,
- scrollHandler: null,
- resizeListener: null,
- overlay: null,
- searchTimeout: null,
- searchValue: null,
- data: /* @__PURE__ */ __name(function data3() {
- return {
- id: this.$attrs.id,
- clicked: false,
- focused: false,
- focusedOptionInfo: {
- index: -1,
- level: 0,
- parentKey: ""
- },
- activeOptionPath: [],
- overlayVisible: false,
- dirty: false,
- mobileActive: false,
- query: null,
- queryMatches: false
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId2(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- options: /* @__PURE__ */ __name(function options() {
- this.autoUpdateModel();
- }, "options")
- },
- mounted: /* @__PURE__ */ __name(function mounted7() {
- this.id = this.id || UniqueComponentId();
- this.autoUpdateModel();
- this.bindMatchMediaListener();
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() {
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- this.unbindMatchMediaListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- if (this.overlay) {
- ZIndex.clear(this.overlay);
- this.overlay = null;
- }
- if (this.mobileActive) {
- this.mobileActive = false;
- }
- }, "beforeUnmount"),
- methods: {
- getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel2(option4) {
- return this.optionLabel ? resolveFieldData(option4, this.optionLabel) : option4;
- }, "getOptionLabel"),
- getOptionValue: /* @__PURE__ */ __name(function getOptionValue2(option4) {
- return this.optionValue ? resolveFieldData(option4, this.optionValue) : option4;
- }, "getOptionValue"),
- isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled2(option4) {
- return this.optionDisabled ? resolveFieldData(option4, this.optionDisabled) : false;
- }, "isOptionDisabled"),
- getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel2(optionGroup) {
- return this.optionGroupLabel ? resolveFieldData(optionGroup, this.optionGroupLabel) : null;
- }, "getOptionGroupLabel"),
- getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren2(optionGroup, level) {
- return isString(this.optionGroupChildren) ? resolveFieldData(optionGroup, this.optionGroupChildren) : resolveFieldData(optionGroup, this.optionGroupChildren[level]);
- }, "getOptionGroupChildren"),
- isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup2(option4, level) {
- return Object.prototype.hasOwnProperty.call(option4, this.optionGroupChildren[level]);
- }, "isOptionGroup"),
- getProccessedOptionLabel: /* @__PURE__ */ __name(function getProccessedOptionLabel() {
- var processedOption = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- var grouped = this.isProccessedOptionGroup(processedOption);
- return grouped ? this.getOptionGroupLabel(processedOption.option, processedOption.level) : this.getOptionLabel(processedOption.option);
- }, "getProccessedOptionLabel"),
- isProccessedOptionGroup: /* @__PURE__ */ __name(function isProccessedOptionGroup(processedOption) {
- return isNotEmpty(processedOption === null || processedOption === void 0 ? void 0 : processedOption.children);
- }, "isProccessedOptionGroup"),
- show: /* @__PURE__ */ __name(function show(isFocus) {
- this.$emit("before-show");
- this.overlayVisible = true;
- this.activeOptionPath = this.$filled ? this.findOptionPathByValue(this.d_value) : this.activeOptionPath;
- if (this.$filled && isNotEmpty(this.activeOptionPath)) {
- var processedOption = this.activeOptionPath[this.activeOptionPath.length - 1];
- this.focusedOptionInfo = {
- index: processedOption.index,
- level: processedOption.level,
- parentKey: processedOption.parentKey
- };
- } else {
- this.focusedOptionInfo = {
- index: this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex(),
- level: 0,
- parentKey: ""
- };
- }
- isFocus && focus(this.$refs.focusInput);
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide(isFocus) {
- var _this = this;
- var _hide = /* @__PURE__ */ __name(function _hide2() {
- _this.$emit("before-hide");
- _this.overlayVisible = false;
- _this.clicked = false;
- _this.activeOptionPath = [];
- _this.focusedOptionInfo = {
- index: -1,
- level: 0,
- parentKey: ""
- };
- isFocus && focus(_this.$refs.focusInput);
- }, "_hide");
- setTimeout(function() {
- _hide();
- }, 0);
- }, "hide"),
- onFocus: /* @__PURE__ */ __name(function onFocus3(event2) {
- if (this.disabled) {
- return;
- }
- this.focused = true;
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur2(event2) {
- var _this$formField$onBlu, _this$formField;
- this.focused = false;
- this.focusedOptionInfo = {
- index: -1,
- level: 0,
- parentKey: ""
- };
- this.searchValue = "";
- this.$emit("blur", event2);
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event2) {
- if (this.disabled || this.loading) {
- event2.preventDefault();
- return;
- }
- var metaKey = event2.metaKey || event2.ctrlKey;
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "ArrowLeft":
- this.onArrowLeftKey(event2);
- break;
- case "ArrowRight":
- this.onArrowRightKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Space":
- this.onSpaceKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Tab":
- this.onTabKey(event2);
- break;
- case "PageDown":
- case "PageUp":
- case "Backspace":
- case "ShiftLeft":
- case "ShiftRight":
- break;
- default:
- if (!metaKey && isPrintableCharacter(event2.key)) {
- !this.overlayVisible && this.show();
- this.searchOptions(event2, event2.key);
- }
- break;
- }
- this.clicked = false;
- }, "onKeyDown"),
- onOptionChange: /* @__PURE__ */ __name(function onOptionChange(event2) {
- var processedOption = event2.processedOption, type = event2.type;
- if (isEmpty(processedOption)) return;
- var index = processedOption.index, key = processedOption.key, level = processedOption.level, parentKey = processedOption.parentKey, children = processedOption.children;
- var grouped = isNotEmpty(children);
- var activeOptionPath = this.activeOptionPath.filter(function(p) {
- return p.parentKey !== parentKey && p.parentKey !== key;
- });
- this.focusedOptionInfo = {
- index,
- level,
- parentKey
- };
- if (type == "hover" && this.queryMatches) {
- return;
- }
- if (grouped) {
- activeOptionPath.push(processedOption);
- }
- this.activeOptionPath = activeOptionPath;
- }, "onOptionChange"),
- onOptionClick: /* @__PURE__ */ __name(function onOptionClick2(event2) {
- var originalEvent = event2.originalEvent, processedOption = event2.processedOption, isFocus = event2.isFocus, isHide = event2.isHide, preventSelection = event2.preventSelection;
- var index = processedOption.index, key = processedOption.key, level = processedOption.level, parentKey = processedOption.parentKey;
- var grouped = this.isProccessedOptionGroup(processedOption);
- var selected3 = this.isSelected(processedOption);
- if (selected3) {
- this.activeOptionPath = this.activeOptionPath.filter(function(p) {
- return key !== p.key && key.startsWith(p.key);
- });
- this.focusedOptionInfo = {
- index,
- level,
- parentKey
- };
- } else {
- if (grouped) {
- this.onOptionChange(event2);
- this.onOptionGroupSelect(originalEvent, processedOption);
- } else {
- var activeOptionPath = this.activeOptionPath.filter(function(p) {
- return p.parentKey !== parentKey;
- });
- activeOptionPath.push(processedOption);
- this.focusedOptionInfo = {
- index,
- level,
- parentKey
- };
- if (!preventSelection || (processedOption === null || processedOption === void 0 ? void 0 : processedOption.children.length) !== 0) {
- this.activeOptionPath = activeOptionPath;
- this.onOptionSelect(originalEvent, processedOption, isHide);
- }
- }
- }
- isFocus && focus(this.$refs.focusInput);
- }, "onOptionClick"),
- onOptionMouseEnter: /* @__PURE__ */ __name(function onOptionMouseEnter2(event2) {
- if (this.focusOnHover) {
- if (this.dirty || !this.dirty && isNotEmpty(this.d_value)) {
- this.onOptionChange(_objectSpread$1$2(_objectSpread$1$2({}, event2), {}, {
- type: "hover"
- }));
- } else if (!this.dirty && event2.processedOption.level === 0) {
- this.onOptionClick(_objectSpread$1$2(_objectSpread$1$2({}, event2), {}, {
- type: "hover"
- }));
- }
- }
- }, "onOptionMouseEnter"),
- onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove2(event2) {
- if (this.focused && this.focusOnHover) {
- this.changeFocusedOptionIndex(event2, event2.processedOption.index);
- }
- }, "onOptionMouseMove"),
- onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect(event2, processedOption) {
- var isHide = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
- var value2 = this.getOptionValue(processedOption === null || processedOption === void 0 ? void 0 : processedOption.option);
- this.activeOptionPath.forEach(function(p) {
- return p.selected = true;
- });
- this.updateModel(event2, value2);
- isHide && this.hide(true);
- }, "onOptionSelect"),
- onOptionGroupSelect: /* @__PURE__ */ __name(function onOptionGroupSelect(event2, processedOption) {
- this.dirty = true;
- this.$emit("group-change", {
- originalEvent: event2,
- value: processedOption.option
- });
- }, "onOptionGroupSelect"),
- onContainerClick: /* @__PURE__ */ __name(function onContainerClick(event2) {
- if (this.disabled || this.loading) {
- return;
- }
- if (event2.target.getAttribute("data-pc-section") === "clearicon" || event2.target.closest('[data-pc-section="clearicon"]')) {
- return;
- } else if (!this.overlay || !this.overlay.contains(event2.target)) {
- this.overlayVisible ? this.hide() : this.show();
- focus(this.$refs.focusInput);
- }
- this.clicked = true;
- this.$emit("click", event2);
- }, "onContainerClick"),
- onClearClick: /* @__PURE__ */ __name(function onClearClick(event2) {
- this.updateModel(event2, null);
- }, "onClearClick"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick2(event2) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.$el
- });
- }, "onOverlayClick"),
- onOverlayKeyDown: /* @__PURE__ */ __name(function onOverlayKeyDown2(event2) {
- switch (event2.code) {
- case "Escape":
- this.onEscapeKey(event2);
- break;
- }
- }, "onOverlayKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey2(event2) {
- if (!this.overlayVisible) {
- this.show();
- } else {
- var optionIndex = this.focusedOptionInfo.index !== -1 ? this.findNextOptionIndex(this.focusedOptionInfo.index) : this.clicked ? this.findFirstOptionIndex() : this.findFirstFocusedOptionIndex();
- this.changeFocusedOptionIndex(event2, optionIndex, true);
- }
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey2(event2) {
- if (event2.altKey) {
- if (this.focusedOptionInfo.index !== -1) {
- var processedOption = this.visibleOptions[this.focusedOptionInfo.index];
- var grouped = this.isProccessedOptionGroup(processedOption);
- !grouped && this.onOptionChange({
- originalEvent: event2,
- processedOption
- });
- }
- this.overlayVisible && this.hide();
- event2.preventDefault();
- } else {
- var optionIndex = this.focusedOptionInfo.index !== -1 ? this.findPrevOptionIndex(this.focusedOptionInfo.index) : this.clicked ? this.findLastOptionIndex() : this.findLastFocusedOptionIndex();
- this.changeFocusedOptionIndex(event2, optionIndex, true);
- !this.overlayVisible && this.show();
- event2.preventDefault();
- }
- }, "onArrowUpKey"),
- onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey(event2) {
- var _this2 = this;
- if (this.overlayVisible) {
- var processedOption = this.visibleOptions[this.focusedOptionInfo.index];
- var parentOption = this.activeOptionPath.find(function(p) {
- return p.key === (processedOption === null || processedOption === void 0 ? void 0 : processedOption.parentKey);
- });
- var matched = this.focusedOptionInfo.parentKey === "" || parentOption && parentOption.key === this.focusedOptionInfo.parentKey;
- var root34 = isEmpty(processedOption === null || processedOption === void 0 ? void 0 : processedOption.parent);
- if (matched) {
- this.activeOptionPath = this.activeOptionPath.filter(function(p) {
- return p.parentKey !== _this2.focusedOptionInfo.parentKey;
- });
- }
- if (!root34) {
- this.focusedOptionInfo = {
- index: -1,
- parentKey: parentOption ? parentOption.parentKey : ""
- };
- this.searchValue = "";
- this.onArrowDownKey(event2);
- }
- event2.preventDefault();
- }
- }, "onArrowLeftKey"),
- onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey(event2) {
- if (this.overlayVisible) {
- var processedOption = this.visibleOptions[this.focusedOptionInfo.index];
- var grouped = this.isProccessedOptionGroup(processedOption);
- if (grouped) {
- var matched = this.activeOptionPath.some(function(p) {
- return (processedOption === null || processedOption === void 0 ? void 0 : processedOption.key) === p.key;
- });
- if (matched) {
- this.focusedOptionInfo = {
- index: -1,
- parentKey: processedOption === null || processedOption === void 0 ? void 0 : processedOption.key
- };
- this.searchValue = "";
- this.onArrowDownKey(event2);
- } else {
- this.onOptionChange({
- originalEvent: event2,
- processedOption
- });
- }
- }
- event2.preventDefault();
- }
- }, "onArrowRightKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey2(event2) {
- this.changeFocusedOptionIndex(event2, this.findFirstOptionIndex());
- !this.overlayVisible && this.show();
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey2(event2) {
- this.changeFocusedOptionIndex(event2, this.findLastOptionIndex());
- !this.overlayVisible && this.show();
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey2(event2) {
- if (!this.overlayVisible) {
- this.focusedOptionInfo.index !== -1;
- this.onArrowDownKey(event2);
- } else {
- if (this.focusedOptionInfo.index !== -1) {
- var processedOption = this.visibleOptions[this.focusedOptionInfo.index];
- var grouped = this.isProccessedOptionGroup(processedOption);
- this.onOptionClick({
- originalEvent: event2,
- processedOption,
- preventSelection: false
- });
- !grouped && this.hide();
- }
- }
- event2.preventDefault();
- }, "onEnterKey"),
- onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event2) {
- this.onEnterKey(event2);
- }, "onSpaceKey"),
- onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey(event2) {
- this.overlayVisible && this.hide(true);
- event2.preventDefault();
- }, "onEscapeKey"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey(event2) {
- if (this.focusedOptionInfo.index !== -1) {
- var processedOption = this.visibleOptions[this.focusedOptionInfo.index];
- var grouped = this.isProccessedOptionGroup(processedOption);
- !grouped && this.onOptionChange({
- originalEvent: event2,
- processedOption
- });
- }
- this.overlayVisible && this.hide();
- }, "onTabKey"),
- onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter2(el) {
- ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
- addStyle(el, {
- position: "absolute",
- top: "0",
- left: "0"
- });
- this.alignOverlay();
- this.scrollInView();
- }, "onOverlayEnter"),
- onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter() {
- this.bindOutsideClickListener();
- this.bindScrollListener();
- this.bindResizeListener();
- this.$emit("show");
- }, "onOverlayAfterEnter"),
- onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave2() {
- this.unbindOutsideClickListener();
- this.unbindScrollListener();
- this.unbindResizeListener();
- this.$emit("hide");
- this.overlay = null;
- this.dirty = false;
- }, "onOverlayLeave"),
- onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave2(el) {
- ZIndex.clear(el);
- }, "onOverlayAfterLeave"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay2() {
- if (this.appendTo === "self") {
- relativePosition(this.overlay, this.$el);
- } else {
- this.overlay.style.minWidth = getOuterWidth(this.$el) + "px";
- absolutePosition(this.overlay, this.$el);
- }
- }, "alignOverlay"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener2() {
- var _this3 = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- if (_this3.overlayVisible && _this3.overlay && !_this3.$el.contains(event2.target) && !_this3.overlay.contains(event2.target)) {
- _this3.hide();
- }
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener2() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener2() {
- var _this4 = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
- if (_this4.overlayVisible) {
- _this4.hide();
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener2() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener2() {
- var _this5 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this5.overlayVisible && !isTouchDevice()) {
- _this5.hide();
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener2() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener2() {
- var _this6 = this;
- if (!this.matchMediaListener) {
- var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
- this.query = query;
- this.queryMatches = query.matches;
- this.matchMediaListener = function() {
- _this6.queryMatches = query.matches;
- _this6.mobileActive = false;
- };
- this.query.addEventListener("change", this.matchMediaListener);
- }
- }, "bindMatchMediaListener"),
- unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener2() {
- if (this.matchMediaListener) {
- this.query.removeEventListener("change", this.matchMediaListener);
- this.matchMediaListener = null;
- }
- }, "unbindMatchMediaListener"),
- isOptionMatched: /* @__PURE__ */ __name(function isOptionMatched(processedOption) {
- var _this$getProccessedOp;
- return this.isValidOption(processedOption) && ((_this$getProccessedOp = this.getProccessedOptionLabel(processedOption)) === null || _this$getProccessedOp === void 0 ? void 0 : _this$getProccessedOp.toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale)));
- }, "isOptionMatched"),
- isValidOption: /* @__PURE__ */ __name(function isValidOption(processedOption) {
- return isNotEmpty(processedOption) && !this.isOptionDisabled(processedOption.option);
- }, "isValidOption"),
- isValidSelectedOption: /* @__PURE__ */ __name(function isValidSelectedOption(processedOption) {
- return this.isValidOption(processedOption) && this.isSelected(processedOption);
- }, "isValidSelectedOption"),
- isSelected: /* @__PURE__ */ __name(function isSelected2(processedOption) {
- return this.activeOptionPath.some(function(p) {
- return p.key === processedOption.key;
- });
- }, "isSelected"),
- findFirstOptionIndex: /* @__PURE__ */ __name(function findFirstOptionIndex() {
- var _this7 = this;
- return this.visibleOptions.findIndex(function(processedOption) {
- return _this7.isValidOption(processedOption);
- });
- }, "findFirstOptionIndex"),
- findLastOptionIndex: /* @__PURE__ */ __name(function findLastOptionIndex() {
- var _this8 = this;
- return findLastIndex(this.visibleOptions, function(processedOption) {
- return _this8.isValidOption(processedOption);
- });
- }, "findLastOptionIndex"),
- findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex(index) {
- var _this9 = this;
- var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function(processedOption) {
- return _this9.isValidOption(processedOption);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
- }, "findNextOptionIndex"),
- findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex(index) {
- var _this10 = this;
- var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function(processedOption) {
- return _this10.isValidOption(processedOption);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex : index;
- }, "findPrevOptionIndex"),
- findSelectedOptionIndex: /* @__PURE__ */ __name(function findSelectedOptionIndex() {
- var _this11 = this;
- return this.visibleOptions.findIndex(function(processedOption) {
- return _this11.isValidSelectedOption(processedOption);
- });
- }, "findSelectedOptionIndex"),
- findFirstFocusedOptionIndex: /* @__PURE__ */ __name(function findFirstFocusedOptionIndex() {
- var selectedIndex = this.findSelectedOptionIndex();
- return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
- }, "findFirstFocusedOptionIndex"),
- findLastFocusedOptionIndex: /* @__PURE__ */ __name(function findLastFocusedOptionIndex() {
- var selectedIndex = this.findSelectedOptionIndex();
- return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
- }, "findLastFocusedOptionIndex"),
- findOptionPathByValue: /* @__PURE__ */ __name(function findOptionPathByValue(value2, processedOptions2) {
- var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
- processedOptions2 = processedOptions2 || level === 0 && this.processedOptions;
- if (!processedOptions2) return null;
- if (isEmpty(value2)) return [];
- for (var i = 0; i < processedOptions2.length; i++) {
- var processedOption = processedOptions2[i];
- if (equals(value2, this.getOptionValue(processedOption.option), this.equalityKey)) {
- return [processedOption];
- }
- var matchedOptions = this.findOptionPathByValue(value2, processedOption.children, level + 1);
- if (matchedOptions) {
- matchedOptions.unshift(processedOption);
- return matchedOptions;
- }
- }
- }, "findOptionPathByValue"),
- searchOptions: /* @__PURE__ */ __name(function searchOptions(event2, _char) {
- var _this12 = this;
- this.searchValue = (this.searchValue || "") + _char;
- var optionIndex = -1;
- var matched = false;
- if (isNotEmpty(this.searchValue)) {
- if (this.focusedOptionInfo.index !== -1) {
- optionIndex = this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex(function(processedOption) {
- return _this12.isOptionMatched(processedOption);
- });
- optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionInfo.index).findIndex(function(processedOption) {
- return _this12.isOptionMatched(processedOption);
- }) : optionIndex + this.focusedOptionInfo.index;
- } else {
- optionIndex = this.visibleOptions.findIndex(function(processedOption) {
- return _this12.isOptionMatched(processedOption);
- });
- }
- if (optionIndex !== -1) {
- matched = true;
- }
- if (optionIndex === -1 && this.focusedOptionInfo.index === -1) {
- optionIndex = this.findFirstFocusedOptionIndex();
- }
- if (optionIndex !== -1) {
- this.changeFocusedOptionIndex(event2, optionIndex);
- }
- }
- if (this.searchTimeout) {
- clearTimeout(this.searchTimeout);
- }
- this.searchTimeout = setTimeout(function() {
- _this12.searchValue = "";
- _this12.searchTimeout = null;
- }, 500);
- return matched;
- }, "searchOptions"),
- changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex(event2, index, preventSelection) {
- if (this.focusedOptionInfo.index !== index) {
- this.focusedOptionInfo.index = index;
- this.scrollInView();
- if (this.focusOnHover) {
- this.onOptionClick({
- originalEvent: event2,
- processedOption: this.visibleOptions[index],
- isHide: false,
- preventSelection
- });
- }
- if (this.selectOnFocus) {
- this.onOptionChange({
- originalEvent: event2,
- processedOption: this.visibleOptions[index],
- isHide: false
- });
- }
- }
- }, "changeFocusedOptionIndex"),
- scrollInView: /* @__PURE__ */ __name(function scrollInView2() {
- var _this13 = this;
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
- this.$nextTick(function() {
- var id4 = index !== -1 ? "".concat(_this13.id, "_").concat(index) : _this13.focusedOptionId;
- var element = findSingle(_this13.list, 'li[id="'.concat(id4, '"]'));
- if (element) {
- element.scrollIntoView && element.scrollIntoView({
- block: "nearest",
- inline: "start"
- });
- }
- });
- }, "scrollInView"),
- autoUpdateModel: /* @__PURE__ */ __name(function autoUpdateModel() {
- if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) {
- this.focusedOptionInfo.index = this.findFirstFocusedOptionIndex();
- this.onOptionChange({
- processedOption: this.visibleOptions[this.focusedOptionInfo.index],
- isHide: false
- });
- !this.overlayVisible && (this.focusedOptionInfo = {
- index: -1,
- level: 0,
- parentKey: ""
- });
- }
- }, "autoUpdateModel"),
- updateModel: /* @__PURE__ */ __name(function updateModel2(event2, value2) {
- this.writeValue(value2, event2);
- this.$emit("change", {
- originalEvent: event2,
- value: value2
- });
- }, "updateModel"),
- createProcessedOptions: /* @__PURE__ */ __name(function createProcessedOptions(options4) {
- var _this14 = this;
- var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
- var processedOptions2 = [];
- options4 && options4.forEach(function(option4, index) {
- var key = (parentKey !== "" ? parentKey + "_" : "") + index;
- var newOption = {
- option: option4,
- index,
- level,
- key,
- parent,
- parentKey
- };
- newOption["children"] = _this14.createProcessedOptions(_this14.getOptionGroupChildren(option4, level), level + 1, newOption, key);
- processedOptions2.push(newOption);
- });
- return processedOptions2;
- }, "createProcessedOptions"),
- overlayRef: /* @__PURE__ */ __name(function overlayRef2(el) {
- this.overlay = el;
- }, "overlayRef")
- },
- computed: {
- // @deprecated use $filled instead.
- hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption() {
- return this.$filled;
- }, "hasSelectedOption"),
- label: /* @__PURE__ */ __name(function label3() {
- var label12 = this.placeholder || "p-emptylabel";
- if (this.$filled) {
- var activeOptionPath = this.findOptionPathByValue(this.d_value);
- var processedOption = isNotEmpty(activeOptionPath) ? activeOptionPath[activeOptionPath.length - 1] : null;
- return processedOption ? this.getOptionLabel(processedOption.option) : label12;
- }
- return label12;
- }, "label"),
- processedOptions: /* @__PURE__ */ __name(function processedOptions() {
- return this.createProcessedOptions(this.options || []);
- }, "processedOptions"),
- visibleOptions: /* @__PURE__ */ __name(function visibleOptions() {
- var _this15 = this;
- var processedOption = this.activeOptionPath.find(function(p) {
- return p.key === _this15.focusedOptionInfo.parentKey;
- });
- return processedOption ? processedOption.children : this.processedOptions;
- }, "visibleOptions"),
- equalityKey: /* @__PURE__ */ __name(function equalityKey() {
- return this.optionValue ? null : this.dataKey;
- }, "equalityKey"),
- searchResultMessageText: /* @__PURE__ */ __name(function searchResultMessageText() {
- return isNotEmpty(this.visibleOptions) ? this.searchMessageText.replaceAll("{0}", this.visibleOptions.length) : this.emptySearchMessageText;
- }, "searchResultMessageText"),
- searchMessageText: /* @__PURE__ */ __name(function searchMessageText() {
- return this.searchMessage || this.$primevue.config.locale.searchMessage || "";
- }, "searchMessageText"),
- emptySearchMessageText: /* @__PURE__ */ __name(function emptySearchMessageText() {
- return this.emptySearchMessage || this.$primevue.config.locale.emptySearchMessage || "";
- }, "emptySearchMessageText"),
- emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText() {
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage || "";
- }, "emptyMessageText"),
- selectionMessageText: /* @__PURE__ */ __name(function selectionMessageText() {
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage || "";
- }, "selectionMessageText"),
- emptySelectionMessageText: /* @__PURE__ */ __name(function emptySelectionMessageText() {
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || "";
- }, "emptySelectionMessageText"),
- selectedMessageText: /* @__PURE__ */ __name(function selectedMessageText() {
- return this.$filled ? this.selectionMessageText.replaceAll("{0}", "1") : this.emptySelectionMessageText;
- }, "selectedMessageText"),
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId() {
- return this.focusedOptionInfo.index !== -1 ? "".concat(this.id).concat(isNotEmpty(this.focusedOptionInfo.parentKey) ? "_" + this.focusedOptionInfo.parentKey : "", "_").concat(this.focusedOptionInfo.index) : null;
- }, "focusedOptionId"),
- isClearIconVisible: /* @__PURE__ */ __name(function isClearIconVisible() {
- return this.showClear && this.d_value != null && isNotEmpty(this.options);
- }, "isClearIconVisible")
- },
- components: {
- CascadeSelectSub: script$1$E,
- Portal: script$1m,
- ChevronDownIcon: script$1h,
- SpinnerIcon: script$1p,
- AngleRightIcon: script$1o,
- TimesIcon: script$1q
- }
-};
-function _typeof$k(o) {
- "@babel/helpers - typeof";
- return _typeof$k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$k(o);
-}
-__name(_typeof$k, "_typeof$k");
-function ownKeys$i(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$i, "ownKeys$i");
-function _objectSpread$i(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$i(Object(t2), true).forEach(function(r2) {
- _defineProperty$j(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$i(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$i, "_objectSpread$i");
-function _defineProperty$j(e, r, t2) {
- return (r = _toPropertyKey$j(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$j, "_defineProperty$j");
-function _toPropertyKey$j(t2) {
- var i = _toPrimitive$j(t2, "string");
- return "symbol" == _typeof$k(i) ? i : i + "";
-}
-__name(_toPropertyKey$j, "_toPropertyKey$j");
-function _toPrimitive$j(t2, r) {
- if ("object" != _typeof$k(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$k(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$j, "_toPrimitive$j");
-var _hoisted_1$r = ["id", "disabled", "placeholder", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
-function render$U(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
- var _component_CascadeSelectSub = resolveComponent("CascadeSelectSub");
- var _component_Portal = resolveComponent("Portal");
- return openBlock(), createElementBlock("div", mergeProps({
- ref: "container",
- "class": _ctx.cx("root"),
- style: _ctx.sx("root"),
- onClick: _cache[5] || (_cache[5] = function($event) {
- return $options.onContainerClick($event);
- })
- }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenInputContainer"), {
- "data-p-hidden-accessible": true
- }), [createBaseVNode("input", mergeProps({
- ref: "focusInput",
- id: _ctx.inputId,
- type: "text",
- "class": _ctx.inputClass,
- style: _ctx.inputStyle,
- readonly: "",
- disabled: _ctx.disabled,
- placeholder: _ctx.placeholder,
- tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
- role: "combobox",
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-haspopup": "tree",
- "aria-expanded": $data.overlayVisible,
- "aria-controls": $data.id + "_tree",
- "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
- "aria-invalid": _ctx.invalid || void 0,
- onFocus: _cache[0] || (_cache[0] = function() {
- return $options.onFocus && $options.onFocus.apply($options, arguments);
- }),
- onBlur: _cache[1] || (_cache[1] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- })
- }, _objectSpread$i(_objectSpread$i({}, _ctx.inputProps), _ctx.ptm("hiddenInput"))), null, 16, _hoisted_1$r)], 16), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("label")
- }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "value", {
- value: _ctx.d_value,
- placeholder: _ctx.placeholder
- }, function() {
- return [createTextVNode(toDisplayString($options.label), 1)];
- })], 16), $options.isClearIconVisible ? renderSlot(_ctx.$slots, "clearicon", {
- key: 0,
- "class": normalizeClass(_ctx.cx("clearIcon")),
- clearCallback: $options.onClearClick
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon ? "i" : "TimesIcon"), mergeProps({
- ref: "clearIcon",
- "class": [_ctx.cx("clearIcon"), _ctx.clearIcon],
- onClick: $options.onClearClick
- }, _ctx.ptm("clearIcon"), {
- "data-pc-section": "clearicon"
- }), null, 16, ["class", "onClick"]))];
- }) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("dropdown"),
- role: "button",
- tabindex: "-1"
- }, _ctx.ptm("dropdown")), [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", {
- key: 0,
- "class": normalizeClass(_ctx.cx("loadingIcon"))
- }, function() {
- return [_ctx.loadingIcon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
- key: 1,
- "class": _ctx.cx("loadingIcon"),
- spin: "",
- "aria-hidden": "true"
- }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
- }) : renderSlot(_ctx.$slots, "dropdownicon", {
- key: 1,
- "class": normalizeClass(_ctx.cx("dropdownIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.cx("dropdownIcon"), _ctx.dropdownIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
- })], 16), createBaseVNode("span", mergeProps({
- role: "status",
- "aria-live": "polite",
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenSearchResult"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($options.searchResultMessageText), 17), createVNode(_component_Portal, {
- appendTo: _ctx.appendTo
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: $options.onOverlayEnter,
- onAfterEnter: $options.onOverlayAfterEnter,
- onLeave: $options.onOverlayLeave,
- onAfterLeave: $options.onOverlayAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.overlayRef,
- "class": [_ctx.cx("overlay"), _ctx.panelClass, _ctx.overlayClass],
- style: [_ctx.panelStyle, _ctx.overlayStyle],
- onClick: _cache[3] || (_cache[3] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- }),
- onKeydown: _cache[4] || (_cache[4] = function() {
- return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
- })
- }, _objectSpread$i(_objectSpread$i(_objectSpread$i({}, _ctx.panelProps), _ctx.overlayProps), _ctx.ptm("overlay"))), [renderSlot(_ctx.$slots, "header", {
- value: _ctx.d_value,
- options: _ctx.options
- }), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("listContainer")
- }, _ctx.ptm("listContainer")), [createVNode(_component_CascadeSelectSub, {
- id: $data.id + "_tree",
- role: "tree",
- "aria-orientation": "horizontal",
- selectId: $data.id,
- focusedOptionId: $data.focused ? $options.focusedOptionId : void 0,
- options: $options.processedOptions,
- activeOptionPath: $data.activeOptionPath,
- level: 0,
- templates: _ctx.$slots,
- optionLabel: _ctx.optionLabel,
- optionValue: _ctx.optionValue,
- optionDisabled: _ctx.optionDisabled,
- optionGroupIcon: _ctx.optionGroupIcon,
- optionGroupLabel: _ctx.optionGroupLabel,
- optionGroupChildren: _ctx.optionGroupChildren,
- value: _ctx.d_value,
- onOptionChange: $options.onOptionClick,
- onOptionFocusChange: $options.onOptionMouseMove,
- onOptionFocusEnterChange: $options.onOptionMouseEnter,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["id", "selectId", "focusedOptionId", "options", "activeOptionPath", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "value", "onOptionChange", "onOptionFocusChange", "onOptionFocusEnterChange", "pt", "unstyled"])], 16), createBaseVNode("span", mergeProps({
- role: "status",
- "aria-live": "polite",
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenSelectedMessage"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($options.selectedMessageText), 17), renderSlot(_ctx.$slots, "footer", {
- value: _ctx.d_value,
- options: _ctx.options
- })], 16)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
- }),
- _: 3
- }, 8, ["appendTo"])], 16);
-}
-__name(render$U, "render$U");
-script$10.render = render$U;
-var theme$x = /* @__PURE__ */ __name(function theme6(_ref) {
- _ref.dt;
- return "\n.p-checkbox-group {\n display: inline-flex;\n}\n";
-}, "theme");
-var classes$B = {
- root: "p-checkbox-group p-component"
-};
-var CheckboxGroupStyle = BaseStyle.extend({
- name: "checkboxgroup",
- theme: theme$x,
- classes: classes$B
-});
-var script$1$D = {
- name: "BaseCheckboxGroup",
- "extends": script$1r,
- style: CheckboxGroupStyle,
- provide: /* @__PURE__ */ __name(function provide11() {
- return {
- $pcCheckboxGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$$ = {
- name: "CheckboxGroup",
- "extends": script$1$D,
- inheritAttrs: false,
- data: /* @__PURE__ */ __name(function data4() {
- return {
- groupName: this.name
- };
- }, "data"),
- watch: {
- name: /* @__PURE__ */ __name(function name(newValue) {
- this.groupName = newValue || uuid("checkbox-group-");
- }, "name")
- },
- mounted: /* @__PURE__ */ __name(function mounted8() {
- this.groupName = this.groupName || uuid("checkbox-group-");
- }, "mounted")
-};
-function render$T(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$T, "render$T");
-script$$.render = render$T;
-var theme$w = /* @__PURE__ */ __name(function theme7(_ref) {
- var dt = _ref.dt;
- return "\n.p-inputchips {\n display: inline-flex;\n}\n\n.p-inputchips-input {\n margin: 0;\n list-style-type: none;\n cursor: text;\n overflow: hidden;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n padding: calc(".concat(dt("inputchips.padding.y"), " / 2) ").concat(dt("inputchips.padding.x"), ";\n gap: calc(").concat(dt("inputchips.padding.y"), " / 2);\n color: ").concat(dt("inputchips.color"), ";\n background: ").concat(dt("inputchips.background"), ";\n border: 1px solid ").concat(dt("inputchips.border.color"), ";\n border-radius: ").concat(dt("inputchips.border.radius"), ";\n width: 100%;\n transition: background ").concat(dt("inputchips.transition.duration"), ", color ").concat(dt("inputchips.transition.duration"), ", border-color ").concat(dt("inputchips.transition.duration"), ", outline-color ").concat(dt("inputchips.transition.duration"), ", box-shadow ").concat(dt("inputchips.transition.duration"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("inputchips.shadow"), ";\n}\n\n.p-inputchips:not(.p-disabled):hover .p-inputchips-input {\n border-color: ").concat(dt("inputchips.hover.border.color"), ";\n}\n\n.p-inputchips:not(.p-disabled).p-focus .p-inputchips-input {\n border-color: ").concat(dt("inputchips.focus.border.color"), ";\n box-shadow: ").concat(dt("inputchips.focus.ring.shadow"), ";\n outline: ").concat(dt("inputchips.focus.ring.width"), " ").concat(dt("inputchips.focus.ring.style"), " ").concat(dt("inputchips.focus.ring.color"), ";\n outline-offset: ").concat(dt("inputchips.focus.ring.offset"), ";\n}\n\n.p-inputchips.p-invalid .p-inputchips-input {\n border-color: ").concat(dt("inputchips.invalid.border.color"), ";\n}\n\n.p-variant-filled.p-inputchips-input {\n background: ").concat(dt("inputchips.filled.background"), ";\n}\n\n.p-inputchips:not(.p-disabled).p-focus .p-variant-filled.p-inputchips-input {\n background: ").concat(dt("inputchips.filled.focus.background"), ";\n}\n\n.p-inputchips.p-disabled .p-inputchips-input {\n opacity: 1;\n background: ").concat(dt("inputchips.disabled.background"), ";\n color: ").concat(dt("inputchips.disabled.color"), ";\n}\n\n.p-inputchips-chip.p-chip {\n padding-top: calc(").concat(dt("inputchips.padding.y"), " / 2);\n padding-bottom: calc(").concat(dt("inputchips.padding.y"), " / 2);\n border-radius: ").concat(dt("inputchips.chip.border.radius"), ";\n transition: background ").concat(dt("inputchips.transition.duration"), ", color ").concat(dt("inputchips.transition.duration"), ";\n}\n\n.p-inputchips-chip-item.p-focus .p-inputchips-chip {\n background: ").concat(dt("inputchips.chip.focus.background"), ";\n color: ").concat(dt("inputchips.chip.focus.color"), ";\n}\n\n.p-inputchips-input:has(.p-inputchips-chip) {\n padding-left: calc(").concat(dt("inputchips.padding.y"), " / 2);\n padding-right: calc(").concat(dt("inputchips.padding.y"), " / 2);\n}\n\n.p-inputchips-input-item {\n flex: 1 1 auto;\n display: inline-flex;\n padding-top: calc(").concat(dt("inputchips.padding.y"), " / 2);\n padding-bottom: calc(").concat(dt("inputchips.padding.y"), " / 2);\n}\n\n.p-inputchips-input-item input {\n border: 0 none;\n outline: 0 none;\n background: transparent;\n margin: 0;\n padding: 0;\n box-shadow: none;\n border-radius: 0;\n width: 100%;\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n color: inherit;\n}\n\n.p-inputchips-input-item input::placeholder {\n color: ").concat(dt("inputchips.placeholder.color"), ";\n}\n");
-}, "theme");
-var classes$A = {
- root: /* @__PURE__ */ __name(function root7(_ref2) {
- var instance = _ref2.instance, props = _ref2.props;
- return ["p-inputchips p-component p-inputwrapper", {
- "p-disabled": props.disabled,
- "p-invalid": props.invalid,
- "p-focus": instance.focused,
- "p-inputwrapper-filled": props.modelValue && props.modelValue.length || instance.inputValue && instance.inputValue.length,
- "p-inputwrapper-focus": instance.focused
- }];
- }, "root"),
- input: /* @__PURE__ */ __name(function input(_ref3) {
- var props = _ref3.props, instance = _ref3.instance;
- return ["p-inputchips-input", {
- "p-variant-filled": props.variant ? props.variant === "filled" : instance.$primevue.config.inputStyle === "filled" || instance.$primevue.config.inputVariant === "filled"
- }];
- }, "input"),
- chipItem: /* @__PURE__ */ __name(function chipItem(_ref4) {
- var state = _ref4.state, index = _ref4.index;
- return ["p-inputchips-chip-item", {
- "p-focus": state.focusedIndex === index
- }];
- }, "chipItem"),
- pcChip: "p-inputchips-chip",
- chipIcon: "p-inputchips-chip-icon",
- inputItem: "p-inputchips-input-item"
-};
-var InputChipsStyle = BaseStyle.extend({
- name: "inputchips",
- theme: theme$w,
- classes: classes$A
-});
-var script$1$C = {
- name: "BaseInputChips",
- "extends": script$1f,
- props: {
- modelValue: {
- type: Array,
- "default": null
- },
- max: {
- type: Number,
- "default": null
- },
- separator: {
- type: [String, Object],
- "default": null
- },
- addOnBlur: {
- type: Boolean,
- "default": null
- },
- allowDuplicate: {
- type: Boolean,
- "default": true
- },
- placeholder: {
- type: String,
- "default": null
- },
- variant: {
- type: String,
- "default": null
- },
- invalid: {
- type: Boolean,
- "default": false
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- inputId: {
- type: String,
- "default": null
- },
- inputClass: {
- type: [String, Object],
- "default": null
- },
- inputStyle: {
- type: Object,
- "default": null
- },
- inputProps: {
- type: null,
- "default": null
- },
- removeTokenIcon: {
- type: String,
- "default": void 0
- },
- chipIcon: {
- type: String,
- "default": void 0
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: InputChipsStyle,
- provide: /* @__PURE__ */ __name(function provide12() {
- return {
- $pcInputChips: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _toConsumableArray$c(r) {
- return _arrayWithoutHoles$c(r) || _iterableToArray$c(r) || _unsupportedIterableToArray$d(r) || _nonIterableSpread$c();
-}
-__name(_toConsumableArray$c, "_toConsumableArray$c");
-function _nonIterableSpread$c() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$c, "_nonIterableSpread$c");
-function _unsupportedIterableToArray$d(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$d(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$d(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$d, "_unsupportedIterableToArray$d");
-function _iterableToArray$c(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$c, "_iterableToArray$c");
-function _arrayWithoutHoles$c(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$d(r);
-}
-__name(_arrayWithoutHoles$c, "_arrayWithoutHoles$c");
-function _arrayLikeToArray$d(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$d, "_arrayLikeToArray$d");
-var script$_ = {
- name: "InputChips",
- "extends": script$1$C,
- inheritAttrs: false,
- emits: ["update:modelValue", "add", "remove", "focus", "blur"],
- data: /* @__PURE__ */ __name(function data5() {
- return {
- id: this.$attrs.id,
- inputValue: null,
- focused: false,
- focusedIndex: null
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId3(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId")
- },
- mounted: /* @__PURE__ */ __name(function mounted9() {
- console.warn("Deprecated since v4. Use AutoComplete component instead with its typeahead property.");
- this.id = this.id || UniqueComponentId();
- }, "mounted"),
- methods: {
- onWrapperClick: /* @__PURE__ */ __name(function onWrapperClick() {
- this.$refs.input.focus();
- }, "onWrapperClick"),
- onInput: /* @__PURE__ */ __name(function onInput2(event2) {
- this.inputValue = event2.target.value;
- this.focusedIndex = null;
- }, "onInput"),
- onFocus: /* @__PURE__ */ __name(function onFocus4(event2) {
- this.focused = true;
- this.focusedIndex = null;
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur3(event2) {
- this.focused = false;
- this.focusedIndex = null;
- if (this.addOnBlur) {
- this.addItem(event2, event2.target.value, false);
- }
- this.$emit("blur", event2);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown3(event2) {
- var inputValue = event2.target.value;
- switch (event2.code) {
- case "Backspace":
- if (inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
- if (this.focusedIndex !== null) {
- this.removeItem(event2, this.focusedIndex);
- } else this.removeItem(event2, this.modelValue.length - 1);
- }
- break;
- case "Enter":
- case "NumpadEnter":
- if (inputValue && inputValue.trim().length && !this.maxedOut) {
- this.addItem(event2, inputValue, true);
- }
- break;
- case "ArrowLeft":
- if (inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
- this.$refs.container.focus();
- }
- break;
- case "ArrowRight":
- event2.stopPropagation();
- break;
- default:
- if (this.separator) {
- if (this.separator === event2.key || event2.key.match(this.separator)) {
- this.addItem(event2, inputValue, true);
- }
- }
- break;
- }
- }, "onKeyDown"),
- onPaste: /* @__PURE__ */ __name(function onPaste(event2) {
- var _this = this;
- if (this.separator) {
- var separator = this.separator.replace("\\n", "\n").replace("\\r", "\r").replace("\\t", " ");
- var pastedData = (event2.clipboardData || window["clipboardData"]).getData("Text");
- if (pastedData) {
- var value2 = this.modelValue || [];
- var pastedValues = pastedData.split(separator);
- pastedValues = pastedValues.filter(function(val) {
- return _this.allowDuplicate || value2.indexOf(val) === -1;
- });
- value2 = [].concat(_toConsumableArray$c(value2), _toConsumableArray$c(pastedValues));
- this.updateModel(event2, value2, true);
- }
- }
- }, "onPaste"),
- onContainerFocus: /* @__PURE__ */ __name(function onContainerFocus() {
- this.focused = true;
- }, "onContainerFocus"),
- onContainerBlur: /* @__PURE__ */ __name(function onContainerBlur() {
- this.focusedIndex = -1;
- this.focused = false;
- }, "onContainerBlur"),
- onContainerKeyDown: /* @__PURE__ */ __name(function onContainerKeyDown(event2) {
- switch (event2.code) {
- case "ArrowLeft":
- this.onArrowLeftKeyOn(event2);
- break;
- case "ArrowRight":
- this.onArrowRightKeyOn(event2);
- break;
- case "Backspace":
- this.onBackspaceKeyOn(event2);
- break;
- }
- }, "onContainerKeyDown"),
- onArrowLeftKeyOn: /* @__PURE__ */ __name(function onArrowLeftKeyOn() {
- if (this.inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
- this.focusedIndex = this.focusedIndex === null ? this.modelValue.length - 1 : this.focusedIndex - 1;
- if (this.focusedIndex < 0) this.focusedIndex = 0;
- }
- }, "onArrowLeftKeyOn"),
- onArrowRightKeyOn: /* @__PURE__ */ __name(function onArrowRightKeyOn() {
- if (this.inputValue.length === 0 && this.modelValue && this.modelValue.length > 0) {
- if (this.focusedIndex === this.modelValue.length - 1) {
- this.focusedIndex = null;
- this.$refs.input.focus();
- } else {
- this.focusedIndex++;
- }
- }
- }, "onArrowRightKeyOn"),
- onBackspaceKeyOn: /* @__PURE__ */ __name(function onBackspaceKeyOn(event2) {
- if (this.focusedIndex !== null) {
- this.removeItem(event2, this.focusedIndex);
- }
- }, "onBackspaceKeyOn"),
- updateModel: /* @__PURE__ */ __name(function updateModel3(event2, value2, preventDefault) {
- var _this2 = this;
- this.$emit("update:modelValue", value2);
- this.$emit("add", {
- originalEvent: event2,
- value: value2
- });
- this.$refs.input.value = "";
- this.inputValue = "";
- setTimeout(function() {
- _this2.maxedOut && (_this2.focused = false);
- }, 0);
- if (preventDefault) {
- event2.preventDefault();
- }
- }, "updateModel"),
- addItem: /* @__PURE__ */ __name(function addItem(event2, item8, preventDefault) {
- if (item8 && item8.trim().length) {
- var value2 = this.modelValue ? _toConsumableArray$c(this.modelValue) : [];
- if (this.allowDuplicate || value2.indexOf(item8) === -1) {
- value2.push(item8);
- this.updateModel(event2, value2, preventDefault);
- }
- }
- }, "addItem"),
- removeItem: /* @__PURE__ */ __name(function removeItem(event2, index) {
- if (this.disabled) {
- return;
- }
- var values = _toConsumableArray$c(this.modelValue);
- var removedItem = values.splice(index, 1);
- this.focusedIndex = null;
- this.$refs.input.focus();
- this.$emit("update:modelValue", values);
- this.$emit("remove", {
- originalEvent: event2,
- value: removedItem
- });
- }, "removeItem")
- },
- computed: {
- maxedOut: /* @__PURE__ */ __name(function maxedOut() {
- return this.max && this.modelValue && this.max === this.modelValue.length;
- }, "maxedOut"),
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId2() {
- return this.focusedIndex !== null ? "".concat(this.id, "_inputchips_item_").concat(this.focusedIndex) : null;
- }, "focusedOptionId")
- },
- components: {
- Chip: script$1s
- }
-};
-function _typeof$j(o) {
- "@babel/helpers - typeof";
- return _typeof$j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$j(o);
-}
-__name(_typeof$j, "_typeof$j");
-function ownKeys$h(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$h, "ownKeys$h");
-function _objectSpread$h(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$h(Object(t2), true).forEach(function(r2) {
- _defineProperty$i(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$h(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$h, "_objectSpread$h");
-function _defineProperty$i(e, r, t2) {
- return (r = _toPropertyKey$i(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$i, "_defineProperty$i");
-function _toPropertyKey$i(t2) {
- var i = _toPrimitive$i(t2, "string");
- return "symbol" == _typeof$j(i) ? i : i + "";
-}
-__name(_toPropertyKey$i, "_toPropertyKey$i");
-function _toPrimitive$i(t2, r) {
- if ("object" != _typeof$j(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$j(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$i, "_toPrimitive$i");
-var _hoisted_1$q = ["aria-labelledby", "aria-label", "aria-activedescendant"];
-var _hoisted_2$j = ["id", "aria-label", "aria-setsize", "aria-posinset", "data-p-focused"];
-var _hoisted_3$g = ["id", "disabled", "placeholder", "aria-invalid"];
-function render$S(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Chip = resolveComponent("Chip");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("ul", mergeProps({
- ref: "container",
- "class": _ctx.cx("input"),
- tabindex: "-1",
- role: "listbox",
- "aria-orientation": "horizontal",
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel,
- "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
- onClick: _cache[5] || (_cache[5] = function($event) {
- return $options.onWrapperClick();
- }),
- onFocus: _cache[6] || (_cache[6] = function() {
- return $options.onContainerFocus && $options.onContainerFocus.apply($options, arguments);
- }),
- onBlur: _cache[7] || (_cache[7] = function() {
- return $options.onContainerBlur && $options.onContainerBlur.apply($options, arguments);
- }),
- onKeydown: _cache[8] || (_cache[8] = function() {
- return $options.onContainerKeyDown && $options.onContainerKeyDown.apply($options, arguments);
- })
- }, _ctx.ptm("input")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.modelValue, function(val, i) {
- return openBlock(), createElementBlock("li", mergeProps({
- key: "".concat(i, "_").concat(val),
- id: $data.id + "_inputchips_item_" + i,
- role: "option",
- "class": _ctx.cx("chipItem", {
- index: i
- }),
- "aria-label": val,
- "aria-selected": true,
- "aria-setsize": _ctx.modelValue.length,
- "aria-posinset": i + 1,
- ref_for: true
- }, _ctx.ptm("chipItem"), {
- "data-p-focused": $data.focusedIndex === i
- }), [renderSlot(_ctx.$slots, "chip", {
- "class": normalizeClass(_ctx.cx("pcChip")),
- index: i,
- value: val,
- removeCallback: /* @__PURE__ */ __name(function removeCallback(event2) {
- return _ctx.removeOption(event2, i);
- }, "removeCallback")
- }, function() {
- return [createVNode(_component_Chip, {
- "class": normalizeClass(_ctx.cx("pcChip")),
- label: val,
- removeIcon: _ctx.chipIcon || _ctx.removeTokenIcon,
- removable: "",
- unstyled: _ctx.unstyled,
- onRemove: /* @__PURE__ */ __name(function onRemove($event) {
- return $options.removeItem($event, i);
- }, "onRemove"),
- pt: _ctx.ptm("pcChip")
- }, {
- removeicon: withCtx(function() {
- return [renderSlot(_ctx.$slots, _ctx.$slots.chipicon ? "chipicon" : "removetokenicon", {
- "class": normalizeClass(_ctx.cx("chipIcon")),
- index: i,
- removeCallback: /* @__PURE__ */ __name(function removeCallback(event2) {
- return $options.removeItem(event2, i);
- }, "removeCallback")
- })];
- }),
- _: 2
- }, 1032, ["class", "label", "removeIcon", "unstyled", "onRemove", "pt"])];
- })], 16, _hoisted_2$j);
- }), 128)), createBaseVNode("li", mergeProps({
- "class": _ctx.cx("inputItem"),
- role: "option"
- }, _ctx.ptm("inputItem")), [createBaseVNode("input", mergeProps({
- ref: "input",
- id: _ctx.inputId,
- type: "text",
- "class": _ctx.inputClass,
- style: _ctx.inputStyle,
- disabled: _ctx.disabled || $options.maxedOut,
- placeholder: _ctx.placeholder,
- "aria-invalid": _ctx.invalid || void 0,
- onFocus: _cache[0] || (_cache[0] = function($event) {
- return $options.onFocus($event);
- }),
- onBlur: _cache[1] || (_cache[1] = function($event) {
- return $options.onBlur($event);
- }),
- onInput: _cache[2] || (_cache[2] = function() {
- return $options.onInput && $options.onInput.apply($options, arguments);
- }),
- onKeydown: _cache[3] || (_cache[3] = function($event) {
- return $options.onKeyDown($event);
- }),
- onPaste: _cache[4] || (_cache[4] = function($event) {
- return $options.onPaste($event);
- })
- }, _objectSpread$h(_objectSpread$h({}, _ctx.inputProps), _ctx.ptm("inputItemField"))), null, 16, _hoisted_3$g)], 16)], 16, _hoisted_1$q)], 16);
-}
-__name(render$S, "render$S");
-script$_.render = render$S;
-var script$Z = {
- name: "Chips",
- "extends": script$_,
- mounted: /* @__PURE__ */ __name(function mounted10() {
- console.warn("Deprecated since v4. Use InputChips component instead.");
- }, "mounted")
-};
-var ChipsStyle = BaseStyle.extend({
- name: "chips"
-});
-var ColumnGroupStyle = BaseStyle.extend({
- name: "columngroup"
-});
-var script$1$B = {
- name: "BaseColumnGroup",
- "extends": script$1f,
- props: {
- type: {
- type: String,
- "default": null
- }
- },
- style: ColumnGroupStyle,
- provide: /* @__PURE__ */ __name(function provide13() {
- return {
- $pcColumnGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$Y = {
- name: "ColumnGroup",
- "extends": script$1$B,
- inheritAttrs: false,
- inject: ["$columnGroups"],
- mounted: /* @__PURE__ */ __name(function mounted11() {
- var _this$$columnGroups;
- (_this$$columnGroups = this.$columnGroups) === null || _this$$columnGroups === void 0 || _this$$columnGroups.add(this.$);
- }, "mounted"),
- unmounted: /* @__PURE__ */ __name(function unmounted2() {
- var _this$$columnGroups2;
- (_this$$columnGroups2 = this.$columnGroups) === null || _this$$columnGroups2 === void 0 || _this$$columnGroups2["delete"](this.$);
- }, "unmounted"),
- render: /* @__PURE__ */ __name(function render() {
- return null;
- }, "render")
-};
-var theme$v = /* @__PURE__ */ __name(function theme8(_ref) {
- var dt = _ref.dt;
- return "\n.p-dataview {\n border-color: ".concat(dt("dataview.border.color"), ";\n border-width: ").concat(dt("dataview.border.width"), ";\n border-style: solid;\n border-radius: ").concat(dt("dataview.border.radius"), ";\n padding: ").concat(dt("dataview.padding"), ";\n}\n\n.p-dataview-header {\n background: ").concat(dt("dataview.header.background"), ";\n color: ").concat(dt("dataview.header.color"), ";\n border-color: ").concat(dt("dataview.header.border.color"), ";\n border-width: ").concat(dt("dataview.header.border.width"), ";\n border-style: solid;\n padding: ").concat(dt("dataview.header.padding"), ";\n border-radius: ").concat(dt("dataview.header.border.radius"), ";\n}\n\n.p-dataview-content {\n background: ").concat(dt("dataview.content.background"), ";\n border-color: ").concat(dt("dataview.content.border.color"), ";\n border-width: ").concat(dt("dataview.content.border.width"), ";\n border-style: solid;\n color: ").concat(dt("dataview.content.color"), ";\n padding: ").concat(dt("dataview.content.padding"), ";\n border-radius: ").concat(dt("dataview.content.border.radius"), ";\n}\n\n.p-dataview-footer {\n background: ").concat(dt("dataview.footer.background"), ";\n color: ").concat(dt("dataview.footer.color"), ";\n border-color: ").concat(dt("dataview.footer.border.color"), ";\n border-width: ").concat(dt("dataview.footer.border.width"), ";\n border-style: solid;\n padding: ").concat(dt("dataview.footer.padding"), ";\n border-radius: ").concat(dt("dataview.footer.border.radius"), ";\n}\n\n.p-dataview-paginator-top {\n border-width: ").concat(dt("dataview.paginator.top.border.width"), ";\n border-color: ").concat(dt("dataview.paginator.top.border.color"), ";\n border-style: solid;\n}\n\n.p-dataview-paginator-bottom {\n border-width: ").concat(dt("dataview.paginator.bottom.border.width"), ";\n border-color: ").concat(dt("dataview.paginator.bottom.border.color"), ";\n border-style: solid;\n}\n");
-}, "theme");
-var classes$z = {
- root: /* @__PURE__ */ __name(function root8(_ref2) {
- var props = _ref2.props;
- return ["p-dataview p-component", {
- "p-dataview-list": props.layout === "list",
- "p-dataview-grid": props.layout === "grid"
- }];
- }, "root"),
- header: "p-dataview-header",
- pcPaginator: /* @__PURE__ */ __name(function pcPaginator(_ref3) {
- var position = _ref3.position;
- return "p-dataview-paginator-" + position;
- }, "pcPaginator"),
- content: "p-dataview-content",
- emptyMessage: "p-dataview-empty-message",
- // TODO: remove?
- footer: "p-dataview-footer"
-};
-var DataViewStyle = BaseStyle.extend({
- name: "dataview",
- theme: theme$v,
- classes: classes$z
-});
-var script$1$A = {
- name: "BaseDataView",
- "extends": script$1f,
- props: {
- value: {
- type: Array,
- "default": null
- },
- layout: {
- type: String,
- "default": "list"
- },
- rows: {
- type: Number,
- "default": 0
- },
- first: {
- type: Number,
- "default": 0
- },
- totalRecords: {
- type: Number,
- "default": 0
- },
- paginator: {
- type: Boolean,
- "default": false
- },
- paginatorPosition: {
- type: String,
- "default": "bottom"
- },
- alwaysShowPaginator: {
- type: Boolean,
- "default": true
- },
- paginatorTemplate: {
- type: String,
- "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
- },
- pageLinkSize: {
- type: Number,
- "default": 5
- },
- rowsPerPageOptions: {
- type: Array,
- "default": null
- },
- currentPageReportTemplate: {
- type: String,
- "default": "({currentPage} of {totalPages})"
- },
- sortField: {
- type: [String, Function],
- "default": null
- },
- sortOrder: {
- type: Number,
- "default": null
- },
- lazy: {
- type: Boolean,
- "default": false
- },
- dataKey: {
- type: String,
- "default": null
- }
- },
- style: DataViewStyle,
- provide: /* @__PURE__ */ __name(function provide14() {
- return {
- $pcDataView: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _toConsumableArray$b(r) {
- return _arrayWithoutHoles$b(r) || _iterableToArray$b(r) || _unsupportedIterableToArray$c(r) || _nonIterableSpread$b();
-}
-__name(_toConsumableArray$b, "_toConsumableArray$b");
-function _nonIterableSpread$b() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$b, "_nonIterableSpread$b");
-function _unsupportedIterableToArray$c(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$c(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$c(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$c, "_unsupportedIterableToArray$c");
-function _iterableToArray$b(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$b, "_iterableToArray$b");
-function _arrayWithoutHoles$b(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$c(r);
-}
-__name(_arrayWithoutHoles$b, "_arrayWithoutHoles$b");
-function _arrayLikeToArray$c(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$c, "_arrayLikeToArray$c");
-var script$X = {
- name: "DataView",
- "extends": script$1$A,
- inheritAttrs: false,
- emits: ["update:first", "update:rows", "page"],
- data: /* @__PURE__ */ __name(function data6() {
- return {
- d_first: this.first,
- d_rows: this.rows
- };
- }, "data"),
- watch: {
- first: /* @__PURE__ */ __name(function first(newValue) {
- this.d_first = newValue;
- }, "first"),
- rows: /* @__PURE__ */ __name(function rows(newValue) {
- this.d_rows = newValue;
- }, "rows"),
- sortField: /* @__PURE__ */ __name(function sortField() {
- this.resetPage();
- }, "sortField"),
- sortOrder: /* @__PURE__ */ __name(function sortOrder() {
- this.resetPage();
- }, "sortOrder")
- },
- methods: {
- getKey: /* @__PURE__ */ __name(function getKey2(item8, index) {
- return this.dataKey ? resolveFieldData(item8, this.dataKey) : index;
- }, "getKey"),
- onPage: /* @__PURE__ */ __name(function onPage(event2) {
- this.d_first = event2.first;
- this.d_rows = event2.rows;
- this.$emit("update:first", this.d_first);
- this.$emit("update:rows", this.d_rows);
- this.$emit("page", event2);
- }, "onPage"),
- sort: /* @__PURE__ */ __name(function sort$1() {
- var _this = this;
- if (this.value) {
- var value2 = _toConsumableArray$b(this.value);
- var comparer = localeComparator();
- value2.sort(function(data1, data210) {
- var value1 = resolveFieldData(data1, _this.sortField);
- var value22 = resolveFieldData(data210, _this.sortField);
- return sort(value1, value22, _this.sortOrder, comparer);
- });
- return value2;
- } else {
- return null;
- }
- }, "sort$1"),
- resetPage: /* @__PURE__ */ __name(function resetPage() {
- this.d_first = 0;
- this.$emit("update:first", this.d_first);
- }, "resetPage")
- },
- computed: {
- getTotalRecords: /* @__PURE__ */ __name(function getTotalRecords() {
- if (this.totalRecords) return this.totalRecords;
- else return this.value ? this.value.length : 0;
- }, "getTotalRecords"),
- empty: /* @__PURE__ */ __name(function empty() {
- return !this.value || this.value.length === 0;
- }, "empty"),
- emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText2() {
- var _this$$primevue$confi;
- return ((_this$$primevue$confi = this.$primevue.config) === null || _this$$primevue$confi === void 0 || (_this$$primevue$confi = _this$$primevue$confi.locale) === null || _this$$primevue$confi === void 0 ? void 0 : _this$$primevue$confi.emptyMessage) || "";
- }, "emptyMessageText"),
- paginatorTop: /* @__PURE__ */ __name(function paginatorTop() {
- return this.paginator && (this.paginatorPosition !== "bottom" || this.paginatorPosition === "both");
- }, "paginatorTop"),
- paginatorBottom: /* @__PURE__ */ __name(function paginatorBottom() {
- return this.paginator && (this.paginatorPosition !== "top" || this.paginatorPosition === "both");
- }, "paginatorBottom"),
- items: /* @__PURE__ */ __name(function items() {
- if (this.value && this.value.length) {
- var data40 = this.value;
- if (data40 && data40.length && this.sortField) {
- data40 = this.sort();
- }
- if (this.paginator) {
- var first3 = this.lazy ? 0 : this.d_first;
- return data40.slice(first3, first3 + this.d_rows);
- } else {
- return data40;
- }
- } else {
- return null;
- }
- }, "items")
- },
- components: {
- DVPaginator: script$1t
- }
-};
-function render$R(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_DVPaginator = resolveComponent("DVPaginator");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [_ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("header")
- }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), $options.paginatorTop ? (openBlock(), createBlock(_component_DVPaginator, {
- key: 1,
- rows: $data.d_rows,
- first: $data.d_first,
- totalRecords: $options.getTotalRecords,
- pageLinkSize: _ctx.pageLinkSize,
- template: _ctx.paginatorTemplate,
- rowsPerPageOptions: _ctx.rowsPerPageOptions,
- currentPageReportTemplate: _ctx.currentPageReportTemplate,
- "class": normalizeClass(_ctx.cx("pcPaginator", {
- position: "top"
- })),
- alwaysShow: _ctx.alwaysShowPaginator,
- onPage: _cache[0] || (_cache[0] = function($event) {
- return $options.onPage($event);
- }),
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcPaginator")
- }, createSlots({
- _: 2
- }, [_ctx.$slots.paginatorcontainer ? {
- name: "container",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorcontainer", {
- first: slotProps.first,
- last: slotProps.last,
- rows: slotProps.rows,
- page: slotProps.page,
- pageCount: slotProps.pageCount,
- totalRecords: slotProps.totalRecords,
- firstPageCallback: slotProps.firstPageCallback,
- lastPageCallback: slotProps.lastPageCallback,
- prevPageCallback: slotProps.prevPageCallback,
- nextPageCallback: slotProps.nextPageCallback,
- rowChangeCallback: slotProps.rowChangeCallback
- })];
- }),
- key: "0"
- } : void 0, _ctx.$slots.paginatorstart ? {
- name: "start",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorstart")];
- }),
- key: "1"
- } : void 0, _ctx.$slots.paginatorend ? {
- name: "end",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorend")];
- }),
- key: "2"
- } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("content")
- }, _ctx.ptm("content")), [!$options.empty ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [_ctx.$slots.list && _ctx.layout === "list" ? renderSlot(_ctx.$slots, "list", {
- key: 0,
- items: $options.items
- }) : createCommentVNode("", true), _ctx.$slots.grid && _ctx.layout === "grid" ? renderSlot(_ctx.$slots, "grid", {
- key: 1,
- items: $options.items
- }) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("emptyMessage")
- }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "empty", {
- layout: _ctx.layout
- }, function() {
- return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];
- })], 16))], 16), $options.paginatorBottom ? (openBlock(), createBlock(_component_DVPaginator, {
- key: 2,
- rows: $data.d_rows,
- first: $data.d_first,
- totalRecords: $options.getTotalRecords,
- pageLinkSize: _ctx.pageLinkSize,
- template: _ctx.paginatorTemplate,
- rowsPerPageOptions: _ctx.rowsPerPageOptions,
- currentPageReportTemplate: _ctx.currentPageReportTemplate,
- "class": normalizeClass(_ctx.cx("pcPaginator", {
- position: "bottom"
- })),
- alwaysShow: _ctx.alwaysShowPaginator,
- onPage: _cache[1] || (_cache[1] = function($event) {
- return $options.onPage($event);
- }),
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcPaginator")
- }, createSlots({
- _: 2
- }, [_ctx.$slots.paginatorcontainer ? {
- name: "container",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorcontainer", {
- first: slotProps.first,
- last: slotProps.last,
- rows: slotProps.rows,
- page: slotProps.page,
- pageCount: slotProps.pageCount,
- totalRecords: slotProps.totalRecords,
- firstPageCallback: slotProps.firstPageCallback,
- lastPageCallback: slotProps.lastPageCallback,
- prevPageCallback: slotProps.prevPageCallback,
- nextPageCallback: slotProps.nextPageCallback,
- rowChangeCallback: slotProps.rowChangeCallback
- })];
- }),
- key: "0"
- } : void 0, _ctx.$slots.paginatorstart ? {
- name: "start",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorstart")];
- }),
- key: "1"
- } : void 0, _ctx.$slots.paginatorend ? {
- name: "end",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorend")];
- }),
- key: "2"
- } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
- key: 3,
- "class": _ctx.cx("footer")
- }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16);
-}
-__name(render$R, "render$R");
-script$X.render = render$R;
-var DeferredContentStyle = BaseStyle.extend({
- name: "deferredcontent"
-});
-var script$W = {
- name: "DeferredContent",
- "extends": script$1f,
- inheritAttrs: false,
- emits: ["load"],
- style: DeferredContentStyle,
- data: /* @__PURE__ */ __name(function data7() {
- return {
- loaded: false
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted12() {
- if (!this.loaded) {
- if (this.shouldLoad()) this.load();
- else this.bindScrollListener();
- }
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount3() {
- this.unbindScrollListener();
- }, "beforeUnmount"),
- methods: {
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener3() {
- var _this = this;
- this.documentScrollListener = function() {
- if (_this.shouldLoad()) {
- _this.load();
- _this.unbindScrollListener();
- }
- };
- window.addEventListener("scroll", this.documentScrollListener);
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener3() {
- if (this.documentScrollListener) {
- window.removeEventListener("scroll", this.documentScrollListener);
- this.documentScrollListener = null;
- }
- }, "unbindScrollListener"),
- shouldLoad: /* @__PURE__ */ __name(function shouldLoad() {
- if (this.loaded) {
- return false;
- } else {
- var rect = this.$refs.container.getBoundingClientRect();
- var docElement = document.documentElement;
- var winHeight = docElement.clientHeight;
- return winHeight >= rect.top;
- }
- }, "shouldLoad"),
- load: /* @__PURE__ */ __name(function load(event2) {
- this.loaded = true;
- this.$emit("load", event2);
- }, "load")
- }
-};
-function render$Q(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- ref: "container"
- }, _ctx.ptmi("root")), [$data.loaded ? renderSlot(_ctx.$slots, "default", {
- key: 0
- }) : createCommentVNode("", true)], 16);
-}
-__name(render$Q, "render$Q");
-script$W.render = render$Q;
-var DynamicDialogEventBus = EventBus();
-var DialogService = {
- install: /* @__PURE__ */ __name(function install(app) {
- var DialogService2 = {
- open: /* @__PURE__ */ __name(function open2(content, options4) {
- var instance = {
- content: content && markRaw(content),
- options: options4 || {},
- data: options4 && options4.data,
- close: /* @__PURE__ */ __name(function close2(params) {
- DynamicDialogEventBus.emit("close", {
- instance,
- params
- });
- }, "close")
- };
- DynamicDialogEventBus.emit("open", {
- instance
- });
- return instance;
- }, "open")
- };
- app.config.globalProperties.$dialog = DialogService2;
- app.provide(PrimeVueDialogSymbol, DialogService2);
- }, "install")
-};
-var theme$u = /* @__PURE__ */ __name(function theme9(_ref) {
- var dt = _ref.dt;
- return "\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n background: ".concat(dt("dock.background"), ";\n border: 1px solid ").concat(dt("dock.border.color"), ";\n padding: ").concat(dt("dock.padding"), ";\n border-radius: ").concat(dt("dock.border.radius"), ";\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n outline: 0 none;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n padding: ").concat(dt("dock.item.padding"), ";\n border-radius: ").concat(dt("dock.item.border.radius"), ";\n}\n\n.p-dock-item.p-focus {\n box-shadow: ").concat(dt("dock.item.focus.ring.shadow"), ";\n outline: ").concat(dt("dock.item.focus.ring.width"), " ").concat(dt("dock.item.focus.ring.style"), " ").concat(dt("dock.item.focus.ring.color"), ";\n outline-offset: ").concat(dt("dock.item.focus.ring.offset"), ";\n}\n\n.p-dock-item-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n width: ").concat(dt("dock.item.size"), ";\n height: ").concat(dt("dock.item.size"), ";\n}\n\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n\n.p-dock-mobile.p-dock-top .p-dock-list-container,\n.p-dock-mobile.p-dock-bottom .p-dock-list-container {\n overflow-x: auto;\n width: 100%;\n}\n\n.p-dock-mobile.p-dock-top .p-dock-list-container .p-dock-list,\n.p-dock-mobile.p-dock-bottom .p-dock-list-container .p-dock-list {\n margin: 0 auto;\n}\n\n.p-dock-mobile.p-dock-left .p-dock-list-container,\n.p-dock-mobile.p-dock-right .p-dock-list-container {\n overflow-y: auto;\n height: 100%;\n}\n\n.p-dock-mobile.p-dock-left .p-dock-list-container .p-dock-list,\n.p-dock-mobile.p-dock-right .p-dock-list-container .p-dock-list {\n margin: auto 0;\n}\n\n.p-dock-mobile .p-dock-list .p-dock-item {\n transform: none;\n margin: 0;\n}\n");
-}, "theme");
-var classes$y = {
- root: /* @__PURE__ */ __name(function root9(_ref2) {
- var instance = _ref2.instance, props = _ref2.props;
- return ["p-dock p-component", "p-dock-".concat(props.position), {
- "p-dock-mobile": instance.queryMatches
- }];
- }, "root"),
- listContainer: "p-dock-list-container",
- list: "p-dock-list",
- item: /* @__PURE__ */ __name(function item2(_ref3) {
- var instance = _ref3.instance, processedItem = _ref3.processedItem, id4 = _ref3.id;
- return ["p-dock-item", {
- "p-focus": instance.isItemActive(id4),
- "p-disabled": instance.disabled(processedItem)
- }];
- }, "item"),
- itemContent: "p-dock-item-content",
- itemLink: "p-dock-item-link",
- itemIcon: "p-dock-item-icon"
-};
-var DockStyle = BaseStyle.extend({
- name: "dock",
- theme: theme$u,
- classes: classes$y
-});
-var script$2$7 = {
- name: "BaseDock",
- "extends": script$1f,
- props: {
- position: {
- type: String,
- "default": "bottom"
- },
- model: null,
- "class": null,
- style: null,
- tooltipOptions: null,
- menuId: {
- type: String,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- breakpoint: {
- type: String,
- "default": "960px"
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- }
- },
- style: DockStyle,
- provide: /* @__PURE__ */ __name(function provide15() {
- return {
- $pcDock: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _toConsumableArray$a(r) {
- return _arrayWithoutHoles$a(r) || _iterableToArray$a(r) || _unsupportedIterableToArray$b(r) || _nonIterableSpread$a();
-}
-__name(_toConsumableArray$a, "_toConsumableArray$a");
-function _nonIterableSpread$a() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$a, "_nonIterableSpread$a");
-function _unsupportedIterableToArray$b(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$b(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$b(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$b, "_unsupportedIterableToArray$b");
-function _iterableToArray$a(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$a, "_iterableToArray$a");
-function _arrayWithoutHoles$a(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$b(r);
-}
-__name(_arrayWithoutHoles$a, "_arrayWithoutHoles$a");
-function _arrayLikeToArray$b(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$b, "_arrayLikeToArray$b");
-var script$1$z = {
- name: "DockSub",
- hostName: "Dock",
- "extends": script$1f,
- emits: ["focus", "blur"],
- props: {
- position: {
- type: String,
- "default": "bottom"
- },
- model: {
- type: Array,
- "default": null
- },
- templates: {
- type: null,
- "default": null
- },
- tooltipOptions: null,
- menuId: {
- type: String,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data8() {
- return {
- id: this.menuId,
- currentIndex: -3,
- focused: false,
- focusedOptionIndex: -1
- };
- }, "data"),
- watch: {
- menuId: /* @__PURE__ */ __name(function menuId(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "menuId")
- },
- mounted: /* @__PURE__ */ __name(function mounted13() {
- this.id = this.id || UniqueComponentId();
- }, "mounted"),
- methods: {
- getItemId: /* @__PURE__ */ __name(function getItemId(index) {
- return "".concat(this.id, "_").concat(index);
- }, "getItemId"),
- getItemProp: /* @__PURE__ */ __name(function getItemProp(processedItem, name4) {
- return processedItem && processedItem.item ? resolve(processedItem.item[name4]) : void 0;
- }, "getItemProp"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key, item8, index) {
- return this.ptm(key, {
- context: {
- index,
- item: item8,
- active: this.isItemActive(this.getItemId(index))
- }
- });
- }, "getPTOptions"),
- isSameMenuItem: /* @__PURE__ */ __name(function isSameMenuItem(event2) {
- return event2.currentTarget && (event2.currentTarget.isSameNode(event2.target) || event2.currentTarget.isSameNode(event2.target.closest('[data-pc-section="item"]')));
- }, "isSameMenuItem"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive2(id4) {
- return id4 === this.focusedOptionIndex;
- }, "isItemActive"),
- onListMouseLeave: /* @__PURE__ */ __name(function onListMouseLeave() {
- this.currentIndex = -3;
- }, "onListMouseLeave"),
- onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter(index) {
- this.currentIndex = index;
- }, "onItemMouseEnter"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick(event2, processedItem) {
- if (this.isSameMenuItem(event2)) {
- var command = this.getItemProp(processedItem, "command");
- command && command({
- originalEvent: event2,
- item: processedItem.item
- });
- }
- }, "onItemClick"),
- onListFocus: /* @__PURE__ */ __name(function onListFocus(event2) {
- this.focused = true;
- this.changeFocusedOptionIndex(0);
- this.$emit("focus", event2);
- }, "onListFocus"),
- onListBlur: /* @__PURE__ */ __name(function onListBlur(event2) {
- this.focused = false;
- this.focusedOptionIndex = -1;
- this.$emit("blur", event2);
- }, "onListBlur"),
- onListKeyDown: /* @__PURE__ */ __name(function onListKeyDown(event2) {
- switch (event2.code) {
- case "ArrowDown": {
- if (this.position === "left" || this.position === "right") this.onArrowDownKey();
- event2.preventDefault();
- break;
- }
- case "ArrowUp": {
- if (this.position === "left" || this.position === "right") this.onArrowUpKey();
- event2.preventDefault();
- break;
- }
- case "ArrowRight": {
- if (this.position === "top" || this.position === "bottom") this.onArrowDownKey();
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- if (this.position === "top" || this.position === "bottom") this.onArrowUpKey();
- event2.preventDefault();
- break;
- }
- case "Home": {
- this.onHomeKey();
- event2.preventDefault();
- break;
- }
- case "End": {
- this.onEndKey();
- event2.preventDefault();
- break;
- }
- case "Enter":
- case "NumpadEnter":
- case "Space": {
- this.onSpaceKey(event2);
- event2.preventDefault();
- break;
- }
- }
- }, "onListKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey3() {
- var optionIndex = this.findNextOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey3() {
- var optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- }, "onArrowUpKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey3() {
- this.changeFocusedOptionIndex(0);
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey3() {
- this.changeFocusedOptionIndex(find(this.$refs.list, 'li[data-pc-section="item"][data-p-disabled="false"]').length - 1);
- }, "onEndKey"),
- onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey2() {
- var element = findSingle(this.$refs.list, 'li[id="'.concat("".concat(this.focusedOptionIndex), '"]'));
- var anchorElement = element && findSingle(element, '[data-pc-section="itemlink"]');
- anchorElement ? anchorElement.click() : element && element.click();
- }, "onSpaceKey"),
- findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex2(index) {
- var menuitems = find(this.$refs.list, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var matchedOptionIndex = _toConsumableArray$a(menuitems).findIndex(function(link) {
- return link.id === index;
- });
- return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;
- }, "findNextOptionIndex"),
- findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex2(index) {
- var menuitems = find(this.$refs.list, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var matchedOptionIndex = _toConsumableArray$a(menuitems).findIndex(function(link) {
- return link.id === index;
- });
- return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;
- }, "findPrevOptionIndex"),
- changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex2(index) {
- var menuitems = find(this.$refs.list, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var order = index >= menuitems.length ? menuitems.length - 1 : index < 0 ? 0 : index;
- this.focusedOptionIndex = menuitems[order].getAttribute("id");
- }, "changeFocusedOptionIndex"),
- disabled: /* @__PURE__ */ __name(function disabled2(item8) {
- return typeof item8.disabled === "function" ? item8.disabled() : item8.disabled;
- }, "disabled"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps2(item8, index) {
- return {
- action: mergeProps({
- tabindex: -1,
- "class": this.cx("itemLink")
- }, this.getPTOptions("itemLink", item8, index)),
- icon: mergeProps({
- "class": [this.cx("itemIcon"), item8.icon]
- }, this.getPTOptions("itemIcon", item8, index))
- };
- }, "getMenuItemProps")
- },
- computed: {
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId3() {
- return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
- }, "focusedOptionId")
- },
- directives: {
- ripple: Ripple,
- tooltip: Tooltip
- }
-};
-var _hoisted_1$p = ["id", "aria-orientation", "aria-activedescendant", "tabindex", "aria-label", "aria-labelledby"];
-var _hoisted_2$i = ["id", "aria-label", "aria-disabled", "onClick", "onMouseenter", "data-p-focused", "data-p-disabled"];
-var _hoisted_3$f = ["href", "target"];
-function render$1$7(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- var _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("listContainer")
- }, _ctx.ptm("listContainer")), [createBaseVNode("ul", mergeProps({
- ref: "list",
- id: $data.id,
- "class": _ctx.cx("list"),
- role: "menu",
- "aria-orientation": $props.position === "bottom" || $props.position === "top" ? "horizontal" : "vertical",
- "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
- tabindex: $props.tabindex,
- "aria-label": $props.ariaLabel,
- "aria-labelledby": $props.ariaLabelledby,
- onFocus: _cache[0] || (_cache[0] = function() {
- return $options.onListFocus && $options.onListFocus.apply($options, arguments);
- }),
- onBlur: _cache[1] || (_cache[1] = function() {
- return $options.onListBlur && $options.onListBlur.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onListKeyDown && $options.onListKeyDown.apply($options, arguments);
- }),
- onMouseleave: _cache[3] || (_cache[3] = function() {
- return $options.onListMouseLeave && $options.onListMouseLeave.apply($options, arguments);
- })
- }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.model, function(processedItem, index) {
- return openBlock(), createElementBlock("li", mergeProps({
- key: index,
- id: $options.getItemId(index),
- "class": _ctx.cx("item", {
- processedItem,
- id: $options.getItemId(index)
- }),
- role: "menuitem",
- "aria-label": processedItem.label,
- "aria-disabled": $options.disabled(processedItem),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, processedItem);
- }, "onClick"),
- onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) {
- return $options.onItemMouseEnter(index);
- }, "onMouseenter"),
- ref_for: true
- }, $options.getPTOptions("item", processedItem, index), {
- "data-p-focused": $options.isItemActive($options.getItemId(index)),
- "data-p-disabled": $options.disabled(processedItem) || false
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("itemContent"),
- ref_for: true
- }, $options.getPTOptions("itemContent", processedItem, index)), [!$props.templates["item"] ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: processedItem.url,
- "class": _ctx.cx("itemLink"),
- target: processedItem.target,
- tabindex: "-1",
- "aria-hidden": "true",
- ref_for: true
- }, $options.getPTOptions("itemLink", processedItem, index)), [!$props.templates["icon"] && !$props.templates["itemicon"] ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": [_ctx.cx("itemIcon"), processedItem.icon],
- ref_for: true
- }, $options.getPTOptions("itemIcon", processedItem, index)), null, 16)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates["icon"] || $props.templates["itemicon"]), {
- key: 1,
- item: processedItem,
- "class": normalizeClass(_ctx.cx("itemIcon"))
- }, null, 8, ["item", "class"]))], 16, _hoisted_3$f)), [[_directive_tooltip, {
- value: processedItem.label,
- disabled: !$props.tooltipOptions
- }, $props.tooltipOptions]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates["item"]), {
- key: 1,
- item: processedItem,
- index,
- label: processedItem.label,
- props: $options.getMenuItemProps(processedItem, index)
- }, null, 8, ["item", "index", "label", "props"]))], 16)], 16, _hoisted_2$i);
- }), 128))], 16, _hoisted_1$p)], 16);
-}
-__name(render$1$7, "render$1$7");
-script$1$z.render = render$1$7;
-var script$V = {
- name: "Dock",
- "extends": script$2$7,
- inheritAttrs: false,
- matchMediaListener: null,
- data: /* @__PURE__ */ __name(function data9() {
- return {
- query: null,
- queryMatches: false
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted14() {
- this.bindMatchMediaListener();
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount4() {
- this.unbindMatchMediaListener();
- }, "beforeUnmount"),
- methods: {
- bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener3() {
- var _this = this;
- if (!this.matchMediaListener) {
- var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
- this.query = query;
- this.queryMatches = query.matches;
- this.matchMediaListener = function() {
- _this.queryMatches = query.matches;
- _this.mobileActive = false;
- };
- this.query.addEventListener("change", this.matchMediaListener);
- }
- }, "bindMatchMediaListener"),
- unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener3() {
- if (this.matchMediaListener) {
- this.query.removeEventListener("change", this.matchMediaListener);
- this.matchMediaListener = null;
- }
- }, "unbindMatchMediaListener")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass() {
- return [this["class"], this.cx("root")];
- }, "containerClass")
- },
- components: {
- DockSub: script$1$z
- }
-};
-function render$P(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_DockSub = resolveComponent("DockSub");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": $options.containerClass,
- style: _ctx.style
- }, _ctx.ptmi("root")), [createVNode(_component_DockSub, {
- model: _ctx.model,
- templates: _ctx.$slots,
- tooltipOptions: _ctx.tooltipOptions,
- position: _ctx.position,
- menuId: _ctx.menuId,
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- tabindex: _ctx.tabindex,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["model", "templates", "tooltipOptions", "position", "menuId", "aria-label", "aria-labelledby", "tabindex", "pt", "unstyled"])], 16);
-}
-__name(render$P, "render$P");
-script$V.render = render$P;
-var script$U = {
- name: "Dropdown",
- "extends": script$1u,
- mounted: /* @__PURE__ */ __name(function mounted15() {
- console.warn("Deprecated since v4. Use Select component instead.");
- }, "mounted")
-};
-var DropdownStyle = BaseStyle.extend({
- name: "dropdown"
-});
-var DynamicDialogStyle = BaseStyle.extend({
- name: "dynamicdialog"
-});
-var script$1$y = {
- name: "BaseDynamicDialog",
- "extends": script$1f,
- props: {},
- style: DynamicDialogStyle,
- provide: /* @__PURE__ */ __name(function provide16() {
- return {
- $pcDynamicDialog: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$T = {
- name: "DynamicDialog",
- "extends": script$1$y,
- inheritAttrs: false,
- data: /* @__PURE__ */ __name(function data10() {
- return {
- instanceMap: {}
- };
- }, "data"),
- openListener: null,
- closeListener: null,
- currentInstance: null,
- mounted: /* @__PURE__ */ __name(function mounted16() {
- var _this = this;
- this.openListener = function(_ref) {
- var instance = _ref.instance;
- var key = UniqueComponentId() + "_dynamic_dialog";
- instance.visible = true;
- instance.key = key;
- _this.instanceMap[key] = instance;
- };
- this.closeListener = function(_ref2) {
- var instance = _ref2.instance, params = _ref2.params;
- var key = instance.key;
- var currentInstance = _this.instanceMap[key];
- if (currentInstance) {
- currentInstance.visible = false;
- currentInstance.options.onClose && currentInstance.options.onClose({
- data: params,
- type: "config-close"
- });
- _this.currentInstance = currentInstance;
- }
- };
- DynamicDialogEventBus.on("open", this.openListener);
- DynamicDialogEventBus.on("close", this.closeListener);
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount5() {
- DynamicDialogEventBus.off("open", this.openListener);
- DynamicDialogEventBus.off("close", this.closeListener);
- }, "beforeUnmount"),
- methods: {
- onDialogHide: /* @__PURE__ */ __name(function onDialogHide(instance) {
- !this.currentInstance && instance.options.onClose && instance.options.onClose({
- type: "dialog-close"
- });
- delete this.instanceMap[instance.key];
- }, "onDialogHide"),
- onDialogAfterHide: /* @__PURE__ */ __name(function onDialogAfterHide() {
- this.currentInstance && delete this.currentInstance;
- this.currentInstance = null;
- }, "onDialogAfterHide"),
- getTemplateItems: /* @__PURE__ */ __name(function getTemplateItems(template) {
- return Array.isArray(template) ? template : [template];
- }, "getTemplateItems")
- },
- components: {
- DDialog: script$1v
- }
-};
-function render$O(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_DDialog = resolveComponent("DDialog");
- return openBlock(true), createElementBlock(Fragment, null, renderList($data.instanceMap, function(instance, key) {
- return openBlock(), createBlock(_component_DDialog, mergeProps({
- key,
- visible: instance.visible,
- "onUpdate:visible": /* @__PURE__ */ __name(function onUpdateVisible($event) {
- return instance.visible = $event;
- }, "onUpdateVisible"),
- _instance: instance,
- ref_for: true
- }, instance.options.props, {
- onHide: /* @__PURE__ */ __name(function onHide($event) {
- return $options.onDialogHide(instance);
- }, "onHide"),
- onAfterHide: $options.onDialogAfterHide
- }), createSlots({
- "default": withCtx(function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(instance.content), mergeProps({
- ref_for: true
- }, instance.options.emits), null, 16))];
- }),
- _: 2
- }, [instance.options.templates && instance.options.templates.header ? {
- name: "header",
- fn: withCtx(function() {
- return [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getTemplateItems(instance.options.templates.header), function(header2, index) {
- return openBlock(), createBlock(resolveDynamicComponent(header2), mergeProps({
- key: index + "_header",
- ref_for: true
- }, instance.options.emits), null, 16);
- }), 128))];
- }),
- key: "0"
- } : void 0, instance.options.templates && instance.options.templates.footer ? {
- name: "footer",
- fn: withCtx(function() {
- return [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getTemplateItems(instance.options.templates.footer), function(footer, index) {
- return openBlock(), createBlock(resolveDynamicComponent(footer), mergeProps({
- key: index + "_footer",
- ref_for: true
- }, instance.options.emits), null, 16);
- }), 128))];
- }),
- key: "1"
- } : void 0]), 1040, ["visible", "onUpdate:visible", "_instance", "onHide", "onAfterHide"]);
- }), 128);
-}
-__name(render$O, "render$O");
-script$T.render = render$O;
-var theme$t = /* @__PURE__ */ __name(function theme10(_ref) {
- var dt = _ref.dt;
- return "\n.p-fieldset {\n background: ".concat(dt("fieldset.background"), ";\n border: 1px solid ").concat(dt("fieldset.border.color"), ";\n border-radius: ").concat(dt("fieldset.border.radius"), ";\n color: ").concat(dt("fieldset.color"), ";\n padding: ").concat(dt("fieldset.padding"), ";\n margin: 0;\n}\n\n.p-fieldset-legend {\n background: ").concat(dt("fieldset.legend.background"), ";\n border-radius: ").concat(dt("fieldset.legend.border.radius"), ";\n border-width: ").concat(dt("fieldset.legend.border.width"), ";\n border-style: solid;\n border-color: ").concat(dt("fieldset.legend.border.color"), ";\n padding: ").concat(dt("fieldset.legend.padding"), ";\n transition: background ").concat(dt("fieldset.transition.duration"), ", color ").concat(dt("fieldset.transition.duration"), ", outline-color ").concat(dt("fieldset.transition.duration"), ", box-shadow ").concat(dt("fieldset.transition.duration"), ";\n}\n\n.p-fieldset-toggleable > .p-fieldset-legend {\n padding: 0;\n}\n\n.p-fieldset-toggle-button {\n cursor: pointer;\n user-select: none;\n overflow: hidden;\n position: relative;\n text-decoration: none;\n display: flex;\n gap: ").concat(dt("fieldset.legend.gap"), ";\n align-items: center;\n justify-content: center;\n padding: ").concat(dt("fieldset.legend.padding"), ";\n background: transparent;\n border: 0 none;\n border-radius: ").concat(dt("fieldset.legend.border.radius"), ";\n transition: background ").concat(dt("fieldset.transition.duration"), ", color ").concat(dt("fieldset.transition.duration"), ", outline-color ").concat(dt("fieldset.transition.duration"), ", box-shadow ").concat(dt("fieldset.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-fieldset-legend-label {\n font-weight: ").concat(dt("fieldset.legend.font.weight"), ";\n}\n\n.p-fieldset-toggle-button:focus-visible {\n box-shadow: ").concat(dt("fieldset.legend.focus.ring.shadow"), ";\n outline: ").concat(dt("fieldset.legend.focus.ring.width"), " ").concat(dt("fieldset.legend.focus.ring.style"), " ").concat(dt("fieldset.legend.focus.ring.color"), ";\n outline-offset: ").concat(dt("fieldset.legend.focus.ring.offset"), ";\n}\n\n.p-fieldset-toggleable > .p-fieldset-legend:hover {\n color: ").concat(dt("fieldset.legend.hover.color"), ";\n background: ").concat(dt("fieldset.legend.hover.background"), ";\n}\n\n.p-fieldset-toggle-icon {\n color: ").concat(dt("fieldset.toggle.icon.color"), ";\n transition: color ").concat(dt("fieldset.transition.duration"), ";\n}\n\n.p-fieldset-toggleable > .p-fieldset-legend:hover .p-fieldset-toggle-icon {\n color: ").concat(dt("fieldset.toggle.icon.hover.color"), ";\n}\n\n.p-fieldset .p-fieldset-content {\n padding: ").concat(dt("fieldset.content.padding"), ";\n}\n");
-}, "theme");
-var classes$x = {
- root: /* @__PURE__ */ __name(function root10(_ref2) {
- var props = _ref2.props;
- return ["p-fieldset p-component", {
- "p-fieldset-toggleable": props.toggleable
- }];
- }, "root"),
- legend: "p-fieldset-legend",
- legendLabel: "p-fieldset-legend-label",
- toggleButton: "p-fieldset-toggle-button",
- toggleIcon: "p-fieldset-toggle-icon",
- contentContainer: "p-fieldset-content-container",
- content: "p-fieldset-content"
-};
-var FieldsetStyle = BaseStyle.extend({
- name: "fieldset",
- theme: theme$t,
- classes: classes$x
-});
-var script$1$x = {
- name: "BaseFieldset",
- "extends": script$1f,
- props: {
- legend: String,
- toggleable: Boolean,
- collapsed: Boolean,
- toggleButtonProps: {
- type: null,
- "default": null
- }
- },
- style: FieldsetStyle,
- provide: /* @__PURE__ */ __name(function provide17() {
- return {
- $pcFieldset: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$S = {
- name: "Fieldset",
- "extends": script$1$x,
- inheritAttrs: false,
- emits: ["update:collapsed", "toggle"],
- data: /* @__PURE__ */ __name(function data11() {
- return {
- id: this.$attrs.id,
- d_collapsed: this.collapsed
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId4(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- collapsed: /* @__PURE__ */ __name(function collapsed(newValue) {
- this.d_collapsed = newValue;
- }, "collapsed")
- },
- mounted: /* @__PURE__ */ __name(function mounted17() {
- this.id = this.id || UniqueComponentId();
- }, "mounted"),
- methods: {
- toggle: /* @__PURE__ */ __name(function toggle(event2) {
- this.d_collapsed = !this.d_collapsed;
- this.$emit("update:collapsed", this.d_collapsed);
- this.$emit("toggle", {
- originalEvent: event2,
- value: this.d_collapsed
- });
- }, "toggle"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown4(event2) {
- if (event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") {
- this.toggle(event2);
- event2.preventDefault();
- }
- }, "onKeyDown")
- },
- computed: {
- buttonAriaLabel: /* @__PURE__ */ __name(function buttonAriaLabel() {
- return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.legend;
- }, "buttonAriaLabel")
- },
- directives: {
- ripple: Ripple
- },
- components: {
- PlusIcon: script$1w,
- MinusIcon: script$1x
- }
-};
-function _typeof$i(o) {
- "@babel/helpers - typeof";
- return _typeof$i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$i(o);
-}
-__name(_typeof$i, "_typeof$i");
-function ownKeys$g(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$g, "ownKeys$g");
-function _objectSpread$g(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$g(Object(t2), true).forEach(function(r2) {
- _defineProperty$h(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$g(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$g, "_objectSpread$g");
-function _defineProperty$h(e, r, t2) {
- return (r = _toPropertyKey$h(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$h, "_defineProperty$h");
-function _toPropertyKey$h(t2) {
- var i = _toPrimitive$h(t2, "string");
- return "symbol" == _typeof$i(i) ? i : i + "";
-}
-__name(_toPropertyKey$h, "_toPropertyKey$h");
-function _toPrimitive$h(t2, r) {
- if ("object" != _typeof$i(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$i(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$h, "_toPrimitive$h");
-var _hoisted_1$o = ["id"];
-var _hoisted_2$h = ["id", "aria-controls", "aria-expanded", "aria-label"];
-var _hoisted_3$e = ["id", "aria-labelledby"];
-function render$N(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("fieldset", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("legend", mergeProps({
- "class": _ctx.cx("legend")
- }, _ctx.ptm("legend")), [renderSlot(_ctx.$slots, "legend", {
- toggleCallback: $options.toggle
- }, function() {
- return [!_ctx.toggleable ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- id: $data.id + "_header",
- "class": _ctx.cx("legendLabel")
- }, _ctx.ptm("legendLabel")), toDisplayString(_ctx.legend), 17, _hoisted_1$o)) : createCommentVNode("", true), _ctx.toggleable ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
- key: 1,
- id: $data.id + "_header",
- type: "button",
- "aria-controls": $data.id + "_content",
- "aria-expanded": !$data.d_collapsed,
- "aria-label": $options.buttonAriaLabel,
- "class": _ctx.cx("toggleButton"),
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.toggle && $options.toggle.apply($options, arguments);
- }),
- onKeydown: _cache[1] || (_cache[1] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- })
- }, _objectSpread$g(_objectSpread$g({}, _ctx.toggleButtonProps), _ctx.ptm("toggleButton"))), [renderSlot(_ctx.$slots, _ctx.$slots.toggleicon ? "toggleicon" : "togglericon", {
- collapsed: $data.d_collapsed,
- "class": normalizeClass(_ctx.cx("toggleIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($data.d_collapsed ? "PlusIcon" : "MinusIcon"), mergeProps({
- "class": _ctx.cx("toggleIcon")
- }, _ctx.ptm("toggleIcon")), null, 16, ["class"]))];
- }), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("legendLabel")
- }, _ctx.ptm("legendLabel")), toDisplayString(_ctx.legend), 17)], 16, _hoisted_2$h)), [[_directive_ripple]]) : createCommentVNode("", true)];
- })], 16), createVNode(Transition, mergeProps({
- name: "p-toggleable-content"
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [withDirectives(createBaseVNode("div", mergeProps({
- id: $data.id + "_content",
- "class": _ctx.cx("contentContainer"),
- role: "region",
- "aria-labelledby": $data.id + "_header"
- }, _ctx.ptm("contentContainer")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("content")
- }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16)], 16, _hoisted_3$e), [[vShow, !$data.d_collapsed]])];
- }),
- _: 3
- }, 16)], 16);
-}
-__name(render$N, "render$N");
-script$S.render = render$N;
-var script$R = {
- name: "UploadIcon",
- "extends": script$1j
-};
-function render$M(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$M, "render$M");
-script$R.render = render$M;
-var theme$s = /* @__PURE__ */ __name(function theme11(_ref) {
- var dt = _ref.dt;
- return '\n.p-fileupload input[type="file"] {\n display: none;\n}\n\n.p-fileupload-advanced {\n border: 1px solid '.concat(dt("fileupload.border.color"), ";\n border-radius: ").concat(dt("fileupload.border.radius"), ";\n background: ").concat(dt("fileupload.background"), ";\n color: ").concat(dt("fileupload.color"), ";\n}\n\n.p-fileupload-header {\n display: flex;\n align-items: center;\n padding: ").concat(dt("fileupload.header.padding"), ";\n background: ").concat(dt("fileupload.header.background"), ";\n color: ").concat(dt("fileupload.header.color"), ";\n border-style: solid;\n border-width: ").concat(dt("fileupload.header.border.width"), ";\n border-color: ").concat(dt("fileupload.header.border.color"), ";\n border-radius: ").concat(dt("fileupload.header.border.radius"), ";\n gap: ").concat(dt("fileupload.header.gap"), ";\n}\n\n.p-fileupload-content {\n border: 1px solid transparent;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("fileupload.content.gap"), ";\n transition: border-color ").concat(dt("fileupload.transition.duration"), ";\n padding: ").concat(dt("fileupload.content.padding"), ";\n}\n\n.p-fileupload-content .p-progressbar {\n width: 100%;\n height: ").concat(dt("fileupload.progressbar.height"), ";\n}\n\n.p-fileupload-file-list {\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("fileupload.filelist.gap"), ";\n}\n\n.p-fileupload-file {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: ").concat(dt("fileupload.file.padding"), ";\n border-block-end: 1px solid ").concat(dt("fileupload.file.border.color"), ";\n gap: ").concat(dt("fileupload.file.gap"), ";\n}\n\n.p-fileupload-file:last-child {\n border-block-end: 0;\n}\n\n.p-fileupload-file-info {\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("fileupload.file.info.gap"), ";\n}\n\n.p-fileupload-file-thumbnail {\n flex-shrink: 0;\n}\n\n.p-fileupload-file-actions {\n margin-inline-start: auto;\n}\n\n.p-fileupload-highlight {\n border: 1px dashed ").concat(dt("fileupload.content.highlight.border.color"), ";\n}\n\n.p-fileupload-basic {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: ").concat(dt("fileupload.basic.gap"), ";\n}\n");
-}, "theme");
-var classes$w = {
- root: /* @__PURE__ */ __name(function root11(_ref2) {
- var props = _ref2.props;
- return ["p-fileupload p-fileupload-".concat(props.mode, " p-component")];
- }, "root"),
- header: "p-fileupload-header",
- pcChooseButton: "p-fileupload-choose-button",
- pcUploadButton: "p-fileupload-upload-button",
- pcCancelButton: "p-fileupload-cancel-button",
- content: "p-fileupload-content",
- fileList: "p-fileupload-file-list",
- file: "p-fileupload-file",
- fileThumbnail: "p-fileupload-file-thumbnail",
- fileInfo: "p-fileupload-file-info",
- fileName: "p-fileupload-file-name",
- fileSize: "p-fileupload-file-size",
- pcFileBadge: "p-fileupload-file-badge",
- fileActions: "p-fileupload-file-actions",
- pcFileRemoveButton: "p-fileupload-file-remove-button"
-};
-var FileUploadStyle = BaseStyle.extend({
- name: "fileupload",
- theme: theme$s,
- classes: classes$w
-});
-var script$2$6 = {
- name: "BaseFileUpload",
- "extends": script$1f,
- props: {
- name: {
- type: String,
- "default": null
- },
- url: {
- type: String,
- "default": null
- },
- mode: {
- type: String,
- "default": "advanced"
- },
- multiple: {
- type: Boolean,
- "default": false
- },
- accept: {
- type: String,
- "default": null
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- auto: {
- type: Boolean,
- "default": false
- },
- maxFileSize: {
- type: Number,
- "default": null
- },
- invalidFileSizeMessage: {
- type: String,
- "default": "{0}: Invalid file size, file size should be smaller than {1}."
- },
- invalidFileTypeMessage: {
- type: String,
- "default": "{0}: Invalid file type, allowed file types: {1}."
- },
- fileLimit: {
- type: Number,
- "default": null
- },
- invalidFileLimitMessage: {
- type: String,
- "default": "Maximum number of files exceeded, limit is {0} at most."
- },
- withCredentials: {
- type: Boolean,
- "default": false
- },
- previewWidth: {
- type: Number,
- "default": 50
- },
- chooseLabel: {
- type: String,
- "default": null
- },
- uploadLabel: {
- type: String,
- "default": null
- },
- cancelLabel: {
- type: String,
- "default": null
- },
- customUpload: {
- type: Boolean,
- "default": false
- },
- showUploadButton: {
- type: Boolean,
- "default": true
- },
- showCancelButton: {
- type: Boolean,
- "default": true
- },
- chooseIcon: {
- type: String,
- "default": void 0
- },
- uploadIcon: {
- type: String,
- "default": void 0
- },
- cancelIcon: {
- type: String,
- "default": void 0
- },
- style: null,
- "class": null,
- chooseButtonProps: {
- type: null,
- "default": null
- },
- uploadButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default6() {
- return {
- severity: "secondary"
- };
- }, "_default")
- },
- cancelButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default7() {
- return {
- severity: "secondary"
- };
- }, "_default")
- }
- },
- style: FileUploadStyle,
- provide: /* @__PURE__ */ __name(function provide18() {
- return {
- $pcFileUpload: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$w = {
- name: "FileContent",
- hostName: "FileUpload",
- "extends": script$1f,
- emits: ["remove"],
- props: {
- files: {
- type: Array,
- "default": /* @__PURE__ */ __name(function _default8() {
- return [];
- }, "_default")
- },
- badgeSeverity: {
- type: String,
- "default": "warn"
- },
- badgeValue: {
- type: String,
- "default": null
- },
- previewWidth: {
- type: Number,
- "default": 50
- },
- templates: {
- type: null,
- "default": null
- }
- },
- methods: {
- formatSize: /* @__PURE__ */ __name(function formatSize(bytes) {
- var _this$$primevue$confi;
- var k = 1024;
- var dm = 3;
- var sizes = ((_this$$primevue$confi = this.$primevue.config.locale) === null || _this$$primevue$confi === void 0 ? void 0 : _this$$primevue$confi.fileSizeTypes) || ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
- if (bytes === 0) {
- return "0 ".concat(sizes[0]);
- }
- var i = Math.floor(Math.log(bytes) / Math.log(k));
- var formattedSize = parseFloat((bytes / Math.pow(k, i)).toFixed(dm));
- return "".concat(formattedSize, " ").concat(sizes[i]);
- }, "formatSize")
- },
- components: {
- Button: script$1d,
- Badge: script$1y,
- TimesIcon: script$1q
- }
-};
-var _hoisted_1$1$5 = ["alt", "src", "width"];
-function render$1$6(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Badge = resolveComponent("Badge");
- var _component_TimesIcon = resolveComponent("TimesIcon");
- var _component_Button = resolveComponent("Button");
- return openBlock(true), createElementBlock(Fragment, null, renderList($props.files, function(file, index) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: file.name + file.type + file.size,
- "class": _ctx.cx("file"),
- ref_for: true
- }, _ctx.ptm("file")), [createBaseVNode("img", mergeProps({
- role: "presentation",
- "class": _ctx.cx("fileThumbnail"),
- alt: file.name,
- src: file.objectURL,
- width: $props.previewWidth,
- ref_for: true
- }, _ctx.ptm("fileThumbnail")), null, 16, _hoisted_1$1$5), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("fileInfo"),
- ref_for: true
- }, _ctx.ptm("fileInfo")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("fileName"),
- ref_for: true
- }, _ctx.ptm("fileName")), toDisplayString(file.name), 17), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("fileSize"),
- ref_for: true
- }, _ctx.ptm("fileSize")), toDisplayString($options.formatSize(file.size)), 17)], 16), createVNode(_component_Badge, {
- value: $props.badgeValue,
- "class": normalizeClass(_ctx.cx("pcFileBadge")),
- severity: $props.badgeSeverity,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcFileBadge")
- }, null, 8, ["value", "class", "severity", "unstyled", "pt"]), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("fileActions"),
- ref_for: true
- }, _ctx.ptm("fileActions")), [createVNode(_component_Button, {
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return _ctx.$emit("remove", index);
- }, "onClick"),
- text: "",
- rounded: "",
- severity: "danger",
- "class": normalizeClass(_ctx.cx("pcFileRemoveButton")),
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcFileRemoveButton")
- }, {
- icon: withCtx(function(iconProps) {
- return [$props.templates.fileremoveicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.fileremoveicon), {
- key: 0,
- "class": normalizeClass(iconProps["class"]),
- file,
- index
- }, null, 8, ["class", "file", "index"])) : (openBlock(), createBlock(_component_TimesIcon, mergeProps({
- key: 1,
- "class": iconProps["class"],
- "aria-hidden": "true",
- ref_for: true
- }, _ctx.ptm("pcFileRemoveButton")["icon"]), null, 16, ["class"]))];
- }),
- _: 2
- }, 1032, ["onClick", "class", "unstyled", "pt"])], 16)], 16);
- }), 128);
-}
-__name(render$1$6, "render$1$6");
-script$1$w.render = render$1$6;
-function _toConsumableArray$9(r) {
- return _arrayWithoutHoles$9(r) || _iterableToArray$9(r) || _unsupportedIterableToArray$a(r) || _nonIterableSpread$9();
-}
-__name(_toConsumableArray$9, "_toConsumableArray$9");
-function _nonIterableSpread$9() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$9, "_nonIterableSpread$9");
-function _iterableToArray$9(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$9, "_iterableToArray$9");
-function _arrayWithoutHoles$9(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$a(r);
-}
-__name(_arrayWithoutHoles$9, "_arrayWithoutHoles$9");
-function _createForOfIteratorHelper$3(r, e) {
- var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t2) {
- if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$a(r)) || e) {
- t2 && (r = t2);
- var _n = 0, F = /* @__PURE__ */ __name(function F2() {
- }, "F");
- return { s: F, n: /* @__PURE__ */ __name(function n() {
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- throw r2;
- }, "e"), f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o, a = true, u = false;
- return { s: /* @__PURE__ */ __name(function s() {
- t2 = t2.call(r);
- }, "s"), n: /* @__PURE__ */ __name(function n() {
- var r2 = t2.next();
- return a = r2.done, r2;
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- u = true, o = r2;
- }, "e"), f: /* @__PURE__ */ __name(function f() {
- try {
- a || null == t2["return"] || t2["return"]();
- } finally {
- if (u) throw o;
- }
- }, "f") };
-}
-__name(_createForOfIteratorHelper$3, "_createForOfIteratorHelper$3");
-function _unsupportedIterableToArray$a(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$a(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$a(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$a, "_unsupportedIterableToArray$a");
-function _arrayLikeToArray$a(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$a, "_arrayLikeToArray$a");
-var script$Q = {
- name: "FileUpload",
- "extends": script$2$6,
- inheritAttrs: false,
- emits: ["select", "uploader", "before-upload", "progress", "upload", "error", "before-send", "clear", "remove", "remove-uploaded-file"],
- duplicateIEEvent: false,
- data: /* @__PURE__ */ __name(function data12() {
- return {
- uploadedFileCount: 0,
- files: [],
- messages: [],
- focused: false,
- progress: null,
- uploadedFiles: []
- };
- }, "data"),
- methods: {
- upload: /* @__PURE__ */ __name(function upload() {
- if (this.hasFiles) this.uploader();
- }, "upload"),
- onBasicUploaderClick: /* @__PURE__ */ __name(function onBasicUploaderClick(event2) {
- if (event2.button === 0) this.$refs.fileInput.click();
- }, "onBasicUploaderClick"),
- onFileSelect: /* @__PURE__ */ __name(function onFileSelect(event2) {
- if (event2.type !== "drop" && this.isIE11() && this.duplicateIEEvent) {
- this.duplicateIEEvent = false;
- return;
- }
- if (this.isBasic && this.hasFiles) {
- this.files = [];
- }
- this.messages = [];
- this.files = this.files || [];
- var files = event2.dataTransfer ? event2.dataTransfer.files : event2.target.files;
- var _iterator = _createForOfIteratorHelper$3(files), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var file = _step.value;
- if (!this.isFileSelected(file) && !this.isFileLimitExceeded()) {
- if (this.validate(file)) {
- if (this.isImage(file)) {
- file.objectURL = window.URL.createObjectURL(file);
- }
- this.files.push(file);
- }
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- this.$emit("select", {
- originalEvent: event2,
- files: this.files
- });
- if (this.fileLimit) {
- this.checkFileLimit();
- }
- if (this.auto && this.hasFiles && !this.isFileLimitExceeded()) {
- this.uploader();
- }
- if (event2.type !== "drop" && this.isIE11()) {
- this.clearIEInput();
- } else {
- this.clearInputElement();
- }
- }, "onFileSelect"),
- choose: /* @__PURE__ */ __name(function choose() {
- this.$refs.fileInput.click();
- }, "choose"),
- uploader: /* @__PURE__ */ __name(function uploader() {
- var _this = this;
- if (this.customUpload) {
- if (this.fileLimit) {
- this.uploadedFileCount += this.files.length;
- }
- this.$emit("uploader", {
- files: this.files
- });
- this.clear();
- } else {
- var xhr = new XMLHttpRequest();
- var formData = new FormData();
- this.$emit("before-upload", {
- xhr,
- formData
- });
- var _iterator2 = _createForOfIteratorHelper$3(this.files), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var file = _step2.value;
- formData.append(this.name, file, file.name);
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- xhr.upload.addEventListener("progress", function(event2) {
- if (event2.lengthComputable) {
- _this.progress = Math.round(event2.loaded * 100 / event2.total);
- }
- _this.$emit("progress", {
- originalEvent: event2,
- progress: _this.progress
- });
- });
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- var _this$uploadedFiles;
- _this.progress = 0;
- if (xhr.status >= 200 && xhr.status < 300) {
- if (_this.fileLimit) {
- _this.uploadedFileCount += _this.files.length;
- }
- _this.$emit("upload", {
- xhr,
- files: _this.files
- });
- } else {
- _this.$emit("error", {
- xhr,
- files: _this.files
- });
- }
- (_this$uploadedFiles = _this.uploadedFiles).push.apply(_this$uploadedFiles, _toConsumableArray$9(_this.files));
- _this.clear();
- }
- };
- xhr.open("POST", this.url, true);
- this.$emit("before-send", {
- xhr,
- formData
- });
- xhr.withCredentials = this.withCredentials;
- xhr.send(formData);
- }
- }, "uploader"),
- clear: /* @__PURE__ */ __name(function clear() {
- this.files = [];
- this.messages = null;
- this.$emit("clear");
- if (this.isAdvanced) {
- this.clearInputElement();
- }
- }, "clear"),
- onFocus: /* @__PURE__ */ __name(function onFocus5() {
- this.focused = true;
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur4() {
- this.focused = false;
- }, "onBlur"),
- isFileSelected: /* @__PURE__ */ __name(function isFileSelected(file) {
- if (this.files && this.files.length) {
- var _iterator3 = _createForOfIteratorHelper$3(this.files), _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- var sFile = _step3.value;
- if (sFile.name + sFile.type + sFile.size === file.name + file.type + file.size) return true;
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- }
- return false;
- }, "isFileSelected"),
- isIE11: /* @__PURE__ */ __name(function isIE11() {
- return !!window["MSInputMethodContext"] && !!document["documentMode"];
- }, "isIE11"),
- validate: /* @__PURE__ */ __name(function validate(file) {
- if (this.accept && !this.isFileTypeValid(file)) {
- this.messages.push(this.invalidFileTypeMessage.replace("{0}", file.name).replace("{1}", this.accept));
- return false;
- }
- if (this.maxFileSize && file.size > this.maxFileSize) {
- this.messages.push(this.invalidFileSizeMessage.replace("{0}", file.name).replace("{1}", this.formatSize(this.maxFileSize)));
- return false;
- }
- return true;
- }, "validate"),
- isFileTypeValid: /* @__PURE__ */ __name(function isFileTypeValid(file) {
- var acceptableTypes = this.accept.split(",").map(function(type2) {
- return type2.trim();
- });
- var _iterator4 = _createForOfIteratorHelper$3(acceptableTypes), _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
- var type = _step4.value;
- var acceptable = this.isWildcard(type) ? this.getTypeClass(file.type) === this.getTypeClass(type) : file.type == type || this.getFileExtension(file).toLowerCase() === type.toLowerCase();
- if (acceptable) {
- return true;
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- return false;
- }, "isFileTypeValid"),
- getTypeClass: /* @__PURE__ */ __name(function getTypeClass(fileType) {
- return fileType.substring(0, fileType.indexOf("/"));
- }, "getTypeClass"),
- isWildcard: /* @__PURE__ */ __name(function isWildcard(fileType) {
- return fileType.indexOf("*") !== -1;
- }, "isWildcard"),
- getFileExtension: /* @__PURE__ */ __name(function getFileExtension(file) {
- return "." + file.name.split(".").pop();
- }, "getFileExtension"),
- isImage: /* @__PURE__ */ __name(function isImage(file) {
- return /^image\//.test(file.type);
- }, "isImage"),
- onDragEnter: /* @__PURE__ */ __name(function onDragEnter(event2) {
- if (!this.disabled) {
- event2.stopPropagation();
- event2.preventDefault();
- }
- }, "onDragEnter"),
- onDragOver: /* @__PURE__ */ __name(function onDragOver(event2) {
- if (!this.disabled) {
- !this.isUnstyled && addClass(this.$refs.content, "p-fileupload-highlight");
- this.$refs.content.setAttribute("data-p-highlight", true);
- event2.stopPropagation();
- event2.preventDefault();
- }
- }, "onDragOver"),
- onDragLeave: /* @__PURE__ */ __name(function onDragLeave() {
- if (!this.disabled) {
- !this.isUnstyled && removeClass(this.$refs.content, "p-fileupload-highlight");
- this.$refs.content.setAttribute("data-p-highlight", false);
- }
- }, "onDragLeave"),
- onDrop: /* @__PURE__ */ __name(function onDrop(event2) {
- if (!this.disabled) {
- !this.isUnstyled && removeClass(this.$refs.content, "p-fileupload-highlight");
- this.$refs.content.setAttribute("data-p-highlight", false);
- event2.stopPropagation();
- event2.preventDefault();
- var files = event2.dataTransfer ? event2.dataTransfer.files : event2.target.files;
- var allowDrop = this.multiple || files && files.length === 1;
- if (allowDrop) {
- this.onFileSelect(event2);
- }
- }
- }, "onDrop"),
- remove: /* @__PURE__ */ __name(function remove(index) {
- this.clearInputElement();
- var removedFile = this.files.splice(index, 1)[0];
- this.files = _toConsumableArray$9(this.files);
- this.$emit("remove", {
- file: removedFile,
- files: this.files
- });
- }, "remove"),
- removeUploadedFile: /* @__PURE__ */ __name(function removeUploadedFile(index) {
- var removedFile = this.uploadedFiles.splice(index, 1)[0];
- this.uploadedFiles = _toConsumableArray$9(this.uploadedFiles);
- this.$emit("remove-uploaded-file", {
- file: removedFile,
- files: this.uploadedFiles
- });
- }, "removeUploadedFile"),
- clearInputElement: /* @__PURE__ */ __name(function clearInputElement() {
- this.$refs.fileInput.value = "";
- }, "clearInputElement"),
- clearIEInput: /* @__PURE__ */ __name(function clearIEInput() {
- if (this.$refs.fileInput) {
- this.duplicateIEEvent = true;
- this.$refs.fileInput.value = "";
- }
- }, "clearIEInput"),
- formatSize: /* @__PURE__ */ __name(function formatSize2(bytes) {
- var _this$$primevue$confi;
- var k = 1024;
- var dm = 3;
- var sizes = ((_this$$primevue$confi = this.$primevue.config.locale) === null || _this$$primevue$confi === void 0 ? void 0 : _this$$primevue$confi.fileSizeTypes) || ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
- if (bytes === 0) {
- return "0 ".concat(sizes[0]);
- }
- var i = Math.floor(Math.log(bytes) / Math.log(k));
- var formattedSize = parseFloat((bytes / Math.pow(k, i)).toFixed(dm));
- return "".concat(formattedSize, " ").concat(sizes[i]);
- }, "formatSize"),
- isFileLimitExceeded: /* @__PURE__ */ __name(function isFileLimitExceeded() {
- if (this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount && this.focused) {
- this.focused = false;
- }
- return this.fileLimit && this.fileLimit < this.files.length + this.uploadedFileCount;
- }, "isFileLimitExceeded"),
- checkFileLimit: /* @__PURE__ */ __name(function checkFileLimit() {
- if (this.isFileLimitExceeded()) {
- this.messages.push(this.invalidFileLimitMessage.replace("{0}", this.fileLimit.toString()));
- }
- }, "checkFileLimit"),
- onMessageClose: /* @__PURE__ */ __name(function onMessageClose() {
- this.messages = null;
- }, "onMessageClose")
- },
- computed: {
- isAdvanced: /* @__PURE__ */ __name(function isAdvanced() {
- return this.mode === "advanced";
- }, "isAdvanced"),
- isBasic: /* @__PURE__ */ __name(function isBasic() {
- return this.mode === "basic";
- }, "isBasic"),
- chooseButtonClass: /* @__PURE__ */ __name(function chooseButtonClass() {
- return [this.cx("pcChooseButton"), this["class"]];
- }, "chooseButtonClass"),
- basicFileChosenLabel: /* @__PURE__ */ __name(function basicFileChosenLabel() {
- var _this$$primevue$confi3;
- if (this.auto) return this.chooseButtonLabel;
- else if (this.hasFiles) {
- var _this$$primevue$confi2;
- if (this.files && this.files.length === 1) return this.files[0].name;
- return (_this$$primevue$confi2 = this.$primevue.config.locale) === null || _this$$primevue$confi2 === void 0 || (_this$$primevue$confi2 = _this$$primevue$confi2.fileChosenMessage) === null || _this$$primevue$confi2 === void 0 ? void 0 : _this$$primevue$confi2.replace("{0}", this.files.length);
- }
- return ((_this$$primevue$confi3 = this.$primevue.config.locale) === null || _this$$primevue$confi3 === void 0 ? void 0 : _this$$primevue$confi3.noFileChosenMessage) || "";
- }, "basicFileChosenLabel"),
- hasFiles: /* @__PURE__ */ __name(function hasFiles() {
- return this.files && this.files.length > 0;
- }, "hasFiles"),
- hasUploadedFiles: /* @__PURE__ */ __name(function hasUploadedFiles() {
- return this.uploadedFiles && this.uploadedFiles.length > 0;
- }, "hasUploadedFiles"),
- chooseDisabled: /* @__PURE__ */ __name(function chooseDisabled() {
- return this.disabled || this.fileLimit && this.fileLimit <= this.files.length + this.uploadedFileCount;
- }, "chooseDisabled"),
- uploadDisabled: /* @__PURE__ */ __name(function uploadDisabled() {
- return this.disabled || !this.hasFiles || this.fileLimit && this.fileLimit < this.files.length;
- }, "uploadDisabled"),
- cancelDisabled: /* @__PURE__ */ __name(function cancelDisabled() {
- return this.disabled || !this.hasFiles;
- }, "cancelDisabled"),
- chooseButtonLabel: /* @__PURE__ */ __name(function chooseButtonLabel() {
- return this.chooseLabel || this.$primevue.config.locale.choose;
- }, "chooseButtonLabel"),
- uploadButtonLabel: /* @__PURE__ */ __name(function uploadButtonLabel() {
- return this.uploadLabel || this.$primevue.config.locale.upload;
- }, "uploadButtonLabel"),
- cancelButtonLabel: /* @__PURE__ */ __name(function cancelButtonLabel() {
- return this.cancelLabel || this.$primevue.config.locale.cancel;
- }, "cancelButtonLabel"),
- completedLabel: /* @__PURE__ */ __name(function completedLabel() {
- return this.$primevue.config.locale.completed;
- }, "completedLabel"),
- pendingLabel: /* @__PURE__ */ __name(function pendingLabel() {
- return this.$primevue.config.locale.pending;
- }, "pendingLabel")
- },
- components: {
- Button: script$1d,
- ProgressBar: script$1z,
- Message: script$1A,
- FileContent: script$1$w,
- PlusIcon: script$1w,
- UploadIcon: script$R,
- TimesIcon: script$1q
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$n = ["multiple", "accept", "disabled"];
-var _hoisted_2$g = ["files"];
-var _hoisted_3$d = ["accept", "disabled", "multiple"];
-function render$L(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Button = resolveComponent("Button");
- var _component_ProgressBar = resolveComponent("ProgressBar");
- var _component_Message = resolveComponent("Message");
- var _component_FileContent = resolveComponent("FileContent");
- return $options.isAdvanced ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("input", mergeProps({
- ref: "fileInput",
- type: "file",
- onChange: _cache[0] || (_cache[0] = function() {
- return $options.onFileSelect && $options.onFileSelect.apply($options, arguments);
- }),
- multiple: _ctx.multiple,
- accept: _ctx.accept,
- disabled: $options.chooseDisabled
- }, _ctx.ptm("input")), null, 16, _hoisted_1$n), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("header")
- }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", {
- files: $data.files,
- uploadedFiles: $data.uploadedFiles,
- chooseCallback: $options.choose,
- uploadCallback: $options.uploader,
- clearCallback: $options.clear
- }, function() {
- return [createVNode(_component_Button, mergeProps({
- label: $options.chooseButtonLabel,
- "class": $options.chooseButtonClass,
- style: _ctx.style,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onClick: $options.choose,
- onKeydown: withKeys($options.choose, ["enter"]),
- onFocus: $options.onFocus,
- onBlur: $options.onBlur
- }, _ctx.chooseButtonProps, {
- pt: _ctx.ptm("pcChooseButton")
- }), {
- icon: withCtx(function(iconProps) {
- return [renderSlot(_ctx.$slots, "chooseicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.chooseIcon ? "span" : "PlusIcon"), mergeProps({
- "class": [iconProps["class"], _ctx.chooseIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("pcChooseButton")["icon"]), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["label", "class", "style", "disabled", "unstyled", "onClick", "onKeydown", "onFocus", "onBlur", "pt"]), _ctx.showUploadButton ? (openBlock(), createBlock(_component_Button, mergeProps({
- key: 0,
- "class": _ctx.cx("pcUploadButton"),
- label: $options.uploadButtonLabel,
- onClick: $options.uploader,
- disabled: $options.uploadDisabled,
- unstyled: _ctx.unstyled
- }, _ctx.uploadButtonProps, {
- pt: _ctx.ptm("pcUploadButton")
- }), {
- icon: withCtx(function(iconProps) {
- return [renderSlot(_ctx.$slots, "uploadicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.uploadIcon ? "span" : "UploadIcon"), mergeProps({
- "class": [iconProps["class"], _ctx.uploadIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("pcUploadButton")["icon"], {
- "data-pc-section": "uploadbuttonicon"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "label", "onClick", "disabled", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.showCancelButton ? (openBlock(), createBlock(_component_Button, mergeProps({
- key: 1,
- "class": _ctx.cx("pcCancelButton"),
- label: $options.cancelButtonLabel,
- onClick: $options.clear,
- disabled: $options.cancelDisabled,
- unstyled: _ctx.unstyled
- }, _ctx.cancelButtonProps, {
- pt: _ctx.ptm("pcCancelButton")
- }), {
- icon: withCtx(function(iconProps) {
- return [renderSlot(_ctx.$slots, "cancelicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.cancelIcon ? "span" : "TimesIcon"), mergeProps({
- "class": [iconProps["class"], _ctx.cancelIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("pcCancelButton")["icon"], {
- "data-pc-section": "cancelbuttonicon"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "label", "onClick", "disabled", "unstyled", "pt"])) : createCommentVNode("", true)];
- })], 16), createBaseVNode("div", mergeProps({
- ref: "content",
- "class": _ctx.cx("content"),
- onDragenter: _cache[1] || (_cache[1] = function() {
- return $options.onDragEnter && $options.onDragEnter.apply($options, arguments);
- }),
- onDragover: _cache[2] || (_cache[2] = function() {
- return $options.onDragOver && $options.onDragOver.apply($options, arguments);
- }),
- onDragleave: _cache[3] || (_cache[3] = function() {
- return $options.onDragLeave && $options.onDragLeave.apply($options, arguments);
- }),
- onDrop: _cache[4] || (_cache[4] = function() {
- return $options.onDrop && $options.onDrop.apply($options, arguments);
- })
- }, _ctx.ptm("content"), {
- "data-p-highlight": false
- }), [renderSlot(_ctx.$slots, "content", {
- files: $data.files,
- uploadedFiles: $data.uploadedFiles,
- removeUploadedFileCallback: $options.removeUploadedFile,
- removeFileCallback: $options.remove,
- progress: $data.progress,
- messages: $data.messages
- }, function() {
- return [$options.hasFiles ? (openBlock(), createBlock(_component_ProgressBar, {
- key: 0,
- value: $data.progress,
- showValue: false,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcProgressbar")
- }, null, 8, ["value", "unstyled", "pt"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function(msg) {
- return openBlock(), createBlock(_component_Message, {
- key: msg,
- severity: "error",
- onClose: $options.onMessageClose,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcMessage")
- }, {
- "default": withCtx(function() {
- return [createTextVNode(toDisplayString(msg), 1)];
- }),
- _: 2
- }, 1032, ["onClose", "unstyled", "pt"]);
- }), 128)), $options.hasFiles ? (openBlock(), createElementBlock("div", {
- key: 1,
- "class": normalizeClass(_ctx.cx("fileList"))
- }, [createVNode(_component_FileContent, {
- files: $data.files,
- onRemove: $options.remove,
- badgeValue: $options.pendingLabel,
- previewWidth: _ctx.previewWidth,
- templates: _ctx.$slots,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["files", "onRemove", "badgeValue", "previewWidth", "templates", "unstyled", "pt"])], 2)) : createCommentVNode("", true), $options.hasUploadedFiles ? (openBlock(), createElementBlock("div", {
- key: 2,
- "class": normalizeClass(_ctx.cx("fileList"))
- }, [createVNode(_component_FileContent, {
- files: $data.uploadedFiles,
- onRemove: $options.removeUploadedFile,
- badgeValue: $options.completedLabel,
- badgeSeverity: "success",
- previewWidth: _ctx.previewWidth,
- templates: _ctx.$slots,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["files", "onRemove", "badgeValue", "previewWidth", "templates", "unstyled", "pt"])], 2)) : createCommentVNode("", true)];
- }), _ctx.$slots.empty && !$options.hasFiles && !$options.hasUploadedFiles ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({
- key: 0
- }, _ctx.ptm("empty"))), [renderSlot(_ctx.$slots, "empty")], 16)) : createCommentVNode("", true)], 16)], 16)) : $options.isBasic ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function(msg) {
- return openBlock(), createBlock(_component_Message, {
- key: msg,
- severity: "error",
- onClose: $options.onMessageClose,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcMessage")
- }, {
- "default": withCtx(function() {
- return [createTextVNode(toDisplayString(msg), 1)];
- }),
- _: 2
- }, 1032, ["onClose", "unstyled", "pt"]);
- }), 128)), createVNode(_component_Button, mergeProps({
- label: $options.chooseButtonLabel,
- "class": $options.chooseButtonClass,
- style: _ctx.style,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onMouseup: $options.onBasicUploaderClick,
- onKeydown: withKeys($options.choose, ["enter"]),
- onFocus: $options.onFocus,
- onBlur: $options.onBlur
- }, _ctx.chooseButtonProps, {
- pt: _ctx.ptm("pcChooseButton")
- }), {
- icon: withCtx(function(iconProps) {
- return [renderSlot(_ctx.$slots, "chooseicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.chooseIcon ? "span" : "PlusIcon"), mergeProps({
- "class": [iconProps["class"], _ctx.chooseIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("pcChooseButton")["icon"]), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["label", "class", "style", "disabled", "unstyled", "onMouseup", "onKeydown", "onFocus", "onBlur", "pt"]), !_ctx.auto ? renderSlot(_ctx.$slots, "filelabel", {
- key: 0,
- "class": normalizeClass(_ctx.cx("filelabel"))
- }, function() {
- return [createBaseVNode("span", {
- "class": normalizeClass(_ctx.cx("filelabel")),
- files: $data.files
- }, toDisplayString($options.basicFileChosenLabel), 11, _hoisted_2$g)];
- }) : createCommentVNode("", true), createBaseVNode("input", mergeProps({
- ref: "fileInput",
- type: "file",
- accept: _ctx.accept,
- disabled: _ctx.disabled,
- multiple: _ctx.multiple,
- onChange: _cache[5] || (_cache[5] = function() {
- return $options.onFileSelect && $options.onFileSelect.apply($options, arguments);
- }),
- onFocus: _cache[6] || (_cache[6] = function() {
- return $options.onFocus && $options.onFocus.apply($options, arguments);
- }),
- onBlur: _cache[7] || (_cache[7] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- })
- }, _ctx.ptm("input")), null, 16, _hoisted_3$d)], 16)) : createCommentVNode("", true);
-}
-__name(render$L, "render$L");
-script$Q.render = render$L;
-var classes$v = {
- root: "p-fluid"
-};
-var FluidStyle = BaseStyle.extend({
- name: "fluid",
- classes: classes$v
-});
-var script$1$v = {
- name: "BaseFluid",
- "extends": script$1f,
- style: FluidStyle,
- provide: /* @__PURE__ */ __name(function provide19() {
- return {
- $pcFluid: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$P = {
- name: "Fluid",
- "extends": script$1$v,
- inheritAttrs: false
-};
-function render$K(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$K, "render$K");
-script$P.render = render$K;
-var theme$r = /* @__PURE__ */ __name(function theme12(_ref) {
- var dt = _ref.dt;
- return "\n.p-iftalabel {\n display: block;\n position: relative;\n}\n\n.p-iftalabel label {\n position: absolute;\n pointer-events: none;\n top: ".concat(dt("iftalabel.top"), ";\n transition-property: all;\n transition-timing-function: ease;\n line-height: 1;\n font-size: ").concat(dt("iftalabel.font.size"), ";\n font-weight: ").concat(dt("iftalabel.font.weight"), ";\n inset-inline-start: ").concat(dt("iftalabel.position.x"), ";\n color: ").concat(dt("iftalabel.color"), ";\n transition-duration: ").concat(dt("iftalabel.transition.duration"), ";\n}\n\n.p-iftalabel .p-inputtext,\n.p-iftalabel .p-textarea,\n.p-iftalabel .p-select-label,\n.p-iftalabel .p-multiselect-label,\n.p-iftalabel .p-autocomplete-input-multiple,\n.p-iftalabel .p-cascadeselect-label,\n.p-iftalabel .p-treeselect-label {\n padding-block-start: ").concat(dt("iftalabel.input.padding.top"), ";\n padding-block-end: ").concat(dt("iftalabel.input.padding.bottom"), ";\n}\n\n.p-iftalabel:has(.p-invalid) label {\n color: ").concat(dt("iftalabel.invalid.color"), ";\n}\n\n.p-iftalabel:has(input:focus) label,\n.p-iftalabel:has(input:-webkit-autofill) label,\n.p-iftalabel:has(textarea:focus) label,\n.p-iftalabel:has(.p-inputwrapper-focus) label {\n color: ").concat(dt("iftalabel.focus.color"), ";\n}\n\n.p-iftalabel .p-inputicon {\n top: ").concat(dt("iftalabel.input.padding.top"), ";\n transform: translateY(25%);\n margin-top: 0;\n}\n");
-}, "theme");
-var classes$u = {
- root: "p-iftalabel"
-};
-var IftaLabelStyle = BaseStyle.extend({
- name: "iftalabel",
- theme: theme$r,
- classes: classes$u
-});
-var script$1$u = {
- name: "BaseIftaLabel",
- "extends": script$1f,
- style: IftaLabelStyle,
- provide: /* @__PURE__ */ __name(function provide20() {
- return {
- $pcIftaLabel: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$O = {
- name: "IftaLabel",
- "extends": script$1$u,
- inheritAttrs: false
-};
-function render$J(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("span", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$J, "render$J");
-script$O.render = render$J;
-var script$N = {
- name: "EyeIcon",
- "extends": script$1j
-};
-function render$I(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M0.0535499 7.25213C0.208567 7.59162 2.40413 12.4 7 12.4C11.5959 12.4 13.7914 7.59162 13.9465 7.25213C13.9487 7.2471 13.9506 7.24304 13.952 7.24001C13.9837 7.16396 14 7.08239 14 7.00001C14 6.91762 13.9837 6.83605 13.952 6.76001C13.9506 6.75697 13.9487 6.75292 13.9465 6.74788C13.7914 6.4084 11.5959 1.60001 7 1.60001C2.40413 1.60001 0.208567 6.40839 0.0535499 6.74788C0.0512519 6.75292 0.0494023 6.75697 0.048 6.76001C0.0163137 6.83605 0 6.91762 0 7.00001C0 7.08239 0.0163137 7.16396 0.048 7.24001C0.0494023 7.24304 0.0512519 7.2471 0.0535499 7.25213ZM7 11.2C3.664 11.2 1.736 7.92001 1.264 7.00001C1.736 6.08001 3.664 2.80001 7 2.80001C10.336 2.80001 12.264 6.08001 12.736 7.00001C12.264 7.92001 10.336 11.2 7 11.2ZM5.55551 9.16182C5.98308 9.44751 6.48576 9.6 7 9.6C7.68891 9.59789 8.349 9.32328 8.83614 8.83614C9.32328 8.349 9.59789 7.68891 9.59999 7C9.59999 6.48576 9.44751 5.98308 9.16182 5.55551C8.87612 5.12794 8.47006 4.7947 7.99497 4.59791C7.51988 4.40112 6.99711 4.34963 6.49276 4.44995C5.98841 4.55027 5.52513 4.7979 5.16152 5.16152C4.7979 5.52513 4.55027 5.98841 4.44995 6.49276C4.34963 6.99711 4.40112 7.51988 4.59791 7.99497C4.7947 8.47006 5.12794 8.87612 5.55551 9.16182ZM6.2222 5.83594C6.45243 5.6821 6.7231 5.6 7 5.6C7.37065 5.6021 7.72553 5.75027 7.98762 6.01237C8.24972 6.27446 8.39789 6.62934 8.4 7C8.4 7.27689 8.31789 7.54756 8.16405 7.77779C8.01022 8.00802 7.79157 8.18746 7.53575 8.29343C7.27994 8.39939 6.99844 8.42711 6.72687 8.37309C6.4553 8.31908 6.20584 8.18574 6.01005 7.98994C5.81425 7.79415 5.68091 7.54469 5.6269 7.27312C5.57288 7.00155 5.6006 6.72006 5.70656 6.46424C5.81253 6.20842 5.99197 5.98977 6.2222 5.83594Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$I, "render$I");
-script$N.render = render$I;
-var script$M = {
- name: "RefreshIcon",
- "extends": script$1j
-};
-function render$H(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M6.77051 5.96336C6.84324 5.99355 6.92127 6.00891 7.00002 6.00854C7.07877 6.00891 7.1568 5.99355 7.22953 5.96336C7.30226 5.93317 7.36823 5.88876 7.42357 5.83273L9.82101 3.43529C9.93325 3.32291 9.99629 3.17058 9.99629 3.01175C9.99629 2.85292 9.93325 2.70058 9.82101 2.5882L7.42357 0.190763C7.3687 0.131876 7.30253 0.0846451 7.22901 0.0518865C7.15549 0.019128 7.07612 0.00151319 6.99564 9.32772e-05C6.91517 -0.00132663 6.83523 0.0134773 6.7606 0.0436218C6.68597 0.0737664 6.61817 0.118634 6.56126 0.175548C6.50435 0.232462 6.45948 0.300257 6.42933 0.374888C6.39919 0.449519 6.38439 0.529456 6.38581 0.609933C6.38722 0.690409 6.40484 0.769775 6.4376 0.843296C6.47036 0.916817 6.51759 0.982986 6.57647 1.03786L7.95103 2.41241H6.99998C5.46337 2.41241 3.98969 3.02283 2.90314 4.10938C1.81659 5.19593 1.20618 6.66961 1.20618 8.20622C1.20618 9.74283 1.81659 11.2165 2.90314 12.3031C3.98969 13.3896 5.46337 14 6.99998 14C8.53595 13.9979 10.0084 13.3868 11.0945 12.3007C12.1806 11.2146 12.7917 9.74218 12.7938 8.20622C12.7938 8.04726 12.7306 7.89481 12.6182 7.78241C12.5058 7.67001 12.3534 7.60686 12.1944 7.60686C12.0355 7.60686 11.883 7.67001 11.7706 7.78241C11.6582 7.89481 11.5951 8.04726 11.5951 8.20622C11.5951 9.11504 11.3256 10.0035 10.8207 10.7591C10.3157 11.5148 9.59809 12.1037 8.75845 12.4515C7.9188 12.7993 6.99489 12.8903 6.10353 12.713C5.21217 12.5357 4.3934 12.0981 3.75077 11.4554C3.10813 10.8128 2.67049 9.99404 2.49319 9.10268C2.31589 8.21132 2.40688 7.2874 2.75468 6.44776C3.10247 5.60811 3.69143 4.89046 4.44709 4.38554C5.20275 3.88063 6.09116 3.61113 6.99998 3.61113H7.95098L6.57647 4.98564C6.46423 5.09802 6.40119 5.25035 6.40119 5.40918C6.40119 5.56801 6.46423 5.72035 6.57647 5.83273C6.63181 5.88876 6.69778 5.93317 6.77051 5.96336Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$H, "render$H");
-script$M.render = render$H;
-var script$L = {
- name: "SearchMinusIcon",
- "extends": script$1j
-};
-function render$G(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M6.0208 12.0411C4.83005 12.0411 3.66604 11.688 2.67596 11.0265C1.68589 10.3649 0.914216 9.42464 0.458534 8.32452C0.00285271 7.22441 -0.116374 6.01388 0.11593 4.84601C0.348235 3.67813 0.921637 2.60537 1.76363 1.76338C2.60562 0.921393 3.67838 0.34799 4.84625 0.115686C6.01412 -0.116618 7.22466 0.00260857 8.32477 0.45829C9.42488 0.913972 10.3652 1.68564 11.0267 2.67572C11.6883 3.66579 12.0414 4.8298 12.0414 6.02056C12.0395 7.41563 11.5542 8.76029 10.6783 9.8305L13.8244 12.9765C13.9367 13.089 13.9997 13.2414 13.9997 13.4003C13.9997 13.5592 13.9367 13.7116 13.8244 13.8241C13.769 13.8801 13.703 13.9245 13.6302 13.9548C13.5575 13.985 13.4794 14.0003 13.4006 14C13.3218 14.0003 13.2437 13.985 13.171 13.9548C13.0982 13.9245 13.0322 13.8801 12.9768 13.8241L9.83082 10.678C8.76059 11.5539 7.4159 12.0393 6.0208 12.0411ZM6.0208 1.20731C5.07199 1.20731 4.14449 1.48867 3.35559 2.0158C2.56669 2.54292 1.95181 3.29215 1.58872 4.16874C1.22562 5.04532 1.13062 6.00989 1.31572 6.94046C1.50083 7.87104 1.95772 8.72583 2.62863 9.39674C3.29954 10.0676 4.15433 10.5245 5.0849 10.7096C6.01548 10.8947 6.98005 10.7997 7.85663 10.4367C8.73322 10.0736 9.48244 9.45868 10.0096 8.66978C10.5367 7.88088 10.8181 6.95337 10.8181 6.00457C10.8181 4.73226 10.3126 3.51206 9.41297 2.6124C8.51331 1.71274 7.29311 1.20731 6.0208 1.20731ZM4.00591 6.60422H8.00362C8.16266 6.60422 8.31518 6.54104 8.42764 6.42859C8.5401 6.31613 8.60328 6.1636 8.60328 6.00456C8.60328 5.84553 8.5401 5.693 8.42764 5.58054C8.31518 5.46809 8.16266 5.40491 8.00362 5.40491H4.00591C3.84687 5.40491 3.69434 5.46809 3.58189 5.58054C3.46943 5.693 3.40625 5.84553 3.40625 6.00456C3.40625 6.1636 3.46943 6.31613 3.58189 6.42859C3.69434 6.54104 3.84687 6.60422 4.00591 6.60422Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$G, "render$G");
-script$L.render = render$G;
-var script$K = {
- name: "SearchPlusIcon",
- "extends": script$1j
-};
-function render$F(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M2.67596 11.0265C3.66604 11.688 4.83005 12.0411 6.0208 12.0411C6.81143 12.0411 7.59432 11.8854 8.32477 11.5828C8.86999 11.357 9.37802 11.0526 9.83311 10.6803L12.9768 13.8241C13.0322 13.8801 13.0982 13.9245 13.171 13.9548C13.2437 13.985 13.3218 14.0003 13.4006 14C13.4794 14.0003 13.5575 13.985 13.6302 13.9548C13.703 13.9245 13.769 13.8801 13.8244 13.8241C13.9367 13.7116 13.9997 13.5592 13.9997 13.4003C13.9997 13.2414 13.9367 13.089 13.8244 12.9765L10.6806 9.8328C11.0529 9.37773 11.3572 8.86972 11.5831 8.32452C11.8856 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0267 2.67572C10.3652 1.68564 9.42488 0.913972 8.32477 0.45829C7.22466 0.00260857 6.01412 -0.116618 4.84625 0.115686C3.67838 0.34799 2.60562 0.921393 1.76363 1.76338C0.921637 2.60537 0.348235 3.67813 0.11593 4.84601C-0.116374 6.01388 0.00285271 7.22441 0.458534 8.32452C0.914216 9.42464 1.68589 10.3649 2.67596 11.0265ZM3.35559 2.0158C4.14449 1.48867 5.07199 1.20731 6.0208 1.20731C7.29311 1.20731 8.51331 1.71274 9.41297 2.6124C10.3126 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5367 7.88088 10.0096 8.66978C9.48244 9.45868 8.73322 10.0736 7.85663 10.4367C6.98005 10.7997 6.01548 10.8947 5.0849 10.7096C4.15433 10.5245 3.29954 10.0676 2.62863 9.39674C1.95772 8.72583 1.50083 7.87104 1.31572 6.94046C1.13062 6.00989 1.22562 5.04532 1.58872 4.16874C1.95181 3.29215 2.56669 2.54292 3.35559 2.0158ZM6.00481 8.60309C5.84641 8.60102 5.69509 8.53718 5.58308 8.42517C5.47107 8.31316 5.40722 8.16183 5.40515 8.00344V6.60422H4.00591C3.84687 6.60422 3.69434 6.54104 3.58189 6.42859C3.46943 6.31613 3.40625 6.1636 3.40625 6.00456C3.40625 5.84553 3.46943 5.693 3.58189 5.58054C3.69434 5.46809 3.84687 5.40491 4.00591 5.40491H5.40515V4.00572C5.40515 3.84668 5.46833 3.69416 5.58079 3.5817C5.69324 3.46924 5.84577 3.40607 6.00481 3.40607C6.16385 3.40607 6.31637 3.46924 6.42883 3.5817C6.54129 3.69416 6.60447 3.84668 6.60447 4.00572V5.40491H8.00362C8.16266 5.40491 8.31518 5.46809 8.42764 5.58054C8.5401 5.693 8.60328 5.84553 8.60328 6.00456C8.60328 6.1636 8.5401 6.31613 8.42764 6.42859C8.31518 6.54104 8.16266 6.60422 8.00362 6.60422H6.60447V8.00344C6.60239 8.16183 6.53855 8.31316 6.42654 8.42517C6.31453 8.53718 6.1632 8.60102 6.00481 8.60309Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$F, "render$F");
-script$K.render = render$F;
-var script$J = {
- name: "UndoIcon",
- "extends": script$1j
-};
-function render$E(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M6.77042 5.96336C6.84315 5.99355 6.92118 6.00891 6.99993 6.00854C7.07868 6.00891 7.15671 5.99355 7.22944 5.96336C7.30217 5.93317 7.36814 5.88876 7.42348 5.83273C7.53572 5.72035 7.59876 5.56801 7.59876 5.40918C7.59876 5.25035 7.53572 5.09802 7.42348 4.98564L6.04897 3.61113H6.99998C7.9088 3.61113 8.79722 3.88063 9.55288 4.38554C10.3085 4.89046 10.8975 5.60811 11.2453 6.44776C11.5931 7.2874 11.6841 8.21132 11.5068 9.10268C11.3295 9.99404 10.8918 10.8128 10.2492 11.4554C9.60657 12.0981 8.7878 12.5357 7.89644 12.713C7.00508 12.8903 6.08116 12.7993 5.24152 12.4515C4.40188 12.1037 3.68422 11.5148 3.17931 10.7591C2.67439 10.0035 2.4049 9.11504 2.4049 8.20622C2.4049 8.04726 2.34175 7.89481 2.22935 7.78241C2.11695 7.67001 1.9645 7.60686 1.80554 7.60686C1.64658 7.60686 1.49413 7.67001 1.38172 7.78241C1.26932 7.89481 1.20618 8.04726 1.20618 8.20622C1.20829 9.74218 1.81939 11.2146 2.90548 12.3007C3.99157 13.3868 5.46402 13.9979 6.99998 14C8.5366 14 10.0103 13.3896 11.0968 12.3031C12.1834 11.2165 12.7938 9.74283 12.7938 8.20622C12.7938 6.66961 12.1834 5.19593 11.0968 4.10938C10.0103 3.02283 8.5366 2.41241 6.99998 2.41241H6.04892L7.42348 1.03786C7.48236 0.982986 7.5296 0.916817 7.56235 0.843296C7.59511 0.769775 7.61273 0.690409 7.61415 0.609933C7.61557 0.529456 7.60076 0.449519 7.57062 0.374888C7.54047 0.300257 7.49561 0.232462 7.43869 0.175548C7.38178 0.118634 7.31398 0.0737664 7.23935 0.0436218C7.16472 0.0134773 7.08478 -0.00132663 7.00431 9.32772e-05C6.92383 0.00151319 6.84447 0.019128 6.77095 0.0518865C6.69742 0.0846451 6.63126 0.131876 6.57638 0.190763L4.17895 2.5882C4.06671 2.70058 4.00366 2.85292 4.00366 3.01175C4.00366 3.17058 4.06671 3.32291 4.17895 3.43529L6.57638 5.83273C6.63172 5.88876 6.69769 5.93317 6.77042 5.96336Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$E, "render$E");
-script$J.render = render$E;
-var theme$q = /* @__PURE__ */ __name(function theme13(_ref) {
- var dt = _ref.dt;
- return "\n.p-image-mask {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-image-preview {\n position: relative;\n display: inline-flex;\n line-height: 0;\n}\n\n.p-image-preview-mask {\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s;\n border: 0 none;\n padding: 0;\n cursor: pointer;\n background: transparent;\n color: ".concat(dt("image.preview.mask.color"), ";\n transition: background ").concat(dt("image.transition.duration"), ";\n}\n\n.p-image-preview:hover > .p-image-preview-mask {\n opacity: 1;\n cursor: pointer;\n background: ").concat(dt("image.preview.mask.background"), ";\n}\n\n.p-image-preview-icon {\n font-size: ").concat(dt("image.preview.icon.size"), ";\n width: ").concat(dt("image.preview.icon.size"), ";\n height: ").concat(dt("image.preview.icon.size"), ";\n}\n\n.p-image-toolbar {\n position: absolute;\n inset-block-start: ").concat(dt("image.toolbar.position.top"), ";\n inset-inline-end: ").concat(dt("image.toolbar.position.right"), ";\n inset-inline-start: ").concat(dt("image.toolbar.position.left"), ";\n inset-block-end: ").concat(dt("image.toolbar.position.bottom"), ";\n display: flex;\n z-index: 1;\n padding: ").concat(dt("image.toolbar.padding"), ";\n background: ").concat(dt("image.toolbar.background"), ";\n backdrop-filter: blur(").concat(dt("image.toolbar.blur"), ");\n border-color: ").concat(dt("image.toolbar.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("image.toolbar.border.width"), ";\n border-radius: ").concat(dt("image.toolbar.border.radius"), ";\n gap: ").concat(dt("image.toolbar.gap"), ";\n}\n\n.p-image-action {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n color: ").concat(dt("image.action.color"), ";\n background: transparent;\n width: ").concat(dt("image.action.size"), ";\n height: ").concat(dt("image.action.size"), ";\n margin: 0;\n padding: 0;\n border: 0 none;\n cursor: pointer;\n user-select: none;\n border-radius: ").concat(dt("image.action.border.radius"), ";\n outline-color: transparent;\n transition: background ").concat(dt("image.transition.duration"), ", color ").concat(dt("image.transition.duration"), ", outline-color ").concat(dt("image.transition.duration"), ", box-shadow ").concat(dt("image.transition.duration"), ";\n}\n\n.p-image-action:hover {\n color: ").concat(dt("image.action.hover.color"), ";\n background: ").concat(dt("image.action.hover.background"), ";\n}\n\n.p-image-action:focus-visible {\n box-shadow: ").concat(dt("image.action.focus.ring.shadow"), ";\n outline: ").concat(dt("image.action.focus.ring.width"), " ").concat(dt("image.action.focus.ring.style"), " ").concat(dt("image.action.focus.ring.color"), ";\n outline-offset: ").concat(dt("image.action.focus.ring.offset"), ";\n}\n\n.p-image-action .p-icon {\n font-size: ").concat(dt("image.action.icon.size"), ";\n width: ").concat(dt("image.action.icon.size"), ";\n height: ").concat(dt("image.action.icon.size"), ";\n}\n\n.p-image-action.p-disabled {\n pointer-events: auto;\n}\n\n.p-image-original {\n transition: transform 0.15s;\n max-width: 100vw;\n max-height: 100vh;\n}\n\n.p-image-original-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n\n.p-image-original-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.p-image-original-enter-from,\n.p-image-original-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n");
-}, "theme");
-var classes$t = {
- root: /* @__PURE__ */ __name(function root12(_ref2) {
- var props = _ref2.props;
- return ["p-image p-component", {
- "p-image-preview": props.preview
- }];
- }, "root"),
- previewMask: "p-image-preview-mask",
- previewIcon: "p-image-preview-icon",
- mask: "p-image-mask p-overlay-mask p-overlay-mask-enter",
- toolbar: "p-image-toolbar",
- rotateRightButton: "p-image-action p-image-rotate-right-button",
- rotateLeftButton: "p-image-action p-image-rotate-left-button",
- zoomOutButton: /* @__PURE__ */ __name(function zoomOutButton(_ref3) {
- var instance = _ref3.instance;
- return ["p-image-action p-image-zoom-out-button", {
- "p-disabled": instance.isZoomOutDisabled
- }];
- }, "zoomOutButton"),
- zoomInButton: /* @__PURE__ */ __name(function zoomInButton(_ref4) {
- var instance = _ref4.instance;
- return ["p-image-action p-image-zoom-in-button", {
- "p-disabled": instance.isZoomInDisabled
- }];
- }, "zoomInButton"),
- closeButton: "p-image-action p-image-close-button",
- original: "p-image-original"
-};
-var ImageStyle = BaseStyle.extend({
- name: "image",
- theme: theme$q,
- classes: classes$t
-});
-var script$1$t = {
- name: "BaseImage",
- "extends": script$1f,
- props: {
- preview: {
- type: Boolean,
- "default": false
- },
- "class": {
- type: null,
- "default": null
- },
- style: {
- type: null,
- "default": null
- },
- imageStyle: {
- type: null,
- "default": null
- },
- imageClass: {
- type: null,
- "default": null
- },
- previewButtonProps: {
- type: null,
- "default": null
- },
- indicatorIcon: {
- type: String,
- "default": void 0
- },
- previewIcon: {
- type: String,
- "default": void 0
- },
- zoomInDisabled: {
- type: Boolean,
- "default": false
- },
- zoomOutDisabled: {
- type: Boolean,
- "default": false
- }
- },
- style: ImageStyle,
- provide: /* @__PURE__ */ __name(function provide21() {
- return {
- $pcImage: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$I = {
- name: "Image",
- "extends": script$1$t,
- inheritAttrs: false,
- emits: ["show", "hide", "error"],
- mask: null,
- data: /* @__PURE__ */ __name(function data13() {
- return {
- maskVisible: false,
- previewVisible: false,
- rotate: 0,
- scale: 1
- };
- }, "data"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount6() {
- if (this.mask) {
- ZIndex.clear(this.container);
- }
- }, "beforeUnmount"),
- methods: {
- maskRef: /* @__PURE__ */ __name(function maskRef(el) {
- this.mask = el;
- }, "maskRef"),
- toolbarRef: /* @__PURE__ */ __name(function toolbarRef(el) {
- this.toolbarRef = el;
- }, "toolbarRef"),
- onImageClick: /* @__PURE__ */ __name(function onImageClick() {
- var _this = this;
- if (this.preview) {
- blockBodyScroll();
- this.maskVisible = true;
- setTimeout(function() {
- _this.previewVisible = true;
- }, 25);
- }
- }, "onImageClick"),
- onPreviewImageClick: /* @__PURE__ */ __name(function onPreviewImageClick() {
- this.previewClick = true;
- }, "onPreviewImageClick"),
- onMaskClick: /* @__PURE__ */ __name(function onMaskClick(event2) {
- var isBarActionsClicked = isAttributeEquals(event2.target, "data-pc-section-group", "action") || event2.target.closest('[data-pc-section-group="action"]');
- if (!this.previewClick && !isBarActionsClicked) {
- this.previewVisible = false;
- this.rotate = 0;
- this.scale = 1;
- }
- this.previewClick = false;
- }, "onMaskClick"),
- onMaskKeydown: /* @__PURE__ */ __name(function onMaskKeydown(event2) {
- var _this2 = this;
- switch (event2.code) {
- case "Escape":
- this.hidePreview();
- setTimeout(function() {
- focus(_this2.$refs.previewButton);
- }, 200);
- event2.preventDefault();
- break;
- }
- }, "onMaskKeydown"),
- onError: /* @__PURE__ */ __name(function onError2() {
- this.$emit("error");
- }, "onError"),
- rotateRight: /* @__PURE__ */ __name(function rotateRight() {
- this.rotate += 90;
- this.previewClick = true;
- }, "rotateRight"),
- rotateLeft: /* @__PURE__ */ __name(function rotateLeft() {
- this.rotate -= 90;
- this.previewClick = true;
- }, "rotateLeft"),
- zoomIn: /* @__PURE__ */ __name(function zoomIn() {
- this.scale = this.scale + 0.1;
- this.previewClick = true;
- }, "zoomIn"),
- zoomOut: /* @__PURE__ */ __name(function zoomOut() {
- this.scale = this.scale - 0.1;
- this.previewClick = true;
- }, "zoomOut"),
- onBeforeEnter: /* @__PURE__ */ __name(function onBeforeEnter() {
- ZIndex.set("modal", this.mask, this.$primevue.config.zIndex.modal);
- }, "onBeforeEnter"),
- onEnter: /* @__PURE__ */ __name(function onEnter() {
- this.focus();
- this.$emit("show");
- }, "onEnter"),
- onBeforeLeave: /* @__PURE__ */ __name(function onBeforeLeave() {
- !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave");
- }, "onBeforeLeave"),
- onLeave: /* @__PURE__ */ __name(function onLeave() {
- unblockBodyScroll();
- this.$emit("hide");
- }, "onLeave"),
- onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave(el) {
- ZIndex.clear(el);
- this.maskVisible = false;
- }, "onAfterLeave"),
- focus: /* @__PURE__ */ __name(function focus2() {
- var focusTarget = this.mask.querySelector("[autofocus]");
- if (focusTarget) {
- focusTarget.focus();
- }
- }, "focus"),
- hidePreview: /* @__PURE__ */ __name(function hidePreview() {
- this.previewVisible = false;
- this.rotate = 0;
- this.scale = 1;
- unblockBodyScroll();
- }, "hidePreview")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass2() {
- return [this.cx("root"), this["class"]];
- }, "containerClass"),
- rotateClass: /* @__PURE__ */ __name(function rotateClass() {
- return "p-image-preview-rotate-" + this.rotate;
- }, "rotateClass"),
- imagePreviewStyle: /* @__PURE__ */ __name(function imagePreviewStyle() {
- return {
- transform: "rotate(" + this.rotate + "deg) scale(" + this.scale + ")"
- };
- }, "imagePreviewStyle"),
- isZoomInDisabled: /* @__PURE__ */ __name(function isZoomInDisabled() {
- return this.zoomInDisabled || this.scale >= 1.5;
- }, "isZoomInDisabled"),
- isZoomOutDisabled: /* @__PURE__ */ __name(function isZoomOutDisabled() {
- return this.zoomOutDisabled || this.scale <= 0.5;
- }, "isZoomOutDisabled"),
- rightAriaLabel: /* @__PURE__ */ __name(function rightAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.rotateRight : void 0;
- }, "rightAriaLabel"),
- leftAriaLabel: /* @__PURE__ */ __name(function leftAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.rotateLeft : void 0;
- }, "leftAriaLabel"),
- zoomInAriaLabel: /* @__PURE__ */ __name(function zoomInAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomIn : void 0;
- }, "zoomInAriaLabel"),
- zoomOutAriaLabel: /* @__PURE__ */ __name(function zoomOutAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomOut : void 0;
- }, "zoomOutAriaLabel"),
- zoomImageAriaLabel: /* @__PURE__ */ __name(function zoomImageAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomImage : void 0;
- }, "zoomImageAriaLabel"),
- closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
- }, "closeAriaLabel")
- },
- components: {
- Portal: script$1m,
- EyeIcon: script$N,
- RefreshIcon: script$M,
- UndoIcon: script$J,
- SearchMinusIcon: script$L,
- SearchPlusIcon: script$K,
- TimesIcon: script$1q
- },
- directives: {
- focustrap: FocusTrap
- }
-};
-function _typeof$h(o) {
- "@babel/helpers - typeof";
- return _typeof$h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$h(o);
-}
-__name(_typeof$h, "_typeof$h");
-function ownKeys$f(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$f, "ownKeys$f");
-function _objectSpread$f(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$f(Object(t2), true).forEach(function(r2) {
- _defineProperty$g(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$f(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$f, "_objectSpread$f");
-function _defineProperty$g(e, r, t2) {
- return (r = _toPropertyKey$g(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$g, "_defineProperty$g");
-function _toPropertyKey$g(t2) {
- var i = _toPrimitive$g(t2, "string");
- return "symbol" == _typeof$h(i) ? i : i + "";
-}
-__name(_toPropertyKey$g, "_toPropertyKey$g");
-function _toPrimitive$g(t2, r) {
- if ("object" != _typeof$h(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$h(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$g, "_toPrimitive$g");
-var _hoisted_1$m = ["aria-label"];
-var _hoisted_2$f = ["aria-modal"];
-var _hoisted_3$c = ["aria-label"];
-var _hoisted_4$8 = ["aria-label"];
-var _hoisted_5$3 = ["disabled", "aria-label"];
-var _hoisted_6$1 = ["disabled", "aria-label"];
-var _hoisted_7$1 = ["aria-label"];
-var _hoisted_8$1 = ["src"];
-function render$D(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_RefreshIcon = resolveComponent("RefreshIcon");
- var _component_UndoIcon = resolveComponent("UndoIcon");
- var _component_SearchMinusIcon = resolveComponent("SearchMinusIcon");
- var _component_SearchPlusIcon = resolveComponent("SearchPlusIcon");
- var _component_TimesIcon = resolveComponent("TimesIcon");
- var _component_Portal = resolveComponent("Portal");
- var _directive_focustrap = resolveDirective("focustrap");
- return openBlock(), createElementBlock("span", mergeProps({
- "class": $options.containerClass,
- style: _ctx.style
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "image", {
- errorCallback: $options.onError
- }, function() {
- return [createBaseVNode("img", mergeProps({
- style: _ctx.imageStyle,
- "class": _ctx.imageClass,
- onError: _cache[0] || (_cache[0] = function() {
- return $options.onError && $options.onError.apply($options, arguments);
- })
- }, _objectSpread$f(_objectSpread$f({}, _ctx.$attrs), _ctx.ptm("image"))), null, 16)];
- }), _ctx.preview ? (openBlock(), createElementBlock("button", mergeProps({
- key: 0,
- ref: "previewButton",
- "aria-label": $options.zoomImageAriaLabel,
- type: "button",
- "class": _ctx.cx("previewMask"),
- onClick: _cache[1] || (_cache[1] = function() {
- return $options.onImageClick && $options.onImageClick.apply($options, arguments);
- })
- }, _objectSpread$f(_objectSpread$f({}, _ctx.previewButtonProps), _ctx.ptm("previewMask"))), [renderSlot(_ctx.$slots, _ctx.$slots.previewicon ? "previewicon" : "indicatoricon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.previewIcon || _ctx.indicatorIcon ? "i" : "EyeIcon"), mergeProps({
- "class": _ctx.cx("previewIcon")
- }, _ctx.ptm("previewIcon")), null, 16, ["class"]))];
- })], 16, _hoisted_1$m)) : createCommentVNode("", true), createVNode(_component_Portal, null, {
- "default": withCtx(function() {
- return [$data.maskVisible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.maskRef,
- role: "dialog",
- "class": _ctx.cx("mask"),
- "aria-modal": $data.maskVisible,
- onClick: _cache[8] || (_cache[8] = function() {
- return $options.onMaskClick && $options.onMaskClick.apply($options, arguments);
- }),
- onKeydown: _cache[9] || (_cache[9] = function() {
- return $options.onMaskKeydown && $options.onMaskKeydown.apply($options, arguments);
- })
- }, _ctx.ptm("mask")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("toolbar")
- }, _ctx.ptm("toolbar")), [createBaseVNode("button", mergeProps({
- "class": _ctx.cx("rotateRightButton"),
- onClick: _cache[2] || (_cache[2] = function() {
- return $options.rotateRight && $options.rotateRight.apply($options, arguments);
- }),
- type: "button",
- "aria-label": $options.rightAriaLabel
- }, _ctx.ptm("rotateRightButton"), {
- "data-pc-group-section": "action"
- }), [renderSlot(_ctx.$slots, "refresh", {}, function() {
- return [createVNode(_component_RefreshIcon, normalizeProps(guardReactiveProps(_ctx.ptm("rotateRightIcon"))), null, 16)];
- })], 16, _hoisted_3$c), createBaseVNode("button", mergeProps({
- "class": _ctx.cx("rotateLeftButton"),
- onClick: _cache[3] || (_cache[3] = function() {
- return $options.rotateLeft && $options.rotateLeft.apply($options, arguments);
- }),
- type: "button",
- "aria-label": $options.leftAriaLabel
- }, _ctx.ptm("rotateLeftButton"), {
- "data-pc-group-section": "action"
- }), [renderSlot(_ctx.$slots, "undo", {}, function() {
- return [createVNode(_component_UndoIcon, normalizeProps(guardReactiveProps(_ctx.ptm("rotateLeftIcon"))), null, 16)];
- })], 16, _hoisted_4$8), createBaseVNode("button", mergeProps({
- "class": _ctx.cx("zoomOutButton"),
- onClick: _cache[4] || (_cache[4] = function() {
- return $options.zoomOut && $options.zoomOut.apply($options, arguments);
- }),
- type: "button",
- disabled: $options.isZoomOutDisabled,
- "aria-label": $options.zoomOutAriaLabel
- }, _ctx.ptm("zoomOutButton"), {
- "data-pc-group-section": "action"
- }), [renderSlot(_ctx.$slots, "zoomout", {}, function() {
- return [createVNode(_component_SearchMinusIcon, normalizeProps(guardReactiveProps(_ctx.ptm("zoomOutIcon"))), null, 16)];
- })], 16, _hoisted_5$3), createBaseVNode("button", mergeProps({
- "class": _ctx.cx("zoomInButton"),
- onClick: _cache[5] || (_cache[5] = function() {
- return $options.zoomIn && $options.zoomIn.apply($options, arguments);
- }),
- type: "button",
- disabled: $options.isZoomInDisabled,
- "aria-label": $options.zoomInAriaLabel
- }, _ctx.ptm("zoomInButton"), {
- "data-pc-group-section": "action"
- }), [renderSlot(_ctx.$slots, "zoomin", {}, function() {
- return [createVNode(_component_SearchPlusIcon, normalizeProps(guardReactiveProps(_ctx.ptm("zoomInIcon"))), null, 16)];
- })], 16, _hoisted_6$1), createBaseVNode("button", mergeProps({
- "class": _ctx.cx("closeButton"),
- type: "button",
- onClick: _cache[6] || (_cache[6] = function() {
- return $options.hidePreview && $options.hidePreview.apply($options, arguments);
- }),
- "aria-label": $options.closeAriaLabel,
- autofocus: ""
- }, _ctx.ptm("closeButton"), {
- "data-pc-group-section": "action"
- }), [renderSlot(_ctx.$slots, "close", {}, function() {
- return [createVNode(_component_TimesIcon, normalizeProps(guardReactiveProps(_ctx.ptm("closeIcon"))), null, 16)];
- })], 16, _hoisted_7$1)], 16), createVNode(Transition, mergeProps({
- name: "p-image-original",
- onBeforeEnter: $options.onBeforeEnter,
- onEnter: $options.onEnter,
- onLeave: $options.onLeave,
- onBeforeLeave: $options.onBeforeLeave,
- onAfterLeave: $options.onAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.previewVisible ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({
- key: 0
- }, _ctx.ptm("originalContainer"))), [renderSlot(_ctx.$slots, _ctx.$slots.original ? "original" : "preview", {
- "class": normalizeClass(_ctx.cx("original")),
- style: normalizeStyle($options.imagePreviewStyle),
- previewCallback: $options.onPreviewImageClick
- }, function() {
- return [createBaseVNode("img", mergeProps({
- src: _ctx.$attrs.src,
- "class": _ctx.cx("original"),
- style: $options.imagePreviewStyle,
- onClick: _cache[7] || (_cache[7] = function() {
- return $options.onPreviewImageClick && $options.onPreviewImageClick.apply($options, arguments);
- })
- }, _ctx.ptm("original")), null, 16, _hoisted_8$1)];
- })], 16)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onBeforeEnter", "onEnter", "onLeave", "onBeforeLeave", "onAfterLeave"])], 16, _hoisted_2$f)), [[_directive_focustrap]]) : createCommentVNode("", true)];
- }),
- _: 3
- })], 16);
-}
-__name(render$D, "render$D");
-script$I.render = render$D;
-var theme$p = /* @__PURE__ */ __name(function theme14(_ref) {
- var dt = _ref.dt;
- return "\n.p-imagecompare {\n position: relative;\n overflow: hidden;\n width: 100%;\n aspect-ratio: 16 / 9;\n}\n\n.p-imagecompare img {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.p-imagecompare img + img {\n clip-path: polygon(0 0, ".concat(dt("imagecompare.scope.x", "50%"), " 0, ").concat(dt("imagecompare.scope.x", "50%"), " 100%, 0 100%);\n}\n\n.p-imagecompare:dir(rtl) img + img {\n clip-path: polygon(calc(100% - ").concat(dt("imagecompare.scope.x", "50%"), ") 0, 100% 0, 100% 100%, calc(100% - ").concat(dt("imagecompare.scope.x", "50%"), ") 100%);\n}\n\n.p-imagecompare-slider {\n position: relative;\n -webkit-appearance: none;\n width: calc(100% + ").concat(dt("imagecompare.handle.size"), ");\n height: 100%;\n margin-inline-start: calc(-1 * calc(").concat(dt("imagecompare.handle.size"), " / 2));\n background-color: transparent;\n outline: none;\n transition: all ").concat(dt("imagecompare.handle.transition.duration"), ";\n}\n\n.p-imagecompare-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: ").concat(dt("imagecompare.handle.size"), ";\n width: ").concat(dt("imagecompare.handle.size"), ";\n background: ").concat(dt("imagecompare.handle.background"), ";\n border: ").concat(dt("imagecompare.handle.border.width"), " solid ").concat(dt("imagecompare.handle.border.color"), ";\n border-radius: ").concat(dt("imagecompare.handle.border.radius"), ";\n background-size: contain;\n cursor: ew-resize;\n transition: all ").concat(dt("imagecompare.handle.transition.duration"), ";\n}\n\n.p-imagecompare-slider::-moz-range-thumb {\n height: ").concat(dt("imagecompare.handle.size"), ";\n width: ").concat(dt("imagecompare.handle.size"), ";\n background: ").concat(dt("imagecompare.handle.background"), ";\n border: ").concat(dt("imagecompare.handle.border.width"), " ").concat(dt("imagecompare.handle.border.style"), " ").concat(dt("imagecompare.handle.border.color"), ";\n border-radius: ").concat(dt("imagecompare.handle.border.radius"), ";\n background-size: contain;\n cursor: ew-resize;\n}\n\n.p-imagecompare-slider:focus-visible::-webkit-slider-thumb {\n box-shadow: ").concat(dt("imagecompare.handle.focus.ring.shadow"), ";\n outline: ").concat(dt("imagecompare.handle.focus.ring.width"), " ").concat(dt("imagecompare.handle.focus.ring.style"), " ").concat(dt("imagecompare.handle.focus.ring.color"), ";\n outline-offset: ").concat(dt("imagecompare.handle.focus.ring.offset"), ";\n}\n\n.p-imagecompare-slider:focus-visible::-moz-range-thumb {\n box-shadow: ").concat(dt("imagecompare.handle.focus.ring.shadow"), ";\n outline: ").concat(dt("imagecompare.handle.focus.ring.width"), " ").concat(dt("imagecompare.handle.focus.ring.style"), " ").concat(dt("imagecompare.handle.focus.ring.color"), ";\n outline-offset: ").concat(dt("imagecompare.handle.focus.ring.offset"), ";\n}\n\n.p-imagecompare-slider:hover {\n width: calc(100% + ").concat(dt("imagecompare.handle.hover.size"), ");\n margin-inline-start: calc(-1 * calc(").concat(dt("imagecompare.handle.hover.size"), " / 2));\n}\n\n.p-imagecompare-slider:hover::-webkit-slider-thumb {\n background: ").concat(dt("imagecompare.handle.hover.background"), ";\n border-color: ").concat(dt("imagecompare.handle.hover.border.color"), ";\n height: ").concat(dt("imagecompare.handle.hover.size"), ";\n width: ").concat(dt("imagecompare.handle.hover.size"), ";\n}\n\n.p-imagecompare-slider:hover::-moz-range-thumb {\n background: ").concat(dt("imagecompare.handle.hover.background"), ";\n border-color: ").concat(dt("imagecompare.handle.hover.border.color"), ";\n height: ").concat(dt("imagecompare.handle.hover.size"), ";\n width: ").concat(dt("imagecompare.handle.hover.size"), ";\n}\n");
-}, "theme");
-var classes$s = {
- root: "p-imagecompare",
- slider: "p-imagecompare-slider"
-};
-var ImageCompareStyle = BaseStyle.extend({
- name: "imagecompare",
- theme: theme$p,
- classes: classes$s
-});
-var script$1$s = {
- name: "BaseImageCompare",
- "extends": script$1f,
- props: {
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: ImageCompareStyle,
- provide: /* @__PURE__ */ __name(function provide22() {
- return {
- $pcImageCompare: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$H = {
- name: "ImageCompare",
- "extends": script$1$s,
- methods: {
- onSlide: /* @__PURE__ */ __name(function onSlide(event2) {
- var value2 = event2.target.value;
- var image = event2.target.previousElementSibling;
- setCSSProperty(image, $dt("imagecompare.scope.x").name, "".concat(value2, "%"));
- }, "onSlide")
- }
-};
-var _hoisted_1$l = ["aria-labelledby", "aria-label"];
-function render$C(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "left"), renderSlot(_ctx.$slots, "right"), createBaseVNode("input", mergeProps({
- type: "range",
- min: "0",
- max: "100",
- value: "50",
- onInput: _cache[0] || (_cache[0] = function() {
- return $options.onSlide && $options.onSlide.apply($options, arguments);
- }),
- "class": _ctx.cx("slider")
- }, _ctx.ptm("slider")), null, 16)], 16, _hoisted_1$l);
-}
-__name(render$C, "render$C");
-script$H.render = render$C;
-var theme$o = /* @__PURE__ */ __name(function theme15(_ref) {
- var dt = _ref.dt;
- return "\n.p-inlinemessage {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: ".concat(dt("inlinemessage.padding"), ";\n border-radius: ").concat(dt("inlinemessage.border.radius"), ";\n gap: ").concat(dt("inlinemessage.gap"), ";\n}\n\n.p-inlinemessage-text {\n font-weight: ").concat(dt("inlinemessage.text.font.weight"), ";\n}\n\n.p-inlinemessage-icon {\n flex-shrink: 0;\n font-size: ").concat(dt("inlinemessage.icon.size"), ";\n width: ").concat(dt("inlinemessage.icon.size"), ";\n height: ").concat(dt("inlinemessage.icon.size"), ";\n}\n\n.p-inlinemessage-icon-only .p-inlinemessage-text {\n visibility: hidden;\n width: 0;\n}\n\n.p-inlinemessage-info {\n background: ").concat(dt("inlinemessage.info.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.info.border.color"), ";\n color: ").concat(dt("inlinemessage.info.color"), ";\n box-shadow: ").concat(dt("inlinemessage.info.shadow"), ";\n}\n\n.p-inlinemessage-info .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.info.color"), ";\n}\n\n.p-inlinemessage-success {\n background: ").concat(dt("inlinemessage.success.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.success.border.color"), ";\n color: ").concat(dt("inlinemessage.success.color"), ";\n box-shadow: ").concat(dt("inlinemessage.success.shadow"), ";\n}\n\n.p-inlinemessage-success .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.success.color"), ";\n}\n\n.p-inlinemessage-warn {\n background: ").concat(dt("inlinemessage.warn.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.warn.border.color"), ";\n color: ").concat(dt("inlinemessage.warn.color"), ";\n box-shadow: ").concat(dt("inlinemessage.warn.shadow"), ";\n}\n\n.p-inlinemessage-warn .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.warn.color"), ";\n}\n\n.p-inlinemessage-error {\n background: ").concat(dt("inlinemessage.error.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.error.border.color"), ";\n color: ").concat(dt("inlinemessage.error.color"), ";\n box-shadow: ").concat(dt("inlinemessage.error.shadow"), ";\n}\n\n.p-inlinemessage-error .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.error.color"), ";\n}\n\n.p-inlinemessage-secondary {\n background: ").concat(dt("inlinemessage.secondary.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.secondary.border.color"), ";\n color: ").concat(dt("inlinemessage.secondary.color"), ";\n box-shadow: ").concat(dt("inlinemessage.secondary.shadow"), ";\n}\n\n.p-inlinemessage-secondary .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.secondary.color"), ";\n}\n\n.p-inlinemessage-contrast {\n background: ").concat(dt("inlinemessage.contrast.background"), ";\n border: 1px solid ").concat(dt("inlinemessage.contrast.border.color"), ";\n color: ").concat(dt("inlinemessage.contrast.color"), ";\n box-shadow: ").concat(dt("inlinemessage.contrast.shadow"), ";\n}\n\n.p-inlinemessage-contrast .p-inlinemessage-icon {\n color: ").concat(dt("inlinemessage.contrast.color"), ";\n}\n");
-}, "theme");
-var classes$r = {
- root: /* @__PURE__ */ __name(function root13(_ref2) {
- var props = _ref2.props, instance = _ref2.instance;
- return ["p-inlinemessage p-component p-inlinemessage-" + props.severity, {
- "p-inlinemessage-icon-only": !instance.$slots["default"]
- }];
- }, "root"),
- icon: /* @__PURE__ */ __name(function icon(_ref3) {
- var props = _ref3.props;
- return ["p-inlinemessage-icon", props.icon];
- }, "icon"),
- text: "p-inlinemessage-text"
-};
-var InlineMessageStyle = BaseStyle.extend({
- name: "inlinemessage",
- theme: theme$o,
- classes: classes$r
-});
-var script$1$r = {
- name: "BaseInlineMessage",
- "extends": script$1f,
- props: {
- severity: {
- type: String,
- "default": "error"
- },
- icon: {
- type: String,
- "default": void 0
- }
- },
- style: InlineMessageStyle,
- provide: /* @__PURE__ */ __name(function provide23() {
- return {
- $pcInlineMessage: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$G = {
- name: "InlineMessage",
- "extends": script$1$r,
- inheritAttrs: false,
- timeout: null,
- data: /* @__PURE__ */ __name(function data14() {
- return {
- visible: true
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted18() {
- var _this = this;
- if (!this.sticky) {
- setTimeout(function() {
- _this.visible = false;
- }, this.life);
- }
- }, "mounted"),
- computed: {
- iconComponent: /* @__PURE__ */ __name(function iconComponent() {
- return {
- info: script$1B,
- success: script$1C,
- warn: script$1D,
- error: script$1E
- }[this.severity];
- }, "iconComponent")
- }
-};
-function render$B(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- role: "alert",
- "aria-live": "assertive",
- "aria-atomic": "true",
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "icon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ? "span" : $options.iconComponent), mergeProps({
- "class": _ctx.cx("icon")
- }, _ctx.ptm("icon")), null, 16, ["class"]))];
- }), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("text")
- }, _ctx.ptm("text")), [renderSlot(_ctx.$slots, "default")], 16)) : createCommentVNode("", true)], 16);
-}
-__name(render$B, "render$B");
-script$G.render = render$B;
-var theme$n = /* @__PURE__ */ __name(function theme16(_ref) {
- var dt = _ref.dt;
- return "\n.p-inplace-display {\n display: inline-block;\n cursor: pointer;\n border: 1px solid transparent;\n padding: ".concat(dt("inplace.padding"), ";\n border-radius: ").concat(dt("inplace.border.radius"), ";\n transition: background ").concat(dt("inplace.transition.duration"), ", color ").concat(dt("inplace.transition.duration"), ", outline-color ").concat(dt("inplace.transition.duration"), ", box-shadow ").concat(dt("inplace.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-inplace-display:not(.p-disabled):hover {\n background: ").concat(dt("inplace.display.hover.background"), ";\n color: ").concat(dt("inplace.display.hover.color"), ";\n}\n\n.p-inplace-display:focus-visible {\n box-shadow: ").concat(dt("inplace.focus.ring.shadow"), ";\n outline: ").concat(dt("inplace.focus.ring.width"), " ").concat(dt("inplace.focus.ring.style"), " ").concat(dt("inplace.focus.ring.color"), ";\n outline-offset: ").concat(dt("inplace.focus.ring.offset"), ";\n}\n\n.p-inplace-content {\n display: block;\n}\n");
-}, "theme");
-var classes$q = {
- root: "p-inplace p-component",
- display: /* @__PURE__ */ __name(function display(_ref2) {
- var props = _ref2.props;
- return ["p-inplace-display", {
- "p-disabled": props.disabled
- }];
- }, "display"),
- content: "p-inplace-content"
-};
-var InplaceStyle = BaseStyle.extend({
- name: "inplace",
- theme: theme$n,
- classes: classes$q
-});
-var script$1$q = {
- name: "BaseInplace",
- "extends": script$1f,
- props: {
- active: {
- type: Boolean,
- "default": false
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- displayProps: {
- type: null,
- "default": null
- }
- },
- style: InplaceStyle,
- provide: /* @__PURE__ */ __name(function provide24() {
- return {
- $pcInplace: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$F = {
- name: "Inplace",
- "extends": script$1$q,
- inheritAttrs: false,
- emits: ["open", "close", "update:active"],
- data: /* @__PURE__ */ __name(function data15() {
- return {
- d_active: this.active
- };
- }, "data"),
- watch: {
- active: /* @__PURE__ */ __name(function active2(newValue) {
- this.d_active = newValue;
- }, "active")
- },
- methods: {
- open: /* @__PURE__ */ __name(function open(event2) {
- if (this.disabled) {
- return;
- }
- this.d_active = true;
- this.$emit("open", event2);
- this.$emit("update:active", true);
- }, "open"),
- close: /* @__PURE__ */ __name(function close(event2) {
- var _this = this;
- this.d_active = false;
- this.$emit("close", event2);
- this.$emit("update:active", false);
- setTimeout(function() {
- _this.$refs.display.focus();
- }, 0);
- }, "close")
- }
-};
-function _typeof$g(o) {
- "@babel/helpers - typeof";
- return _typeof$g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$g(o);
-}
-__name(_typeof$g, "_typeof$g");
-function ownKeys$e(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$e, "ownKeys$e");
-function _objectSpread$e(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$e(Object(t2), true).forEach(function(r2) {
- _defineProperty$f(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$e(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$e, "_objectSpread$e");
-function _defineProperty$f(e, r, t2) {
- return (r = _toPropertyKey$f(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$f, "_defineProperty$f");
-function _toPropertyKey$f(t2) {
- var i = _toPrimitive$f(t2, "string");
- return "symbol" == _typeof$g(i) ? i : i + "";
-}
-__name(_toPropertyKey$f, "_toPropertyKey$f");
-function _toPrimitive$f(t2, r) {
- if ("object" != _typeof$g(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$g(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$f, "_toPrimitive$f");
-var _hoisted_1$k = ["tabindex"];
-function render$A(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- "aria-live": "polite"
- }, _ctx.ptmi("root")), [!$data.d_active ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: "display",
- "class": _ctx.cx("display"),
- tabindex: _ctx.$attrs.tabindex || "0",
- role: "button",
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.open && $options.open.apply($options, arguments);
- }),
- onKeydown: _cache[1] || (_cache[1] = withKeys(function() {
- return $options.open && $options.open.apply($options, arguments);
- }, ["enter"]))
- }, _objectSpread$e(_objectSpread$e({}, _ctx.displayProps), _ctx.ptm("display"))), [renderSlot(_ctx.$slots, "display")], 16, _hoisted_1$k)) : (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("content")
- }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "content", {
- closeCallback: $options.close
- })], 16))], 16);
-}
-__name(render$A, "render$A");
-script$F.render = render$A;
-var theme$m = /* @__PURE__ */ __name(function theme17(_ref) {
- var dt = _ref.dt;
- return "\n.p-inputgroup,\n.p-inputgroup .p-iconfield,\n.p-inputgroup .p-floatlabel,\n.p-inputgroup .p-iftalabel {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n\n.p-inputgroup .p-inputtext,\n.p-inputgroup .p-inputwrapper {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-inputgroupaddon {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ".concat(dt("inputgroup.addon.padding"), ";\n background: ").concat(dt("inputgroup.addon.background"), ";\n color: ").concat(dt("inputgroup.addon.color"), ";\n border-block-start: 1px solid ").concat(dt("inputgroup.addon.border.color"), ";\n border-block-end: 1px solid ").concat(dt("inputgroup.addon.border.color"), ";\n min-width: ").concat(dt("inputgroup.addon.min.width"), ";\n}\n\n.p-inputgroupaddon:first-child,\n.p-inputgroupaddon + .p-inputgroupaddon {\n border-inline-start: 1px solid ").concat(dt("inputgroup.addon.border.color"), ";\n}\n\n.p-inputgroupaddon:last-child {\n border-inline-end: 1px solid ").concat(dt("inputgroup.addon.border.color"), ";\n}\n\n.p-inputgroupaddon:has(.p-button) {\n padding: 0;\n overflow: hidden;\n}\n\n.p-inputgroupaddon .p-button {\n border-radius: 0;\n}\n\n.p-inputgroup > .p-component,\n.p-inputgroup > .p-inputwrapper > .p-component,\n.p-inputgroup > .p-iconfield > .p-component,\n.p-inputgroup > .p-floatlabel > .p-component,\n.p-inputgroup > .p-floatlabel > .p-inputwrapper > .p-component,\n.p-inputgroup > .p-iftalabel > .p-component,\n.p-inputgroup > .p-iftalabel > .p-inputwrapper > .p-component {\n border-radius: 0;\n margin: 0;\n}\n\n.p-inputgroupaddon:first-child,\n.p-inputgroup > .p-component:first-child,\n.p-inputgroup > .p-inputwrapper:first-child > .p-component,\n.p-inputgroup > .p-iconfield:first-child > .p-component,\n.p-inputgroup > .p-floatlabel:first-child > .p-component,\n.p-inputgroup > .p-floatlabel:first-child > .p-inputwrapper > .p-component,\n.p-inputgroup > .p-iftalabel:first-child > .p-component,\n.p-inputgroup > .p-iftalabel:first-child > .p-inputwrapper > .p-component {\n border-start-start-radius: ").concat(dt("inputgroup.addon.border.radius"), ";\n border-end-start-radius: ").concat(dt("inputgroup.addon.border.radius"), ";\n}\n\n.p-inputgroupaddon:last-child,\n.p-inputgroup > .p-component:last-child,\n.p-inputgroup > .p-inputwrapper:last-child > .p-component,\n.p-inputgroup > .p-iconfield:last-child > .p-component,\n.p-inputgroup > .p-floatlabel:last-child > .p-component,\n.p-inputgroup > .p-floatlabel:last-child > .p-inputwrapper > .p-component,\n.p-inputgroup > .p-iftalabel:last-child > .p-component,\n.p-inputgroup > .p-iftalabel:last-child > .p-inputwrapper > .p-component {\n border-start-end-radius: ").concat(dt("inputgroup.addon.border.radius"), ";\n border-end-end-radius: ").concat(dt("inputgroup.addon.border.radius"), ";\n}\n\n.p-inputgroup .p-component:focus,\n.p-inputgroup .p-component.p-focus,\n.p-inputgroup .p-inputwrapper-focus,\n.p-inputgroup .p-component:focus ~ label,\n.p-inputgroup .p-component.p-focus ~ label,\n.p-inputgroup .p-inputwrapper-focus ~ label {\n z-index: 1;\n}\n\n.p-inputgroup > .p-button:not(.p-button-icon-only) {\n width: auto;\n}\n\n.p-inputgroup .p-iconfield + .p-iconfield .p-inputtext {\n border-inline-start: 0;\n}\n");
-}, "theme");
-var classes$p = {
- root: "p-inputgroup"
-};
-var InputGroupStyle = BaseStyle.extend({
- name: "inputgroup",
- theme: theme$m,
- classes: classes$p
-});
-var script$1$p = {
- name: "BaseInputGroup",
- "extends": script$1f,
- style: InputGroupStyle,
- provide: /* @__PURE__ */ __name(function provide25() {
- return {
- $pcInputGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$E = {
- name: "InputGroup",
- "extends": script$1$p,
- inheritAttrs: false
-};
-function render$z(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$z, "render$z");
-script$E.render = render$z;
-var classes$o = {
- root: "p-inputgroupaddon"
-};
-var InputGroupAddonStyle = BaseStyle.extend({
- name: "inputgroupaddon",
- classes: classes$o
-});
-var script$1$o = {
- name: "BaseInputGroupAddon",
- "extends": script$1f,
- style: InputGroupAddonStyle,
- provide: /* @__PURE__ */ __name(function provide26() {
- return {
- $pcInputGroupAddon: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$D = {
- name: "InputGroupAddon",
- "extends": script$1$o,
- inheritAttrs: false
-};
-function render$y(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$y, "render$y");
-script$D.render = render$y;
-var classes$n = {
- root: /* @__PURE__ */ __name(function root14(_ref) {
- var instance = _ref.instance;
- return ["p-inputmask", {
- "p-filled": instance.$filled
- }];
- }, "root")
-};
-var InputMaskStyle = BaseStyle.extend({
- name: "inputmask",
- classes: classes$n
-});
-var script$1$n = {
- name: "BaseInputMask",
- "extends": script$1k,
- props: {
- slotChar: {
- type: String,
- "default": "_"
- },
- id: {
- type: String,
- "default": null
- },
- "class": {
- type: [String, Object],
- "default": null
- },
- mask: {
- type: String,
- "default": null
- },
- placeholder: {
- type: String,
- "default": null
- },
- autoClear: {
- type: Boolean,
- "default": true
- },
- unmask: {
- type: Boolean,
- "default": false
- },
- readonly: {
- type: Boolean,
- "default": false
- }
- },
- style: InputMaskStyle,
- provide: /* @__PURE__ */ __name(function provide27() {
- return {
- $pcInputMask: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$C = {
- name: "InputMask",
- "extends": script$1$n,
- inheritAttrs: false,
- emits: ["focus", "blur", "keydown", "complete", "keypress", "paste"],
- inject: {
- $pcFluid: {
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data16() {
- return {
- currentVal: ""
- };
- }, "data"),
- watch: {
- mask: /* @__PURE__ */ __name(function mask(newMask, oldMask) {
- if (oldMask !== newMask) {
- this.initMask();
- }
- }, "mask")
- },
- mounted: /* @__PURE__ */ __name(function mounted19() {
- this.initMask();
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated3() {
- if (this.isValueUpdated()) {
- this.updateValue();
- }
- }, "updated"),
- methods: {
- onInput: /* @__PURE__ */ __name(function onInput3(event2) {
- if (!event2.isComposing) {
- if (this.androidChrome) this.handleAndroidInput(event2);
- else this.handleInputChange(event2);
- this.updateModelValue(event2.target.value);
- }
- }, "onInput"),
- onFocus: /* @__PURE__ */ __name(function onFocus6(event2) {
- var _this = this;
- if (this.readonly) {
- return;
- }
- this.focus = true;
- clearTimeout(this.caretTimeoutId);
- var pos;
- this.focusText = this.$el.value;
- pos = this.checkVal();
- this.caretTimeoutId = setTimeout(function() {
- if (_this.$el !== document.activeElement) {
- return;
- }
- _this.writeBuffer();
- if (pos === _this.mask.replace("?", "").length) {
- _this.caret(0, pos);
- } else {
- _this.caret(pos);
- }
- }, 10);
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur5(event2) {
- var _this$formField$onBlu, _this$formField;
- this.focus = false;
- this.checkVal();
- this.updateModelValue(event2.target.value);
- if (this.$el.value !== this.focusText) {
- var e = document.createEvent("HTMLEvents");
- e.initEvent("change", true, false);
- this.$el.dispatchEvent(e);
- }
- this.$emit("blur", event2);
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event2);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown5(event2) {
- if (this.readonly) {
- return;
- }
- var k = event2.code, pos, begin, end;
- var iPhone = /iphone/i.test(getUserAgent());
- this.oldVal = this.$el.value;
- if (k === "Backspace" || k === "Delete" || iPhone && k === "Escape") {
- pos = this.caret();
- begin = pos.begin;
- end = pos.end;
- if (end - begin === 0) {
- begin = k !== "Delete" ? this.seekPrev(begin) : end = this.seekNext(begin - 1);
- end = k === "Delete" ? this.seekNext(end) : end;
- }
- this.clearBuffer(begin, end);
- this.shiftL(begin, end - 1);
- this.updateModelValue(event2.target.value);
- event2.preventDefault();
- } else if (k === "Enter") {
- this.$el.blur();
- this.updateModelValue(event2.target.value);
- } else if (k === "Escape") {
- this.$el.value = this.focusText;
- this.caret(0, this.checkVal());
- this.updateModelValue(event2.target.value);
- event2.preventDefault();
- }
- this.$emit("keydown", event2);
- }, "onKeyDown"),
- onKeyPress: /* @__PURE__ */ __name(function onKeyPress(event2) {
- var _this2 = this;
- if (this.readonly) {
- return;
- }
- var k = event2.code, pos = this.caret(), p, c, next, completed;
- if (event2.ctrlKey || event2.altKey || event2.metaKey || event2.shiftKey || event2.key === "CapsLock" || event2.key === "Escape" || event2.key === "Tab") {
- return;
- } else if (k && k !== "Enter") {
- if (pos.end - pos.begin !== 0) {
- this.clearBuffer(pos.begin, pos.end);
- this.shiftL(pos.begin, pos.end - 1);
- }
- p = this.seekNext(pos.begin - 1);
- if (p < this.len) {
- c = event2.key;
- if (this.tests[p].test(c)) {
- this.shiftR(p);
- this.buffer[p] = c;
- this.writeBuffer();
- next = this.seekNext(p);
- if (/android/i.test(getUserAgent())) {
- var proxy = /* @__PURE__ */ __name(function proxy2() {
- _this2.caret(next);
- }, "proxy");
- setTimeout(proxy, 0);
- } else {
- this.caret(next);
- }
- if (pos.begin <= this.lastRequiredNonMaskPos) {
- completed = this.isCompleted();
- }
- }
- }
- event2.preventDefault();
- }
- this.updateModelValue(event2.target.value);
- if (completed) {
- this.$emit("complete", event2);
- }
- this.$emit("keypress", event2);
- }, "onKeyPress"),
- onPaste: /* @__PURE__ */ __name(function onPaste2(event2) {
- this.handleInputChange(event2);
- this.$emit("paste", event2);
- }, "onPaste"),
- caret: /* @__PURE__ */ __name(function caret(first3, last) {
- var range, begin, end;
- if (!this.$el.offsetParent || this.$el !== document.activeElement) {
- return;
- }
- if (typeof first3 === "number") {
- begin = first3;
- end = typeof last === "number" ? last : begin;
- if (this.$el.setSelectionRange) {
- this.$el.setSelectionRange(begin, end);
- } else if (this.$el["createTextRange"]) {
- range = this.$el["createTextRange"]();
- range.collapse(true);
- range.moveEnd("character", end);
- range.moveStart("character", begin);
- range.select();
- }
- } else {
- if (this.$el.setSelectionRange) {
- begin = this.$el.selectionStart;
- end = this.$el.selectionEnd;
- } else if (document["selection"] && document["selection"].createRange) {
- range = document["selection"].createRange();
- begin = 0 - range.duplicate().moveStart("character", -1e5);
- end = begin + range.text.length;
- }
- return {
- begin,
- end
- };
- }
- }, "caret"),
- isCompleted: /* @__PURE__ */ __name(function isCompleted() {
- for (var i = this.firstNonMaskPos; i <= this.lastRequiredNonMaskPos; i++) {
- if (this.tests[i] && this.buffer[i] === this.getPlaceholder(i)) {
- return false;
- }
- }
- return true;
- }, "isCompleted"),
- getPlaceholder: /* @__PURE__ */ __name(function getPlaceholder(i) {
- if (i < this.slotChar.length) {
- return this.slotChar.charAt(i);
- }
- return this.slotChar.charAt(0);
- }, "getPlaceholder"),
- seekNext: /* @__PURE__ */ __name(function seekNext(pos) {
- while (++pos < this.len && !this.tests[pos]) ;
- return pos;
- }, "seekNext"),
- seekPrev: /* @__PURE__ */ __name(function seekPrev(pos) {
- while (--pos >= 0 && !this.tests[pos]) ;
- return pos;
- }, "seekPrev"),
- shiftL: /* @__PURE__ */ __name(function shiftL(begin, end) {
- var i, j;
- if (begin < 0) {
- return;
- }
- for (i = begin, j = this.seekNext(end); i < this.len; i++) {
- if (this.tests[i]) {
- if (j < this.len && this.tests[i].test(this.buffer[j])) {
- this.buffer[i] = this.buffer[j];
- this.buffer[j] = this.getPlaceholder(j);
- } else {
- break;
- }
- j = this.seekNext(j);
- }
- }
- this.writeBuffer();
- this.caret(Math.max(this.firstNonMaskPos, begin));
- }, "shiftL"),
- shiftR: /* @__PURE__ */ __name(function shiftR(pos) {
- var i, c, j, t2;
- for (i = pos, c = this.getPlaceholder(pos); i < this.len; i++) {
- if (this.tests[i]) {
- j = this.seekNext(i);
- t2 = this.buffer[i];
- this.buffer[i] = c;
- if (j < this.len && this.tests[j].test(t2)) {
- c = t2;
- } else {
- break;
- }
- }
- }
- }, "shiftR"),
- handleAndroidInput: /* @__PURE__ */ __name(function handleAndroidInput(event2) {
- var curVal = this.$el.value;
- var pos = this.caret();
- if (this.oldVal && this.oldVal.length && this.oldVal.length > curVal.length) {
- this.checkVal(true);
- while (pos.begin > 0 && !this.tests[pos.begin - 1]) pos.begin--;
- if (pos.begin === 0) {
- while (pos.begin < this.firstNonMaskPos && !this.tests[pos.begin]) pos.begin++;
- }
- this.caret(pos.begin, pos.begin);
- } else {
- this.checkVal(true);
- while (pos.begin < this.len && !this.tests[pos.begin]) pos.begin++;
- this.caret(pos.begin, pos.begin);
- }
- if (this.isCompleted()) {
- this.$emit("complete", event2);
- }
- }, "handleAndroidInput"),
- clearBuffer: /* @__PURE__ */ __name(function clearBuffer(start, end) {
- var i;
- for (i = start; i < end && i < this.len; i++) {
- if (this.tests[i]) {
- this.buffer[i] = this.getPlaceholder(i);
- }
- }
- }, "clearBuffer"),
- writeBuffer: /* @__PURE__ */ __name(function writeBuffer() {
- this.$el.value = this.buffer.join("");
- }, "writeBuffer"),
- checkVal: /* @__PURE__ */ __name(function checkVal(allow) {
- this.isValueChecked = true;
- var test = this.$el.value, lastMatch = -1, i, c, pos;
- for (i = 0, pos = 0; i < this.len; i++) {
- if (this.tests[i]) {
- this.buffer[i] = this.getPlaceholder(i);
- while (pos++ < test.length) {
- c = test.charAt(pos - 1);
- if (this.tests[i].test(c)) {
- this.buffer[i] = c;
- lastMatch = i;
- break;
- }
- }
- if (pos > test.length) {
- this.clearBuffer(i + 1, this.len);
- break;
- }
- } else {
- if (this.buffer[i] === test.charAt(pos)) {
- pos++;
- }
- if (i < this.partialPosition) {
- lastMatch = i;
- }
- }
- }
- if (allow) {
- this.writeBuffer();
- } else if (lastMatch + 1 < this.partialPosition) {
- if (this.autoClear || this.buffer.join("") === this.defaultBuffer) {
- if (this.$el.value) this.$el.value = "";
- this.clearBuffer(0, this.len);
- } else {
- this.writeBuffer();
- }
- } else {
- this.writeBuffer();
- this.$el.value = this.$el.value.substring(0, lastMatch + 1);
- }
- return this.partialPosition ? i : this.firstNonMaskPos;
- }, "checkVal"),
- handleInputChange: /* @__PURE__ */ __name(function handleInputChange(event2) {
- var isPasteEvent = event2.type === "paste";
- if (this.readonly || isPasteEvent) {
- return;
- }
- var pos = this.checkVal(true);
- this.caret(pos);
- this.updateModelValue(event2.target.value);
- if (this.isCompleted()) {
- this.$emit("complete", event2);
- }
- }, "handleInputChange"),
- getUnmaskedValue: /* @__PURE__ */ __name(function getUnmaskedValue() {
- var unmaskedBuffer = [];
- for (var i = 0; i < this.buffer.length; i++) {
- var c = this.buffer[i];
- if (this.tests[i] && c !== this.getPlaceholder(i)) {
- unmaskedBuffer.push(c);
- }
- }
- return unmaskedBuffer.join("");
- }, "getUnmaskedValue"),
- updateModelValue: /* @__PURE__ */ __name(function updateModelValue(value2) {
- if (this.currentVal === value2) return;
- var val = this.unmask ? this.getUnmaskedValue() : value2;
- this.currentVal = value2;
- this.writeValue(this.defaultBuffer !== val ? val : "");
- }, "updateModelValue"),
- updateValue: /* @__PURE__ */ __name(function updateValue2() {
- var _this3 = this;
- var updateModel8 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
- if (this.$el) {
- if (this.d_value == null) {
- this.$el.value = "";
- updateModel8 && this.updateModelValue("");
- } else {
- this.$el.value = this.d_value;
- this.checkVal();
- setTimeout(function() {
- if (_this3.$el) {
- _this3.writeBuffer();
- _this3.checkVal();
- if (updateModel8) _this3.updateModelValue(_this3.$el.value);
- }
- }, 10);
- }
- this.focusText = this.$el.value;
- }
- }, "updateValue"),
- initMask: /* @__PURE__ */ __name(function initMask() {
- this.tests = [];
- this.partialPosition = this.mask.length;
- this.len = this.mask.length;
- this.firstNonMaskPos = null;
- this.defs = {
- 9: "[0-9]",
- a: "[A-Za-z]",
- "*": "[A-Za-z0-9]"
- };
- var ua = getUserAgent();
- this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
- var maskTokens = this.mask.split("");
- for (var i = 0; i < maskTokens.length; i++) {
- var c = maskTokens[i];
- if (c === "?") {
- this.len--;
- this.partialPosition = i;
- } else if (this.defs[c]) {
- this.tests.push(new RegExp(this.defs[c]));
- if (this.firstNonMaskPos === null) {
- this.firstNonMaskPos = this.tests.length - 1;
- }
- if (i < this.partialPosition) {
- this.lastRequiredNonMaskPos = this.tests.length - 1;
- }
- } else {
- this.tests.push(null);
- }
- }
- this.buffer = [];
- for (var _i = 0; _i < maskTokens.length; _i++) {
- var _c = maskTokens[_i];
- if (_c !== "?") {
- if (this.defs[_c]) this.buffer.push(this.getPlaceholder(_i));
- else this.buffer.push(_c);
- }
- }
- this.defaultBuffer = this.buffer.join("");
- this.updateValue(false);
- }, "initMask"),
- isValueUpdated: /* @__PURE__ */ __name(function isValueUpdated() {
- return this.unmask ? this.d_value != this.getUnmaskedValue() : this.defaultBuffer !== this.$el.value && this.$el.value !== this.d_value;
- }, "isValueUpdated")
- },
- computed: {
- inputClass: /* @__PURE__ */ __name(function inputClass() {
- return [this.cx("root"), this["class"]];
- }, "inputClass"),
- rootPTOptions: /* @__PURE__ */ __name(function rootPTOptions() {
- return {
- root: mergeProps(this.ptm("pcInputText", this.ptmParams), this.ptmi("root", this.ptmParams))
- };
- }, "rootPTOptions"),
- ptmParams: /* @__PURE__ */ __name(function ptmParams() {
- return {
- context: {
- filled: this.$filled
- }
- };
- }, "ptmParams")
- },
- components: {
- InputText: script$1l
- }
-};
-function render$x(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_InputText = resolveComponent("InputText");
- return openBlock(), createBlock(_component_InputText, {
- id: _ctx.id,
- value: $data.currentVal,
- "class": normalizeClass($options.inputClass),
- readonly: _ctx.readonly,
- disabled: _ctx.disabled,
- invalid: _ctx.invalid,
- size: _ctx.size,
- name: _ctx.name,
- variant: _ctx.variant,
- placeholder: _ctx.placeholder,
- fluid: _ctx.$fluid,
- unstyled: _ctx.unstyled,
- onInput: $options.onInput,
- onCompositionend: $options.onInput,
- onFocus: $options.onFocus,
- onBlur: $options.onBlur,
- onKeydown: $options.onKeyDown,
- onKeypress: $options.onKeyPress,
- onPaste: $options.onPaste,
- pt: $options.rootPTOptions
- }, null, 8, ["id", "value", "class", "readonly", "disabled", "invalid", "size", "name", "variant", "placeholder", "fluid", "unstyled", "onInput", "onCompositionend", "onFocus", "onBlur", "onKeydown", "onKeypress", "onPaste", "pt"]);
-}
-__name(render$x, "render$x");
-script$C.render = render$x;
-var theme$l = /* @__PURE__ */ __name(function theme18(_ref) {
- var dt = _ref.dt;
- return "\n.p-inputotp {\n display: flex;\n align-items: center;\n gap: ".concat(dt("inputotp.gap"), ";\n}\n\n.p-inputotp-input {\n text-align: center;\n width: ").concat(dt("inputotp.input.width"), ";\n}\n\n.p-inputotp-input.p-inputtext-sm {\n text-align: center;\n width: ").concat(dt("inputotp.input.sm.width"), ";\n}\n\n.p-inputotp-input.p-inputtext-lg {\n text-align: center;\n width: ").concat(dt("inputotp.input.lg.width"), ";\n}\n");
-}, "theme");
-var classes$m = {
- root: "p-inputotp p-component",
- pcInputText: "p-inputotp-input"
-};
-var InputOtpStyle = BaseStyle.extend({
- name: "inputotp",
- theme: theme$l,
- classes: classes$m
-});
-var script$1$m = {
- name: "BaseInputOtp",
- "extends": script$1k,
- props: {
- readonly: {
- type: Boolean,
- "default": false
- },
- tabindex: {
- type: Number,
- "default": null
- },
- length: {
- type: Number,
- "default": 4
- },
- mask: {
- type: Boolean,
- "default": false
- },
- integerOnly: {
- type: Boolean,
- "default": false
- }
- },
- style: InputOtpStyle,
- provide: /* @__PURE__ */ __name(function provide28() {
- return {
- $pcInputOtp: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$B = {
- name: "InputOtp",
- "extends": script$1$m,
- inheritAttrs: false,
- emits: ["change", "focus", "blur"],
- data: /* @__PURE__ */ __name(function data17() {
- return {
- tokens: []
- };
- }, "data"),
- watch: {
- modelValue: {
- immediate: true,
- handler: /* @__PURE__ */ __name(function handler2(newValue) {
- this.tokens = newValue ? newValue.split("") : new Array(this.length);
- }, "handler")
- }
- },
- methods: {
- getTemplateAttrs: /* @__PURE__ */ __name(function getTemplateAttrs(index) {
- return {
- value: this.tokens[index]
- };
- }, "getTemplateAttrs"),
- getTemplateEvents: /* @__PURE__ */ __name(function getTemplateEvents(index) {
- var _this = this;
- return {
- input: /* @__PURE__ */ __name(function input2(event2) {
- return _this.onInput(event2, index);
- }, "input"),
- keydown: /* @__PURE__ */ __name(function keydown(event2) {
- return _this.onKeyDown(event2);
- }, "keydown"),
- focus: /* @__PURE__ */ __name(function focus4(event2) {
- return _this.onFocus(event2);
- }, "focus"),
- blur: /* @__PURE__ */ __name(function blur(event2) {
- return _this.onBlur(event2);
- }, "blur"),
- paste: /* @__PURE__ */ __name(function paste(event2) {
- return _this.onPaste(event2);
- }, "paste")
- };
- }, "getTemplateEvents"),
- onInput: /* @__PURE__ */ __name(function onInput4(event2, index) {
- this.tokens[index] = event2.target.value;
- this.updateModel(event2);
- if (event2.inputType === "deleteContentBackward") {
- this.moveToPrev(event2);
- } else if (event2.inputType === "insertText" || event2.inputType === "deleteContentForward" || isTouchDevice() && event2 instanceof CustomEvent) {
- this.moveToNext(event2);
- }
- }, "onInput"),
- updateModel: /* @__PURE__ */ __name(function updateModel4(event2) {
- var newValue = this.tokens.join("");
- this.writeValue(newValue, event2);
- this.$emit("change", {
- originalEvent: event2,
- value: newValue
- });
- }, "updateModel"),
- moveToPrev: /* @__PURE__ */ __name(function moveToPrev(event2) {
- var prevInput = this.findPrevInput(event2.target);
- if (prevInput) {
- prevInput.focus();
- prevInput.select();
- }
- }, "moveToPrev"),
- moveToNext: /* @__PURE__ */ __name(function moveToNext(event2) {
- var nextInput = this.findNextInput(event2.target);
- if (nextInput) {
- nextInput.focus();
- nextInput.select();
- }
- }, "moveToNext"),
- findNextInput: /* @__PURE__ */ __name(function findNextInput(element) {
- var nextElement = element.nextElementSibling;
- if (!nextElement) return;
- return nextElement.nodeName === "INPUT" ? nextElement : this.findNextInput(nextElement);
- }, "findNextInput"),
- findPrevInput: /* @__PURE__ */ __name(function findPrevInput(element) {
- var prevElement = element.previousElementSibling;
- if (!prevElement) return;
- return prevElement.nodeName === "INPUT" ? prevElement : this.findPrevInput(prevElement);
- }, "findPrevInput"),
- onFocus: /* @__PURE__ */ __name(function onFocus7(event2) {
- event2.target.select();
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur6(event2) {
- this.$emit("blur", event2);
- }, "onBlur"),
- onClick: /* @__PURE__ */ __name(function onClick3(event2) {
- setTimeout(function() {
- return event2.target.select();
- }, 1);
- }, "onClick"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown6(event2) {
- if (event2.ctrlKey || event2.metaKey) {
- return;
- }
- switch (event2.code) {
- case "ArrowLeft":
- this.moveToPrev(event2);
- event2.preventDefault();
- break;
- case "ArrowUp":
- case "ArrowDown":
- event2.preventDefault();
- break;
- case "Backspace":
- if (event2.target.value.length === 0) {
- this.moveToPrev(event2);
- event2.preventDefault();
- }
- break;
- case "ArrowRight":
- this.moveToNext(event2);
- event2.preventDefault();
- break;
- case "Enter":
- case "NumpadEnter":
- case "Tab":
- break;
- default:
- if (this.integerOnly && !(event2.code !== "Space" && Number(event2.key) >= 0 && Number(event2.key) <= 9) || this.tokens.join("").length >= this.length && event2.code !== "Delete") {
- event2.preventDefault();
- }
- break;
- }
- }, "onKeyDown"),
- onPaste: /* @__PURE__ */ __name(function onPaste3(event2) {
- var paste = event2.clipboardData.getData("text");
- if (paste.length) {
- var pastedCode = paste.substring(0, this.length);
- if (!this.integerOnly || !isNaN(pastedCode)) {
- this.tokens = pastedCode.split("");
- this.updateModel(event2);
- }
- }
- event2.preventDefault();
- }, "onPaste")
- },
- computed: {
- inputMode: /* @__PURE__ */ __name(function inputMode() {
- return this.integerOnly ? "numeric" : "text";
- }, "inputMode"),
- inputType: /* @__PURE__ */ __name(function inputType() {
- return this.mask ? "password" : "text";
- }, "inputType")
- },
- components: {
- OtpInputText: script$1l
- }
-};
-function render$w(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_OtpInputText = resolveComponent("OtpInputText");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.length, function(i) {
- return renderSlot(_ctx.$slots, "default", {
- key: i,
- events: $options.getTemplateEvents(i - 1),
- attrs: $options.getTemplateAttrs(i - 1),
- index: i
- }, function() {
- return [createVNode(_component_OtpInputText, {
- value: $data.tokens[i - 1],
- type: $options.inputType,
- "class": normalizeClass(_ctx.cx("pcInputText")),
- name: _ctx.$formName,
- inputmode: $options.inputMode,
- variant: _ctx.variant,
- readonly: _ctx.readonly,
- disabled: _ctx.disabled,
- size: _ctx.size,
- invalid: _ctx.invalid,
- tabindex: _ctx.tabindex,
- unstyled: _ctx.unstyled,
- onInput: /* @__PURE__ */ __name(function onInput6($event) {
- return $options.onInput($event, i - 1);
- }, "onInput"),
- onFocus: _cache[0] || (_cache[0] = function($event) {
- return $options.onFocus($event);
- }),
- onBlur: _cache[1] || (_cache[1] = function($event) {
- return $options.onBlur($event);
- }),
- onPaste: _cache[2] || (_cache[2] = function($event) {
- return $options.onPaste($event);
- }),
- onKeydown: _cache[3] || (_cache[3] = function($event) {
- return $options.onKeyDown($event);
- }),
- onClick: _cache[4] || (_cache[4] = function($event) {
- return $options.onClick($event);
- }),
- pt: _ctx.ptm("pcInputText")
- }, null, 8, ["value", "type", "class", "name", "inputmode", "variant", "readonly", "disabled", "size", "invalid", "tabindex", "unstyled", "onInput", "pt"])];
- });
- }), 128))], 16);
-}
-__name(render$w, "render$w");
-script$B.render = render$w;
-var script$A = {
- name: "InputSwitch",
- "extends": script$1F,
- mounted: /* @__PURE__ */ __name(function mounted20() {
- console.warn("Deprecated since v4. Use ToggleSwitch component instead.");
- }, "mounted")
-};
-var InputSwitchStyle = BaseStyle.extend({
- name: "inputswitch"
-});
-var KeyFilterStyle = BaseStyle.extend({
- name: "keyfilter-directive"
-});
-var BaseKeyFilter = BaseDirective.extend({
- style: KeyFilterStyle
-});
-function _toConsumableArray$8(r) {
- return _arrayWithoutHoles$8(r) || _iterableToArray$8(r) || _unsupportedIterableToArray$9(r) || _nonIterableSpread$8();
-}
-__name(_toConsumableArray$8, "_toConsumableArray$8");
-function _nonIterableSpread$8() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$8, "_nonIterableSpread$8");
-function _unsupportedIterableToArray$9(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$9(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$9(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$9, "_unsupportedIterableToArray$9");
-function _iterableToArray$8(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$8, "_iterableToArray$8");
-function _arrayWithoutHoles$8(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$9(r);
-}
-__name(_arrayWithoutHoles$8, "_arrayWithoutHoles$8");
-function _arrayLikeToArray$9(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$9, "_arrayLikeToArray$9");
-function _typeof$f(o) {
- "@babel/helpers - typeof";
- return _typeof$f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$f(o);
-}
-__name(_typeof$f, "_typeof$f");
-var KeyFilter = BaseKeyFilter.extend("keyfilter", {
- beforeMount: /* @__PURE__ */ __name(function beforeMount(el, options4) {
- var target = this.getTarget(el);
- if (!target) return;
- target.$_pkeyfilterModifier = this.getModifiers(options4);
- if (_typeof$f(options4.value)) {
- var _options$value, _options$value2;
- target.$_pkeyfilterPattern = ((_options$value = options4.value) === null || _options$value === void 0 ? void 0 : _options$value.pattern) || options4.value;
- target.$_pkeyfilterValidateOnly = ((_options$value2 = options4.value) === null || _options$value2 === void 0 ? void 0 : _options$value2.validateOnly) || false;
- }
- this.bindEvents(target);
- target.setAttribute("data-pd-keyfilter", true);
- }, "beforeMount"),
- updated: /* @__PURE__ */ __name(function updated4(el, options4) {
- var target = this.getTarget(el);
- if (!target) return;
- target.$_pkeyfilterModifier = this.getModifiers(options4);
- this.unbindEvents(el, options4);
- if (_typeof$f(options4.value)) {
- var _options$value3, _options$value4;
- target.$_pkeyfilterPattern = ((_options$value3 = options4.value) === null || _options$value3 === void 0 ? void 0 : _options$value3.pattern) || options4.value;
- target.$_pkeyfilterValidateOnly = ((_options$value4 = options4.value) === null || _options$value4 === void 0 ? void 0 : _options$value4.validateOnly) || false;
- }
- this.bindEvents(target);
- }, "updated"),
- unmounted: /* @__PURE__ */ __name(function unmounted3(el, options4) {
- this.unbindEvents(el, options4);
- }, "unmounted"),
- DEFAULT_PATTERNS: {
- pint: /[\d]/,
- "int": /[\d\-]/,
- pnum: /[\d\.]/,
- money: /[\d\.\s,]/,
- num: /[\d\-\.]/,
- hex: /[0-9a-f]/i,
- email: /[a-z0-9_\.\-@]/i,
- alpha: /[a-z_]/i,
- alphanum: /[a-z0-9_]/i
- },
- methods: {
- getTarget: /* @__PURE__ */ __name(function getTarget(el) {
- return isAttributeEquals(el, "data-pc-name", "inputtext") || isAttributeEquals(el, "data-pc-name", "textarea") ? el : null;
- }, "getTarget"),
- getModifiers: /* @__PURE__ */ __name(function getModifiers(options4) {
- if (options4.modifiers && Object.keys(options4.modifiers).length) {
- return Object.keys(options4.modifiers)[Object.keys.length - 1];
- }
- return "";
- }, "getModifiers"),
- getRegex: /* @__PURE__ */ __name(function getRegex(target) {
- return target.$_pkeyfilterPattern ? target.$_pkeyfilterPattern : target.$_pkeyfilterModifier ? this.DEFAULT_PATTERNS[target.$_pkeyfilterModifier] : /./;
- }, "getRegex"),
- bindEvents: /* @__PURE__ */ __name(function bindEvents(el) {
- var _this = this;
- el.$_keyfilterKeydownEvent = function(event2) {
- return _this.onKeydown(event2, el);
- };
- el.$_keyfilterPasteEvent = function(event2) {
- return _this.onPaste(event2, el);
- };
- el.addEventListener("keypress", el.$_keyfilterKeydownEvent);
- el.addEventListener("paste", el.$_keyfilterPasteEvent);
- }, "bindEvents"),
- unbindEvents: /* @__PURE__ */ __name(function unbindEvents(el) {
- el.removeEventListener("keypress", el.$_keyfilterKeydownEvent);
- el.removeEventListener("paste", el.$_keyfilterPasteEvent);
- el.$_keyfilterKeydownEvent = null;
- el.$_keyfilterPasteEvent = null;
- }, "unbindEvents"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown2(event2, target) {
- if (event2.ctrlKey || event2.altKey || event2.metaKey || event2.key === "Tab") {
- return;
- }
- var regex = this.getRegex(target);
- if (regex === "") {
- return;
- }
- var testKey = "".concat(event2.key);
- if (target.$_pkeyfilterValidateOnly) {
- testKey = "".concat(event2.target.value).concat(event2.key);
- }
- if (!regex.test(testKey)) {
- event2.preventDefault();
- }
- }, "onKeydown"),
- onPaste: /* @__PURE__ */ __name(function onPaste4(event2, target) {
- var regex = this.getRegex(target);
- if (regex === "") {
- return;
- }
- var clipboard = event2.clipboardData.getData("text");
- var testKey = "";
- _toConsumableArray$8(clipboard).forEach(function(c) {
- if (target.$_pkeyfilterValidateOnly) {
- testKey += c;
- } else {
- testKey = c;
- }
- if (!regex.test(testKey)) {
- event2.preventDefault();
- return false;
- }
- });
- }, "onPaste")
- }
-});
-var theme$k = /* @__PURE__ */ __name(function theme19(_ref) {
- var dt = _ref.dt;
- return "\n.p-knob-range {\n fill: none;\n transition: stroke 0.1s ease-in;\n}\n\n.p-knob-value {\n animation-name: p-knob-dash-frame;\n animation-fill-mode: forwards;\n fill: none;\n}\n\n.p-knob-text {\n font-size: 1.3rem;\n text-align: center;\n}\n\n.p-knob svg {\n border-radius: 50%;\n outline-color: transparent;\n transition: background ".concat(dt("knob.transition.duration"), ", color ").concat(dt("knob.transition.duration"), ", outline-color ").concat(dt("knob.transition.duration"), ", box-shadow ").concat(dt("knob.transition.duration"), ";\n}\n\n.p-knob svg:focus-visible {\n box-shadow: ").concat(dt("knob.focus.ring.shadow"), ";\n outline: ").concat(dt("knob.focus.ring.width"), " ").concat(dt("knob.focus.ring.style"), " ").concat(dt("knob.focus.ring.color"), ";\n outline-offset: ").concat(dt("knob.focus.ring.offset"), ";\n}\n\n@keyframes p-knob-dash-frame {\n 100% {\n stroke-dashoffset: 0;\n }\n}\n");
-}, "theme");
-var classes$l = {
- root: /* @__PURE__ */ __name(function root15(_ref2) {
- var instance = _ref2.instance, props = _ref2.props;
- return ["p-knob p-component", {
- "p-disabled": props.disabled,
- "p-invalid": instance.$invalid
- }];
- }, "root"),
- range: "p-knob-range",
- value: "p-knob-value",
- text: "p-knob-text"
-};
-var KnobStyle = BaseStyle.extend({
- name: "knob",
- theme: theme$k,
- classes: classes$l
-});
-var script$1$l = {
- name: "BaseKnob",
- "extends": script$1r,
- props: {
- size: {
- type: Number,
- "default": 100
- },
- readonly: {
- type: Boolean,
- "default": false
- },
- step: {
- type: Number,
- "default": 1
- },
- min: {
- type: Number,
- "default": 0
- },
- max: {
- type: Number,
- "default": 100
- },
- valueColor: {
- type: String,
- "default": /* @__PURE__ */ __name(function _default9() {
- return $dt("knob.value.background").variable;
- }, "_default")
- },
- rangeColor: {
- type: String,
- "default": /* @__PURE__ */ __name(function _default10() {
- return $dt("knob.range.background").variable;
- }, "_default")
- },
- textColor: {
- type: String,
- "default": /* @__PURE__ */ __name(function _default11() {
- return $dt("knob.text.color").variable;
- }, "_default")
- },
- strokeWidth: {
- type: Number,
- "default": 14
- },
- showValue: {
- type: Boolean,
- "default": true
- },
- valueTemplate: {
- type: [String, Function],
- "default": "{value}"
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: KnobStyle,
- provide: /* @__PURE__ */ __name(function provide29() {
- return {
- $pcKnob: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var Math_PI$1 = 3.14159265358979;
-var script$z = {
- name: "Knob",
- "extends": script$1$l,
- inheritAttrs: false,
- emits: ["change"],
- data: /* @__PURE__ */ __name(function data18() {
- return {
- radius: 40,
- midX: 50,
- midY: 50,
- minRadians: 4 * Math_PI$1 / 3,
- maxRadians: -Math_PI$1 / 3
- };
- }, "data"),
- methods: {
- updateValueByOffset: /* @__PURE__ */ __name(function updateValueByOffset(offsetX, offsetY) {
- var dx = offsetX - this.size / 2;
- var dy = this.size / 2 - offsetY;
- var angle = Math.atan2(dy, dx);
- var start = -Math_PI$1 / 2 - Math_PI$1 / 6;
- this.updateModel(angle, start);
- }, "updateValueByOffset"),
- updateModel: /* @__PURE__ */ __name(function updateModel5(angle, start) {
- var mappedValue;
- if (angle > this.maxRadians) mappedValue = this.mapRange(angle, this.minRadians, this.maxRadians, this.min, this.max);
- else if (angle < start) mappedValue = this.mapRange(angle + 2 * Math_PI$1, this.minRadians, this.maxRadians, this.min, this.max);
- else return;
- var newValue = Math.round((mappedValue - this.min) / this.step) * this.step + this.min;
- this.writeValue(newValue);
- this.$emit("change", newValue);
- }, "updateModel"),
- updateModelValue: /* @__PURE__ */ __name(function updateModelValue2(newValue) {
- if (newValue > this.max) this.writeValue(this.max);
- else if (newValue < this.min) this.writeValue(this.min);
- else this.writeValue(newValue);
- }, "updateModelValue"),
- mapRange: /* @__PURE__ */ __name(function mapRange(x, inMin, inMax, outMin, outMax) {
- return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
- }, "mapRange"),
- onClick: /* @__PURE__ */ __name(function onClick4(event2) {
- if (!this.disabled && !this.readonly) {
- this.updateValueByOffset(event2.offsetX, event2.offsetY);
- }
- }, "onClick"),
- onBlur: /* @__PURE__ */ __name(function onBlur7(event2) {
- var _this$formField$onBlu, _this$formField;
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event2);
- }, "onBlur"),
- onMouseDown: /* @__PURE__ */ __name(function onMouseDown(event2) {
- if (!this.disabled && !this.readonly) {
- window.addEventListener("mousemove", this.onMouseMove);
- window.addEventListener("mouseup", this.onMouseUp);
- event2.preventDefault();
- }
- }, "onMouseDown"),
- onMouseUp: /* @__PURE__ */ __name(function onMouseUp(event2) {
- if (!this.disabled && !this.readonly) {
- window.removeEventListener("mousemove", this.onMouseMove);
- window.removeEventListener("mouseup", this.onMouseUp);
- event2.preventDefault();
- }
- }, "onMouseUp"),
- onTouchStart: /* @__PURE__ */ __name(function onTouchStart(event2) {
- if (!this.disabled && !this.readonly) {
- window.addEventListener("touchmove", this.onTouchMove);
- window.addEventListener("touchend", this.onTouchEnd);
- event2.preventDefault();
- }
- }, "onTouchStart"),
- onTouchEnd: /* @__PURE__ */ __name(function onTouchEnd(event2) {
- if (!this.disabled && !this.readonly) {
- window.removeEventListener("touchmove", this.onTouchMove);
- window.removeEventListener("touchend", this.onTouchEnd);
- event2.preventDefault();
- }
- }, "onTouchEnd"),
- onMouseMove: /* @__PURE__ */ __name(function onMouseMove(event2) {
- if (!this.disabled && !this.readonly) {
- this.updateValueByOffset(event2.offsetX, event2.offsetY);
- event2.preventDefault();
- }
- }, "onMouseMove"),
- onTouchMove: /* @__PURE__ */ __name(function onTouchMove(event2) {
- if (!this.disabled && !this.readonly && event2.touches.length == 1) {
- var rect = this.$el.getBoundingClientRect();
- var touch = event2.targetTouches.item(0);
- var offsetX = touch.clientX - rect.left;
- var offsetY = touch.clientY - rect.top;
- this.updateValueByOffset(offsetX, offsetY);
- }
- }, "onTouchMove"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown7(event2) {
- if (!this.disabled && !this.readonly) {
- switch (event2.code) {
- case "ArrowRight":
- case "ArrowUp": {
- event2.preventDefault();
- this.updateModelValue(this.d_value + this.step);
- break;
- }
- case "ArrowLeft":
- case "ArrowDown": {
- event2.preventDefault();
- this.updateModelValue(this.d_value - this.step);
- break;
- }
- case "Home": {
- event2.preventDefault();
- this.writeValue(this.min);
- break;
- }
- case "End": {
- event2.preventDefault();
- this.writeValue(this.max);
- break;
- }
- case "PageUp": {
- event2.preventDefault();
- this.updateModelValue(this.d_value + 10);
- break;
- }
- case "PageDown": {
- event2.preventDefault();
- this.updateModelValue(this.d_value - 10);
- break;
- }
- }
- }
- }, "onKeyDown")
- },
- computed: {
- rangePath: /* @__PURE__ */ __name(function rangePath() {
- return "M ".concat(this.minX, " ").concat(this.minY, " A ").concat(this.radius, " ").concat(this.radius, " 0 1 1 ").concat(this.maxX, " ").concat(this.maxY);
- }, "rangePath"),
- valuePath: /* @__PURE__ */ __name(function valuePath() {
- return "M ".concat(this.zeroX, " ").concat(this.zeroY, " A ").concat(this.radius, " ").concat(this.radius, " 0 ").concat(this.largeArc, " ").concat(this.sweep, " ").concat(this.valueX, " ").concat(this.valueY);
- }, "valuePath"),
- zeroRadians: /* @__PURE__ */ __name(function zeroRadians() {
- if (this.min > 0 && this.max > 0) return this.mapRange(this.min, this.min, this.max, this.minRadians, this.maxRadians);
- else return this.mapRange(0, this.min, this.max, this.minRadians, this.maxRadians);
- }, "zeroRadians"),
- valueRadians: /* @__PURE__ */ __name(function valueRadians() {
- return this.mapRange(this.d_value, this.min, this.max, this.minRadians, this.maxRadians);
- }, "valueRadians"),
- minX: /* @__PURE__ */ __name(function minX() {
- return this.midX + Math.cos(this.minRadians) * this.radius;
- }, "minX"),
- minY: /* @__PURE__ */ __name(function minY() {
- return this.midY - Math.sin(this.minRadians) * this.radius;
- }, "minY"),
- maxX: /* @__PURE__ */ __name(function maxX() {
- return this.midX + Math.cos(this.maxRadians) * this.radius;
- }, "maxX"),
- maxY: /* @__PURE__ */ __name(function maxY() {
- return this.midY - Math.sin(this.maxRadians) * this.radius;
- }, "maxY"),
- zeroX: /* @__PURE__ */ __name(function zeroX() {
- return this.midX + Math.cos(this.zeroRadians) * this.radius;
- }, "zeroX"),
- zeroY: /* @__PURE__ */ __name(function zeroY() {
- return this.midY - Math.sin(this.zeroRadians) * this.radius;
- }, "zeroY"),
- valueX: /* @__PURE__ */ __name(function valueX() {
- return this.midX + Math.cos(this.valueRadians) * this.radius;
- }, "valueX"),
- valueY: /* @__PURE__ */ __name(function valueY() {
- return this.midY - Math.sin(this.valueRadians) * this.radius;
- }, "valueY"),
- largeArc: /* @__PURE__ */ __name(function largeArc() {
- return Math.abs(this.zeroRadians - this.valueRadians) < Math_PI$1 ? 0 : 1;
- }, "largeArc"),
- sweep: /* @__PURE__ */ __name(function sweep() {
- return this.valueRadians > this.zeroRadians ? 0 : 1;
- }, "sweep"),
- valueToDisplay: /* @__PURE__ */ __name(function valueToDisplay() {
- if (typeof this.valueTemplate === "string") {
- return this.valueTemplate.replace(/{value}/g, this.d_value);
- } else {
- return this.valueTemplate(this.d_value);
- }
- }, "valueToDisplay")
- }
-};
-var _hoisted_1$j = ["width", "height", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-labelledby", "aria-label"];
-var _hoisted_2$e = ["d", "stroke-width", "stroke"];
-var _hoisted_3$b = ["d", "stroke-width", "stroke"];
-var _hoisted_4$7 = ["fill"];
-function render$v(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(), createElementBlock("svg", mergeProps({
- viewBox: "0 0 100 100",
- role: "slider",
- width: _ctx.size,
- height: _ctx.size,
- tabindex: _ctx.readonly || _ctx.disabled ? -1 : _ctx.tabindex,
- "aria-valuemin": _ctx.min,
- "aria-valuemax": _ctx.max,
- "aria-valuenow": _ctx.d_value,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel,
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- }),
- onBlur: _cache[1] || (_cache[1] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- }),
- onMousedown: _cache[3] || (_cache[3] = function() {
- return $options.onMouseDown && $options.onMouseDown.apply($options, arguments);
- }),
- onMouseup: _cache[4] || (_cache[4] = function() {
- return $options.onMouseUp && $options.onMouseUp.apply($options, arguments);
- }),
- onTouchstartPassive: _cache[5] || (_cache[5] = function() {
- return $options.onTouchStart && $options.onTouchStart.apply($options, arguments);
- }),
- onTouchend: _cache[6] || (_cache[6] = function() {
- return $options.onTouchEnd && $options.onTouchEnd.apply($options, arguments);
- })
- }, _ctx.ptm("svg")), [createBaseVNode("path", mergeProps({
- d: $options.rangePath,
- "stroke-width": _ctx.strokeWidth,
- stroke: _ctx.rangeColor,
- "class": _ctx.cx("range")
- }, _ctx.ptm("range")), null, 16, _hoisted_2$e), createBaseVNode("path", mergeProps({
- d: $options.valuePath,
- "stroke-width": _ctx.strokeWidth,
- stroke: _ctx.valueColor,
- "class": _ctx.cx("value")
- }, _ctx.ptm("value")), null, 16, _hoisted_3$b), _ctx.showValue ? (openBlock(), createElementBlock("text", mergeProps({
- key: 0,
- x: 50,
- y: 57,
- "text-anchor": "middle",
- fill: _ctx.textColor,
- "class": _ctx.cx("text")
- }, _ctx.ptm("text")), toDisplayString($options.valueToDisplay), 17, _hoisted_4$7)) : createCommentVNode("", true)], 16, _hoisted_1$j))], 16);
-}
-__name(render$v, "render$v");
-script$z.render = render$v;
-var theme$j = /* @__PURE__ */ __name(function theme20(_ref) {
- var dt = _ref.dt;
- return "\n.p-megamenu {\n position: relative;\n display: flex;\n align-items: center;\n background: ".concat(dt("megamenu.background"), ";\n border: 1px solid ").concat(dt("megamenu.border.color"), ";\n border-radius: ").concat(dt("megamenu.border.radius"), ";\n color: ").concat(dt("megamenu.color"), ";\n gap: ").concat(dt("megamenu.gap"), ";\n}\n\n.p-megamenu-start,\n.p-megamenu-end {\n display: flex;\n align-items: center;\n}\n\n.p-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n outline: 0 none;\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: ").concat(dt("megamenu.gap"), ";\n}\n\n.p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content {\n border-radius: ").concat(dt("megamenu.base.item.border.radius"), ";\n}\n\n.p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content > .p-megamenu-item-link {\n padding: ").concat(dt("megamenu.base.item.padding"), ";\n}\n\n.p-megamenu-item-content {\n transition: background ").concat(dt("megamenu.transition.duration"), ", color ").concat(dt("megamenu.transition.duration"), ";\n border-radius: ").concat(dt("megamenu.item.border.radius"), ";\n color: ").concat(dt("megamenu.item.color"), ";\n}\n\n.p-megamenu-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("megamenu.item.padding"), ";\n gap: ").concat(dt("megamenu.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-megamenu-item-label {\n line-height: 1;\n}\n\n.p-megamenu-item-icon {\n color: ").concat(dt("megamenu.item.icon.color"), ";\n}\n\n.p-megamenu-submenu-icon {\n color: ").concat(dt("megamenu.submenu.icon.color"), ";\n font-size: ").concat(dt("megamenu.submenu.icon.size"), ";\n width: ").concat(dt("megamenu.submenu.icon.size"), ";\n height: ").concat(dt("megamenu.submenu.icon.size"), ";\n}\n\n.p-megamenu-item.p-focus > .p-megamenu-item-content {\n color: ").concat(dt("megamenu.item.focus.color"), ";\n background: ").concat(dt("megamenu.item.focus.background"), ";\n}\n\n.p-megamenu-item.p-focus > .p-megamenu-item-content .p-megamenu-item-icon {\n color: ").concat(dt("megamenu.item.icon.focus.color"), ";\n}\n\n.p-megamenu-item.p-focus > .p-megamenu-item-content .p-megamenu-submenu-icon {\n color: ").concat(dt("megamenu.submenu.icon.focus.color"), ";\n}\n\n.p-megamenu-item:not(.p-disabled) > .p-megamenu-item-content:hover {\n color: ").concat(dt("megamenu.item.focus.color"), ";\n background: ").concat(dt("megamenu.item.focus.background"), ";\n}\n\n.p-megamenu-item:not(.p-disabled) > .p-megamenu-item-content:hover .p-megamenu-item-icon {\n color: ").concat(dt("megamenu.item.icon.focus.color"), ";\n}\n\n.p-megamenu-item:not(.p-disabled) > .p-megamenu-item-content:hover .p-megamenu-submenu-icon {\n color: ").concat(dt("megamenu.submenu.icon.focus.color"), ";\n}\n\n.p-megamenu-item-active > .p-megamenu-item-content {\n color: ").concat(dt("megamenu.item.active.color"), ";\n background: ").concat(dt("megamenu.item.active.background"), ";\n}\n\n.p-megamenu-item-active > .p-megamenu-item-content .p-megamenu-item-icon {\n color: ").concat(dt("megamenu.item.icon.active.color"), ";\n}\n\n.p-megamenu-item-active > .p-megamenu-item-content .p-megamenu-submenu-icon {\n color: ").concat(dt("megamenu.submenu.icon.active.color"), ";\n}\n\n.p-megamenu-overlay {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n left: 0;\n min-width: 100%;\n padding: ").concat(dt("megamenu.overlay.padding"), ";\n background: ").concat(dt("megamenu.overlay.background"), ";\n color: ").concat(dt("megamenu.overlay.color"), ";\n border: 1px solid ").concat(dt("megamenu.overlay.border.color"), ";\n border-radius: ").concat(dt("megamenu.overlay.border.radius"), ";\n box-shadow: ").concat(dt("megamenu.overlay.shadow"), ";\n}\n\n.p-megamenu-overlay:dir(rtl) {\n left: auto;\n right: 0;\n}\n\n.p-megamenu-root-list > .p-megamenu-item-active > .p-megamenu-overlay {\n display: block;\n}\n\n.p-megamenu-submenu {\n margin: 0;\n list-style: none;\n padding: ").concat(dt("megamenu.submenu.padding"), ";\n min-width: 12.5rem;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("megamenu.submenu.gap"), "\n}\n\n.p-megamenu-submenu-label {\n padding: ").concat(dt("megamenu.submenu.label.padding"), ";\n color: ").concat(dt("megamenu.submenu.label.color"), ";\n font-weight: ").concat(dt("megamenu.submenu.label.font.weight"), ";\n background: ").concat(dt("megamenu.submenu.label.background"), ";\n}\n\n.p-megamenu-separator {\n border-block-start: 1px solid ").concat(dt("megamenu.separator.border.color"), ";\n}\n\n.p-megamenu-horizontal {\n align-items: center;\n padding: ").concat(dt("megamenu.horizontal.orientation.padding"), ";\n}\n\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: ").concat(dt("megamenu.horizontal.orientation.gap"), ";\n}\n\n.p-megamenu-horizontal .p-megamenu-end {\n margin-left: auto;\n align-self: center;\n}\n\n.p-megamenu-horizontal .p-megamenu-end:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-megamenu-vertical {\n display: inline-flex;\n min-width: 12.5rem;\n flex-direction: column;\n align-items: stretch;\n padding: ").concat(dt("megamenu.vertical.orientation.padding"), ";\n}\n\n.p-megamenu-vertical .p-megamenu-root-list {\n align-items: stretch;\n flex-direction: column;\n gap: ").concat(dt("megamenu.vertical.orientation.gap"), ";\n}\n\n.p-megamenu-vertical .p-megamenu-root-list > .p-megamenu-item-active > .p-megamenu-overlay {\n left: 100%;\n top: 0;\n}\n\n.p-megamenu-vertical .p-megamenu-root-list > .p-megamenu-item-active > .p-megamenu-overlay:dir(rtl) {\n left: auto;\n right: 100%;\n}\n\n.p-megamenu-vertical .p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content .p-megamenu-submenu-icon {\n margin-left: auto;\n}\n\n.p-megamenu-vertical .p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content .p-megamenu-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n transform: rotate(180deg);\n}\n\n.p-megamenu-grid {\n display: flex;\n}\n\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: ").concat(dt("megamenu.overlay.gap"), ";\n}\n\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n\n.p-megamenu-col-3 {\n width: 25%;\n}\n\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n\n.p-megamenu-col-6 {\n width: 50%;\n}\n\n.p-megamenu-col-12 {\n width: 100%;\n}\n\n.p-megamenu-button {\n display: none;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n width: ").concat(dt("megamenu.mobile.button.size"), ";\n height: ").concat(dt("megamenu.mobile.button.size"), ";\n position: relative;\n color: ").concat(dt("megamenu.mobile.button.color"), ";\n border: 0 none;\n background: transparent;\n border-radius: ").concat(dt("megamenu.mobile.button.border.radius"), ";\n transition: background ").concat(dt("megamenu.transition.duration"), ", color ").concat(dt("megamenu.transition.duration"), ", outline-color ").concat(dt("megamenu.transition.duration"), ", box-shadow ").concat(dt("megamenu.transition.duration"), ";\n outline-color: transparent;\n}\n\n.p-megamenu-button:hover {\n color: ").concat(dt("megamenu.mobile.button.hover.color"), ";\n background: ").concat(dt("megamenu.mobile.button.hover.background"), ";\n}\n\n.p-megamenu-button:focus-visible {\n box-shadow: ").concat(dt("megamenu.mobile.button.focus.ring.shadow"), ";\n outline: ").concat(dt("megamenu.mobile.button.focus.ring.width"), " ").concat(dt("megamenu.mobile.button.focus.ring.style"), " ").concat(dt("megamenu.mobile.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("megamenu.mobile.button.focus.ring.offset"), ";\n}\n\n.p-megamenu-mobile {\n display: flex;\n}\n\n.p-megamenu-mobile .p-megamenu-button {\n display: flex;\n}\n\n.p-megamenu-mobile .p-megamenu-root-list {\n position: absolute;\n display: none;\n flex-direction: column;\n top: 100%;\n left: 0;\n z-index: 1;\n width: 100%;\n padding: ").concat(dt("megamenu.submenu.padding"), ";\n gap: ").concat(dt("megamenu.submenu.gap"), ";\n background: ").concat(dt("megamenu.overlay.background"), ";\n border: 1px solid ").concat(dt("megamenu.overlay.border.color"), ";\n box-shadow: ").concat(dt("megamenu.overlay.shadow"), ";\n}\n\n.p-megamenu-mobile .p-megamenu-root-list:dir(rtl) {\n left: auto;\n right: 0;\n}\n\n.p-megamenu-mobile-active .p-megamenu-root-list {\n display: block;\n}\n\n.p-megamenu-mobile .p-megamenu-root-list .p-megamenu-item {\n width: 100%;\n position: static;\n}\n\n.p-megamenu-mobile .p-megamenu-overlay {\n position: static;\n border: 0 none;\n border-radius: 0;\n box-shadow: none;\n}\n\n.p-megamenu-mobile .p-megamenu-grid {\n flex-wrap: wrap;\n overflow: auto;\n max-height: 90%;\n}\n\n.p-megamenu-mobile .p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content .p-megamenu-submenu-icon {\n margin-left: auto;\n transition: transform 0.2s;\n}\n\n.p-megamenu-mobile .p-megamenu-root-list > .p-megamenu-item > .p-megamenu-item-content .p-megamenu-submenu-icon:dir(rtl) {\n margin-left: 0;\n margin-right: auto;\n}\n\n.p-megamenu-mobile .p-megamenu-root-list > .p-megamenu-item-active > .p-megamenu-item-content .p-megamenu-submenu-icon {\n transform: rotate(-180deg);\n}\n");
-}, "theme");
-var inlineStyles$6 = {
- rootList: /* @__PURE__ */ __name(function rootList(_ref2) {
- var props = _ref2.props;
- return {
- "max-height": props.scrollHeight,
- overflow: "auto"
- };
- }, "rootList")
-};
-var classes$k = {
- root: /* @__PURE__ */ __name(function root16(_ref3) {
- var instance = _ref3.instance;
- return ["p-megamenu p-component", {
- "p-megamenu-mobile": instance.queryMatches,
- "p-megamenu-mobile-active": instance.mobileActive,
- "p-megamenu-horizontal": instance.horizontal,
- "p-megamenu-vertical": instance.vertical
- }];
- }, "root"),
- start: "p-megamenu-start",
- button: "p-megamenu-button",
- rootList: "p-megamenu-root-list",
- submenuLabel: /* @__PURE__ */ __name(function submenuLabel(_ref4) {
- var instance = _ref4.instance, processedItem = _ref4.processedItem;
- return ["p-megamenu-submenu-label", {
- "p-disabled": instance.isItemDisabled(processedItem)
- }];
- }, "submenuLabel"),
- item: /* @__PURE__ */ __name(function item3(_ref5) {
- var instance = _ref5.instance, processedItem = _ref5.processedItem;
- return ["p-megamenu-item", {
- "p-megamenu-item-active": instance.isItemActive(processedItem),
- "p-focus": instance.isItemFocused(processedItem),
- "p-disabled": instance.isItemDisabled(processedItem)
- }];
- }, "item"),
- itemContent: "p-megamenu-item-content",
- itemLink: "p-megamenu-item-link",
- itemIcon: "p-megamenu-item-icon",
- itemLabel: "p-megamenu-item-label",
- submenuIcon: "p-megamenu-submenu-icon",
- overlay: "p-megamenu-overlay",
- grid: "p-megamenu-grid",
- column: /* @__PURE__ */ __name(function column(_ref6) {
- var instance = _ref6.instance, processedItem = _ref6.processedItem;
- var length = instance.isItemGroup(processedItem) ? processedItem.items.length : 0;
- var columnClass;
- if (instance.$parentInstance.queryMatches) columnClass = "p-megamenu-col-12";
- else {
- switch (length) {
- case 2:
- columnClass = "p-megamenu-col-6";
- break;
- case 3:
- columnClass = "p-megamenu-col-4";
- break;
- case 4:
- columnClass = "p-megamenu-col-3";
- break;
- case 6:
- columnClass = "p-megamenu-col-2";
- break;
- default:
- columnClass = "p-megamenu-col-12";
- break;
- }
- }
- return columnClass;
- }, "column"),
- submenu: "p-megamenu-submenu",
- separator: "p-megamenu-separator",
- end: "p-megamenu-end"
-};
-var MegaMenuStyle = BaseStyle.extend({
- name: "megamenu",
- theme: theme$j,
- classes: classes$k,
- inlineStyles: inlineStyles$6
-});
-var script$2$5 = {
- name: "BaseMegaMenu",
- "extends": script$1f,
- props: {
- model: {
- type: Array,
- "default": null
- },
- orientation: {
- type: String,
- "default": "horizontal"
- },
- breakpoint: {
- type: String,
- "default": "960px"
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- scrollHeight: {
- type: String,
- "default": "20rem"
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: MegaMenuStyle,
- provide: /* @__PURE__ */ __name(function provide30() {
- return {
- $pcMegaMenu: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$k = {
- name: "MegaMenuSub",
- hostName: "MegaMenu",
- "extends": script$1f,
- emits: ["item-click", "item-mouseenter"],
- props: {
- menuId: {
- type: String,
- "default": null
- },
- focusedItemId: {
- type: String,
- "default": null
- },
- horizontal: {
- type: Boolean,
- "default": false
- },
- submenu: {
- type: Object,
- "default": null
- },
- mobileActive: {
- type: Boolean,
- "default": false
- },
- items: {
- type: Array,
- "default": null
- },
- level: {
- type: Number,
- "default": 0
- },
- templates: {
- type: Object,
- "default": null
- },
- activeItem: {
- type: Object,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- }
- },
- methods: {
- getSubListId: /* @__PURE__ */ __name(function getSubListId(processedItem) {
- return "".concat(this.getItemId(processedItem), "_list");
- }, "getSubListId"),
- getSubListKey: /* @__PURE__ */ __name(function getSubListKey(processedItem) {
- return this.getSubListId(processedItem);
- }, "getSubListKey"),
- getItemId: /* @__PURE__ */ __name(function getItemId2(processedItem) {
- return "".concat(this.menuId, "_").concat(processedItem.key);
- }, "getItemId"),
- getItemKey: /* @__PURE__ */ __name(function getItemKey(processedItem) {
- return this.getItemId(processedItem);
- }, "getItemKey"),
- getItemProp: /* @__PURE__ */ __name(function getItemProp2(processedItem, name4, params) {
- return processedItem && processedItem.item ? resolve(processedItem.item[name4], params) : void 0;
- }, "getItemProp"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel(processedItem) {
- return this.getItemProp(processedItem, "label");
- }, "getItemLabel"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions3(processedItem, index, key) {
- return this.ptm(key, {
- context: {
- item: processedItem.item,
- index,
- active: this.isItemActive(processedItem),
- focused: this.isItemFocused(processedItem),
- disabled: this.isItemDisabled(processedItem)
- }
- });
- }, "getPTOptions"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive3(processedItem) {
- return isNotEmpty(this.activeItem) ? this.activeItem.key === processedItem.key : false;
- }, "isItemActive"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible(processedItem) {
- return this.getItemProp(processedItem, "visible") !== false;
- }, "isItemVisible"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled(processedItem) {
- return this.getItemProp(processedItem, "disabled");
- }, "isItemDisabled"),
- isItemFocused: /* @__PURE__ */ __name(function isItemFocused(processedItem) {
- return this.focusedItemId === this.getItemId(processedItem);
- }, "isItemFocused"),
- isItemGroup: /* @__PURE__ */ __name(function isItemGroup(processedItem) {
- return isNotEmpty(processedItem.items);
- }, "isItemGroup"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick2(event2, processedItem) {
- this.getItemProp(processedItem, "command", {
- originalEvent: event2,
- item: processedItem.item
- });
- this.$emit("item-click", {
- originalEvent: event2,
- processedItem,
- isFocus: true
- });
- }, "onItemClick"),
- onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter2(event2, processedItem) {
- this.$emit("item-mouseenter", {
- originalEvent: event2,
- processedItem
- });
- }, "onItemMouseEnter"),
- getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize() {
- var _this = this;
- return this.items.filter(function(processedItem) {
- return _this.isItemVisible(processedItem) && !_this.getItemProp(processedItem, "separator");
- }).length;
- }, "getAriaSetSize"),
- getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset(index) {
- var _this2 = this;
- return index - this.items.slice(0, index).filter(function(processedItem) {
- return _this2.isItemVisible(processedItem) && _this2.getItemProp(processedItem, "separator");
- }).length + 1;
- }, "getAriaPosInset"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps3(processedItem, index) {
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- tabindex: -1
- }, this.getPTOptions(processedItem, index, "itemLink")),
- icon: mergeProps({
- "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")]
- }, this.getPTOptions(processedItem, index, "itemIcon")),
- label: mergeProps({
- "class": this.cx("label")
- }, this.getPTOptions(processedItem, index, "label")),
- submenuicon: mergeProps({
- "class": this.cx("submenuIcon")
- }, this.getPTOptions(processedItem, index, "submenuIcon"))
- };
- }, "getMenuItemProps")
- },
- components: {
- AngleRightIcon: script$1o,
- AngleDownIcon: script$1G
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$1$4 = ["tabindex"];
-var _hoisted_2$1$3 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"];
-var _hoisted_3$a = ["onClick", "onMouseenter"];
-var _hoisted_4$6 = ["href", "target"];
-var _hoisted_5$2 = ["id"];
-function render$1$5(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_MegaMenuSub = resolveComponent("MegaMenuSub", true);
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("ul", mergeProps({
- "class": $props.level === 0 ? _ctx.cx("rootList") : _ctx.cx("submenu"),
- tabindex: $props.tabindex
- }, $props.level === 0 ? _ctx.ptm("rootList") : _ctx.ptm("submenu")), [$props.submenu ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- "class": [_ctx.cx("submenuLabel", {
- submenu: $props.submenu
- }), $options.getItemProp($props.submenu, "class")],
- style: $options.getItemProp($props.submenu, "style"),
- role: "presentation"
- }, _ctx.ptm("submenuLabel")), toDisplayString($options.getItemLabel($props.submenu)), 17)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.getItemKey(processedItem)
- }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: $options.getItemId(processedItem),
- style: $options.getItemProp(processedItem, "style"),
- "class": [_ctx.cx("item", {
- processedItem
- }), $options.getItemProp(processedItem, "class")],
- role: "menuitem",
- "aria-label": $options.getItemLabel(processedItem),
- "aria-disabled": $options.isItemDisabled(processedItem) || void 0,
- "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0,
- "aria-haspopup": $options.isItemGroup(processedItem) && !$options.getItemProp(processedItem, "to") ? "menu" : void 0,
- "aria-level": $props.level + 1,
- "aria-setsize": $options.getAriaSetSize(),
- "aria-posinset": $options.getAriaPosInset(index),
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "item"), {
- "data-p-active": $options.isItemActive(processedItem),
- "data-p-focused": $options.isItemFocused(processedItem),
- "data-p-disabled": $options.isItemDisabled(processedItem)
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("itemContent"),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, processedItem);
- }, "onClick"),
- onMouseenter: /* @__PURE__ */ __name(function onMouseenter($event) {
- return $options.onItemMouseEnter($event, processedItem);
- }, "onMouseenter"),
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: $options.getItemProp(processedItem, "url"),
- "class": _ctx.cx("itemLink"),
- target: $options.getItemProp(processedItem, "target"),
- tabindex: "-1",
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), {
- key: 0,
- item: processedItem.item,
- "class": normalizeClass(_ctx.cx("itemIcon"))
- }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")],
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemLabel"),
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17), $options.isItemGroup(processedItem) ? (openBlock(), createElementBlock(Fragment, {
- key: 2
- }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), mergeProps({
- key: 0,
- active: $options.isItemActive(processedItem),
- "class": _ctx.cx("submenuIcon"),
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["active", "class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.horizontal || $props.mobileActive ? "AngleDownIcon" : "AngleRightIcon"), mergeProps({
- key: 1,
- "class": _ctx.cx("submenuIcon"),
- ref_for: true
- }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$6)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
- key: 1,
- item: processedItem.item,
- hasSubmenu: $options.isItemGroup(processedItem),
- label: $options.getItemLabel(processedItem),
- props: $options.getMenuItemProps(processedItem, index)
- }, null, 8, ["item", "hasSubmenu", "label", "props"]))], 16, _hoisted_3$a), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("overlay"),
- ref_for: true
- }, _ctx.ptm("overlay")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("grid"),
- ref_for: true
- }, _ctx.ptm("grid")), [(openBlock(true), createElementBlock(Fragment, null, renderList(processedItem.items, function(col) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: $options.getItemKey(col),
- "class": _ctx.cx("column", {
- processedItem
- }),
- ref_for: true
- }, _ctx.ptm("column")), [(openBlock(true), createElementBlock(Fragment, null, renderList(col, function(submenu) {
- return openBlock(), createBlock(_component_MegaMenuSub, {
- key: $options.getSubListKey(submenu),
- id: $options.getSubListId(submenu),
- style: normalizeStyle(_ctx.sx("submenu", true, {
- processedItem
- })),
- role: "menu",
- menuId: $props.menuId,
- focusedItemId: $props.focusedItemId,
- submenu,
- items: submenu.items,
- templates: $props.templates,
- level: $props.level + 1,
- mobileActive: $props.mobileActive,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled,
- onItemClick: _cache[0] || (_cache[0] = function($event) {
- return _ctx.$emit("item-click", $event);
- }),
- onItemMouseenter: _cache[1] || (_cache[1] = function($event) {
- return _ctx.$emit("item-mouseenter", $event);
- })
- }, null, 8, ["id", "style", "menuId", "focusedItemId", "submenu", "items", "templates", "level", "mobileActive", "pt", "unstyled"]);
- }), 128))], 16);
- }), 128))], 16)], 16)) : createCommentVNode("", true)], 16, _hoisted_2$1$3)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
- key: 1,
- id: $options.getItemId(processedItem),
- "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")],
- style: $options.getItemProp(processedItem, "style"),
- role: "separator",
- ref_for: true
- }, _ctx.ptm("separator")), null, 16, _hoisted_5$2)) : createCommentVNode("", true)], 64);
- }), 128))], 16, _hoisted_1$1$4);
-}
-__name(render$1$5, "render$1$5");
-script$1$k.render = render$1$5;
-var script$y = {
- name: "MegaMenu",
- "extends": script$2$5,
- inheritAttrs: false,
- emits: ["focus", "blur"],
- outsideClickListener: null,
- resizeListener: null,
- matchMediaListener: null,
- container: null,
- menubar: null,
- searchTimeout: null,
- searchValue: null,
- data: /* @__PURE__ */ __name(function data19() {
- return {
- id: this.$attrs.id,
- mobileActive: false,
- focused: false,
- focusedItemInfo: {
- index: -1,
- key: "",
- parentKey: ""
- },
- activeItem: null,
- dirty: false,
- query: null,
- queryMatches: false
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId5(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- activeItem: /* @__PURE__ */ __name(function activeItem(newItem) {
- if (isNotEmpty(newItem)) {
- this.bindOutsideClickListener();
- this.bindResizeListener();
- } else {
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- }
- }, "activeItem")
- },
- mounted: /* @__PURE__ */ __name(function mounted21() {
- this.id = this.id || UniqueComponentId();
- this.bindMatchMediaListener();
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount7() {
- this.mobileActive = false;
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- this.unbindMatchMediaListener();
- }, "beforeUnmount"),
- methods: {
- getItemProp: /* @__PURE__ */ __name(function getItemProp3(item8, name4) {
- return item8 ? resolve(item8[name4]) : void 0;
- }, "getItemProp"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel2(item8) {
- return this.getItemProp(item8, "label");
- }, "getItemLabel"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled2(item8) {
- return this.getItemProp(item8, "disabled");
- }, "isItemDisabled"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible2(item8) {
- return this.getItemProp(item8, "visible") !== false;
- }, "isItemVisible"),
- isItemGroup: /* @__PURE__ */ __name(function isItemGroup2(item8) {
- return isNotEmpty(this.getItemProp(item8, "items"));
- }, "isItemGroup"),
- isItemSeparator: /* @__PURE__ */ __name(function isItemSeparator(item8) {
- return this.getItemProp(item8, "separator");
- }, "isItemSeparator"),
- getProccessedItemLabel: /* @__PURE__ */ __name(function getProccessedItemLabel(processedItem) {
- return processedItem ? this.getItemLabel(processedItem.item) : void 0;
- }, "getProccessedItemLabel"),
- isProccessedItemGroup: /* @__PURE__ */ __name(function isProccessedItemGroup(processedItem) {
- return processedItem && isNotEmpty(processedItem.items);
- }, "isProccessedItemGroup"),
- toggle: /* @__PURE__ */ __name(function toggle2(event2) {
- var _this = this;
- if (this.mobileActive) {
- this.mobileActive = false;
- ZIndex.clear(this.menubar);
- this.hide();
- } else {
- this.mobileActive = true;
- ZIndex.set("menu", this.menubar, this.$primevue.config.zIndex.menu);
- setTimeout(function() {
- _this.show();
- }, 1);
- }
- this.bindOutsideClickListener();
- event2.preventDefault();
- }, "toggle"),
- show: /* @__PURE__ */ __name(function show2() {
- this.focusedItemInfo = {
- index: this.findFirstFocusedItemIndex(),
- level: 0,
- parentKey: ""
- };
- focus(this.menubar);
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide2(event2, isFocus) {
- var _this2 = this;
- if (this.mobileActive) {
- this.mobileActive = false;
- setTimeout(function() {
- focus(_this2.$refs.menubutton, {
- preventScroll: true
- });
- }, 1);
- }
- this.activeItem = null;
- this.focusedItemInfo = {
- index: -1,
- key: "",
- parentKey: ""
- };
- isFocus && focus(this.menubar);
- this.dirty = false;
- }, "hide"),
- onFocus: /* @__PURE__ */ __name(function onFocus8(event2) {
- this.focused = true;
- if (this.focusedItemInfo.index === -1) {
- var index = this.findFirstFocusedItemIndex();
- var processedItem = this.findVisibleItem(index);
- this.focusedItemInfo = {
- index,
- key: processedItem.key,
- parentKey: processedItem.parentKey
- };
- }
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur8(event2) {
- this.focused = false;
- this.focusedItemInfo = {
- index: -1,
- key: "",
- parentKey: ""
- };
- this.searchValue = "";
- this.dirty = false;
- this.$emit("blur", event2);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown8(event2) {
- if (this.disabled) {
- event2.preventDefault();
- return;
- }
- var metaKey = event2.metaKey || event2.ctrlKey;
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "ArrowLeft":
- this.onArrowLeftKey(event2);
- break;
- case "ArrowRight":
- this.onArrowRightKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Space":
- this.onSpaceKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Tab":
- this.onTabKey(event2);
- break;
- case "PageDown":
- case "PageUp":
- case "Backspace":
- case "ShiftLeft":
- case "ShiftRight":
- break;
- default:
- if (!metaKey && isPrintableCharacter(event2.key)) {
- this.searchItems(event2, event2.key);
- }
- break;
- }
- }, "onKeyDown"),
- onItemChange: /* @__PURE__ */ __name(function onItemChange(event2) {
- var processedItem = event2.processedItem, isFocus = event2.isFocus;
- if (isEmpty(processedItem)) return;
- var index = processedItem.index, key = processedItem.key, parentKey = processedItem.parentKey, items2 = processedItem.items;
- var grouped = isNotEmpty(items2);
- grouped && (this.activeItem = processedItem);
- this.focusedItemInfo = {
- index,
- key,
- parentKey
- };
- grouped && (this.dirty = true);
- isFocus && focus(this.menubar);
- }, "onItemChange"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick3(event2) {
- var originalEvent = event2.originalEvent, processedItem = event2.processedItem;
- var grouped = this.isProccessedItemGroup(processedItem);
- var root34 = isEmpty(processedItem.parent);
- var selected3 = this.isSelected(processedItem);
- if (selected3) {
- var index = processedItem.index, key = processedItem.key, parentKey = processedItem.parentKey;
- this.activeItem = null;
- this.focusedItemInfo = {
- index,
- key,
- parentKey
- };
- this.dirty = !root34;
- if (!this.mobileActive) {
- focus(this.menubar, {
- preventScroll: true
- });
- }
- } else {
- if (grouped) {
- this.onItemChange(event2);
- } else {
- this.hide(originalEvent);
- }
- }
- }, "onItemClick"),
- onItemMouseEnter: /* @__PURE__ */ __name(function onItemMouseEnter3(event2) {
- if (!this.mobileActive && this.dirty) {
- this.onItemChange(event2);
- }
- }, "onItemMouseEnter"),
- menuButtonClick: /* @__PURE__ */ __name(function menuButtonClick(event2) {
- this.toggle(event2);
- }, "menuButtonClick"),
- menuButtonKeydown: /* @__PURE__ */ __name(function menuButtonKeydown(event2) {
- (event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") && this.menuButtonClick(event2);
- }, "menuButtonKeydown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey4(event2) {
- if (this.horizontal) {
- if (isNotEmpty(this.activeItem) && this.activeItem.key === this.focusedItemInfo.key) {
- this.focusedItemInfo = {
- index: -1,
- key: "",
- parentKey: this.activeItem.key
- };
- } else {
- var processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var grouped = this.isProccessedItemGroup(processedItem);
- if (grouped) {
- this.onItemChange({
- originalEvent: event2,
- processedItem
- });
- this.focusedItemInfo = {
- index: -1,
- key: processedItem.key,
- parentKey: processedItem.parentKey
- };
- this.searchValue = "";
- }
- }
- }
- var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
- this.changeFocusedItemInfo(event2, itemIndex);
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey4(event2) {
- if (event2.altKey && this.horizontal) {
- if (this.focusedItemInfo.index !== -1) {
- var processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var grouped = this.isProccessedItemGroup(processedItem);
- if (!grouped && isNotEmpty(this.activeItem)) {
- if (this.focusedItemInfo.index === 0) {
- this.focusedItemInfo = {
- index: this.activeItem.index,
- key: this.activeItem.key,
- parentKey: this.activeItem.parentKey
- };
- this.activeItem = null;
- } else {
- this.changeFocusedItemInfo(event2, this.findFirstItemIndex());
- }
- }
- }
- event2.preventDefault();
- } else {
- var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex();
- this.changeFocusedItemInfo(event2, itemIndex);
- event2.preventDefault();
- }
- }, "onArrowUpKey"),
- onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey2(event2) {
- var processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var grouped = this.isProccessedItemGroup(processedItem);
- if (grouped) {
- if (this.horizontal) {
- var itemIndex = this.focusedItemInfo.index !== -1 ? this.findPrevItemIndex(this.focusedItemInfo.index) : this.findLastFocusedItemIndex();
- this.changeFocusedItemInfo(event2, itemIndex);
- }
- } else {
- if (this.vertical && isNotEmpty(this.activeItem)) {
- if (processedItem.columnIndex === 0) {
- this.focusedItemInfo = {
- index: this.activeItem.index,
- key: this.activeItem.key,
- parentKey: this.activeItem.parentKey
- };
- this.activeItem = null;
- }
- }
- var columnIndex = processedItem.columnIndex - 1;
- var _itemIndex = this.visibleItems.findIndex(function(item8) {
- return item8.columnIndex === columnIndex;
- });
- _itemIndex !== -1 && this.changeFocusedItemInfo(event2, _itemIndex);
- }
- event2.preventDefault();
- }, "onArrowLeftKey"),
- onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey2(event2) {
- var processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var grouped = this.isProccessedItemGroup(processedItem);
- if (grouped) {
- if (this.vertical) {
- if (isNotEmpty(this.activeItem) && this.activeItem.key === processedItem.key) {
- this.focusedItemInfo = {
- index: -1,
- key: "",
- parentKey: this.activeItem.key
- };
- } else {
- var _processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var _grouped = this.isProccessedItemGroup(_processedItem);
- if (_grouped) {
- this.onItemChange({
- originalEvent: event2,
- processedItem: _processedItem
- });
- this.focusedItemInfo = {
- index: -1,
- key: _processedItem.key,
- parentKey: _processedItem.parentKey
- };
- this.searchValue = "";
- }
- }
- }
- var itemIndex = this.focusedItemInfo.index !== -1 ? this.findNextItemIndex(this.focusedItemInfo.index) : this.findFirstFocusedItemIndex();
- this.changeFocusedItemInfo(event2, itemIndex);
- } else {
- var columnIndex = processedItem.columnIndex + 1;
- var _itemIndex2 = this.visibleItems.findIndex(function(item8) {
- return item8.columnIndex === columnIndex;
- });
- _itemIndex2 !== -1 && this.changeFocusedItemInfo(event2, _itemIndex2);
- }
- event2.preventDefault();
- }, "onArrowRightKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey4(event2) {
- this.changeFocusedItemInfo(event2, this.findFirstItemIndex());
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey4(event2) {
- this.changeFocusedItemInfo(event2, this.findLastItemIndex());
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey3(event2) {
- if (this.focusedItemInfo.index !== -1) {
- var element = findSingle(this.menubar, 'li[id="'.concat("".concat(this.focusedItemId), '"]'));
- var anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]');
- anchorElement ? anchorElement.click() : element && element.click();
- var processedItem = this.visibleItems[this.focusedItemInfo.index];
- var grouped = this.isProccessedItemGroup(processedItem);
- !grouped && this.changeFocusedItemInfo(event2, this.findFirstFocusedItemIndex());
- }
- event2.preventDefault();
- }, "onEnterKey"),
- onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey3(event2) {
- this.onEnterKey(event2);
- }, "onSpaceKey"),
- onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey2(event2) {
- if (isNotEmpty(this.activeItem)) {
- this.focusedItemInfo = {
- index: this.activeItem.index,
- key: this.activeItem.key
- };
- this.activeItem = null;
- }
- event2.preventDefault();
- }, "onEscapeKey"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey2(event2) {
- if (this.focusedItemInfo.index !== -1) {
- var processedItem = this.findVisibleItem(this.focusedItemInfo.index);
- var grouped = this.isProccessedItemGroup(processedItem);
- !grouped && this.onItemChange({
- originalEvent: event2,
- processedItem
- });
- }
- this.hide();
- }, "onTabKey"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener3() {
- var _this3 = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- var isOutsideContainer = _this3.container && !_this3.container.contains(event2.target);
- var isOutsideTarget = !(_this3.target && (_this3.target === event2.target || _this3.target.contains(event2.target)));
- if (isOutsideContainer && isOutsideTarget) {
- _this3.hide();
- }
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener3() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener3() {
- var _this4 = this;
- if (!this.resizeListener) {
- this.resizeListener = function(event2) {
- if (!isTouchDevice()) {
- _this4.hide(event2, true);
- }
- _this4.mobileActive = false;
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener3() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- bindMatchMediaListener: /* @__PURE__ */ __name(function bindMatchMediaListener4() {
- var _this5 = this;
- if (!this.matchMediaListener) {
- var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
- this.query = query;
- this.queryMatches = query.matches;
- this.matchMediaListener = function() {
- _this5.queryMatches = query.matches;
- _this5.mobileActive = false;
- };
- this.query.addEventListener("change", this.matchMediaListener);
- }
- }, "bindMatchMediaListener"),
- unbindMatchMediaListener: /* @__PURE__ */ __name(function unbindMatchMediaListener4() {
- if (this.matchMediaListener) {
- this.query.removeEventListener("change", this.matchMediaListener);
- this.matchMediaListener = null;
- }
- }, "unbindMatchMediaListener"),
- isItemMatched: /* @__PURE__ */ __name(function isItemMatched(processedItem) {
- var _this$getProccessedIt;
- return this.isValidItem(processedItem) && ((_this$getProccessedIt = this.getProccessedItemLabel(processedItem)) === null || _this$getProccessedIt === void 0 ? void 0 : _this$getProccessedIt.toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase()));
- }, "isItemMatched"),
- isValidItem: /* @__PURE__ */ __name(function isValidItem(processedItem) {
- return !!processedItem && !this.isItemDisabled(processedItem.item) && !this.isItemSeparator(processedItem.item) && this.isItemVisible(processedItem.item);
- }, "isValidItem"),
- isValidSelectedItem: /* @__PURE__ */ __name(function isValidSelectedItem(processedItem) {
- return this.isValidItem(processedItem) && this.isSelected(processedItem);
- }, "isValidSelectedItem"),
- isSelected: /* @__PURE__ */ __name(function isSelected3(processedItem) {
- return isNotEmpty(this.activeItem) ? this.activeItem.key === processedItem.key : false;
- }, "isSelected"),
- findFirstItemIndex: /* @__PURE__ */ __name(function findFirstItemIndex() {
- var _this6 = this;
- return this.visibleItems.findIndex(function(processedItem) {
- return _this6.isValidItem(processedItem);
- });
- }, "findFirstItemIndex"),
- findLastItemIndex: /* @__PURE__ */ __name(function findLastItemIndex() {
- var _this7 = this;
- return findLastIndex(this.visibleItems, function(processedItem) {
- return _this7.isValidItem(processedItem);
- });
- }, "findLastItemIndex"),
- findNextItemIndex: /* @__PURE__ */ __name(function findNextItemIndex(index) {
- var _this8 = this;
- var matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex(function(processedItem) {
- return _this8.isValidItem(processedItem);
- }) : -1;
- return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index;
- }, "findNextItemIndex"),
- findPrevItemIndex: /* @__PURE__ */ __name(function findPrevItemIndex(index) {
- var _this9 = this;
- var matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), function(processedItem) {
- return _this9.isValidItem(processedItem);
- }) : -1;
- return matchedItemIndex > -1 ? matchedItemIndex : index;
- }, "findPrevItemIndex"),
- findSelectedItemIndex: /* @__PURE__ */ __name(function findSelectedItemIndex() {
- var _this10 = this;
- return this.visibleItems.findIndex(function(processedItem) {
- return _this10.isValidSelectedItem(processedItem);
- });
- }, "findSelectedItemIndex"),
- findFirstFocusedItemIndex: /* @__PURE__ */ __name(function findFirstFocusedItemIndex() {
- var selectedIndex = this.findSelectedItemIndex();
- return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex;
- }, "findFirstFocusedItemIndex"),
- findLastFocusedItemIndex: /* @__PURE__ */ __name(function findLastFocusedItemIndex() {
- var selectedIndex = this.findSelectedItemIndex();
- return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex;
- }, "findLastFocusedItemIndex"),
- findVisibleItem: /* @__PURE__ */ __name(function findVisibleItem(index) {
- return isNotEmpty(this.visibleItems) ? this.visibleItems[index] : null;
- }, "findVisibleItem"),
- searchItems: /* @__PURE__ */ __name(function searchItems(event2, _char) {
- var _this11 = this;
- this.searchValue = (this.searchValue || "") + _char;
- var itemIndex = -1;
- var matched = false;
- if (this.focusedItemInfo.index !== -1) {
- itemIndex = this.visibleItems.slice(this.focusedItemInfo.index).findIndex(function(processedItem) {
- return _this11.isItemMatched(processedItem);
- });
- itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo.index).findIndex(function(processedItem) {
- return _this11.isItemMatched(processedItem);
- }) : itemIndex + this.focusedItemInfo.index;
- } else {
- itemIndex = this.visibleItems.findIndex(function(processedItem) {
- return _this11.isItemMatched(processedItem);
- });
- }
- if (itemIndex !== -1) {
- matched = true;
- }
- if (itemIndex === -1 && this.focusedItemInfo.index === -1) {
- itemIndex = this.findFirstFocusedItemIndex();
- }
- if (itemIndex !== -1) {
- this.changeFocusedItemInfo(event2, itemIndex);
- }
- if (this.searchTimeout) {
- clearTimeout(this.searchTimeout);
- }
- this.searchTimeout = setTimeout(function() {
- _this11.searchValue = "";
- _this11.searchTimeout = null;
- }, 500);
- return matched;
- }, "searchItems"),
- changeFocusedItemInfo: /* @__PURE__ */ __name(function changeFocusedItemInfo(event2, index) {
- var processedItem = this.findVisibleItem(index);
- this.focusedItemInfo.index = index;
- this.focusedItemInfo.key = isNotEmpty(processedItem) ? processedItem.key : "";
- this.scrollInView();
- }, "changeFocusedItemInfo"),
- scrollInView: /* @__PURE__ */ __name(function scrollInView3() {
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
- var id4 = index !== -1 ? "".concat(this.id, "_").concat(index) : this.focusedItemId;
- var element;
- if (id4 === null && this.queryMatches) {
- element = this.$refs.menubutton;
- } else {
- element = findSingle(this.menubar, 'li[id="'.concat(id4, '"]'));
- }
- if (element) {
- element.scrollIntoView && element.scrollIntoView({
- block: "nearest",
- inline: "nearest",
- behavior: "smooth"
- });
- }
- }, "scrollInView"),
- createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems(items2) {
- var _this12 = this;
- var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
- var columnIndex = arguments.length > 4 ? arguments[4] : void 0;
- var processedItems3 = [];
- items2 && items2.forEach(function(item8, index) {
- var key = (parentKey !== "" ? parentKey + "_" : "") + (columnIndex !== void 0 ? columnIndex + "_" : "") + index;
- var newItem = {
- item: item8,
- index,
- level,
- key,
- parent,
- parentKey,
- columnIndex: columnIndex !== void 0 ? columnIndex : parent.columnIndex !== void 0 ? parent.columnIndex : index
- };
- newItem["items"] = level === 0 && item8.items && item8.items.length > 0 ? item8.items.map(function(_items, _index) {
- return _this12.createProcessedItems(_items, level + 1, newItem, key, _index);
- }) : _this12.createProcessedItems(item8.items, level + 1, newItem, key);
- processedItems3.push(newItem);
- });
- return processedItems3;
- }, "createProcessedItems"),
- containerRef: /* @__PURE__ */ __name(function containerRef2(el) {
- this.container = el;
- }, "containerRef"),
- menubarRef: /* @__PURE__ */ __name(function menubarRef(el) {
- this.menubar = el ? el.$el : void 0;
- }, "menubarRef")
- },
- computed: {
- processedItems: /* @__PURE__ */ __name(function processedItems() {
- return this.createProcessedItems(this.model || []);
- }, "processedItems"),
- visibleItems: /* @__PURE__ */ __name(function visibleItems() {
- var processedItem = isNotEmpty(this.activeItem) ? this.activeItem : null;
- return processedItem && processedItem.key === this.focusedItemInfo.parentKey ? processedItem.items.reduce(function(items2, col) {
- col.forEach(function(submenu) {
- submenu.items.forEach(function(a) {
- items2.push(a);
- });
- });
- return items2;
- }, []) : this.processedItems;
- }, "visibleItems"),
- horizontal: /* @__PURE__ */ __name(function horizontal() {
- return this.orientation === "horizontal";
- }, "horizontal"),
- vertical: /* @__PURE__ */ __name(function vertical() {
- return this.orientation === "vertical";
- }, "vertical"),
- focusedItemId: /* @__PURE__ */ __name(function focusedItemId() {
- return isNotEmpty(this.focusedItemInfo.key) ? "".concat(this.id, "_").concat(this.focusedItemInfo.key) : null;
- }, "focusedItemId")
- },
- components: {
- MegaMenuSub: script$1$k,
- BarsIcon: script$1H
- }
-};
-var _hoisted_1$i = ["id"];
-var _hoisted_2$d = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"];
-function render$u(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_BarsIcon = resolveComponent("BarsIcon");
- var _component_MegaMenuSub = resolveComponent("MegaMenuSub");
- return openBlock(), createElementBlock("div", mergeProps({
- ref: $options.containerRef,
- id: $data.id,
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("start")
- }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.button ? "button" : "menubutton", {
- id: $data.id,
- "class": normalizeClass(_ctx.cx("button")),
- toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event2) {
- return $options.menuButtonClick(event2);
- }, "toggleCallback")
- }, function() {
- var _ctx$$primevue$config;
- return [_ctx.model && _ctx.model.length > 0 ? (openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- ref: "menubutton",
- role: "button",
- tabindex: "0",
- "class": _ctx.cx("button"),
- "aria-haspopup": _ctx.model.length && _ctx.model.length > 0 ? true : false,
- "aria-expanded": $data.mobileActive,
- "aria-controls": $data.id,
- "aria-label": (_ctx$$primevue$config = _ctx.$primevue.config.locale.aria) === null || _ctx$$primevue$config === void 0 ? void 0 : _ctx$$primevue$config.navigation,
- onClick: _cache[0] || (_cache[0] = function($event) {
- return $options.menuButtonClick($event);
- }),
- onKeydown: _cache[1] || (_cache[1] = function($event) {
- return $options.menuButtonKeydown($event);
- })
- }, _ctx.ptm("button")), [renderSlot(_ctx.$slots, _ctx.$slots.buttonicon ? "buttonicon" : "menubuttonicon", {}, function() {
- return [createVNode(_component_BarsIcon, normalizeProps(guardReactiveProps(_ctx.ptm("buttonIcon"))), null, 16)];
- })], 16, _hoisted_2$d)) : createCommentVNode("", true)];
- }), createVNode(_component_MegaMenuSub, {
- ref: $options.menubarRef,
- id: $data.id + "_list",
- tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
- role: "menubar",
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-disabled": _ctx.disabled || void 0,
- "aria-orientation": _ctx.orientation,
- "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0,
- menuId: $data.id,
- focusedItemId: $data.focused ? $options.focusedItemId : void 0,
- items: $options.processedItems,
- horizontal: $options.horizontal,
- templates: _ctx.$slots,
- activeItem: $data.activeItem,
- mobileActive: $data.mobileActive,
- level: 0,
- style: normalizeStyle(_ctx.sx("rootList")),
- pt: _ctx.pt,
- unstyled: _ctx.unstyled,
- onFocus: $options.onFocus,
- onBlur: $options.onBlur,
- onKeydown: $options.onKeyDown,
- onItemClick: $options.onItemClick,
- onItemMouseenter: $options.onItemMouseEnter
- }, null, 8, ["id", "tabindex", "aria-label", "aria-labelledby", "aria-disabled", "aria-orientation", "aria-activedescendant", "menuId", "focusedItemId", "items", "horizontal", "templates", "activeItem", "mobileActive", "style", "pt", "unstyled", "onFocus", "onBlur", "onKeydown", "onItemClick", "onItemMouseenter"]), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("end")
- }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$i);
-}
-__name(render$u, "render$u");
-script$y.render = render$u;
-var theme$i = /* @__PURE__ */ __name(function theme21(_ref) {
- var dt = _ref.dt;
- return "\n.p-menu {\n background: ".concat(dt("menu.background"), ";\n color: ").concat(dt("menu.color"), ";\n border: 1px solid ").concat(dt("menu.border.color"), ";\n border-radius: ").concat(dt("menu.border.radius"), ";\n min-width: 12.5rem;\n}\n\n.p-menu-list {\n margin: 0;\n padding: ").concat(dt("menu.list.padding"), ";\n outline: 0 none;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("menu.list.gap"), ";\n}\n\n.p-menu-item-content {\n transition: background ").concat(dt("menu.transition.duration"), ", color ").concat(dt("menu.transition.duration"), ";\n border-radius: ").concat(dt("menu.item.border.radius"), ";\n color: ").concat(dt("menu.item.color"), ";\n}\n\n.p-menu-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ").concat(dt("menu.item.padding"), ";\n gap: ").concat(dt("menu.item.gap"), ";\n user-select: none;\n outline: 0 none;\n}\n\n.p-menu-item-label {\n line-height: 1;\n}\n\n.p-menu-item-icon {\n color: ").concat(dt("menu.item.icon.color"), ";\n}\n\n.p-menu-item.p-focus .p-menu-item-content {\n color: ").concat(dt("menu.item.focus.color"), ";\n background: ").concat(dt("menu.item.focus.background"), ";\n}\n\n.p-menu-item.p-focus .p-menu-item-icon {\n color: ").concat(dt("menu.item.icon.focus.color"), ";\n}\n\n.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {\n color: ").concat(dt("menu.item.focus.color"), ";\n background: ").concat(dt("menu.item.focus.background"), ";\n}\n\n.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {\n color: ").concat(dt("menu.item.icon.focus.color"), ";\n}\n\n.p-menu-overlay {\n box-shadow: ").concat(dt("menu.shadow"), ";\n}\n\n.p-menu-submenu-label {\n background: ").concat(dt("menu.submenu.label.background"), ";\n padding: ").concat(dt("menu.submenu.label.padding"), ";\n color: ").concat(dt("menu.submenu.label.color"), ";\n font-weight: ").concat(dt("menu.submenu.label.font.weight"), ";\n}\n\n.p-menu-separator {\n border-block-start: 1px solid ").concat(dt("menu.separator.border.color"), ";\n}\n");
-}, "theme");
-var classes$j = {
- root: /* @__PURE__ */ __name(function root17(_ref2) {
- var props = _ref2.props;
- return ["p-menu p-component", {
- "p-menu-overlay": props.popup
- }];
- }, "root"),
- start: "p-menu-start",
- list: "p-menu-list",
- submenuLabel: "p-menu-submenu-label",
- separator: "p-menu-separator",
- end: "p-menu-end",
- item: /* @__PURE__ */ __name(function item4(_ref3) {
- var instance = _ref3.instance;
- return ["p-menu-item", {
- "p-focus": instance.id === instance.focusedOptionId,
- "p-disabled": instance.disabled()
- }];
- }, "item"),
- itemContent: "p-menu-item-content",
- itemLink: "p-menu-item-link",
- itemIcon: "p-menu-item-icon",
- itemLabel: "p-menu-item-label"
-};
-var MenuStyle = BaseStyle.extend({
- name: "menu",
- theme: theme$i,
- classes: classes$j
-});
-var script$2$4 = {
- name: "BaseMenu",
- "extends": script$1f,
- props: {
- popup: {
- type: Boolean,
- "default": false
- },
- model: {
- type: Array,
- "default": null
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- autoZIndex: {
- type: Boolean,
- "default": true
- },
- baseZIndex: {
- type: Number,
- "default": 0
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- }
- },
- style: MenuStyle,
- provide: /* @__PURE__ */ __name(function provide31() {
- return {
- $pcMenu: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$j = {
- name: "Menuitem",
- hostName: "Menu",
- "extends": script$1f,
- inheritAttrs: false,
- emits: ["item-click", "item-mousemove"],
- props: {
- item: null,
- templates: null,
- id: null,
- focusedOptionId: null,
- index: null
- },
- methods: {
- getItemProp: /* @__PURE__ */ __name(function getItemProp4(processedItem, name4) {
- return processedItem && processedItem.item ? resolve(processedItem.item[name4]) : void 0;
- }, "getItemProp"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(key) {
- return this.ptm(key, {
- context: {
- item: this.item,
- index: this.index,
- focused: this.isItemFocused(),
- disabled: this.disabled()
- }
- });
- }, "getPTOptions"),
- isItemFocused: /* @__PURE__ */ __name(function isItemFocused2() {
- return this.focusedOptionId === this.id;
- }, "isItemFocused"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick4(event2) {
- var command = this.getItemProp(this.item, "command");
- command && command({
- originalEvent: event2,
- item: this.item.item
- });
- this.$emit("item-click", {
- originalEvent: event2,
- item: this.item,
- id: this.id
- });
- }, "onItemClick"),
- onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove(event2) {
- this.$emit("item-mousemove", {
- originalEvent: event2,
- item: this.item,
- id: this.id
- });
- }, "onItemMouseMove"),
- visible: /* @__PURE__ */ __name(function visible2() {
- return typeof this.item.visible === "function" ? this.item.visible() : this.item.visible !== false;
- }, "visible"),
- disabled: /* @__PURE__ */ __name(function disabled3() {
- return typeof this.item.disabled === "function" ? this.item.disabled() : this.item.disabled;
- }, "disabled"),
- label: /* @__PURE__ */ __name(function label4() {
- return typeof this.item.label === "function" ? this.item.label() : this.item.label;
- }, "label"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps4(item8) {
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- tabindex: "-1"
- }, this.getPTOptions("itemLink")),
- icon: mergeProps({
- "class": [this.cx("itemIcon"), item8.icon]
- }, this.getPTOptions("itemIcon")),
- label: mergeProps({
- "class": this.cx("itemLabel")
- }, this.getPTOptions("itemLabel"))
- };
- }, "getMenuItemProps")
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$1$3 = ["id", "aria-label", "aria-disabled", "data-p-focused", "data-p-disabled"];
-var _hoisted_2$1$2 = ["href", "target"];
-function render$1$4(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- return $options.visible() ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: $props.id,
- "class": [_ctx.cx("item"), $props.item["class"]],
- role: "menuitem",
- style: $props.item.style,
- "aria-label": $options.label(),
- "aria-disabled": $options.disabled()
- }, $options.getPTOptions("item"), {
- "data-p-focused": $options.isItemFocused(),
- "data-p-disabled": $options.disabled() || false
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("itemContent"),
- onClick: _cache[0] || (_cache[0] = function($event) {
- return $options.onItemClick($event);
- }),
- onMousemove: _cache[1] || (_cache[1] = function($event) {
- return $options.onItemMouseMove($event);
- })
- }, $options.getPTOptions("itemContent")), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: $props.item.url,
- "class": _ctx.cx("itemLink"),
- target: $props.item.target,
- tabindex: "-1"
- }, $options.getPTOptions("itemLink")), [$props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), {
- key: 0,
- item: $props.item,
- "class": normalizeClass(_ctx.cx("itemIcon"))
- }, null, 8, ["item", "class"])) : $props.item.icon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": [_ctx.cx("itemIcon"), $props.item.icon]
- }, $options.getPTOptions("itemIcon")), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemLabel")
- }, $options.getPTOptions("itemLabel")), toDisplayString($options.label()), 17)], 16, _hoisted_2$1$2)), [[_directive_ripple]]) : $props.templates.item ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
- key: 1,
- item: $props.item,
- label: $options.label(),
- props: $options.getMenuItemProps($props.item)
- }, null, 8, ["item", "label", "props"])) : createCommentVNode("", true)], 16)], 16, _hoisted_1$1$3)) : createCommentVNode("", true);
-}
-__name(render$1$4, "render$1$4");
-script$1$j.render = render$1$4;
-function _toConsumableArray$7(r) {
- return _arrayWithoutHoles$7(r) || _iterableToArray$7(r) || _unsupportedIterableToArray$8(r) || _nonIterableSpread$7();
-}
-__name(_toConsumableArray$7, "_toConsumableArray$7");
-function _nonIterableSpread$7() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$7, "_nonIterableSpread$7");
-function _unsupportedIterableToArray$8(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$8(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$8(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$8, "_unsupportedIterableToArray$8");
-function _iterableToArray$7(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$7, "_iterableToArray$7");
-function _arrayWithoutHoles$7(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$8(r);
-}
-__name(_arrayWithoutHoles$7, "_arrayWithoutHoles$7");
-function _arrayLikeToArray$8(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$8, "_arrayLikeToArray$8");
-var script$x = {
- name: "Menu",
- "extends": script$2$4,
- inheritAttrs: false,
- emits: ["show", "hide", "focus", "blur"],
- data: /* @__PURE__ */ __name(function data20() {
- return {
- id: this.$attrs.id,
- overlayVisible: false,
- focused: false,
- focusedOptionIndex: -1,
- selectedOptionIndex: -1
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId6(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId")
- },
- target: null,
- outsideClickListener: null,
- scrollHandler: null,
- resizeListener: null,
- container: null,
- list: null,
- mounted: /* @__PURE__ */ __name(function mounted22() {
- this.id = this.id || UniqueComponentId();
- if (!this.popup) {
- this.bindResizeListener();
- this.bindOutsideClickListener();
- }
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount8() {
- this.unbindResizeListener();
- this.unbindOutsideClickListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- this.target = null;
- if (this.container && this.autoZIndex) {
- ZIndex.clear(this.container);
- }
- this.container = null;
- }, "beforeUnmount"),
- methods: {
- itemClick: /* @__PURE__ */ __name(function itemClick(event2) {
- var item8 = event2.item;
- if (this.disabled(item8)) {
- return;
- }
- if (item8.command) {
- item8.command(event2);
- }
- if (this.overlayVisible) this.hide();
- if (!this.popup && this.focusedOptionIndex !== event2.id) {
- this.focusedOptionIndex = event2.id;
- }
- }, "itemClick"),
- itemMouseMove: /* @__PURE__ */ __name(function itemMouseMove(event2) {
- if (this.focused) {
- this.focusedOptionIndex = event2.id;
- }
- }, "itemMouseMove"),
- onListFocus: /* @__PURE__ */ __name(function onListFocus2(event2) {
- this.focused = true;
- !this.popup && this.changeFocusedOptionIndex(0);
- this.$emit("focus", event2);
- }, "onListFocus"),
- onListBlur: /* @__PURE__ */ __name(function onListBlur2(event2) {
- this.focused = false;
- this.focusedOptionIndex = -1;
- this.$emit("blur", event2);
- }, "onListBlur"),
- onListKeyDown: /* @__PURE__ */ __name(function onListKeyDown2(event2) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Space":
- this.onSpaceKey(event2);
- break;
- case "Escape":
- if (this.popup) {
- focus(this.target);
- this.hide();
- }
- case "Tab":
- this.overlayVisible && this.hide();
- break;
- }
- }, "onListKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey5(event2) {
- var optionIndex = this.findNextOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey5(event2) {
- if (event2.altKey && this.popup) {
- focus(this.target);
- this.hide();
- event2.preventDefault();
- } else {
- var optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- event2.preventDefault();
- }
- }, "onArrowUpKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey5(event2) {
- this.changeFocusedOptionIndex(0);
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey5(event2) {
- this.changeFocusedOptionIndex(find(this.container, 'li[data-pc-section="item"][data-p-disabled="false"]').length - 1);
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey4(event2) {
- var element = findSingle(this.list, 'li[id="'.concat("".concat(this.focusedOptionIndex), '"]'));
- var anchorElement = element && findSingle(element, 'a[data-pc-section="itemlink"]');
- this.popup && focus(this.target);
- anchorElement ? anchorElement.click() : element && element.click();
- event2.preventDefault();
- }, "onEnterKey"),
- onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey4(event2) {
- this.onEnterKey(event2);
- }, "onSpaceKey"),
- findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex3(index) {
- var links = find(this.container, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var matchedOptionIndex = _toConsumableArray$7(links).findIndex(function(link) {
- return link.id === index;
- });
- return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;
- }, "findNextOptionIndex"),
- findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex3(index) {
- var links = find(this.container, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var matchedOptionIndex = _toConsumableArray$7(links).findIndex(function(link) {
- return link.id === index;
- });
- return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;
- }, "findPrevOptionIndex"),
- changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex3(index) {
- var links = find(this.container, 'li[data-pc-section="item"][data-p-disabled="false"]');
- var order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;
- order > -1 && (this.focusedOptionIndex = links[order].getAttribute("id"));
- }, "changeFocusedOptionIndex"),
- toggle: /* @__PURE__ */ __name(function toggle3(event2) {
- if (this.overlayVisible) this.hide();
- else this.show(event2);
- }, "toggle"),
- show: /* @__PURE__ */ __name(function show3(event2) {
- this.overlayVisible = true;
- this.target = event2.currentTarget;
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide3() {
- this.overlayVisible = false;
- this.target = null;
- }, "hide"),
- onEnter: /* @__PURE__ */ __name(function onEnter2(el) {
- addStyle(el, {
- position: "absolute",
- top: "0",
- left: "0"
- });
- this.alignOverlay();
- this.bindOutsideClickListener();
- this.bindResizeListener();
- this.bindScrollListener();
- if (this.autoZIndex) {
- ZIndex.set("menu", el, this.baseZIndex + this.$primevue.config.zIndex.menu);
- }
- if (this.popup) {
- focus(this.list);
- }
- this.$emit("show");
- }, "onEnter"),
- onLeave: /* @__PURE__ */ __name(function onLeave2() {
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- this.unbindScrollListener();
- this.$emit("hide");
- }, "onLeave"),
- onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave2(el) {
- if (this.autoZIndex) {
- ZIndex.clear(el);
- }
- }, "onAfterLeave"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay3() {
- absolutePosition(this.container, this.target);
- var targetWidth = getOuterWidth(this.target);
- if (targetWidth > getOuterWidth(this.container)) {
- this.container.style.minWidth = getOuterWidth(this.target) + "px";
- }
- }, "alignOverlay"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener4() {
- var _this = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- var isOutsideContainer = _this.container && !_this.container.contains(event2.target);
- var isOutsideTarget = !(_this.target && (_this.target === event2.target || _this.target.contains(event2.target)));
- if (_this.overlayVisible && isOutsideContainer && isOutsideTarget) {
- _this.hide();
- } else if (!_this.popup && isOutsideContainer && isOutsideTarget) {
- _this.focusedOptionIndex = -1;
- }
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener4() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener4() {
- var _this2 = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, function() {
- if (_this2.overlayVisible) {
- _this2.hide();
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener4() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener4() {
- var _this3 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this3.overlayVisible && !isTouchDevice()) {
- _this3.hide();
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener4() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- visible: /* @__PURE__ */ __name(function visible3(item8) {
- return typeof item8.visible === "function" ? item8.visible() : item8.visible !== false;
- }, "visible"),
- disabled: /* @__PURE__ */ __name(function disabled4(item8) {
- return typeof item8.disabled === "function" ? item8.disabled() : item8.disabled;
- }, "disabled"),
- label: /* @__PURE__ */ __name(function label5(item8) {
- return typeof item8.label === "function" ? item8.label() : item8.label;
- }, "label"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick3(event2) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.target
- });
- }, "onOverlayClick"),
- containerRef: /* @__PURE__ */ __name(function containerRef3(el) {
- this.container = el;
- }, "containerRef"),
- listRef: /* @__PURE__ */ __name(function listRef(el) {
- this.list = el;
- }, "listRef")
- },
- computed: {
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId4() {
- return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
- }, "focusedOptionId")
- },
- components: {
- PVMenuitem: script$1$j,
- Portal: script$1m
- }
-};
-var _hoisted_1$h = ["id"];
-var _hoisted_2$c = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
-var _hoisted_3$9 = ["id"];
-function render$t(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_PVMenuitem = resolveComponent("PVMenuitem");
- var _component_Portal = resolveComponent("Portal");
- return openBlock(), createBlock(_component_Portal, {
- appendTo: _ctx.appendTo,
- disabled: !_ctx.popup
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: $options.onEnter,
- onLeave: $options.onLeave,
- onAfterLeave: $options.onAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [(_ctx.popup ? $data.overlayVisible : true) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.containerRef,
- id: $data.id,
- "class": _ctx.cx("root"),
- onClick: _cache[3] || (_cache[3] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- })
- }, _ctx.ptmi("root")), [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("start")
- }, _ctx.ptm("start")), [renderSlot(_ctx.$slots, "start")], 16)) : createCommentVNode("", true), createBaseVNode("ul", mergeProps({
- ref: $options.listRef,
- id: $data.id + "_list",
- "class": _ctx.cx("list"),
- role: "menu",
- tabindex: _ctx.tabindex,
- "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- onFocus: _cache[0] || (_cache[0] = function() {
- return $options.onListFocus && $options.onListFocus.apply($options, arguments);
- }),
- onBlur: _cache[1] || (_cache[1] = function() {
- return $options.onListBlur && $options.onListBlur.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onListKeyDown && $options.onListKeyDown.apply($options, arguments);
- })
- }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.label(item8) + i.toString()
- }, [item8.items && $options.visible(item8) && !item8.separator ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [item8.items ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: $data.id + "_" + i,
- "class": [_ctx.cx("submenuLabel"), item8["class"]],
- role: "none",
- ref_for: true
- }, _ctx.ptm("submenuLabel")), [renderSlot(_ctx.$slots, _ctx.$slots.submenulabel ? "submenulabel" : "submenuheader", {
- item: item8
- }, function() {
- return [createTextVNode(toDisplayString($options.label(item8)), 1)];
- })], 16, _hoisted_3$9)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(item8.items, function(child, j) {
- return openBlock(), createElementBlock(Fragment, {
- key: child.label + i + "_" + j
- }, [$options.visible(child) && !child.separator ? (openBlock(), createBlock(_component_PVMenuitem, {
- key: 0,
- id: $data.id + "_" + i + "_" + j,
- item: child,
- templates: _ctx.$slots,
- focusedOptionId: $options.focusedOptionId,
- unstyled: _ctx.unstyled,
- onItemClick: $options.itemClick,
- onItemMousemove: $options.itemMouseMove,
- pt: _ctx.pt
- }, null, 8, ["id", "item", "templates", "focusedOptionId", "unstyled", "onItemClick", "onItemMousemove", "pt"])) : $options.visible(child) && child.separator ? (openBlock(), createElementBlock("li", mergeProps({
- key: "separator" + i + j,
- "class": [_ctx.cx("separator"), item8["class"]],
- style: child.style,
- role: "separator",
- ref_for: true
- }, _ctx.ptm("separator")), null, 16)) : createCommentVNode("", true)], 64);
- }), 128))], 64)) : $options.visible(item8) && item8.separator ? (openBlock(), createElementBlock("li", mergeProps({
- key: "separator" + i.toString(),
- "class": [_ctx.cx("separator"), item8["class"]],
- style: item8.style,
- role: "separator",
- ref_for: true
- }, _ctx.ptm("separator")), null, 16)) : (openBlock(), createBlock(_component_PVMenuitem, {
- key: $options.label(item8) + i.toString(),
- id: $data.id + "_" + i,
- item: item8,
- index: i,
- templates: _ctx.$slots,
- focusedOptionId: $options.focusedOptionId,
- unstyled: _ctx.unstyled,
- onItemClick: $options.itemClick,
- onItemMousemove: $options.itemMouseMove,
- pt: _ctx.pt
- }, null, 8, ["id", "item", "index", "templates", "focusedOptionId", "unstyled", "onItemClick", "onItemMousemove", "pt"]))], 64);
- }), 128))], 16, _hoisted_2$c), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("end")
- }, _ctx.ptm("end")), [renderSlot(_ctx.$slots, "end")], 16)) : createCommentVNode("", true)], 16, _hoisted_1$h)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onLeave", "onAfterLeave"])];
- }),
- _: 3
- }, 8, ["appendTo", "disabled"]);
-}
-__name(render$t, "render$t");
-script$x.render = render$t;
-var theme$h = /* @__PURE__ */ __name(function theme22(_ref) {
- var dt = _ref.dt;
- return "\n.p-metergroup {\n display: flex;\n gap: ".concat(dt("metergroup.gap"), ";\n}\n\n.p-metergroup-meters {\n display: flex;\n background: ").concat(dt("metergroup.meters.background"), ";\n border-radius: ").concat(dt("metergroup.border.radius"), ";\n}\n\n.p-metergroup-label-list {\n display: flex;\n flex-wrap: wrap;\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.p-metergroup-label {\n display: inline-flex;\n align-items: center;\n gap: ").concat(dt("metergroup.label.gap"), ";\n}\n\n.p-metergroup-label-marker {\n display: inline-flex;\n width: ").concat(dt("metergroup.label.marker.size"), ";\n height: ").concat(dt("metergroup.label.marker.size"), ";\n border-radius: 100%;\n}\n\n.p-metergroup-label-icon {\n font-size: ").concat(dt("metergroup.label.icon.size"), ";\n width: ").concat(dt("metergroup.label.icon.size"), ";\n height: ").concat(dt("metergroup.label.icon.size"), ";\n}\n\n.p-metergroup-horizontal {\n flex-direction: column;\n}\n\n.p-metergroup-label-list-horizontal {\n gap: ").concat(dt("metergroup.label.list.horizontal.gap"), ";\n}\n\n.p-metergroup-horizontal .p-metergroup-meters {\n height: ").concat(dt("metergroup.meters.size"), ";\n}\n\n.p-metergroup-horizontal .p-metergroup-meter:first-of-type {\n border-start-start-radius: ").concat(dt("metergroup.border.radius"), ";\n border-end-start-radius: ").concat(dt("metergroup.border.radius"), ";\n}\n\n.p-metergroup-horizontal .p-metergroup-meter:last-of-type {\n border-start-end-radius: ").concat(dt("metergroup.border.radius"), ";\n border-end-end-radius: ").concat(dt("metergroup.border.radius"), ";\n}\n\n.p-metergroup-vertical {\n flex-direction: row;\n}\n\n.p-metergroup-label-list-vertical {\n flex-direction: column;\n gap: ").concat(dt("metergroup.label.list.vertical.gap"), ";\n}\n\n.p-metergroup-vertical .p-metergroup-meters {\n flex-direction: column;\n width: ").concat(dt("metergroup.meters.size"), ";\n height: 100%;\n}\n\n.p-metergroup-vertical .p-metergroup-label-list {\n align-items: flex-start;\n}\n\n.p-metergroup-vertical .p-metergroup-meter:first-of-type {\n border-start-start-radius: ").concat(dt("metergroup.border.radius"), ";\n border-start-end-radius: ").concat(dt("metergroup.border.radius"), ";\n}\n\n.p-metergroup-vertical .p-metergroup-meter:last-of-type {\n border-end-start-radius: ").concat(dt("metergroup.border.radius"), ";\n border-end-end-radius: ").concat(dt("metergroup.border.radius"), ";\n}\n");
-}, "theme");
-var classes$i = {
- root: /* @__PURE__ */ __name(function root18(_ref2) {
- var props = _ref2.props;
- return ["p-metergroup p-component", {
- "p-metergroup-horizontal": props.orientation === "horizontal",
- "p-metergroup-vertical": props.orientation === "vertical"
- }];
- }, "root"),
- meters: "p-metergroup-meters",
- meter: "p-metergroup-meter",
- labelList: /* @__PURE__ */ __name(function labelList(_ref3) {
- var props = _ref3.props;
- return ["p-metergroup-label-list", {
- "p-metergroup-label-list-vertical": props.labelOrientation === "vertical",
- "p-metergroup-label-list-horizontal": props.labelOrientation === "horizontal"
- }];
- }, "labelList"),
- label: "p-metergroup-label",
- labelIcon: "p-metergroup-label-icon",
- labelMarker: "p-metergroup-label-marker",
- labelText: "p-metergroup-label-text"
-};
-var MeterGroupStyle = BaseStyle.extend({
- name: "metergroup",
- theme: theme$h,
- classes: classes$i
-});
-var script$2$3 = {
- name: "MeterGroup",
- "extends": script$1f,
- props: {
- value: {
- type: Array,
- "default": null
- },
- min: {
- type: Number,
- "default": 0
- },
- max: {
- type: Number,
- "default": 100
- },
- orientation: {
- type: String,
- "default": "horizontal"
- },
- labelPosition: {
- type: String,
- "default": "end"
- },
- labelOrientation: {
- type: String,
- "default": "horizontal"
- }
- },
- style: MeterGroupStyle,
- provide: /* @__PURE__ */ __name(function provide32() {
- return {
- $pcMeterGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$i = {
- name: "MeterGroupLabel",
- hostName: "MeterGroup",
- "extends": script$1f,
- inheritAttrs: false,
- props: {
- value: {
- type: Array,
- "default": null
- },
- labelPosition: {
- type: String,
- "default": "end"
- },
- labelOrientation: {
- type: String,
- "default": "horizontal"
- }
- }
-};
-function render$1$3(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("ol", mergeProps({
- "class": _ctx.cx("labelList")
- }, _ctx.ptm("labelList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.value, function(val, index) {
- return openBlock(), createElementBlock("li", mergeProps({
- key: index + "_label",
- "class": _ctx.cx("label"),
- ref_for: true
- }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "icon", {
- value: val,
- "class": normalizeClass(_ctx.cx("labelIcon"))
- }, function() {
- return [val.icon ? (openBlock(), createElementBlock("i", mergeProps({
- key: 0,
- "class": [val.icon, _ctx.cx("labelIcon")],
- style: {
- color: val.color
- },
- ref_for: true
- }, _ctx.ptm("labelIcon")), null, 16)) : (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": _ctx.cx("labelMarker"),
- style: {
- backgroundColor: val.color
- },
- ref_for: true
- }, _ctx.ptm("labelMarker")), null, 16))];
- }), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("labelText"),
- ref_for: true
- }, _ctx.ptm("labelText")), toDisplayString(val.label) + " (" + toDisplayString(_ctx.$parentInstance.percentValue(val.value)) + ")", 17)], 16);
- }), 128))], 16);
-}
-__name(render$1$3, "render$1$3");
-script$1$i.render = render$1$3;
-var script$w = {
- name: "MeterGroup",
- "extends": script$2$3,
- inheritAttrs: false,
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(key, value2, index) {
- return this.ptm(key, {
- context: {
- value: value2,
- index
- }
- });
- }, "getPTOptions"),
- percent: /* @__PURE__ */ __name(function percent() {
- var meter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
- var percentOfItem = (meter - this.min) / (this.max - this.min) * 100;
- return Math.round(Math.max(0, Math.min(100, percentOfItem)));
- }, "percent"),
- percentValue: /* @__PURE__ */ __name(function percentValue(meter) {
- return this.percent(meter) + "%";
- }, "percentValue"),
- meterCalculatedStyles: /* @__PURE__ */ __name(function meterCalculatedStyles(val) {
- return {
- backgroundColor: val.color,
- width: this.orientation === "horizontal" && this.percentValue(val.value),
- height: this.orientation === "vertical" && this.percentValue(val.value)
- };
- }, "meterCalculatedStyles")
- },
- computed: {
- totalPercent: /* @__PURE__ */ __name(function totalPercent() {
- return this.percent(this.value.reduce(function(total, val) {
- return total + val.value;
- }, 0));
- }, "totalPercent"),
- percentages: /* @__PURE__ */ __name(function percentages() {
- var sum = 0;
- var sumsArray = [];
- this.value.forEach(function(item8) {
- sum += item8.value;
- sumsArray.push(sum);
- });
- return sumsArray;
- }, "percentages")
- },
- components: {
- MeterGroupLabel: script$1$i
- }
-};
-var _hoisted_1$g = ["aria-valuemin", "aria-valuemax", "aria-valuenow"];
-function render$s(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_MeterGroupLabel = resolveComponent("MeterGroupLabel");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- role: "meter",
- "aria-valuemin": _ctx.min,
- "aria-valuemax": _ctx.max,
- "aria-valuenow": $options.totalPercent
- }, _ctx.ptmi("root")), [_ctx.labelPosition === "start" ? renderSlot(_ctx.$slots, "label", {
- key: 0,
- value: _ctx.value,
- totalPercent: $options.totalPercent,
- percentages: $options.percentages
- }, function() {
- return [createVNode(_component_MeterGroupLabel, {
- value: _ctx.value,
- labelPosition: _ctx.labelPosition,
- labelOrientation: _ctx.labelOrientation,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["value", "labelPosition", "labelOrientation", "unstyled", "pt"])];
- }) : createCommentVNode("", true), renderSlot(_ctx.$slots, "start", {
- value: _ctx.value,
- totalPercent: $options.totalPercent,
- percentages: $options.percentages
- }), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("meters")
- }, _ctx.ptm("meters")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.value, function(val, index) {
- return renderSlot(_ctx.$slots, "meter", {
- key: index,
- value: val,
- index,
- "class": normalizeClass(_ctx.cx("meter")),
- orientation: _ctx.orientation,
- size: $options.percentValue(val.value),
- totalPercent: $options.totalPercent
- }, function() {
- return [$options.percent(val.value) ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("meter"),
- style: $options.meterCalculatedStyles(val),
- ref_for: true
- }, $options.getPTOptions("meter", val, index)), null, 16)) : createCommentVNode("", true)];
- });
- }), 128))], 16), renderSlot(_ctx.$slots, "end", {
- value: _ctx.value,
- totalPercent: $options.totalPercent,
- percentages: $options.percentages
- }), _ctx.labelPosition === "end" ? renderSlot(_ctx.$slots, "label", {
- key: 1,
- value: _ctx.value,
- totalPercent: $options.totalPercent,
- percentages: $options.percentages
- }, function() {
- return [createVNode(_component_MeterGroupLabel, {
- value: _ctx.value,
- labelPosition: _ctx.labelPosition,
- labelOrientation: _ctx.labelOrientation,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["value", "labelPosition", "labelOrientation", "unstyled", "pt"])];
- }) : createCommentVNode("", true)], 16, _hoisted_1$g);
-}
-__name(render$s, "render$s");
-script$w.render = render$s;
-var theme$g = /* @__PURE__ */ __name(function theme23(_ref) {
- var dt = _ref.dt;
- return "\n.p-multiselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n background: ".concat(dt("multiselect.background"), ";\n border: 1px solid ").concat(dt("multiselect.border.color"), ";\n transition: background ").concat(dt("multiselect.transition.duration"), ", color ").concat(dt("multiselect.transition.duration"), ", border-color ").concat(dt("multiselect.transition.duration"), ", outline-color ").concat(dt("multiselect.transition.duration"), ", box-shadow ").concat(dt("multiselect.transition.duration"), ";\n border-radius: ").concat(dt("multiselect.border.radius"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("multiselect.shadow"), ";\n}\n\n.p-multiselect:not(.p-disabled):hover {\n border-color: ").concat(dt("multiselect.hover.border.color"), ";\n}\n\n.p-multiselect:not(.p-disabled).p-focus {\n border-color: ").concat(dt("multiselect.focus.border.color"), ";\n box-shadow: ").concat(dt("multiselect.focus.ring.shadow"), ";\n outline: ").concat(dt("multiselect.focus.ring.width"), " ").concat(dt("multiselect.focus.ring.style"), " ").concat(dt("multiselect.focus.ring.color"), ";\n outline-offset: ").concat(dt("multiselect.focus.ring.offset"), ";\n}\n\n.p-multiselect.p-variant-filled {\n background: ").concat(dt("multiselect.filled.background"), ";\n}\n\n.p-multiselect.p-variant-filled:not(.p-disabled):hover {\n background: ").concat(dt("multiselect.filled.hover.background"), ";\n}\n\n.p-multiselect.p-variant-filled.p-focus {\n background: ").concat(dt("multiselect.filled.focus.background"), ";\n}\n\n.p-multiselect.p-invalid {\n border-color: ").concat(dt("multiselect.invalid.border.color"), ";\n}\n\n.p-multiselect.p-disabled {\n opacity: 1;\n background: ").concat(dt("multiselect.disabled.background"), ";\n}\n\n.p-multiselect-dropdown {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n background: transparent;\n color: ").concat(dt("multiselect.dropdown.color"), ";\n width: ").concat(dt("multiselect.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("multiselect.border.radius"), ";\n border-end-end-radius: ").concat(dt("multiselect.border.radius"), ";\n}\n\n.p-multiselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n color: ").concat(dt("multiselect.clear.icon.color"), ";\n inset-inline-end: ").concat(dt("multiselect.dropdown.width"), ";\n}\n\n.p-multiselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n}\n\n.p-multiselect-label {\n display: flex;\n align-items: center;\n gap: calc(").concat(dt("multiselect.padding.y"), " / 2);\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: ").concat(dt("multiselect.padding.y"), " ").concat(dt("multiselect.padding.x"), ";\n color: ").concat(dt("multiselect.color"), ";\n}\n\n.p-multiselect-label.p-placeholder {\n color: ").concat(dt("multiselect.placeholder.color"), ";\n}\n\n.p-multiselect.p-invalid .p-multiselect-label.p-placeholder {\n color: ").concat(dt("multiselect.invalid.placeholder.color"), ";\n}\n\n.p-multiselect.p-disabled .p-multiselect-label {\n color: ").concat(dt("multiselect.disabled.color"), ";\n}\n\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-multiselect .p-multiselect-overlay {\n min-width: 100%;\n}\n\n.p-multiselect-overlay {\n position: absolute;\n top: 0;\n left: 0;\n background: ").concat(dt("multiselect.overlay.background"), ";\n color: ").concat(dt("multiselect.overlay.color"), ";\n border: 1px solid ").concat(dt("multiselect.overlay.border.color"), ";\n border-radius: ").concat(dt("multiselect.overlay.border.radius"), ";\n box-shadow: ").concat(dt("multiselect.overlay.shadow"), ";\n}\n\n.p-multiselect-header {\n display: flex;\n align-items: center;\n padding: ").concat(dt("multiselect.list.header.padding"), ";\n}\n\n.p-multiselect-header .p-checkbox {\n margin-inline-end: ").concat(dt("multiselect.option.gap"), ";\n}\n\n.p-multiselect-filter-container {\n flex: 1 1 auto;\n}\n\n.p-multiselect-filter {\n width: 100%;\n}\n\n.p-multiselect-list-container {\n overflow: auto;\n}\n\n.p-multiselect-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n padding: ").concat(dt("multiselect.list.padding"), ";\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("multiselect.list.gap"), ";\n}\n\n.p-multiselect-option {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n gap: ").concat(dt("multiselect.option.gap"), ";\n padding: ").concat(dt("multiselect.option.padding"), ";\n border: 0 none;\n color: ").concat(dt("multiselect.option.color"), ";\n background: transparent;\n transition: background ").concat(dt("multiselect.transition.duration"), ", color ").concat(dt("multiselect.transition.duration"), ", border-color ").concat(dt("multiselect.transition.duration"), ", box-shadow ").concat(dt("multiselect.transition.duration"), ", outline-color ").concat(dt("multiselect.transition.duration"), ";\n border-radius: ").concat(dt("multiselect.option.border.radius"), ";\n}\n\n.p-multiselect-option:not(.p-multiselect-option-selected):not(.p-disabled).p-focus {\n background: ").concat(dt("multiselect.option.focus.background"), ";\n color: ").concat(dt("multiselect.option.focus.color"), ";\n}\n\n.p-multiselect-option.p-multiselect-option-selected {\n background: ").concat(dt("multiselect.option.selected.background"), ";\n color: ").concat(dt("multiselect.option.selected.color"), ";\n}\n\n.p-multiselect-option.p-multiselect-option-selected.p-focus {\n background: ").concat(dt("multiselect.option.selected.focus.background"), ";\n color: ").concat(dt("multiselect.option.selected.focus.color"), ";\n}\n\n.p-multiselect-option-group {\n cursor: auto;\n margin: 0;\n padding: ").concat(dt("multiselect.option.group.padding"), ";\n background: ").concat(dt("multiselect.option.group.background"), ";\n color: ").concat(dt("multiselect.option.group.color"), ";\n font-weight: ").concat(dt("multiselect.option.group.font.weight"), ";\n}\n\n.p-multiselect-empty-message {\n padding: ").concat(dt("multiselect.empty.message.padding"), ";\n}\n\n.p-multiselect-label .p-chip {\n padding-block-start: calc(").concat(dt("multiselect.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("multiselect.padding.y"), " / 2);\n border-radius: ").concat(dt("multiselect.chip.border.radius"), ";\n}\n\n.p-multiselect-label:has(.p-chip) {\n padding: calc(").concat(dt("multiselect.padding.y"), " / 2) calc(").concat(dt("multiselect.padding.x"), " / 2);\n}\n\n.p-multiselect-fluid {\n display: flex;\n width: 100%;\n}\n\n.p-multiselect-sm .p-multiselect-label {\n font-size: ").concat(dt("multiselect.sm.font.size"), ";\n padding-block: ").concat(dt("multiselect.sm.padding.y"), ";\n padding-inline: ").concat(dt("multiselect.sm.padding.x"), ";\n}\n\n.p-multiselect-sm .p-multiselect-dropdown .p-icon {\n font-size: ").concat(dt("multiselect.sm.font.size"), ";\n width: ").concat(dt("multiselect.sm.font.size"), ";\n height: ").concat(dt("multiselect.sm.font.size"), ";\n}\n\n.p-multiselect-lg .p-multiselect-label {\n font-size: ").concat(dt("multiselect.lg.font.size"), ";\n padding-block: ").concat(dt("multiselect.lg.padding.y"), ";\n padding-inline: ").concat(dt("multiselect.lg.padding.x"), ";\n}\n\n.p-multiselect-lg .p-multiselect-dropdown .p-icon {\n font-size: ").concat(dt("multiselect.lg.font.size"), ";\n width: ").concat(dt("multiselect.lg.font.size"), ";\n height: ").concat(dt("multiselect.lg.font.size"), ";\n}\n");
-}, "theme");
-var inlineStyles$5 = {
- root: /* @__PURE__ */ __name(function root19(_ref2) {
- var props = _ref2.props;
- return {
- position: props.appendTo === "self" ? "relative" : void 0
- };
- }, "root")
-};
-var classes$h = {
- root: /* @__PURE__ */ __name(function root20(_ref3) {
- var instance = _ref3.instance, props = _ref3.props;
- return ["p-multiselect p-component p-inputwrapper", {
- "p-multiselect-display-chip": props.display === "chip",
- "p-disabled": props.disabled,
- "p-invalid": instance.$invalid,
- "p-variant-filled": instance.$variant === "filled",
- "p-focus": instance.focused,
- "p-inputwrapper-filled": instance.$filled,
- "p-inputwrapper-focus": instance.focused || instance.overlayVisible,
- "p-multiselect-open": instance.overlayVisible,
- "p-multiselect-fluid": instance.$fluid,
- "p-multiselect-sm p-inputfield-sm": props.size === "small",
- "p-multiselect-lg p-inputfield-lg": props.size === "large"
- }];
- }, "root"),
- labelContainer: "p-multiselect-label-container",
- label: /* @__PURE__ */ __name(function label6(_ref4) {
- var instance = _ref4.instance, props = _ref4.props;
- return ["p-multiselect-label", {
- "p-placeholder": instance.label === props.placeholder,
- "p-multiselect-label-empty": !props.placeholder && (!props.modelValue || props.modelValue.length === 0)
- }];
- }, "label"),
- clearIcon: "p-multiselect-clear-icon",
- chipItem: "p-multiselect-chip-item",
- pcChip: "p-multiselect-chip",
- chipIcon: "p-multiselect-chip-icon",
- dropdown: "p-multiselect-dropdown",
- loadingIcon: "p-multiselect-loading-icon",
- dropdownIcon: "p-multiselect-dropdown-icon",
- overlay: "p-multiselect-overlay p-component",
- header: "p-multiselect-header",
- pcFilterContainer: "p-multiselect-filter-container",
- pcFilter: "p-multiselect-filter",
- listContainer: "p-multiselect-list-container",
- list: "p-multiselect-list",
- optionGroup: "p-multiselect-option-group",
- option: /* @__PURE__ */ __name(function option2(_ref5) {
- var instance = _ref5.instance, _option = _ref5.option, index = _ref5.index, getItemOptions = _ref5.getItemOptions, props = _ref5.props;
- return ["p-multiselect-option", {
- "p-multiselect-option-selected": instance.isSelected(_option) && props.highlightOnSelect,
- "p-focus": instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),
- "p-disabled": instance.isOptionDisabled(_option)
- }];
- }, "option"),
- emptyMessage: "p-multiselect-empty-message"
-};
-var MultiSelectStyle = BaseStyle.extend({
- name: "multiselect",
- theme: theme$g,
- classes: classes$h,
- inlineStyles: inlineStyles$5
-});
-var script$1$h = {
- name: "BaseMultiSelect",
- "extends": script$1k,
- props: {
- options: Array,
- optionLabel: null,
- optionValue: null,
- optionDisabled: null,
- optionGroupLabel: null,
- optionGroupChildren: null,
- scrollHeight: {
- type: String,
- "default": "14rem"
- },
- placeholder: String,
- inputId: {
- type: String,
- "default": null
- },
- panelClass: {
- type: String,
- "default": null
- },
- panelStyle: {
- type: null,
- "default": null
- },
- overlayClass: {
- type: String,
- "default": null
- },
- overlayStyle: {
- type: null,
- "default": null
- },
- dataKey: null,
- showClear: {
- type: Boolean,
- "default": false
- },
- clearIcon: {
- type: String,
- "default": void 0
- },
- resetFilterOnClear: {
- type: Boolean,
- "default": false
- },
- filter: Boolean,
- filterPlaceholder: String,
- filterLocale: String,
- filterMatchMode: {
- type: String,
- "default": "contains"
- },
- filterFields: {
- type: Array,
- "default": null
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- display: {
- type: String,
- "default": "comma"
- },
- selectedItemsLabel: {
- type: String,
- "default": null
- },
- maxSelectedLabels: {
- type: Number,
- "default": null
- },
- selectionLimit: {
- type: Number,
- "default": null
- },
- showToggleAll: {
- type: Boolean,
- "default": true
- },
- loading: {
- type: Boolean,
- "default": false
- },
- checkboxIcon: {
- type: String,
- "default": void 0
- },
- dropdownIcon: {
- type: String,
- "default": void 0
- },
- filterIcon: {
- type: String,
- "default": void 0
- },
- loadingIcon: {
- type: String,
- "default": void 0
- },
- removeTokenIcon: {
- type: String,
- "default": void 0
- },
- chipIcon: {
- type: String,
- "default": void 0
- },
- selectAll: {
- type: Boolean,
- "default": null
- },
- resetFilterOnHide: {
- type: Boolean,
- "default": false
- },
- virtualScrollerOptions: {
- type: Object,
- "default": null
- },
- autoOptionFocus: {
- type: Boolean,
- "default": false
- },
- autoFilterFocus: {
- type: Boolean,
- "default": false
- },
- focusOnHover: {
- type: Boolean,
- "default": true
- },
- highlightOnSelect: {
- type: Boolean,
- "default": false
- },
- filterMessage: {
- type: String,
- "default": null
- },
- selectionMessage: {
- type: String,
- "default": null
- },
- emptySelectionMessage: {
- type: String,
- "default": null
- },
- emptyFilterMessage: {
- type: String,
- "default": null
- },
- emptyMessage: {
- type: String,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- }
- },
- style: MultiSelectStyle,
- provide: /* @__PURE__ */ __name(function provide33() {
- return {
- $pcMultiSelect: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _typeof$1$2(o) {
- "@babel/helpers - typeof";
- return _typeof$1$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$1$2(o);
-}
-__name(_typeof$1$2, "_typeof$1$2");
-function ownKeys$d(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$d, "ownKeys$d");
-function _objectSpread$d(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$d(Object(t2), true).forEach(function(r2) {
- _defineProperty$1$2(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$d(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$d, "_objectSpread$d");
-function _defineProperty$1$2(e, r, t2) {
- return (r = _toPropertyKey$1$2(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$1$2, "_defineProperty$1$2");
-function _toPropertyKey$1$2(t2) {
- var i = _toPrimitive$1$2(t2, "string");
- return "symbol" == _typeof$1$2(i) ? i : i + "";
-}
-__name(_toPropertyKey$1$2, "_toPropertyKey$1$2");
-function _toPrimitive$1$2(t2, r) {
- if ("object" != _typeof$1$2(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$1$2(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$1$2, "_toPrimitive$1$2");
-function _toConsumableArray$6(r) {
- return _arrayWithoutHoles$6(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$7(r) || _nonIterableSpread$6();
-}
-__name(_toConsumableArray$6, "_toConsumableArray$6");
-function _nonIterableSpread$6() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$6, "_nonIterableSpread$6");
-function _unsupportedIterableToArray$7(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$7(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$7(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$7, "_unsupportedIterableToArray$7");
-function _iterableToArray$6(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$6, "_iterableToArray$6");
-function _arrayWithoutHoles$6(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$7(r);
-}
-__name(_arrayWithoutHoles$6, "_arrayWithoutHoles$6");
-function _arrayLikeToArray$7(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$7, "_arrayLikeToArray$7");
-var script$v = {
- name: "MultiSelect",
- "extends": script$1$h,
- inheritAttrs: false,
- emits: ["change", "focus", "blur", "before-show", "before-hide", "show", "hide", "filter", "selectall-change"],
- inject: {
- $pcFluid: {
- "default": null
- }
- },
- outsideClickListener: null,
- scrollHandler: null,
- resizeListener: null,
- overlay: null,
- list: null,
- virtualScroller: null,
- startRangeIndex: -1,
- searchTimeout: null,
- searchValue: "",
- selectOnFocus: false,
- data: /* @__PURE__ */ __name(function data21() {
- return {
- id: this.$attrs.id,
- clicked: false,
- focused: false,
- focusedOptionIndex: -1,
- filterValue: null,
- overlayVisible: false
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId7(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- options: /* @__PURE__ */ __name(function options2() {
- this.autoUpdateModel();
- }, "options")
- },
- mounted: /* @__PURE__ */ __name(function mounted23() {
- this.id = this.id || UniqueComponentId();
- this.autoUpdateModel();
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount9() {
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- if (this.overlay) {
- ZIndex.clear(this.overlay);
- this.overlay = null;
- }
- }, "beforeUnmount"),
- methods: {
- getOptionIndex: /* @__PURE__ */ __name(function getOptionIndex(index, fn) {
- return this.virtualScrollerDisabled ? index : fn && fn(index)["index"];
- }, "getOptionIndex"),
- getOptionLabel: /* @__PURE__ */ __name(function getOptionLabel3(option4) {
- return this.optionLabel ? resolveFieldData(option4, this.optionLabel) : option4;
- }, "getOptionLabel"),
- getOptionValue: /* @__PURE__ */ __name(function getOptionValue3(option4) {
- return this.optionValue ? resolveFieldData(option4, this.optionValue) : option4;
- }, "getOptionValue"),
- getOptionRenderKey: /* @__PURE__ */ __name(function getOptionRenderKey(option4, index) {
- return this.dataKey ? resolveFieldData(option4, this.dataKey) : this.getOptionLabel(option4) + "_".concat(index);
- }, "getOptionRenderKey"),
- getHeaderCheckboxPTOptions: /* @__PURE__ */ __name(function getHeaderCheckboxPTOptions(key) {
- return this.ptm(key, {
- context: {
- selected: this.allSelected
- }
- });
- }, "getHeaderCheckboxPTOptions"),
- getCheckboxPTOptions: /* @__PURE__ */ __name(function getCheckboxPTOptions(option4, itemOptions, index, key) {
- return this.ptm(key, {
- context: {
- selected: this.isSelected(option4),
- focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),
- disabled: this.isOptionDisabled(option4)
- }
- });
- }, "getCheckboxPTOptions"),
- isOptionDisabled: /* @__PURE__ */ __name(function isOptionDisabled3(option4) {
- if (this.maxSelectionLimitReached && !this.isSelected(option4)) {
- return true;
- }
- return this.optionDisabled ? resolveFieldData(option4, this.optionDisabled) : false;
- }, "isOptionDisabled"),
- isOptionGroup: /* @__PURE__ */ __name(function isOptionGroup3(option4) {
- return this.optionGroupLabel && option4.optionGroup && option4.group;
- }, "isOptionGroup"),
- getOptionGroupLabel: /* @__PURE__ */ __name(function getOptionGroupLabel3(optionGroup) {
- return resolveFieldData(optionGroup, this.optionGroupLabel);
- }, "getOptionGroupLabel"),
- getOptionGroupChildren: /* @__PURE__ */ __name(function getOptionGroupChildren3(optionGroup) {
- return resolveFieldData(optionGroup, this.optionGroupChildren);
- }, "getOptionGroupChildren"),
- getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset2(index) {
- var _this = this;
- return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(function(option4) {
- return _this.isOptionGroup(option4);
- }).length : index) + 1;
- }, "getAriaPosInset"),
- show: /* @__PURE__ */ __name(function show4(isFocus) {
- this.$emit("before-show");
- this.overlayVisible = true;
- this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex();
- isFocus && focus(this.$refs.focusInput);
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide4(isFocus) {
- var _this2 = this;
- var _hide = /* @__PURE__ */ __name(function _hide2() {
- _this2.$emit("before-hide");
- _this2.overlayVisible = false;
- _this2.clicked = false;
- _this2.focusedOptionIndex = -1;
- _this2.searchValue = "";
- _this2.resetFilterOnHide && (_this2.filterValue = null);
- isFocus && focus(_this2.$refs.focusInput);
- }, "_hide");
- setTimeout(function() {
- _hide();
- }, 0);
- }, "hide"),
- onFocus: /* @__PURE__ */ __name(function onFocus9(event2) {
- if (this.disabled) {
- return;
- }
- this.focused = true;
- if (this.overlayVisible) {
- this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex();
- this.scrollInView(this.focusedOptionIndex);
- }
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur9(event2) {
- var _this$formField$onBlu, _this$formField;
- this.clicked = false;
- this.focused = false;
- this.focusedOptionIndex = -1;
- this.searchValue = "";
- this.$emit("blur", event2);
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown9(event2) {
- var _this3 = this;
- if (this.disabled) {
- event2.preventDefault();
- return;
- }
- var metaKey = event2.metaKey || event2.ctrlKey;
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "PageDown":
- this.onPageDownKey(event2);
- break;
- case "PageUp":
- this.onPageUpKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Tab":
- this.onTabKey(event2);
- break;
- case "ShiftLeft":
- case "ShiftRight":
- this.onShiftKey(event2);
- break;
- default:
- if (event2.code === "KeyA" && metaKey) {
- var value2 = this.visibleOptions.filter(function(option4) {
- return _this3.isValidOption(option4);
- }).map(function(option4) {
- return _this3.getOptionValue(option4);
- });
- this.updateModel(event2, value2);
- event2.preventDefault();
- break;
- }
- if (!metaKey && isPrintableCharacter(event2.key)) {
- !this.overlayVisible && this.show();
- this.searchOptions(event2);
- event2.preventDefault();
- }
- break;
- }
- this.clicked = false;
- }, "onKeyDown"),
- onContainerClick: /* @__PURE__ */ __name(function onContainerClick2(event2) {
- if (this.disabled || this.loading) {
- return;
- }
- if (event2.target.tagName === "INPUT" || event2.target.getAttribute("data-pc-section") === "clearicon" || event2.target.closest('[data-pc-section="clearicon"]')) {
- return;
- } else if (!this.overlay || !this.overlay.contains(event2.target)) {
- this.overlayVisible ? this.hide(true) : this.show(true);
- }
- this.clicked = true;
- }, "onContainerClick"),
- onClearClick: /* @__PURE__ */ __name(function onClearClick2(event2) {
- this.updateModel(event2, null);
- this.resetFilterOnClear && (this.filterValue = null);
- }, "onClearClick"),
- onFirstHiddenFocus: /* @__PURE__ */ __name(function onFirstHiddenFocus(event2) {
- var focusableEl = event2.relatedTarget === this.$refs.focusInput ? getFirstFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
- focus(focusableEl);
- }, "onFirstHiddenFocus"),
- onLastHiddenFocus: /* @__PURE__ */ __name(function onLastHiddenFocus(event2) {
- var focusableEl = event2.relatedTarget === this.$refs.focusInput ? getLastFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
- focus(focusableEl);
- }, "onLastHiddenFocus"),
- onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect2(event2, option4) {
- var _this4 = this;
- var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
- var isFocus = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
- if (this.disabled || this.isOptionDisabled(option4)) {
- return;
- }
- var selected3 = this.isSelected(option4);
- var value2 = null;
- if (selected3) value2 = this.d_value.filter(function(val) {
- return !equals(val, _this4.getOptionValue(option4), _this4.equalityKey);
- });
- else value2 = [].concat(_toConsumableArray$6(this.d_value || []), [this.getOptionValue(option4)]);
- this.updateModel(event2, value2);
- index !== -1 && (this.focusedOptionIndex = index);
- isFocus && focus(this.$refs.focusInput);
- }, "onOptionSelect"),
- onOptionMouseMove: /* @__PURE__ */ __name(function onOptionMouseMove3(event2, index) {
- if (this.focusOnHover) {
- this.changeFocusedOptionIndex(event2, index);
- }
- }, "onOptionMouseMove"),
- onOptionSelectRange: /* @__PURE__ */ __name(function onOptionSelectRange(event2) {
- var _this5 = this;
- var start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1;
- var end = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : -1;
- start === -1 && (start = this.findNearestSelectedOptionIndex(end, true));
- end === -1 && (end = this.findNearestSelectedOptionIndex(start));
- if (start !== -1 && end !== -1) {
- var rangeStart = Math.min(start, end);
- var rangeEnd = Math.max(start, end);
- var value2 = this.visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function(option4) {
- return _this5.isValidOption(option4);
- }).map(function(option4) {
- return _this5.getOptionValue(option4);
- });
- this.updateModel(event2, value2);
- }
- }, "onOptionSelectRange"),
- onFilterChange: /* @__PURE__ */ __name(function onFilterChange(event2) {
- var value2 = event2.target.value;
- this.filterValue = value2;
- this.focusedOptionIndex = -1;
- this.$emit("filter", {
- originalEvent: event2,
- value: value2
- });
- !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);
- }, "onFilterChange"),
- onFilterKeyDown: /* @__PURE__ */ __name(function onFilterKeyDown(event2) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2, true);
- break;
- case "ArrowLeft":
- case "ArrowRight":
- this.onArrowLeftKey(event2, true);
- break;
- case "Home":
- this.onHomeKey(event2, true);
- break;
- case "End":
- this.onEndKey(event2, true);
- break;
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Tab":
- this.onTabKey(event2, true);
- break;
- }
- }, "onFilterKeyDown"),
- onFilterBlur: /* @__PURE__ */ __name(function onFilterBlur() {
- this.focusedOptionIndex = -1;
- }, "onFilterBlur"),
- onFilterUpdated: /* @__PURE__ */ __name(function onFilterUpdated() {
- if (this.overlayVisible) {
- this.alignOverlay();
- }
- }, "onFilterUpdated"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick4(event2) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.$el
- });
- }, "onOverlayClick"),
- onOverlayKeyDown: /* @__PURE__ */ __name(function onOverlayKeyDown3(event2) {
- switch (event2.code) {
- case "Escape":
- this.onEscapeKey(event2);
- break;
- }
- }, "onOverlayKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey6(event2) {
- if (!this.overlayVisible) {
- this.show();
- } else {
- var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findFirstOptionIndex() : this.findFirstFocusedOptionIndex();
- if (event2.shiftKey) {
- this.onOptionSelectRange(event2, this.startRangeIndex, optionIndex);
- }
- this.changeFocusedOptionIndex(event2, optionIndex);
- }
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey6(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (event2.altKey && !pressedInInputText) {
- if (this.focusedOptionIndex !== -1) {
- this.onOptionSelect(event2, this.visibleOptions[this.focusedOptionIndex]);
- }
- this.overlayVisible && this.hide();
- event2.preventDefault();
- } else {
- var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findLastOptionIndex() : this.findLastFocusedOptionIndex();
- if (event2.shiftKey) {
- this.onOptionSelectRange(event2, optionIndex, this.startRangeIndex);
- }
- this.changeFocusedOptionIndex(event2, optionIndex);
- !this.overlayVisible && this.show();
- event2.preventDefault();
- }
- }, "onArrowUpKey"),
- onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey3(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- pressedInInputText && (this.focusedOptionIndex = -1);
- }, "onArrowLeftKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey6(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (pressedInInputText) {
- var target = event2.currentTarget;
- if (event2.shiftKey) {
- target.setSelectionRange(0, event2.target.selectionStart);
- } else {
- target.setSelectionRange(0, 0);
- this.focusedOptionIndex = -1;
- }
- } else {
- var metaKey = event2.metaKey || event2.ctrlKey;
- var optionIndex = this.findFirstOptionIndex();
- if (event2.shiftKey && metaKey) {
- this.onOptionSelectRange(event2, optionIndex, this.startRangeIndex);
- }
- this.changeFocusedOptionIndex(event2, optionIndex);
- !this.overlayVisible && this.show();
- }
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey6(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (pressedInInputText) {
- var target = event2.currentTarget;
- if (event2.shiftKey) {
- target.setSelectionRange(event2.target.selectionStart, target.value.length);
- } else {
- var len = target.value.length;
- target.setSelectionRange(len, len);
- this.focusedOptionIndex = -1;
- }
- } else {
- var metaKey = event2.metaKey || event2.ctrlKey;
- var optionIndex = this.findLastOptionIndex();
- if (event2.shiftKey && metaKey) {
- this.onOptionSelectRange(event2, this.startRangeIndex, optionIndex);
- }
- this.changeFocusedOptionIndex(event2, optionIndex);
- !this.overlayVisible && this.show();
- }
- event2.preventDefault();
- }, "onEndKey"),
- onPageUpKey: /* @__PURE__ */ __name(function onPageUpKey(event2) {
- this.scrollInView(0);
- event2.preventDefault();
- }, "onPageUpKey"),
- onPageDownKey: /* @__PURE__ */ __name(function onPageDownKey(event2) {
- this.scrollInView(this.visibleOptions.length - 1);
- event2.preventDefault();
- }, "onPageDownKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey5(event2) {
- if (!this.overlayVisible) {
- this.focusedOptionIndex = -1;
- this.onArrowDownKey(event2);
- } else {
- if (this.focusedOptionIndex !== -1) {
- if (event2.shiftKey) this.onOptionSelectRange(event2, this.focusedOptionIndex);
- else this.onOptionSelect(event2, this.visibleOptions[this.focusedOptionIndex]);
- }
- }
- event2.preventDefault();
- }, "onEnterKey"),
- onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey3(event2) {
- this.overlayVisible && this.hide(true);
- event2.preventDefault();
- }, "onEscapeKey"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey3(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (!pressedInInputText) {
- if (this.overlayVisible && this.hasFocusableElements()) {
- focus(event2.shiftKey ? this.$refs.lastHiddenFocusableElementOnOverlay : this.$refs.firstHiddenFocusableElementOnOverlay);
- event2.preventDefault();
- } else {
- if (this.focusedOptionIndex !== -1) {
- this.onOptionSelect(event2, this.visibleOptions[this.focusedOptionIndex]);
- }
- this.overlayVisible && this.hide(this.filter);
- }
- }
- }, "onTabKey"),
- onShiftKey: /* @__PURE__ */ __name(function onShiftKey() {
- this.startRangeIndex = this.focusedOptionIndex;
- }, "onShiftKey"),
- onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter3(el) {
- ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
- addStyle(el, {
- position: "absolute",
- top: "0",
- left: "0"
- });
- this.alignOverlay();
- this.scrollInView();
- this.autoFilterFocus && focus(this.$refs.filterInput.$el);
- }, "onOverlayEnter"),
- onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter2() {
- this.bindOutsideClickListener();
- this.bindScrollListener();
- this.bindResizeListener();
- this.$emit("show");
- }, "onOverlayAfterEnter"),
- onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave3() {
- this.unbindOutsideClickListener();
- this.unbindScrollListener();
- this.unbindResizeListener();
- this.$emit("hide");
- this.overlay = null;
- }, "onOverlayLeave"),
- onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave3(el) {
- ZIndex.clear(el);
- }, "onOverlayAfterLeave"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay4() {
- if (this.appendTo === "self") {
- relativePosition(this.overlay, this.$el);
- } else {
- this.overlay.style.minWidth = getOuterWidth(this.$el) + "px";
- absolutePosition(this.overlay, this.$el);
- }
- }, "alignOverlay"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener5() {
- var _this6 = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- if (_this6.overlayVisible && _this6.isOutsideClicked(event2)) {
- _this6.hide();
- }
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener5() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener5() {
- var _this7 = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
- if (_this7.overlayVisible) {
- _this7.hide();
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener5() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener5() {
- var _this8 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this8.overlayVisible && !isTouchDevice()) {
- _this8.hide();
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener5() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked2(event2) {
- return !(this.$el.isSameNode(event2.target) || this.$el.contains(event2.target) || this.overlay && this.overlay.contains(event2.target));
- }, "isOutsideClicked"),
- getLabelByValue: /* @__PURE__ */ __name(function getLabelByValue(value2) {
- var _this9 = this;
- var options4 = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
- var matchedOption = options4.find(function(option4) {
- return !_this9.isOptionGroup(option4) && equals(_this9.getOptionValue(option4), value2, _this9.equalityKey);
- });
- return matchedOption ? this.getOptionLabel(matchedOption) : null;
- }, "getLabelByValue"),
- getSelectedItemsLabel: /* @__PURE__ */ __name(function getSelectedItemsLabel() {
- var pattern = /{(.*?)}/;
- var selectedItemsLabel = this.selectedItemsLabel || this.$primevue.config.locale.selectionMessage;
- if (pattern.test(selectedItemsLabel)) {
- return selectedItemsLabel.replace(selectedItemsLabel.match(pattern)[0], this.d_value.length + "");
- }
- return selectedItemsLabel;
- }, "getSelectedItemsLabel"),
- onToggleAll: /* @__PURE__ */ __name(function onToggleAll(event2) {
- var _this10 = this;
- if (this.selectAll !== null) {
- this.$emit("selectall-change", {
- originalEvent: event2,
- checked: !this.allSelected
- });
- } else {
- var value2 = this.allSelected ? [] : this.visibleOptions.filter(function(option4) {
- return _this10.isValidOption(option4);
- }).map(function(option4) {
- return _this10.getOptionValue(option4);
- });
- this.updateModel(event2, value2);
- }
- }, "onToggleAll"),
- removeOption: /* @__PURE__ */ __name(function removeOption(event2, optionValue) {
- var _this11 = this;
- event2.stopPropagation();
- var value2 = this.d_value.filter(function(val) {
- return !equals(val, optionValue, _this11.equalityKey);
- });
- this.updateModel(event2, value2);
- }, "removeOption"),
- clearFilter: /* @__PURE__ */ __name(function clearFilter() {
- this.filterValue = null;
- }, "clearFilter"),
- hasFocusableElements: /* @__PURE__ */ __name(function hasFocusableElements() {
- return getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
- }, "hasFocusableElements"),
- isOptionMatched: /* @__PURE__ */ __name(function isOptionMatched2(option4) {
- var _this$getOptionLabel;
- return this.isValidOption(option4) && typeof this.getOptionLabel(option4) === "string" && ((_this$getOptionLabel = this.getOptionLabel(option4)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)));
- }, "isOptionMatched"),
- isValidOption: /* @__PURE__ */ __name(function isValidOption2(option4) {
- return isNotEmpty(option4) && !(this.isOptionDisabled(option4) || this.isOptionGroup(option4));
- }, "isValidOption"),
- isValidSelectedOption: /* @__PURE__ */ __name(function isValidSelectedOption2(option4) {
- return this.isValidOption(option4) && this.isSelected(option4);
- }, "isValidSelectedOption"),
- isEquals: /* @__PURE__ */ __name(function isEquals(value1, value2) {
- return equals(value1, value2, this.equalityKey);
- }, "isEquals"),
- isSelected: /* @__PURE__ */ __name(function isSelected4(option4) {
- var _this12 = this;
- var optionValue = this.getOptionValue(option4);
- return (this.d_value || []).some(function(value2) {
- return _this12.isEquals(value2, optionValue);
- });
- }, "isSelected"),
- findFirstOptionIndex: /* @__PURE__ */ __name(function findFirstOptionIndex2() {
- var _this13 = this;
- return this.visibleOptions.findIndex(function(option4) {
- return _this13.isValidOption(option4);
- });
- }, "findFirstOptionIndex"),
- findLastOptionIndex: /* @__PURE__ */ __name(function findLastOptionIndex2() {
- var _this14 = this;
- return findLastIndex(this.visibleOptions, function(option4) {
- return _this14.isValidOption(option4);
- });
- }, "findLastOptionIndex"),
- findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex4(index) {
- var _this15 = this;
- var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function(option4) {
- return _this15.isValidOption(option4);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
- }, "findNextOptionIndex"),
- findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex4(index) {
- var _this16 = this;
- var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function(option4) {
- return _this16.isValidOption(option4);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex : index;
- }, "findPrevOptionIndex"),
- findSelectedOptionIndex: /* @__PURE__ */ __name(function findSelectedOptionIndex2() {
- var _this17 = this;
- if (this.$filled) {
- var _loop = /* @__PURE__ */ __name(function _loop2() {
- var value2 = _this17.d_value[index];
- var matchedOptionIndex = _this17.visibleOptions.findIndex(function(option4) {
- return _this17.isValidSelectedOption(option4) && _this17.isEquals(value2, _this17.getOptionValue(option4));
- });
- if (matchedOptionIndex > -1) return {
- v: matchedOptionIndex
- };
- }, "_loop"), _ret;
- for (var index = this.d_value.length - 1; index >= 0; index--) {
- _ret = _loop();
- if (_ret) return _ret.v;
- }
- }
- return -1;
- }, "findSelectedOptionIndex"),
- findFirstSelectedOptionIndex: /* @__PURE__ */ __name(function findFirstSelectedOptionIndex() {
- var _this18 = this;
- return this.$filled ? this.visibleOptions.findIndex(function(option4) {
- return _this18.isValidSelectedOption(option4);
- }) : -1;
- }, "findFirstSelectedOptionIndex"),
- findLastSelectedOptionIndex: /* @__PURE__ */ __name(function findLastSelectedOptionIndex() {
- var _this19 = this;
- return this.$filled ? findLastIndex(this.visibleOptions, function(option4) {
- return _this19.isValidSelectedOption(option4);
- }) : -1;
- }, "findLastSelectedOptionIndex"),
- findNextSelectedOptionIndex: /* @__PURE__ */ __name(function findNextSelectedOptionIndex(index) {
- var _this20 = this;
- var matchedOptionIndex = this.$filled && index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function(option4) {
- return _this20.isValidSelectedOption(option4);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : -1;
- }, "findNextSelectedOptionIndex"),
- findPrevSelectedOptionIndex: /* @__PURE__ */ __name(function findPrevSelectedOptionIndex(index) {
- var _this21 = this;
- var matchedOptionIndex = this.$filled && index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function(option4) {
- return _this21.isValidSelectedOption(option4);
- }) : -1;
- return matchedOptionIndex > -1 ? matchedOptionIndex : -1;
- }, "findPrevSelectedOptionIndex"),
- findNearestSelectedOptionIndex: /* @__PURE__ */ __name(function findNearestSelectedOptionIndex(index) {
- var firstCheckUp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var matchedOptionIndex = -1;
- if (this.$filled) {
- if (firstCheckUp) {
- matchedOptionIndex = this.findPrevSelectedOptionIndex(index);
- matchedOptionIndex = matchedOptionIndex === -1 ? this.findNextSelectedOptionIndex(index) : matchedOptionIndex;
- } else {
- matchedOptionIndex = this.findNextSelectedOptionIndex(index);
- matchedOptionIndex = matchedOptionIndex === -1 ? this.findPrevSelectedOptionIndex(index) : matchedOptionIndex;
- }
- }
- return matchedOptionIndex > -1 ? matchedOptionIndex : index;
- }, "findNearestSelectedOptionIndex"),
- findFirstFocusedOptionIndex: /* @__PURE__ */ __name(function findFirstFocusedOptionIndex2() {
- var selectedIndex = this.findSelectedOptionIndex();
- return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;
- }, "findFirstFocusedOptionIndex"),
- findLastFocusedOptionIndex: /* @__PURE__ */ __name(function findLastFocusedOptionIndex2() {
- var selectedIndex = this.findSelectedOptionIndex();
- return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;
- }, "findLastFocusedOptionIndex"),
- searchOptions: /* @__PURE__ */ __name(function searchOptions2(event2) {
- var _this22 = this;
- this.searchValue = (this.searchValue || "") + event2.key;
- var optionIndex = -1;
- if (isNotEmpty(this.searchValue)) {
- if (this.focusedOptionIndex !== -1) {
- optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function(option4) {
- return _this22.isOptionMatched(option4);
- });
- optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function(option4) {
- return _this22.isOptionMatched(option4);
- }) : optionIndex + this.focusedOptionIndex;
- } else {
- optionIndex = this.visibleOptions.findIndex(function(option4) {
- return _this22.isOptionMatched(option4);
- });
- }
- if (optionIndex === -1 && this.focusedOptionIndex === -1) {
- optionIndex = this.findFirstFocusedOptionIndex();
- }
- if (optionIndex !== -1) {
- this.changeFocusedOptionIndex(event2, optionIndex);
- }
- }
- if (this.searchTimeout) {
- clearTimeout(this.searchTimeout);
- }
- this.searchTimeout = setTimeout(function() {
- _this22.searchValue = "";
- _this22.searchTimeout = null;
- }, 500);
- }, "searchOptions"),
- changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex4(event2, index) {
- if (this.focusedOptionIndex !== index) {
- this.focusedOptionIndex = index;
- this.scrollInView();
- if (this.selectOnFocus) {
- this.onOptionSelect(event2, this.visibleOptions[index]);
- }
- }
- }, "changeFocusedOptionIndex"),
- scrollInView: /* @__PURE__ */ __name(function scrollInView4() {
- var _this23 = this;
- var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : -1;
- this.$nextTick(function() {
- var id4 = index !== -1 ? "".concat(_this23.id, "_").concat(index) : _this23.focusedOptionId;
- var element = findSingle(_this23.list, 'li[id="'.concat(id4, '"]'));
- if (element) {
- element.scrollIntoView && element.scrollIntoView({
- block: "nearest",
- inline: "nearest"
- });
- } else if (!_this23.virtualScrollerDisabled) {
- _this23.virtualScroller && _this23.virtualScroller.scrollToIndex(index !== -1 ? index : _this23.focusedOptionIndex);
- }
- });
- }, "scrollInView"),
- autoUpdateModel: /* @__PURE__ */ __name(function autoUpdateModel2() {
- if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) {
- this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
- var value2 = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);
- this.updateModel(null, [value2]);
- }
- }, "autoUpdateModel"),
- updateModel: /* @__PURE__ */ __name(function updateModel6(event2, value2) {
- this.writeValue(value2, event2);
- this.$emit("change", {
- originalEvent: event2,
- value: value2
- });
- }, "updateModel"),
- flatOptions: /* @__PURE__ */ __name(function flatOptions(options4) {
- var _this24 = this;
- return (options4 || []).reduce(function(result, option4, index) {
- result.push({
- optionGroup: option4,
- group: true,
- index
- });
- var optionGroupChildren = _this24.getOptionGroupChildren(option4);
- optionGroupChildren && optionGroupChildren.forEach(function(o) {
- return result.push(o);
- });
- return result;
- }, []);
- }, "flatOptions"),
- overlayRef: /* @__PURE__ */ __name(function overlayRef3(el) {
- this.overlay = el;
- }, "overlayRef"),
- listRef: /* @__PURE__ */ __name(function listRef2(el, contentRef) {
- this.list = el;
- contentRef && contentRef(el);
- }, "listRef"),
- virtualScrollerRef: /* @__PURE__ */ __name(function virtualScrollerRef(el) {
- this.virtualScroller = el;
- }, "virtualScrollerRef")
- },
- computed: {
- visibleOptions: /* @__PURE__ */ __name(function visibleOptions2() {
- var _this25 = this;
- var options4 = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
- if (this.filterValue) {
- var filteredOptions = FilterService.filter(options4, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);
- if (this.optionGroupLabel) {
- var optionGroups = this.options || [];
- var filtered = [];
- optionGroups.forEach(function(group) {
- var groupChildren = _this25.getOptionGroupChildren(group);
- var filteredItems = groupChildren.filter(function(item8) {
- return filteredOptions.includes(item8);
- });
- if (filteredItems.length > 0) filtered.push(_objectSpread$d(_objectSpread$d({}, group), {}, _defineProperty$1$2({}, typeof _this25.optionGroupChildren === "string" ? _this25.optionGroupChildren : "items", _toConsumableArray$6(filteredItems))));
- });
- return this.flatOptions(filtered);
- }
- return filteredOptions;
- }
- return options4;
- }, "visibleOptions"),
- label: /* @__PURE__ */ __name(function label7() {
- var label12;
- if (this.d_value && this.d_value.length) {
- if (isNotEmpty(this.maxSelectedLabels) && this.d_value.length > this.maxSelectedLabels) {
- return this.getSelectedItemsLabel();
- } else {
- label12 = "";
- for (var i = 0; i < this.d_value.length; i++) {
- if (i !== 0) {
- label12 += ", ";
- }
- label12 += this.getLabelByValue(this.d_value[i]);
- }
- }
- } else {
- label12 = this.placeholder;
- }
- return label12;
- }, "label"),
- chipSelectedItems: /* @__PURE__ */ __name(function chipSelectedItems() {
- return isNotEmpty(this.maxSelectedLabels) && this.d_value && this.d_value.length > this.maxSelectedLabels;
- }, "chipSelectedItems"),
- allSelected: /* @__PURE__ */ __name(function allSelected() {
- var _this26 = this;
- return this.selectAll !== null ? this.selectAll : isNotEmpty(this.visibleOptions) && this.visibleOptions.every(function(option4) {
- return _this26.isOptionGroup(option4) || _this26.isOptionDisabled(option4) || _this26.isSelected(option4);
- });
- }, "allSelected"),
- // @deprecated use $filled instead.
- hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption2() {
- return this.$filled;
- }, "hasSelectedOption"),
- equalityKey: /* @__PURE__ */ __name(function equalityKey2() {
- return this.optionValue ? null : this.dataKey;
- }, "equalityKey"),
- searchFields: /* @__PURE__ */ __name(function searchFields() {
- return this.filterFields || [this.optionLabel];
- }, "searchFields"),
- maxSelectionLimitReached: /* @__PURE__ */ __name(function maxSelectionLimitReached() {
- return this.selectionLimit && this.d_value && this.d_value.length === this.selectionLimit;
- }, "maxSelectionLimitReached"),
- filterResultMessageText: /* @__PURE__ */ __name(function filterResultMessageText() {
- return isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll("{0}", this.visibleOptions.length) : this.emptyFilterMessageText;
- }, "filterResultMessageText"),
- filterMessageText: /* @__PURE__ */ __name(function filterMessageText() {
- return this.filterMessage || this.$primevue.config.locale.searchMessage || "";
- }, "filterMessageText"),
- emptyFilterMessageText: /* @__PURE__ */ __name(function emptyFilterMessageText() {
- return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || "";
- }, "emptyFilterMessageText"),
- emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText3() {
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage || "";
- }, "emptyMessageText"),
- selectionMessageText: /* @__PURE__ */ __name(function selectionMessageText2() {
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage || "";
- }, "selectionMessageText"),
- emptySelectionMessageText: /* @__PURE__ */ __name(function emptySelectionMessageText2() {
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || "";
- }, "emptySelectionMessageText"),
- selectedMessageText: /* @__PURE__ */ __name(function selectedMessageText2() {
- return this.$filled ? this.selectionMessageText.replaceAll("{0}", this.d_value.length) : this.emptySelectionMessageText;
- }, "selectedMessageText"),
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId5() {
- return this.focusedOptionIndex !== -1 ? "".concat(this.id, "_").concat(this.focusedOptionIndex) : null;
- }, "focusedOptionId"),
- ariaSetSize: /* @__PURE__ */ __name(function ariaSetSize() {
- var _this27 = this;
- return this.visibleOptions.filter(function(option4) {
- return !_this27.isOptionGroup(option4);
- }).length;
- }, "ariaSetSize"),
- toggleAllAriaLabel: /* @__PURE__ */ __name(function toggleAllAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria[this.allSelected ? "selectAll" : "unselectAll"] : void 0;
- }, "toggleAllAriaLabel"),
- listAriaLabel: /* @__PURE__ */ __name(function listAriaLabel2() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.listLabel : void 0;
- }, "listAriaLabel"),
- virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled() {
- return !this.virtualScrollerOptions;
- }, "virtualScrollerDisabled"),
- hasFluid: /* @__PURE__ */ __name(function hasFluid() {
- return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;
- }, "hasFluid"),
- isClearIconVisible: /* @__PURE__ */ __name(function isClearIconVisible2() {
- return this.showClear && this.d_value != null && isNotEmpty(this.options);
- }, "isClearIconVisible")
- },
- directives: {
- ripple: Ripple
- },
- components: {
- InputText: script$1l,
- Checkbox: script$1I,
- VirtualScroller: script$1J,
- Portal: script$1m,
- Chip: script$1s,
- IconField: script$1K,
- InputIcon: script$1L,
- TimesIcon: script$1q,
- SearchIcon: script$1M,
- ChevronDownIcon: script$1h,
- SpinnerIcon: script$1p,
- CheckIcon: script$1C
- }
-};
-function _typeof$e(o) {
- "@babel/helpers - typeof";
- return _typeof$e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$e(o);
-}
-__name(_typeof$e, "_typeof$e");
-function _defineProperty$e(e, r, t2) {
- return (r = _toPropertyKey$e(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$e, "_defineProperty$e");
-function _toPropertyKey$e(t2) {
- var i = _toPrimitive$e(t2, "string");
- return "symbol" == _typeof$e(i) ? i : i + "";
-}
-__name(_toPropertyKey$e, "_toPropertyKey$e");
-function _toPrimitive$e(t2, r) {
- if ("object" != _typeof$e(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$e(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$e, "_toPrimitive$e");
-var _hoisted_1$f = ["id", "disabled", "placeholder", "tabindex", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
-var _hoisted_2$b = {
- key: 0
-};
-var _hoisted_3$8 = ["id", "aria-label"];
-var _hoisted_4$5 = ["id"];
-var _hoisted_5$1 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focused", "data-p-disabled"];
-function render$r(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Chip = resolveComponent("Chip");
- var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
- var _component_Checkbox = resolveComponent("Checkbox");
- var _component_InputText = resolveComponent("InputText");
- var _component_SearchIcon = resolveComponent("SearchIcon");
- var _component_InputIcon = resolveComponent("InputIcon");
- var _component_IconField = resolveComponent("IconField");
- var _component_VirtualScroller = resolveComponent("VirtualScroller");
- var _component_Portal = resolveComponent("Portal");
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("div", mergeProps({
- ref: "container",
- "class": _ctx.cx("root"),
- style: _ctx.sx("root"),
- onClick: _cache[7] || (_cache[7] = function() {
- return $options.onContainerClick && $options.onContainerClick.apply($options, arguments);
- })
- }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenInputContainer"), {
- "data-p-hidden-accessible": true
- }), [createBaseVNode("input", mergeProps({
- ref: "focusInput",
- id: _ctx.inputId,
- type: "text",
- readonly: "",
- disabled: _ctx.disabled,
- placeholder: _ctx.placeholder,
- tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
- role: "combobox",
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-haspopup": "listbox",
- "aria-expanded": $data.overlayVisible,
- "aria-controls": $data.id + "_list",
- "aria-activedescendant": $data.focused ? $options.focusedOptionId : void 0,
- "aria-invalid": _ctx.invalid || void 0,
- onFocus: _cache[0] || (_cache[0] = function() {
- return $options.onFocus && $options.onFocus.apply($options, arguments);
- }),
- onBlur: _cache[1] || (_cache[1] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- })
- }, _ctx.ptm("hiddenInput")), null, 16, _hoisted_1$f)], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("labelContainer")
- }, _ctx.ptm("labelContainer")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("label")
- }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "value", {
- value: _ctx.d_value,
- placeholder: _ctx.placeholder
- }, function() {
- return [_ctx.display === "comma" ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [createTextVNode(toDisplayString($options.label || "empty"), 1)], 64)) : _ctx.display === "chip" ? (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [$options.chipSelectedItems ? (openBlock(), createElementBlock("span", _hoisted_2$b, toDisplayString($options.label), 1)) : (openBlock(true), createElementBlock(Fragment, {
- key: 1
- }, renderList(_ctx.d_value, function(item8) {
- return openBlock(), createElementBlock("span", mergeProps({
- key: $options.getLabelByValue(item8),
- "class": _ctx.cx("chipItem"),
- ref_for: true
- }, _ctx.ptm("chipItem")), [renderSlot(_ctx.$slots, "chip", {
- value: item8,
- removeCallback: /* @__PURE__ */ __name(function removeCallback(event2) {
- return $options.removeOption(event2, item8);
- }, "removeCallback")
- }, function() {
- return [createVNode(_component_Chip, {
- "class": normalizeClass(_ctx.cx("pcChip")),
- label: $options.getLabelByValue(item8),
- removeIcon: _ctx.chipIcon || _ctx.removeTokenIcon,
- removable: "",
- unstyled: _ctx.unstyled,
- onRemove: /* @__PURE__ */ __name(function onRemove($event) {
- return $options.removeOption($event, item8);
- }, "onRemove"),
- pt: _ctx.ptm("pcChip")
- }, {
- removeicon: withCtx(function() {
- return [renderSlot(_ctx.$slots, _ctx.$slots.chipicon ? "chipicon" : "removetokenicon", {
- "class": normalizeClass(_ctx.cx("chipIcon")),
- item: item8,
- removeCallback: /* @__PURE__ */ __name(function removeCallback(event2) {
- return $options.removeOption(event2, item8);
- }, "removeCallback")
- })];
- }),
- _: 2
- }, 1032, ["class", "label", "removeIcon", "unstyled", "onRemove", "pt"])];
- })], 16);
- }), 128)), !_ctx.d_value || _ctx.d_value.length === 0 ? (openBlock(), createElementBlock(Fragment, {
- key: 2
- }, [createTextVNode(toDisplayString(_ctx.placeholder || "empty"), 1)], 64)) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)];
- })], 16)], 16), $options.isClearIconVisible ? renderSlot(_ctx.$slots, "clearicon", {
- key: 0,
- "class": normalizeClass(_ctx.cx("clearIcon")),
- clearCallback: $options.onClearClick
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon ? "i" : "TimesIcon"), mergeProps({
- ref: "clearIcon",
- "class": [_ctx.cx("clearIcon"), _ctx.clearIcon],
- onClick: $options.onClearClick
- }, _ctx.ptm("clearIcon"), {
- "data-pc-section": "clearicon"
- }), null, 16, ["class", "onClick"]))];
- }) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("dropdown")
- }, _ctx.ptm("dropdown")), [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", {
- key: 0,
- "class": normalizeClass(_ctx.cx("loadingIcon"))
- }, function() {
- return [_ctx.loadingIcon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
- key: 1,
- "class": _ctx.cx("loadingIcon"),
- spin: "",
- "aria-hidden": "true"
- }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
- }) : renderSlot(_ctx.$slots, "dropdownicon", {
- key: 1,
- "class": normalizeClass(_ctx.cx("dropdownIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({
- "class": [_ctx.cx("dropdownIcon"), _ctx.dropdownIcon],
- "aria-hidden": "true"
- }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
- })], 16), createVNode(_component_Portal, {
- appendTo: _ctx.appendTo
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: $options.onOverlayEnter,
- onAfterEnter: $options.onOverlayAfterEnter,
- onLeave: $options.onOverlayLeave,
- onAfterLeave: $options.onOverlayAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.overlayRef,
- style: [_ctx.panelStyle, _ctx.overlayStyle],
- "class": [_ctx.cx("overlay"), _ctx.panelClass, _ctx.overlayClass],
- onClick: _cache[5] || (_cache[5] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- }),
- onKeydown: _cache[6] || (_cache[6] = function() {
- return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
- })
- }, _ctx.ptm("overlay")), [createBaseVNode("span", mergeProps({
- ref: "firstHiddenFocusableElementOnOverlay",
- role: "presentation",
- "aria-hidden": "true",
- "class": "p-hidden-accessible p-hidden-focusable",
- tabindex: 0,
- onFocus: _cache[3] || (_cache[3] = function() {
- return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);
- })
- }, _ctx.ptm("hiddenFirstFocusableEl"), {
- "data-p-hidden-accessible": true,
- "data-p-hidden-focusable": true
- }), null, 16), renderSlot(_ctx.$slots, "header", {
- value: _ctx.d_value,
- options: $options.visibleOptions
- }), _ctx.showToggleAll && _ctx.selectionLimit == null || _ctx.filter ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("header")
- }, _ctx.ptm("header")), [_ctx.showToggleAll && _ctx.selectionLimit == null ? (openBlock(), createBlock(_component_Checkbox, {
- key: 0,
- modelValue: $options.allSelected,
- binary: true,
- disabled: _ctx.disabled,
- variant: _ctx.variant,
- "aria-label": $options.toggleAllAriaLabel,
- onChange: $options.onToggleAll,
- unstyled: _ctx.unstyled,
- pt: $options.getHeaderCheckboxPTOptions("pcHeaderCheckbox")
- }, {
- icon: withCtx(function(slotProps) {
- return [_ctx.$slots.headercheckboxicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.headercheckboxicon), {
- key: 0,
- checked: slotProps.checked,
- "class": normalizeClass(slotProps["class"])
- }, null, 8, ["checked", "class"])) : slotProps.checked ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.checkboxIcon ? "span" : "CheckIcon"), mergeProps({
- key: 1,
- "class": [slotProps["class"], _defineProperty$e({}, _ctx.checkboxIcon, slotProps.checked)]
- }, $options.getHeaderCheckboxPTOptions("pcHeaderCheckbox.icon")), null, 16, ["class"])) : createCommentVNode("", true)];
- }),
- _: 1
- }, 8, ["modelValue", "disabled", "variant", "aria-label", "onChange", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.filter ? (openBlock(), createBlock(_component_IconField, {
- key: 1,
- "class": normalizeClass(_ctx.cx("pcFilterContainer")),
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcFilterContainer")
- }, {
- "default": withCtx(function() {
- return [createVNode(_component_InputText, {
- ref: "filterInput",
- value: $data.filterValue,
- onVnodeMounted: $options.onFilterUpdated,
- onVnodeUpdated: $options.onFilterUpdated,
- "class": normalizeClass(_ctx.cx("pcFilter")),
- placeholder: _ctx.filterPlaceholder,
- disabled: _ctx.disabled,
- variant: _ctx.variant,
- unstyled: _ctx.unstyled,
- role: "searchbox",
- autocomplete: "off",
- "aria-owns": $data.id + "_list",
- "aria-activedescendant": $options.focusedOptionId,
- onKeydown: $options.onFilterKeyDown,
- onBlur: $options.onFilterBlur,
- onInput: $options.onFilterChange,
- pt: _ctx.ptm("pcFilter")
- }, null, 8, ["value", "onVnodeMounted", "onVnodeUpdated", "class", "placeholder", "disabled", "variant", "unstyled", "aria-owns", "aria-activedescendant", "onKeydown", "onBlur", "onInput", "pt"]), createVNode(_component_InputIcon, {
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcFilterIconContainer")
- }, {
- "default": withCtx(function() {
- return [renderSlot(_ctx.$slots, "filtericon", {}, function() {
- return [_ctx.filterIcon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.filterIcon
- }, _ctx.ptm("filterIcon")), null, 16)) : (openBlock(), createBlock(_component_SearchIcon, normalizeProps(mergeProps({
- key: 1
- }, _ctx.ptm("filterIcon"))), null, 16))];
- })];
- }),
- _: 3
- }, 8, ["unstyled", "pt"])];
- }),
- _: 3
- }, 8, ["class", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.filter ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- role: "status",
- "aria-live": "polite",
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenFilterResult"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($options.filterResultMessageText), 17)) : createCommentVNode("", true)], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("listContainer"),
- style: {
- "max-height": $options.virtualScrollerDisabled ? _ctx.scrollHeight : ""
- }
- }, _ctx.ptm("listContainer")), [createVNode(_component_VirtualScroller, mergeProps({
- ref: $options.virtualScrollerRef
- }, _ctx.virtualScrollerOptions, {
- items: $options.visibleOptions,
- style: {
- height: _ctx.scrollHeight
- },
- tabindex: -1,
- disabled: $options.virtualScrollerDisabled,
- pt: _ctx.ptm("virtualScroller")
- }), createSlots({
- content: withCtx(function(_ref2) {
- var styleClass = _ref2.styleClass, contentRef = _ref2.contentRef, items2 = _ref2.items, getItemOptions = _ref2.getItemOptions, contentStyle = _ref2.contentStyle, itemSize = _ref2.itemSize;
- return [createBaseVNode("ul", mergeProps({
- ref: /* @__PURE__ */ __name(function ref2(el) {
- return $options.listRef(el, contentRef);
- }, "ref"),
- id: $data.id + "_list",
- "class": [_ctx.cx("list"), styleClass],
- style: contentStyle,
- role: "listbox",
- "aria-multiselectable": "true",
- "aria-label": $options.listAriaLabel
- }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList(items2, function(option4, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.getOptionRenderKey(option4, $options.getOptionIndex(i, getItemOptions))
- }, [$options.isOptionGroup(option4) ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: $data.id + "_" + $options.getOptionIndex(i, getItemOptions),
- style: {
- height: itemSize ? itemSize + "px" : void 0
- },
- "class": _ctx.cx("optionGroup"),
- role: "option",
- ref_for: true
- }, _ctx.ptm("optionGroup")), [renderSlot(_ctx.$slots, "optiongroup", {
- option: option4.optionGroup,
- index: $options.getOptionIndex(i, getItemOptions)
- }, function() {
- return [createTextVNode(toDisplayString($options.getOptionGroupLabel(option4.optionGroup)), 1)];
- })], 16, _hoisted_4$5)) : withDirectives((openBlock(), createElementBlock("li", mergeProps({
- key: 1,
- id: $data.id + "_" + $options.getOptionIndex(i, getItemOptions),
- style: {
- height: itemSize ? itemSize + "px" : void 0
- },
- "class": _ctx.cx("option", {
- option: option4,
- index: i,
- getItemOptions
- }),
- role: "option",
- "aria-label": $options.getOptionLabel(option4),
- "aria-selected": $options.isSelected(option4),
- "aria-disabled": $options.isOptionDisabled(option4),
- "aria-setsize": $options.ariaSetSize,
- "aria-posinset": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onOptionSelect($event, option4, $options.getOptionIndex(i, getItemOptions), true);
- }, "onClick"),
- onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
- return $options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions));
- }, "onMousemove"),
- ref_for: true
- }, $options.getCheckboxPTOptions(option4, getItemOptions, i, "option"), {
- "data-p-selected": $options.isSelected(option4),
- "data-p-focused": $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions),
- "data-p-disabled": $options.isOptionDisabled(option4)
- }), [createVNode(_component_Checkbox, {
- defaultValue: $options.isSelected(option4),
- binary: true,
- tabindex: -1,
- variant: _ctx.variant,
- unstyled: _ctx.unstyled,
- pt: $options.getCheckboxPTOptions(option4, getItemOptions, i, "pcOptionCheckbox")
- }, {
- icon: withCtx(function(slotProps) {
- return [_ctx.$slots.optioncheckboxicon || _ctx.$slots.itemcheckboxicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.optioncheckboxicon || _ctx.$slots.itemcheckboxicon), {
- key: 0,
- checked: slotProps.checked,
- "class": normalizeClass(slotProps["class"])
- }, null, 8, ["checked", "class"])) : slotProps.checked ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.checkboxIcon ? "span" : "CheckIcon"), mergeProps({
- key: 1,
- "class": [slotProps["class"], _defineProperty$e({}, _ctx.checkboxIcon, slotProps.checked)],
- ref_for: true
- }, $options.getCheckboxPTOptions(option4, getItemOptions, i, "pcOptionCheckbox.icon")), null, 16, ["class"])) : createCommentVNode("", true)];
- }),
- _: 2
- }, 1032, ["defaultValue", "variant", "unstyled", "pt"]), renderSlot(_ctx.$slots, "option", {
- option: option4,
- selected: $options.isSelected(option4),
- index: $options.getOptionIndex(i, getItemOptions)
- }, function() {
- return [createBaseVNode("span", mergeProps({
- ref_for: true
- }, _ctx.ptm("optionLabel")), toDisplayString($options.getOptionLabel(option4)), 17)];
- })], 16, _hoisted_5$1)), [[_directive_ripple]])], 64);
- }), 128)), $data.filterValue && (!items2 || items2 && items2.length === 0) ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- "class": _ctx.cx("emptyMessage"),
- role: "option"
- }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "emptyfilter", {}, function() {
- return [createTextVNode(toDisplayString($options.emptyFilterMessageText), 1)];
- })], 16)) : !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("li", mergeProps({
- key: 1,
- "class": _ctx.cx("emptyMessage"),
- role: "option"
- }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "empty", {}, function() {
- return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];
- })], 16)) : createCommentVNode("", true)], 16, _hoisted_3$8)];
- }),
- _: 2
- }, [_ctx.$slots.loader ? {
- name: "loader",
- fn: withCtx(function(_ref4) {
- var options4 = _ref4.options;
- return [renderSlot(_ctx.$slots, "loader", {
- options: options4
- })];
- }),
- key: "0"
- } : void 0]), 1040, ["items", "style", "disabled", "pt"])], 16), renderSlot(_ctx.$slots, "footer", {
- value: _ctx.d_value,
- options: $options.visibleOptions
- }), !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- role: "status",
- "aria-live": "polite",
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenEmptyMessage"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($options.emptyMessageText), 17)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- role: "status",
- "aria-live": "polite",
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenSelectedMessage"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($options.selectedMessageText), 17), createBaseVNode("span", mergeProps({
- ref: "lastHiddenFocusableElementOnOverlay",
- role: "presentation",
- "aria-hidden": "true",
- "class": "p-hidden-accessible p-hidden-focusable",
- tabindex: 0,
- onFocus: _cache[4] || (_cache[4] = function() {
- return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);
- })
- }, _ctx.ptm("hiddenLastFocusableEl"), {
- "data-p-hidden-accessible": true,
- "data-p-hidden-focusable": true
- }), null, 16)], 16)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
- }),
- _: 3
- }, 8, ["appendTo"])], 16);
-}
-__name(render$r, "render$r");
-script$v.render = render$r;
-var script$u = {
- name: "AngleDoubleDownIcon",
- "extends": script$1j
-};
-function render$q(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M6.70786 6.59831C6.80043 6.63674 6.89974 6.65629 6.99997 6.65581C7.19621 6.64081 7.37877 6.54953 7.50853 6.40153L11.0685 2.8416C11.1364 2.69925 11.1586 2.53932 11.132 2.38384C11.1053 2.22837 11.0311 2.08498 10.9195 1.97343C10.808 1.86188 10.6646 1.78766 10.5091 1.76099C10.3536 1.73431 10.1937 1.75649 10.0513 1.82448L6.99997 4.87585L3.9486 1.82448C3.80625 1.75649 3.64632 1.73431 3.49084 1.76099C3.33536 1.78766 3.19197 1.86188 3.08043 1.97343C2.96888 2.08498 2.89466 2.22837 2.86798 2.38384C2.84131 2.53932 2.86349 2.69925 2.93147 2.8416L6.46089 6.43205C6.53132 6.50336 6.61528 6.55989 6.70786 6.59831ZM6.70786 12.1925C6.80043 12.2309 6.89974 12.2505 6.99997 12.25C7.10241 12.2465 7.20306 12.2222 7.29575 12.1785C7.38845 12.1348 7.47124 12.0726 7.53905 11.9957L11.0685 8.46629C11.1614 8.32292 11.2036 8.15249 11.1881 7.98233C11.1727 7.81216 11.1005 7.6521 10.9833 7.52781C10.866 7.40353 10.7104 7.3222 10.5415 7.29688C10.3725 7.27155 10.1999 7.30369 10.0513 7.38814L6.99997 10.4395L3.9486 7.38814C3.80006 7.30369 3.62747 7.27155 3.45849 7.29688C3.28951 7.3222 3.13393 7.40353 3.01667 7.52781C2.89942 7.6521 2.82729 7.81216 2.81184 7.98233C2.79639 8.15249 2.83852 8.32292 2.93148 8.46629L6.4609 12.0262C6.53133 12.0975 6.61529 12.1541 6.70786 12.1925Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$q, "render$q");
-script$u.render = render$q;
-var script$t = {
- name: "AngleDoubleUpIcon",
- "extends": script$1j
-};
-function render$p(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M10.1504 6.67719C10.2417 6.71508 10.3396 6.73436 10.4385 6.73389C10.6338 6.74289 10.8249 6.67441 10.97 6.54334C11.1109 6.4023 11.19 6.21112 11.19 6.01178C11.19 5.81245 11.1109 5.62127 10.97 5.48023L7.45977 1.96998C7.31873 1.82912 7.12755 1.75 6.92821 1.75C6.72888 1.75 6.5377 1.82912 6.39666 1.96998L2.9165 5.45014C2.83353 5.58905 2.79755 5.751 2.81392 5.91196C2.83028 6.07293 2.89811 6.22433 3.00734 6.34369C3.11656 6.46306 3.26137 6.54402 3.42025 6.57456C3.57914 6.60511 3.74364 6.5836 3.88934 6.51325L6.89813 3.50446L9.90691 6.51325C9.97636 6.58357 10.0592 6.6393 10.1504 6.67719ZM9.93702 11.9993C10.065 12.1452 10.245 12.2352 10.4385 12.25C10.632 12.2352 10.812 12.1452 10.9399 11.9993C11.0633 11.8614 11.1315 11.6828 11.1315 11.4978C11.1315 11.3128 11.0633 11.1342 10.9399 10.9963L7.48987 7.48609C7.34883 7.34523 7.15765 7.26611 6.95832 7.26611C6.75899 7.26611 6.5678 7.34523 6.42677 7.48609L2.91652 10.9963C2.84948 11.1367 2.82761 11.2944 2.85391 11.4477C2.88022 11.601 2.9534 11.7424 3.06339 11.8524C3.17338 11.9624 3.31477 12.0356 3.46808 12.0619C3.62139 12.0882 3.77908 12.0663 3.91945 11.9993L6.92823 8.99048L9.93702 11.9993Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$p, "render$p");
-script$t.render = render$p;
-var theme$f = /* @__PURE__ */ __name(function theme24(_ref) {
- var dt = _ref.dt;
- return "\n.p-orderlist {\n display: flex;\n gap: ".concat(dt("orderlist.gap"), ";\n}\n\n.p-orderlist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: ").concat(dt("orderlist.controls.gap"), ";\n}\n");
-}, "theme");
-var classes$g = {
- root: "p-orderlist p-component",
- controls: "p-orderlist-controls"
-};
-var OrderListStyle = BaseStyle.extend({
- name: "orderlist",
- theme: theme$f,
- classes: classes$g
-});
-var script$1$g = {
- name: "BaseOrderList",
- "extends": script$1f,
- props: {
- modelValue: {
- type: Array,
- "default": null
- },
- selection: {
- type: Array,
- "default": null
- },
- dataKey: {
- type: String,
- "default": null
- },
- listStyle: {
- type: null,
- "default": null
- },
- metaKeySelection: {
- type: Boolean,
- "default": false
- },
- autoOptionFocus: {
- type: Boolean,
- "default": true
- },
- focusOnHover: {
- type: Boolean,
- "default": true
- },
- responsive: {
- type: Boolean,
- "default": true
- },
- breakpoint: {
- type: String,
- "default": "960px"
- },
- striped: {
- type: Boolean,
- "default": false
- },
- scrollHeight: {
- type: String,
- "default": "14rem"
- },
- buttonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default12() {
- return {
- severity: "secondary"
- };
- }, "_default")
- },
- moveUpButtonProps: {
- type: null,
- "default": null
- },
- moveTopButtonProps: {
- type: null,
- "default": null
- },
- moveDownButtonProps: {
- type: null,
- "default": null
- },
- moveBottomButtonProps: {
- type: null,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: OrderListStyle,
- provide: /* @__PURE__ */ __name(function provide34() {
- return {
- $pcOrderList: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _toConsumableArray$5(r) {
- return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$6(r) || _nonIterableSpread$5();
-}
-__name(_toConsumableArray$5, "_toConsumableArray$5");
-function _nonIterableSpread$5() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$5, "_nonIterableSpread$5");
-function _unsupportedIterableToArray$6(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$6(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$6(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$6, "_unsupportedIterableToArray$6");
-function _iterableToArray$5(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$5, "_iterableToArray$5");
-function _arrayWithoutHoles$5(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$6(r);
-}
-__name(_arrayWithoutHoles$5, "_arrayWithoutHoles$5");
-function _arrayLikeToArray$6(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$6, "_arrayLikeToArray$6");
-var script$s = {
- name: "OrderList",
- "extends": script$1$g,
- inheritAttrs: false,
- emits: ["update:modelValue", "reorder", "update:selection", "selection-change", "focus", "blur"],
- itemTouched: false,
- reorderDirection: null,
- styleElement: null,
- list: null,
- data: /* @__PURE__ */ __name(function data22() {
- return {
- id: this.$attrs.id,
- d_selection: this.selection
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId8(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId")
- },
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount10() {
- this.destroyStyle();
- }, "beforeUnmount"),
- updated: /* @__PURE__ */ __name(function updated5() {
- if (this.reorderDirection) {
- this.updateListScroll();
- this.reorderDirection = null;
- }
- }, "updated"),
- mounted: /* @__PURE__ */ __name(function mounted24() {
- this.id = this.id || UniqueComponentId();
- if (this.responsive) {
- this.createStyle();
- }
- }, "mounted"),
- methods: {
- updateSelection: /* @__PURE__ */ __name(function updateSelection(event2) {
- this.$emit("update:selection", this.d_selection);
- this.$emit("selection-change", {
- originalEvent: event2,
- value: this.d_selection
- });
- }, "updateSelection"),
- onChangeSelection: /* @__PURE__ */ __name(function onChangeSelection(params) {
- this.d_selection = params.value;
- this.updateSelection(params.event);
- }, "onChangeSelection"),
- onListFocus: /* @__PURE__ */ __name(function onListFocus3(event2) {
- this.$emit("focus", event2);
- }, "onListFocus"),
- onListBlur: /* @__PURE__ */ __name(function onListBlur3(event2) {
- this.$emit("blur", event2);
- }, "onListBlur"),
- onReorderUpdate: /* @__PURE__ */ __name(function onReorderUpdate(event2, value2) {
- this.$emit("update:modelValue", value2);
- this.$emit("reorder", {
- originalEvent: event2,
- value: value2,
- direction: this.reorderDirection
- });
- }, "onReorderUpdate"),
- moveUp: /* @__PURE__ */ __name(function moveUp(event2) {
- if (this.d_selection) {
- var value2 = _toConsumableArray$5(this.modelValue);
- for (var i = 0; i < this.d_selection.length; i++) {
- var selectedItem = this.d_selection[i];
- var selectedItemIndex = findIndexInList(selectedItem, value2);
- if (selectedItemIndex !== 0) {
- var movedItem = value2[selectedItemIndex];
- var temp = value2[selectedItemIndex - 1];
- value2[selectedItemIndex - 1] = movedItem;
- value2[selectedItemIndex] = temp;
- } else {
- break;
- }
- }
- this.reorderDirection = "up";
- this.onReorderUpdate(event2, value2);
- }
- }, "moveUp"),
- moveTop: /* @__PURE__ */ __name(function moveTop(event2) {
- if (this.d_selection) {
- var value2 = _toConsumableArray$5(this.modelValue);
- for (var i = 0; i < this.d_selection.length; i++) {
- var selectedItem = this.d_selection[i];
- var selectedItemIndex = findIndexInList(selectedItem, value2);
- if (selectedItemIndex !== 0) {
- var movedItem = value2.splice(selectedItemIndex, 1)[0];
- value2.unshift(movedItem);
- } else {
- break;
- }
- }
- this.reorderDirection = "top";
- this.onReorderUpdate(event2, value2);
- }
- }, "moveTop"),
- moveDown: /* @__PURE__ */ __name(function moveDown(event2) {
- if (this.d_selection) {
- var value2 = _toConsumableArray$5(this.modelValue);
- for (var i = this.d_selection.length - 1; i >= 0; i--) {
- var selectedItem = this.d_selection[i];
- var selectedItemIndex = findIndexInList(selectedItem, value2);
- if (selectedItemIndex !== value2.length - 1) {
- var movedItem = value2[selectedItemIndex];
- var temp = value2[selectedItemIndex + 1];
- value2[selectedItemIndex + 1] = movedItem;
- value2[selectedItemIndex] = temp;
- } else {
- break;
- }
- }
- this.reorderDirection = "down";
- this.onReorderUpdate(event2, value2);
- }
- }, "moveDown"),
- moveBottom: /* @__PURE__ */ __name(function moveBottom(event2) {
- if (this.d_selection) {
- var value2 = _toConsumableArray$5(this.modelValue);
- for (var i = this.d_selection.length - 1; i >= 0; i--) {
- var selectedItem = this.d_selection[i];
- var selectedItemIndex = findIndexInList(selectedItem, value2);
- if (selectedItemIndex !== value2.length - 1) {
- var movedItem = value2.splice(selectedItemIndex, 1)[0];
- value2.push(movedItem);
- } else {
- break;
- }
- }
- this.reorderDirection = "bottom";
- this.onReorderUpdate(event2, value2);
- }
- }, "moveBottom"),
- updateListScroll: /* @__PURE__ */ __name(function updateListScroll() {
- this.list = findSingle(this.$refs.listbox.$el, '[data-pc-section="list"]');
- var listItems = find(this.list, '[data-pc-section="item"][data-p-selected="true"]');
- if (listItems && listItems.length) {
- switch (this.reorderDirection) {
- case "up":
- scrollInView(this.list, listItems[0]);
- break;
- case "top":
- this.list.scrollTop = 0;
- break;
- case "down":
- scrollInView(this.list, listItems[listItems.length - 1]);
- break;
- case "bottom":
- this.list.scrollTop = this.list.scrollHeight;
- break;
- }
- }
- }, "updateListScroll"),
- createStyle: /* @__PURE__ */ __name(function createStyle() {
- if (!this.styleElement && !this.isUnstyled) {
- var _this$$primevue;
- this.styleElement = document.createElement("style");
- this.styleElement.type = "text/css";
- setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
- document.head.appendChild(this.styleElement);
- var innerHTML = "\n@media screen and (max-width: ".concat(this.breakpoint, ") {\n .p-orderlist[").concat(this.$attrSelector, "] {\n flex-direction: column;\n }\n\n .p-orderlist[").concat(this.$attrSelector, "] .p-orderlist-controls {\n flex-direction: row;\n }\n}\n");
- this.styleElement.innerHTML = innerHTML;
- }
- }, "createStyle"),
- destroyStyle: /* @__PURE__ */ __name(function destroyStyle() {
- if (this.styleElement) {
- document.head.removeChild(this.styleElement);
- this.styleElement = null;
- }
- }, "destroyStyle"),
- moveDisabled: /* @__PURE__ */ __name(function moveDisabled() {
- return this.disabled ? true : !this.d_selection || !this.d_selection.length ? true : false;
- }, "moveDisabled")
- },
- computed: {
- moveUpAriaLabel: /* @__PURE__ */ __name(function moveUpAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveUp : void 0;
- }, "moveUpAriaLabel"),
- moveTopAriaLabel: /* @__PURE__ */ __name(function moveTopAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveTop : void 0;
- }, "moveTopAriaLabel"),
- moveDownAriaLabel: /* @__PURE__ */ __name(function moveDownAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveDown : void 0;
- }, "moveDownAriaLabel"),
- moveBottomAriaLabel: /* @__PURE__ */ __name(function moveBottomAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveBottom : void 0;
- }, "moveBottomAriaLabel"),
- hasSelectedOption: /* @__PURE__ */ __name(function hasSelectedOption3() {
- return isNotEmpty(this.d_selection);
- }, "hasSelectedOption")
- },
- components: {
- Listbox: script$1N,
- Button: script$1d,
- AngleUpIcon: script$1O,
- AngleDownIcon: script$1G,
- AngleDoubleUpIcon: script$t,
- AngleDoubleDownIcon: script$u
- },
- directives: {
- ripple: Ripple
- }
-};
-function _typeof$d(o) {
- "@babel/helpers - typeof";
- return _typeof$d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$d(o);
-}
-__name(_typeof$d, "_typeof$d");
-function ownKeys$c(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$c, "ownKeys$c");
-function _objectSpread$c(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$c(Object(t2), true).forEach(function(r2) {
- _defineProperty$d(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$c(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$c, "_objectSpread$c");
-function _defineProperty$d(e, r, t2) {
- return (r = _toPropertyKey$d(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$d, "_defineProperty$d");
-function _toPropertyKey$d(t2) {
- var i = _toPrimitive$d(t2, "string");
- return "symbol" == _typeof$d(i) ? i : i + "";
-}
-__name(_toPropertyKey$d, "_toPropertyKey$d");
-function _toPrimitive$d(t2, r) {
- if ("object" != _typeof$d(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$d(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$d, "_toPrimitive$d");
-function render$o(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_AngleUpIcon = resolveComponent("AngleUpIcon");
- var _component_Button = resolveComponent("Button");
- var _component_AngleDoubleUpIcon = resolveComponent("AngleDoubleUpIcon");
- var _component_AngleDownIcon = resolveComponent("AngleDownIcon");
- var _component_AngleDoubleDownIcon = resolveComponent("AngleDoubleDownIcon");
- var _component_Listbox = resolveComponent("Listbox");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("controls")
- }, _ctx.ptm("controls")), [renderSlot(_ctx.$slots, "controlsstart"), createVNode(_component_Button, mergeProps({
- onClick: $options.moveUp,
- "aria-label": $options.moveUpAriaLabel,
- disabled: $options.moveDisabled()
- }, _objectSpread$c(_objectSpread$c({}, _ctx.buttonProps), _ctx.moveUpButtonProps), {
- pt: _ctx.ptm("pcMoveUpButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "moveupicon", {}, function() {
- return [createVNode(_component_AngleUpIcon, mergeProps(_ctx.ptm("pcMoveUpButton")["icon"], {
- "data-pc-section": "moveupicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["onClick", "aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- onClick: $options.moveTop,
- "aria-label": $options.moveTopAriaLabel,
- disabled: $options.moveDisabled()
- }, _objectSpread$c(_objectSpread$c({}, _ctx.buttonProps), _ctx.moveTopButtonProps), {
- pt: _ctx.ptm("pcMoveTopButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movetopicon", {}, function() {
- return [createVNode(_component_AngleDoubleUpIcon, mergeProps(_ctx.ptm("pcMoveTopButton")["icon"], {
- "data-pc-section": "movetopicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["onClick", "aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- onClick: $options.moveDown,
- "aria-label": $options.moveDownAriaLabel,
- disabled: $options.moveDisabled()
- }, _objectSpread$c(_objectSpread$c({}, _ctx.buttonProps), _ctx.moveDownButtonProps), {
- pt: _ctx.ptm("pcMoveDownButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movedownicon", {}, function() {
- return [createVNode(_component_AngleDownIcon, mergeProps(_ctx.ptm("pcMoveDownButton")["icon"], {
- "data-pc-section": "movedownicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["onClick", "aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- onClick: $options.moveBottom,
- "aria-label": $options.moveBottomAriaLabel,
- disabled: $options.moveDisabled()
- }, _objectSpread$c(_objectSpread$c({}, _ctx.buttonProps), _ctx.moveBottomButtonProps), {
- pt: _ctx.ptm("pcMoveBottomButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movebottomicon", {}, function() {
- return [createVNode(_component_AngleDoubleDownIcon, mergeProps(_ctx.ptm("pcMoveBottomButton")["icon"], {
- "data-pc-section": "movebottomicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["onClick", "aria-label", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "controlsend")], 16), createVNode(_component_Listbox, {
- ref: "listbox",
- id: $data.id,
- modelValue: $data.d_selection,
- options: _ctx.modelValue,
- multiple: "",
- metaKeySelection: _ctx.metaKeySelection,
- listStyle: _ctx.listStyle,
- scrollHeight: _ctx.scrollHeight,
- tabindex: _ctx.tabindex,
- dataKey: _ctx.dataKey,
- autoOptionFocus: _ctx.autoOptionFocus,
- focusOnHover: _ctx.focusOnHover,
- striped: _ctx.striped,
- disabled: _ctx.disabled,
- ariaLabel: _ctx.ariaLabel,
- ariaLabelledby: _ctx.ariaLabelledby,
- pt: _ctx.ptm("pcListbox"),
- unstyled: _ctx.unstyled,
- onFocus: $options.onListFocus,
- onBlur: $options.onListBlur,
- onChange: $options.onChangeSelection
- }, createSlots({
- option: withCtx(function(_ref) {
- var option4 = _ref.option, selected3 = _ref.selected, index = _ref.index;
- return [renderSlot(_ctx.$slots, _ctx.$slots.option ? "option" : "item", {
- item: option4,
- option: option4,
- selected: selected3,
- index
- })];
- }),
- _: 2
- }, [_ctx.$slots.header ? {
- name: "header",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "header")];
- }),
- key: "0"
- } : void 0]), 1032, ["id", "modelValue", "options", "metaKeySelection", "listStyle", "scrollHeight", "tabindex", "dataKey", "autoOptionFocus", "focusOnHover", "striped", "disabled", "ariaLabel", "ariaLabelledby", "pt", "unstyled", "onFocus", "onBlur", "onChange"])], 16);
-}
-__name(render$o, "render$o");
-script$s.render = render$o;
-var theme$e = /* @__PURE__ */ __name(function theme25(_ref) {
- var dt = _ref.dt;
- return "\n.p-organizationchart-table {\n border-spacing: 0;\n border-collapse: separate;\n margin: 0 auto;\n}\n\n.p-organizationchart-table > tbody > tr > td {\n text-align: center;\n vertical-align: top;\n padding: 0 ".concat(dt("organizationchart.gutter"), ";\n}\n\n.p-organizationchart-node {\n display: inline-block;\n position: relative;\n border: 1px solid ").concat(dt("organizationchart.node.border.color"), ";\n background: ").concat(dt("organizationchart.node.background"), ";\n color: ").concat(dt("organizationchart.node.color"), ";\n padding: ").concat(dt("organizationchart.node.padding"), ";\n border-radius: ").concat(dt("organizationchart.node.border.radius"), ";\n transition: background ").concat(dt("organizationchart.transition.duration"), ", border-color ").concat(dt("organizationchart.transition.duration"), ", color ").concat(dt("organizationchart.transition.duration"), ", box-shadow ").concat(dt("organizationchart.transition.duration"), ";\n}\n\n.p-organizationchart-node:has(.p-organizationchart-node-toggle-button) {\n padding: ").concat(dt("organizationchart.node.toggleable.padding"), ";\n}\n\n.p-organizationchart-node.p-organizationchart-node-selectable:not(.p-organizationchart-node-selected):hover {\n background: ").concat(dt("organizationchart.node.hover.background"), ";\n color: ").concat(dt("organizationchart.node.hover.color"), ";\n}\n\n.p-organizationchart-node-selected {\n background: ").concat(dt("organizationchart.node.selected.background"), ";\n color: ").concat(dt("organizationchart.node.selected.color"), ";\n}\n\n.p-organizationchart-node-toggle-button {\n position: absolute;\n inset-block-end: calc(-1 * calc(").concat(dt("organizationchart.node.toggle.button.size"), " / 2));\n margin-inline-start: calc(-1 * calc(").concat(dt("organizationchart.node.toggle.button.size"), " / 2));\n z-index: 2;\n inset-inline-start: 50%;\n user-select: none;\n cursor: pointer;\n width: ").concat(dt("organizationchart.node.toggle.button.size"), ";\n height: ").concat(dt("organizationchart.node.toggle.button.size"), ";\n text-decoration: none;\n background: ").concat(dt("organizationchart.node.toggle.button.background"), ";\n color: ").concat(dt("organizationchart.node.toggle.button.color"), ";\n border-radius: ").concat(dt("organizationchart.node.toggle.button.border.radius"), ";\n border: 1px solid ").concat(dt("organizationchart.node.toggle.button.border.color"), ";\n display: inline-flex;\n justify-content: center;\n align-items: center;\n outline-color: transparent;\n transition: background ").concat(dt("organizationchart.transition.duration"), ", color ").concat(dt("organizationchart.transition.duration"), ", border-color ").concat(dt("organizationchart.transition.duration"), ", outline-color ").concat(dt("organizationchart.transition.duration"), ", box-shadow ").concat(dt("organizationchart.transition.duration"), ";\n}\n\n.p-organizationchart-node-toggle-button:hover {\n background: ").concat(dt("organizationchart.node.toggle.button.hover.background"), ";\n color: ").concat(dt("organizationchart.node.toggle.button.hover.color"), ";\n}\n\n.p-organizationchart-node-toggle-button:focus-visible {\n box-shadow: ").concat(dt("breadcrumb.item.focus.ring.shadow"), ";\n outline: ").concat(dt("breadcrumb.item.focus.ring.width"), " ").concat(dt("breadcrumb.item.focus.ring.style"), " ").concat(dt("breadcrumb.item.focus.ring.color"), ";\n outline-offset: ").concat(dt("breadcrumb.item.focus.ring.offset"), ";\n}\n\n.p-organizationchart-node-toggle-button-icon {\n position: relative;\n inset-block-start: 1px;\n}\n\n.p-organizationchart-connector-down {\n margin: 0 auto;\n height: ").concat(dt("organizationchart.connector.height"), ";\n width: 1px;\n background: ").concat(dt("organizationchart.connector.color"), ";\n}\n\n.p-organizationchart-connector-right {\n border-radius: 0;\n}\n\n.p-organizationchart-connector-left {\n border-radius: 0;\n border-inline-end: 1px solid ").concat(dt("organizationchart.connector.color"), ";\n}\n\n.p-organizationchart-connector-top {\n border-block-start: 1px solid ").concat(dt("organizationchart.connector.color"), ";\n}\n\n.p-organizationchart-node-selectable {\n cursor: pointer;\n}\n\n.p-organizationchart-connectors :nth-child(1 of .p-organizationchart-connector-left) {\n border-inline-end: 0 none;\n}\n\n.p-organizationchart-connectors :nth-last-child(1 of .p-organizationchart-connector-left) {\n border-start-end-radius: ").concat(dt("organizationchart.connector.border.radius"), ";\n}\n\n.p-organizationchart-connectors :nth-child(1 of .p-organizationchart-connector-right) {\n border-inline-start: 1px solid ").concat(dt("organizationchart.connector.color"), ";\n border-start-start-radius: ").concat(dt("organizationchart.connector.border.radius"), ";\n}\n");
-}, "theme");
-var classes$f = {
- root: "p-organizationchart p-component",
- table: "p-organizationchart-table",
- node: /* @__PURE__ */ __name(function node(_ref2) {
- var instance = _ref2.instance;
- return ["p-organizationchart-node", {
- "p-organizationchart-node-selectable": instance.selectable,
- "p-organizationchart-node-selected": instance.selected
- }];
- }, "node"),
- nodeToggleButton: "p-organizationchart-node-toggle-button",
- nodeToggleButtonIcon: "p-organizationchart-node-toggle-button-icon",
- connectors: "p-organizationchart-connectors",
- connectorDown: "p-organizationchart-connector-down",
- connectorLeft: /* @__PURE__ */ __name(function connectorLeft(_ref3) {
- var index = _ref3.index;
- return ["p-organizationchart-connector-left", {
- "p-organizationchart-connector-top": !(index === 0)
- }];
- }, "connectorLeft"),
- connectorRight: /* @__PURE__ */ __name(function connectorRight(_ref4) {
- var props = _ref4.props, index = _ref4.index;
- return ["p-organizationchart-connector-right", {
- "p-organizationchart-connector-top": !(index === props.node.children.length - 1)
- }];
- }, "connectorRight"),
- nodeChildren: "p-organizationchart-node-children"
-};
-var OrganizationChartStyle = BaseStyle.extend({
- name: "organizationchart",
- theme: theme$e,
- classes: classes$f
-});
-var script$2$2 = {
- name: "BaseOrganizationChart",
- "extends": script$1f,
- props: {
- value: {
- type: null,
- "default": null
- },
- selectionKeys: {
- type: null,
- "default": null
- },
- selectionMode: {
- type: String,
- "default": null
- },
- collapsible: {
- type: Boolean,
- "default": false
- },
- collapsedKeys: {
- type: null,
- "default": null
- }
- },
- style: OrganizationChartStyle,
- provide: /* @__PURE__ */ __name(function provide35() {
- return {
- $pcOrganizationChart: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1$f = {
- name: "OrganizationChartNode",
- hostName: "OrganizationChart",
- "extends": script$1f,
- emits: ["node-click", "node-toggle"],
- props: {
- node: {
- type: null,
- "default": null
- },
- templates: {
- type: null,
- "default": null
- },
- collapsible: {
- type: Boolean,
- "default": false
- },
- collapsedKeys: {
- type: null,
- "default": null
- },
- selectionKeys: {
- type: null,
- "default": null
- },
- selectionMode: {
- type: String,
- "default": null
- }
- },
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions6(key) {
- return this.ptm(key, {
- context: {
- expanded: this.expanded,
- selectable: this.selectable,
- selected: this.selected,
- toggleable: this.toggleable,
- active: this.selected
- }
- });
- }, "getPTOptions"),
- getNodeOptions: /* @__PURE__ */ __name(function getNodeOptions(lineTop, key) {
- return this.ptm(key, {
- context: {
- lineTop
- }
- });
- }, "getNodeOptions"),
- onNodeClick: /* @__PURE__ */ __name(function onNodeClick(event2) {
- if (isAttributeEquals(event2.target, "data-pc-section", "nodetogglebutton") || isAttributeEquals(event2.target, "data-pc-section", "nodetogglebuttonicon")) {
- return;
- }
- if (this.selectionMode) {
- this.$emit("node-click", this.node);
- }
- }, "onNodeClick"),
- onChildNodeClick: /* @__PURE__ */ __name(function onChildNodeClick(node2) {
- this.$emit("node-click", node2);
- }, "onChildNodeClick"),
- toggleNode: /* @__PURE__ */ __name(function toggleNode() {
- this.$emit("node-toggle", this.node);
- }, "toggleNode"),
- onChildNodeToggle: /* @__PURE__ */ __name(function onChildNodeToggle(node2) {
- this.$emit("node-toggle", node2);
- }, "onChildNodeToggle"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown3(event2) {
- if (event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") {
- this.toggleNode();
- event2.preventDefault();
- }
- }, "onKeydown")
- },
- computed: {
- leaf: /* @__PURE__ */ __name(function leaf() {
- return this.node.leaf === false ? false : !(this.node.children && this.node.children.length);
- }, "leaf"),
- colspan: /* @__PURE__ */ __name(function colspan() {
- return this.node.children && this.node.children.length ? this.node.children.length * 2 : null;
- }, "colspan"),
- childStyle: /* @__PURE__ */ __name(function childStyle() {
- return {
- visibility: !this.leaf && this.expanded ? "inherit" : "hidden"
- };
- }, "childStyle"),
- expanded: /* @__PURE__ */ __name(function expanded() {
- return this.collapsedKeys[this.node.key] === void 0;
- }, "expanded"),
- selectable: /* @__PURE__ */ __name(function selectable() {
- return this.selectionMode && this.node.selectable !== false;
- }, "selectable"),
- selected: /* @__PURE__ */ __name(function selected() {
- return this.selectable && this.selectionKeys && this.selectionKeys[this.node.key] === true;
- }, "selected"),
- toggleable: /* @__PURE__ */ __name(function toggleable() {
- return this.collapsible && this.node.collapsible !== false && !this.leaf;
- }, "toggleable")
- },
- components: {
- ChevronDownIcon: script$1h,
- ChevronUpIcon: script$1g
- }
-};
-var _hoisted_1$e = ["colspan"];
-var _hoisted_2$a = ["colspan"];
-var _hoisted_3$7 = ["colspan"];
-function render$1$2(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_OrganizationChartNode = resolveComponent("OrganizationChartNode", true);
- return openBlock(), createElementBlock("table", mergeProps({
- "class": _ctx.cx("table")
- }, _ctx.ptm("table")), [createBaseVNode("tbody", normalizeProps(guardReactiveProps(_ctx.ptm("body"))), [$props.node ? (openBlock(), createElementBlock("tr", normalizeProps(mergeProps({
- key: 0
- }, _ctx.ptm("row"))), [createBaseVNode("td", mergeProps({
- colspan: $options.colspan
- }, _ctx.ptm("cell")), [createBaseVNode("div", mergeProps({
- "class": [_ctx.cx("node"), $props.node.styleClass],
- onClick: _cache[2] || (_cache[2] = function() {
- return $options.onNodeClick && $options.onNodeClick.apply($options, arguments);
- })
- }, $options.getPTOptions("node")), [(openBlock(), createBlock(resolveDynamicComponent($props.templates[$props.node.type] || $props.templates["default"]), {
- node: $props.node
- }, null, 8, ["node"])), $options.toggleable ? (openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- tabindex: "0",
- "class": _ctx.cx("nodeToggleButton"),
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.toggleNode && $options.toggleNode.apply($options, arguments);
- }),
- onKeydown: _cache[1] || (_cache[1] = function() {
- return $options.onKeydown && $options.onKeydown.apply($options, arguments);
- })
- }, $options.getPTOptions("nodeToggleButton")), [$props.templates.toggleicon || $props.templates.togglericon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.toggleicon || $props.templates.togglericon), mergeProps({
- key: 0,
- expanded: $options.expanded,
- "class": _ctx.cx("nodeToggleButtonIcon")
- }, $options.getPTOptions("nodeToggleButtonIcon")), null, 16, ["expanded", "class"])) : (openBlock(), createBlock(resolveDynamicComponent($options.expanded ? "ChevronDownIcon" : "ChevronUpIcon"), mergeProps({
- key: 1,
- "class": _ctx.cx("nodeToggleButtonIcon")
- }, $options.getPTOptions("nodeToggleButtonIcon")), null, 16, ["class"]))], 16)) : createCommentVNode("", true)], 16)], 16, _hoisted_1$e)], 16)) : createCommentVNode("", true), createBaseVNode("tr", mergeProps({
- style: $options.childStyle,
- "class": _ctx.cx("connectors")
- }, _ctx.ptm("connectors")), [createBaseVNode("td", mergeProps({
- colspan: $options.colspan
- }, _ctx.ptm("lineCell")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("connectorDown")
- }, _ctx.ptm("connectorDown")), null, 16)], 16, _hoisted_2$a)], 16), createBaseVNode("tr", mergeProps({
- style: $options.childStyle,
- "class": _ctx.cx("connectors")
- }, _ctx.ptm("connectors")), [$props.node.children && $props.node.children.length === 1 ? (openBlock(), createElementBlock("td", mergeProps({
- key: 0,
- colspan: $options.colspan
- }, _ctx.ptm("lineCell")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("connectorDown")
- }, _ctx.ptm("connectorDown")), null, 16)], 16, _hoisted_3$7)) : createCommentVNode("", true), $props.node.children && $props.node.children.length > 1 ? (openBlock(true), createElementBlock(Fragment, {
- key: 1
- }, renderList($props.node.children, function(child, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: child.key
- }, [createBaseVNode("td", mergeProps({
- "class": _ctx.cx("connectorLeft", {
- index: i
- }),
- ref_for: true
- }, $options.getNodeOptions(!(i === 0), "connectorLeft")), " ", 16), createBaseVNode("td", mergeProps({
- "class": _ctx.cx("connectorRight", {
- index: i
- }),
- ref_for: true
- }, $options.getNodeOptions(!(i === $props.node.children.length - 1), "connectorRight")), " ", 16)], 64);
- }), 128)) : createCommentVNode("", true)], 16), createBaseVNode("tr", mergeProps({
- style: $options.childStyle,
- "class": _ctx.cx("nodeChildren")
- }, _ctx.ptm("nodeChildren")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.node.children, function(child) {
- return openBlock(), createElementBlock("td", mergeProps({
- key: child.key,
- colspan: "2",
- ref_for: true
- }, _ctx.ptm("nodeCell")), [createVNode(_component_OrganizationChartNode, {
- node: child,
- templates: $props.templates,
- collapsedKeys: $props.collapsedKeys,
- onNodeToggle: $options.onChildNodeToggle,
- collapsible: $props.collapsible,
- selectionMode: $props.selectionMode,
- selectionKeys: $props.selectionKeys,
- onNodeClick: $options.onChildNodeClick,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["node", "templates", "collapsedKeys", "onNodeToggle", "collapsible", "selectionMode", "selectionKeys", "onNodeClick", "pt", "unstyled"])], 16);
- }), 128))], 16)], 16)], 16);
-}
-__name(render$1$2, "render$1$2");
-script$1$f.render = render$1$2;
-function _typeof$c(o) {
- "@babel/helpers - typeof";
- return _typeof$c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$c(o);
-}
-__name(_typeof$c, "_typeof$c");
-function ownKeys$b(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$b, "ownKeys$b");
-function _objectSpread$b(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$b(Object(t2), true).forEach(function(r2) {
- _defineProperty$c(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$b(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$b, "_objectSpread$b");
-function _defineProperty$c(e, r, t2) {
- return (r = _toPropertyKey$c(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$c, "_defineProperty$c");
-function _toPropertyKey$c(t2) {
- var i = _toPrimitive$c(t2, "string");
- return "symbol" == _typeof$c(i) ? i : i + "";
-}
-__name(_toPropertyKey$c, "_toPropertyKey$c");
-function _toPrimitive$c(t2, r) {
- if ("object" != _typeof$c(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$c(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$c, "_toPrimitive$c");
-var script$r = {
- name: "OrganizationChart",
- "extends": script$2$2,
- inheritAttrs: false,
- emits: ["node-unselect", "node-select", "update:selectionKeys", "node-expand", "node-collapse", "update:collapsedKeys"],
- data: /* @__PURE__ */ __name(function data23() {
- return {
- d_collapsedKeys: this.collapsedKeys || {}
- };
- }, "data"),
- watch: {
- collapsedKeys: /* @__PURE__ */ __name(function collapsedKeys(newValue) {
- this.d_collapsedKeys = newValue;
- }, "collapsedKeys")
- },
- methods: {
- onNodeClick: /* @__PURE__ */ __name(function onNodeClick2(node2) {
- var key = node2.key;
- if (this.selectionMode) {
- var _selectionKeys = this.selectionKeys ? _objectSpread$b({}, this.selectionKeys) : {};
- if (_selectionKeys[key]) {
- delete _selectionKeys[key];
- this.$emit("node-unselect", node2);
- } else {
- if (this.selectionMode === "single") {
- _selectionKeys = {};
- }
- _selectionKeys[key] = true;
- this.$emit("node-select", node2);
- }
- this.$emit("update:selectionKeys", _selectionKeys);
- }
- }, "onNodeClick"),
- onNodeToggle: /* @__PURE__ */ __name(function onNodeToggle(node2) {
- var key = node2.key;
- if (this.d_collapsedKeys[key]) {
- delete this.d_collapsedKeys[key];
- this.$emit("node-expand", node2);
- } else {
- this.d_collapsedKeys[key] = true;
- this.$emit("node-collapse", node2);
- }
- this.d_collapsedKeys = _objectSpread$b({}, this.d_collapsedKeys);
- this.$emit("update:collapsedKeys", this.d_collapsedKeys);
- }, "onNodeToggle")
- },
- components: {
- OrganizationChartNode: script$1$f
- }
-};
-function render$n(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_OrganizationChartNode = resolveComponent("OrganizationChartNode");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createVNode(_component_OrganizationChartNode, {
- node: _ctx.value,
- templates: _ctx.$slots,
- onNodeToggle: $options.onNodeToggle,
- collapsedKeys: $data.d_collapsedKeys,
- collapsible: _ctx.collapsible,
- onNodeClick: $options.onNodeClick,
- selectionMode: _ctx.selectionMode,
- selectionKeys: _ctx.selectionKeys,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["node", "templates", "onNodeToggle", "collapsedKeys", "collapsible", "onNodeClick", "selectionMode", "selectionKeys", "pt", "unstyled"])], 16);
-}
-__name(render$n, "render$n");
-script$r.render = render$n;
-var script$q = {
- name: "OverlayPanel",
- "extends": script$1P,
- mounted: /* @__PURE__ */ __name(function mounted25() {
- console.warn("Deprecated since v4. Use Popover component instead.");
- }, "mounted")
-};
-var OverlayPanelStyle = BaseStyle.extend({
- name: "overlaypanel"
-});
-var theme$d = /* @__PURE__ */ __name(function theme26(_ref) {
- var dt = _ref.dt;
- return "\n.p-panelmenu {\n display: flex;\n flex-direction: column;\n gap: ".concat(dt("panelmenu.gap"), ";\n}\n\n.p-panelmenu-panel {\n background: ").concat(dt("panelmenu.panel.background"), ";\n border-width: ").concat(dt("panelmenu.panel.border.width"), ";\n border-style: solid;\n border-color: ").concat(dt("panelmenu.panel.border.color"), ";\n color: ").concat(dt("panelmenu.panel.color"), ";\n border-radius: ").concat(dt("panelmenu.panel.border.radius"), ";\n padding: ").concat(dt("panelmenu.panel.padding"), ";\n}\n\n.p-panelmenu-panel:first-child {\n border-width: ").concat(dt("panelmenu.panel.first.border.width"), ";\n border-start-start-radius: ").concat(dt("panelmenu.panel.first.top.border.radius"), ";\n border-start-end-radius: ").concat(dt("panelmenu.panel.first.top.border.radius"), ";\n}\n\n.p-panelmenu-panel:last-child {\n border-width: ").concat(dt("panelmenu.panel.last.border.width"), ";\n border-end-start-radius: ").concat(dt("panelmenu.panel.last.bottom.border.radius"), ";\n border-end-end-radius: ").concat(dt("panelmenu.panel.last.bottom.border.radius"), ";\n}\n\n.p-panelmenu-header {\n outline: 0 none;\n}\n\n.p-panelmenu-header-content {\n border-radius: ").concat(dt("panelmenu.item.border.radius"), ";\n transition: background ").concat(dt("panelmenu.transition.duration"), ", color ").concat(dt("panelmenu.transition.duration"), ", outline-color ").concat(dt("panelmenu.transition.duration"), ", box-shadow ").concat(dt("panelmenu.transition.duration"), ";\n outline-color: transparent;\n color: ").concat(dt("panelmenu.item.color"), ";\n}\n\n.p-panelmenu-header-link {\n display: flex;\n gap: ").concat(dt("panelmenu.item.gap"), ";\n padding: ").concat(dt("panelmenu.item.padding"), ";\n align-items: center;\n user-select: none;\n cursor: pointer;\n position: relative;\n text-decoration: none;\n color: inherit;\n}\n\n.p-panelmenu-header-icon,\n.p-panelmenu-item-icon {\n color: ").concat(dt("panelmenu.item.icon.color"), ";\n}\n\n.p-panelmenu-submenu-icon {\n color: ").concat(dt("panelmenu.submenu.icon.color"), ";\n}\n\n.p-panelmenu-submenu-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n\n.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content {\n background: ").concat(dt("panelmenu.item.focus.background"), ";\n color: ").concat(dt("panelmenu.item.focus.color"), ";\n}\n\n.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-header-icon {\n color: ").concat(dt("panelmenu.item.icon.focus.color"), ";\n}\n\n.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-submenu-icon {\n color: ").concat(dt("panelmenu.submenu.icon.focus.color"), ";\n}\n\n.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover {\n background: ").concat(dt("panelmenu.item.focus.background"), ";\n color: ").concat(dt("panelmenu.item.focus.color"), ";\n}\n\n.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-header-icon {\n color: ").concat(dt("panelmenu.item.icon.focus.color"), ";\n}\n\n.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-submenu-icon {\n color: ").concat(dt("panelmenu.submenu.icon.focus.color"), ";\n}\n\n.p-panelmenu-submenu {\n margin: 0;\n padding: 0 0 0 ").concat(dt("panelmenu.submenu.indent"), ";\n outline: 0;\n list-style: none;\n}\n\n.p-panelmenu-submenu:dir(rtl) {\n padding: 0 ").concat(dt("panelmenu.submenu.indent"), " 0 0;\n}\n\n.p-panelmenu-item-link {\n display: flex;\n gap: ").concat(dt("panelmenu.item.gap"), ";\n padding: ").concat(dt("panelmenu.item.padding"), ";\n align-items: center;\n user-select: none;\n cursor: pointer;\n text-decoration: none;\n color: inherit;\n position: relative;\n overflow: hidden;\n}\n\n.p-panelmenu-item-label {\n line-height: 1;\n}\n\n.p-panelmenu-item-content {\n border-radius: ").concat(dt("panelmenu.item.border.radius"), ";\n transition: background ").concat(dt("panelmenu.transition.duration"), ", color ").concat(dt("panelmenu.transition.duration"), ", outline-color ").concat(dt("panelmenu.transition.duration"), ", box-shadow ").concat(dt("panelmenu.transition.duration"), ";\n color: ").concat(dt("panelmenu.item.color"), ";\n outline-color: transparent;\n}\n\n.p-panelmenu-item.p-focus > .p-panelmenu-item-content {\n background: ").concat(dt("panelmenu.item.focus.background"), ";\n color: ").concat(dt("panelmenu.item.focus.color"), ";\n}\n\n.p-panelmenu-item.p-focus > .p-panelmenu-item-content .p-panelmenu-item-icon {\n color: ").concat(dt("panelmenu.item.focus.color"), ";\n}\n\n.p-panelmenu-item.p-focus > .p-panelmenu-item-content .p-panelmenu-submenu-icon {\n color: ").concat(dt("panelmenu.submenu.icon.focus.color"), ";\n}\n\n.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover {\n background: ").concat(dt("panelmenu.item.focus.background"), ";\n color: ").concat(dt("panelmenu.item.focus.color"), ";\n}\n\n.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-item-icon {\n color: ").concat(dt("panelmenu.item.icon.focus.color"), ";\n}\n\n.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-submenu-icon {\n color: ").concat(dt("panelmenu.submenu.icon.focus.color"), ";\n}\n");
-}, "theme");
-var classes$e = {
- root: "p-panelmenu p-component",
- panel: "p-panelmenu-panel",
- header: /* @__PURE__ */ __name(function header(_ref2) {
- var instance = _ref2.instance, item8 = _ref2.item;
- return ["p-panelmenu-header", {
- "p-panelmenu-header-active": instance.isItemActive(item8) && !!item8.items,
- "p-disabled": instance.isItemDisabled(item8)
- }];
- }, "header"),
- headerContent: "p-panelmenu-header-content",
- headerLink: "p-panelmenu-header-link",
- headerIcon: "p-panelmenu-header-icon",
- headerLabel: "p-panelmenu-header-label",
- contentContainer: "p-panelmenu-content-container",
- content: "p-panelmenu-content",
- rootList: "p-panelmenu-root-list",
- item: /* @__PURE__ */ __name(function item5(_ref3) {
- var instance = _ref3.instance, processedItem = _ref3.processedItem;
- return ["p-panelmenu-item", {
- "p-focus": instance.isItemFocused(processedItem),
- "p-disabled": instance.isItemDisabled(processedItem)
- }];
- }, "item"),
- itemContent: "p-panelmenu-item-content",
- itemLink: "p-panelmenu-item-link",
- itemIcon: "p-panelmenu-item-icon",
- itemLabel: "p-panelmenu-item-label",
- submenuIcon: "p-panelmenu-submenu-icon",
- submenu: "p-panelmenu-submenu",
- separator: "p-menuitem-separator"
-};
-var PanelMenuStyle = BaseStyle.extend({
- name: "panelmenu",
- theme: theme$d,
- classes: classes$e
-});
-var script$3$1 = {
- name: "BasePanelMenu",
- "extends": script$1f,
- props: {
- model: {
- type: Array,
- "default": null
- },
- expandedKeys: {
- type: Object,
- "default": null
- },
- multiple: {
- type: Boolean,
- "default": false
- },
- tabindex: {
- type: Number,
- "default": 0
- }
- },
- style: PanelMenuStyle,
- provide: /* @__PURE__ */ __name(function provide36() {
- return {
- $pcPanelMenu: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$2$1 = {
- name: "PanelMenuSub",
- hostName: "PanelMenu",
- "extends": script$1f,
- emits: ["item-toggle", "item-mousemove"],
- props: {
- panelId: {
- type: String,
- "default": null
- },
- focusedItemId: {
- type: String,
- "default": null
- },
- items: {
- type: Array,
- "default": null
- },
- level: {
- type: Number,
- "default": 0
- },
- templates: {
- type: Object,
- "default": null
- },
- activeItemPath: {
- type: Object,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": -1
- }
- },
- methods: {
- getItemId: /* @__PURE__ */ __name(function getItemId3(processedItem) {
- return "".concat(this.panelId, "_").concat(processedItem.key);
- }, "getItemId"),
- getItemKey: /* @__PURE__ */ __name(function getItemKey2(processedItem) {
- return this.getItemId(processedItem);
- }, "getItemKey"),
- getItemProp: /* @__PURE__ */ __name(function getItemProp5(processedItem, name4, params) {
- return processedItem && processedItem.item ? resolve(processedItem.item[name4], params) : void 0;
- }, "getItemProp"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel3(processedItem) {
- return this.getItemProp(processedItem, "label");
- }, "getItemLabel"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions7(key, processedItem, index) {
- return this.ptm(key, {
- context: {
- item: processedItem.item,
- index,
- active: this.isItemActive(processedItem),
- focused: this.isItemFocused(processedItem),
- disabled: this.isItemDisabled(processedItem)
- }
- });
- }, "getPTOptions"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive4(processedItem) {
- return this.activeItemPath.some(function(path) {
- return path.key === processedItem.key;
- });
- }, "isItemActive"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible3(processedItem) {
- return this.getItemProp(processedItem, "visible") !== false;
- }, "isItemVisible"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled3(processedItem) {
- return this.getItemProp(processedItem, "disabled");
- }, "isItemDisabled"),
- isItemFocused: /* @__PURE__ */ __name(function isItemFocused3(processedItem) {
- return this.focusedItemId === this.getItemId(processedItem);
- }, "isItemFocused"),
- isItemGroup: /* @__PURE__ */ __name(function isItemGroup3(processedItem) {
- return isNotEmpty(processedItem.items);
- }, "isItemGroup"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick5(event2, processedItem) {
- this.getItemProp(processedItem, "command", {
- originalEvent: event2,
- item: processedItem.item
- });
- this.$emit("item-toggle", {
- processedItem,
- expanded: !this.isItemActive(processedItem)
- });
- }, "onItemClick"),
- onItemToggle: /* @__PURE__ */ __name(function onItemToggle(event2) {
- this.$emit("item-toggle", event2);
- }, "onItemToggle"),
- onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove2(event2, processedItem) {
- this.$emit("item-mousemove", {
- originalEvent: event2,
- processedItem
- });
- }, "onItemMouseMove"),
- getAriaSetSize: /* @__PURE__ */ __name(function getAriaSetSize2() {
- var _this = this;
- return this.items.filter(function(processedItem) {
- return _this.isItemVisible(processedItem) && !_this.getItemProp(processedItem, "separator");
- }).length;
- }, "getAriaSetSize"),
- getAriaPosInset: /* @__PURE__ */ __name(function getAriaPosInset3(index) {
- var _this2 = this;
- return index - this.items.slice(0, index).filter(function(processedItem) {
- return _this2.isItemVisible(processedItem) && _this2.getItemProp(processedItem, "separator");
- }).length + 1;
- }, "getAriaPosInset"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps5(processedItem, index) {
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- tabindex: -1
- }, this.getPTOptions("itemLink", processedItem, index)),
- icon: mergeProps({
- "class": [this.cx("itemIcon"), this.getItemProp(processedItem, "icon")]
- }, this.getPTOptions("itemIcon", processedItem, index)),
- label: mergeProps({
- "class": this.cx("itemLabel")
- }, this.getPTOptions("itemLabel", processedItem, index)),
- submenuicon: mergeProps({
- "class": this.cx("submenuIcon")
- }, this.getPTOptions("submenuicon", processedItem, index))
- };
- }, "getMenuItemProps")
- },
- components: {
- ChevronRightIcon: script$1i,
- ChevronDownIcon: script$1h
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$1$2 = ["tabindex"];
-var _hoisted_2$1$1 = ["id", "aria-label", "aria-expanded", "aria-level", "aria-setsize", "aria-posinset", "data-p-focused", "data-p-disabled"];
-var _hoisted_3$1$1 = ["onClick", "onMousemove"];
-var _hoisted_4$1$1 = ["href", "target"];
-function render$2$1(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_PanelMenuSub = resolveComponent("PanelMenuSub", true);
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("ul", {
- "class": normalizeClass(_ctx.cx("submenu")),
- tabindex: $props.tabindex
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList($props.items, function(processedItem, index) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.getItemKey(processedItem)
- }, [$options.isItemVisible(processedItem) && !$options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: $options.getItemId(processedItem),
- "class": [_ctx.cx("item", {
- processedItem
- }), $options.getItemProp(processedItem, "class")],
- style: $options.getItemProp(processedItem, "style"),
- role: "treeitem",
- "aria-label": $options.getItemLabel(processedItem),
- "aria-expanded": $options.isItemGroup(processedItem) ? $options.isItemActive(processedItem) : void 0,
- "aria-level": $props.level + 1,
- "aria-setsize": $options.getAriaSetSize(),
- "aria-posinset": $options.getAriaPosInset(index),
- ref_for: true
- }, $options.getPTOptions("item", processedItem, index), {
- "data-p-focused": $options.isItemFocused(processedItem),
- "data-p-disabled": $options.isItemDisabled(processedItem)
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("itemContent"),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, processedItem);
- }, "onClick"),
- onMousemove: /* @__PURE__ */ __name(function onMousemove($event) {
- return $options.onItemMouseMove($event, processedItem);
- }, "onMousemove"),
- ref_for: true
- }, $options.getPTOptions("itemContent", processedItem, index)), [!$props.templates.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: $options.getItemProp(processedItem, "url"),
- "class": _ctx.cx("itemLink"),
- target: $options.getItemProp(processedItem, "target"),
- tabindex: "-1",
- ref_for: true
- }, $options.getPTOptions("itemLink", processedItem, index)), [$options.isItemGroup(processedItem) ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), mergeProps({
- key: 0,
- "class": _ctx.cx("submenuIcon"),
- active: $options.isItemActive(processedItem),
- ref_for: true
- }, $options.getPTOptions("submenuIcon", processedItem, index)), null, 16, ["class", "active"])) : (openBlock(), createBlock(resolveDynamicComponent($options.isItemActive(processedItem) ? "ChevronDownIcon" : "ChevronRightIcon"), mergeProps({
- key: 1,
- "class": _ctx.cx("submenuIcon"),
- ref_for: true
- }, $options.getPTOptions("submenuIcon", processedItem, index)), null, 16, ["class"]))], 64)) : createCommentVNode("", true), $props.templates.itemicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.itemicon), {
- key: 1,
- item: processedItem.item,
- "class": normalizeClass(_ctx.cx("itemIcon"))
- }, null, 8, ["item", "class"])) : $options.getItemProp(processedItem, "icon") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- "class": [_ctx.cx("itemIcon"), $options.getItemProp(processedItem, "icon")],
- ref_for: true
- }, $options.getPTOptions("itemIcon", processedItem, index)), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemLabel"),
- ref_for: true
- }, $options.getPTOptions("itemLabel", processedItem, index)), toDisplayString($options.getItemLabel(processedItem)), 17)], 16, _hoisted_4$1$1)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
- key: 1,
- item: processedItem.item,
- root: false,
- active: $options.isItemActive(processedItem),
- hasSubmenu: $options.isItemGroup(processedItem),
- label: $options.getItemLabel(processedItem),
- props: $options.getMenuItemProps(processedItem, index)
- }, null, 8, ["item", "active", "hasSubmenu", "label", "props"]))], 16, _hoisted_3$1$1), createVNode(Transition, mergeProps({
- name: "p-toggleable-content",
- ref_for: true
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [withDirectives(createBaseVNode("div", mergeProps({
- "class": _ctx.cx("contentContainer"),
- ref_for: true
- }, _ctx.ptm("contentContainer")), [$options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_PanelMenuSub, mergeProps({
- key: 0,
- id: $options.getItemId(processedItem) + "_list",
- role: "group",
- panelId: $props.panelId,
- focusedItemId: $props.focusedItemId,
- items: processedItem.items,
- level: $props.level + 1,
- templates: $props.templates,
- activeItemPath: $props.activeItemPath,
- onItemToggle: $options.onItemToggle,
- onItemMousemove: _cache[0] || (_cache[0] = function($event) {
- return _ctx.$emit("item-mousemove", $event);
- }),
- pt: _ctx.pt,
- unstyled: _ctx.unstyled,
- ref_for: true
- }, _ctx.ptm("submenu")), null, 16, ["id", "panelId", "focusedItemId", "items", "level", "templates", "activeItemPath", "onItemToggle", "pt", "unstyled"])) : createCommentVNode("", true)], 16), [[vShow, $options.isItemActive(processedItem)]])];
- }),
- _: 2
- }, 1040)], 16, _hoisted_2$1$1)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
- key: 1,
- style: $options.getItemProp(processedItem, "style"),
- "class": [_ctx.cx("separator"), $options.getItemProp(processedItem, "class")],
- role: "separator",
- ref_for: true
- }, _ctx.ptm("separator")), null, 16)) : createCommentVNode("", true)], 64);
- }), 128))], 10, _hoisted_1$1$2);
-}
-__name(render$2$1, "render$2$1");
-script$2$1.render = render$2$1;
-function _slicedToArray(r, e) {
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$5(r, e) || _nonIterableRest();
-}
-__name(_slicedToArray, "_slicedToArray");
-function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableRest, "_nonIterableRest");
-function _unsupportedIterableToArray$5(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$5(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$5(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$5, "_unsupportedIterableToArray$5");
-function _arrayLikeToArray$5(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$5, "_arrayLikeToArray$5");
-function _iterableToArrayLimit(r, l) {
- var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t2) {
- var e, n, i, u, a = [], f = true, o = false;
- try {
- if (i = (t2 = t2.call(r)).next, 0 === l) ;
- else for (; !(f = (e = i.call(t2)).done) && (a.push(e.value), a.length !== l); f = true) ;
- } catch (r2) {
- o = true, n = r2;
- } finally {
- try {
- if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
- } finally {
- if (o) throw n;
- }
- }
- return a;
- }
-}
-__name(_iterableToArrayLimit, "_iterableToArrayLimit");
-function _arrayWithHoles(r) {
- if (Array.isArray(r)) return r;
-}
-__name(_arrayWithHoles, "_arrayWithHoles");
-var script$1$e = {
- name: "PanelMenuList",
- hostName: "PanelMenu",
- "extends": script$1f,
- emits: ["item-toggle", "header-focus"],
- props: {
- panelId: {
- type: String,
- "default": null
- },
- items: {
- type: Array,
- "default": null
- },
- templates: {
- type: Object,
- "default": null
- },
- expandedKeys: {
- type: Object,
- "default": null
- }
- },
- searchTimeout: null,
- searchValue: null,
- data: /* @__PURE__ */ __name(function data24() {
- return {
- focused: false,
- focusedItem: null,
- activeItemPath: []
- };
- }, "data"),
- watch: {
- expandedKeys: /* @__PURE__ */ __name(function expandedKeys(newValue) {
- this.autoUpdateActiveItemPath(newValue);
- }, "expandedKeys")
- },
- mounted: /* @__PURE__ */ __name(function mounted26() {
- this.autoUpdateActiveItemPath(this.expandedKeys);
- }, "mounted"),
- methods: {
- getItemProp: /* @__PURE__ */ __name(function getItemProp6(processedItem, name4) {
- return processedItem && processedItem.item ? resolve(processedItem.item[name4]) : void 0;
- }, "getItemProp"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel4(processedItem) {
- return this.getItemProp(processedItem, "label");
- }, "getItemLabel"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible4(processedItem) {
- return this.getItemProp(processedItem, "visible") !== false;
- }, "isItemVisible"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled4(processedItem) {
- return this.getItemProp(processedItem, "disabled");
- }, "isItemDisabled"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive5(processedItem) {
- return this.activeItemPath.some(function(path) {
- return path.key === processedItem.parentKey;
- });
- }, "isItemActive"),
- isItemGroup: /* @__PURE__ */ __name(function isItemGroup4(processedItem) {
- return isNotEmpty(processedItem.items);
- }, "isItemGroup"),
- onFocus: /* @__PURE__ */ __name(function onFocus10(event2) {
- this.focused = true;
- this.focusedItem = this.focusedItem || (this.isElementInPanel(event2, event2.relatedTarget) ? this.findFirstItem() : this.findLastItem());
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur10() {
- this.focused = false;
- this.focusedItem = null;
- this.searchValue = "";
- }, "onBlur"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown10(event2) {
- var metaKey = event2.metaKey || event2.ctrlKey;
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "ArrowLeft":
- this.onArrowLeftKey(event2);
- break;
- case "ArrowRight":
- this.onArrowRightKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Space":
- this.onSpaceKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Escape":
- case "Tab":
- case "PageDown":
- case "PageUp":
- case "Backspace":
- case "ShiftLeft":
- case "ShiftRight":
- break;
- default:
- if (!metaKey && isPrintableCharacter(event2.key)) {
- this.searchItems(event2, event2.key);
- }
- break;
- }
- }, "onKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey7(event2) {
- var processedItem = isNotEmpty(this.focusedItem) ? this.findNextItem(this.focusedItem) : this.findFirstItem();
- this.changeFocusedItem({
- originalEvent: event2,
- processedItem,
- focusOnNext: true
- });
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey7(event2) {
- var processedItem = isNotEmpty(this.focusedItem) ? this.findPrevItem(this.focusedItem) : this.findLastItem();
- this.changeFocusedItem({
- originalEvent: event2,
- processedItem,
- selfCheck: true
- });
- event2.preventDefault();
- }, "onArrowUpKey"),
- onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey4(event2) {
- var _this = this;
- if (isNotEmpty(this.focusedItem)) {
- var matched = this.activeItemPath.some(function(p) {
- return p.key === _this.focusedItem.key;
- });
- if (matched) {
- this.activeItemPath = this.activeItemPath.filter(function(p) {
- return p.key !== _this.focusedItem.key;
- });
- } else {
- this.focusedItem = isNotEmpty(this.focusedItem.parent) ? this.focusedItem.parent : this.focusedItem;
- }
- event2.preventDefault();
- }
- }, "onArrowLeftKey"),
- onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey3(event2) {
- var _this2 = this;
- if (isNotEmpty(this.focusedItem)) {
- var grouped = this.isItemGroup(this.focusedItem);
- if (grouped) {
- var matched = this.activeItemPath.some(function(p) {
- return p.key === _this2.focusedItem.key;
- });
- if (matched) {
- this.onArrowDownKey(event2);
- } else {
- this.activeItemPath = this.activeItemPath.filter(function(p) {
- return p.parentKey !== _this2.focusedItem.parentKey;
- });
- this.activeItemPath.push(this.focusedItem);
- }
- }
- event2.preventDefault();
- }
- }, "onArrowRightKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey7(event2) {
- this.changeFocusedItem({
- originalEvent: event2,
- processedItem: this.findFirstItem(),
- allowHeaderFocus: false
- });
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey7(event2) {
- this.changeFocusedItem({
- originalEvent: event2,
- processedItem: this.findLastItem(),
- focusOnNext: true,
- allowHeaderFocus: false
- });
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey6(event2) {
- if (isNotEmpty(this.focusedItem)) {
- var element = findSingle(this.$el, 'li[id="'.concat("".concat(this.focusedItemId), '"]'));
- var anchorElement = element && (findSingle(element, '[data-pc-section="itemlink"]') || findSingle(element, "a,button"));
- anchorElement ? anchorElement.click() : element && element.click();
- }
- event2.preventDefault();
- }, "onEnterKey"),
- onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey5(event2) {
- this.onEnterKey(event2);
- }, "onSpaceKey"),
- onItemToggle: /* @__PURE__ */ __name(function onItemToggle2(event2) {
- var processedItem = event2.processedItem, expanded3 = event2.expanded;
- if (this.expandedKeys) {
- this.$emit("item-toggle", {
- item: processedItem.item,
- expanded: expanded3
- });
- } else {
- this.activeItemPath = this.activeItemPath.filter(function(p) {
- return p.parentKey !== processedItem.parentKey;
- });
- expanded3 && this.activeItemPath.push(processedItem);
- }
- this.focusedItem = processedItem;
- focus(this.$el);
- }, "onItemToggle"),
- onItemMouseMove: /* @__PURE__ */ __name(function onItemMouseMove3(event2) {
- if (this.focused) {
- this.focusedItem = event2.processedItem;
- }
- }, "onItemMouseMove"),
- isElementInPanel: /* @__PURE__ */ __name(function isElementInPanel(event2, element) {
- var panel2 = event2.currentTarget.closest('[data-pc-section="panel"]');
- return panel2 && panel2.contains(element);
- }, "isElementInPanel"),
- isItemMatched: /* @__PURE__ */ __name(function isItemMatched2(processedItem) {
- var _this$getItemLabel;
- return this.isValidItem(processedItem) && ((_this$getItemLabel = this.getItemLabel(processedItem)) === null || _this$getItemLabel === void 0 ? void 0 : _this$getItemLabel.toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale)));
- }, "isItemMatched"),
- isVisibleItem: /* @__PURE__ */ __name(function isVisibleItem(processedItem) {
- return !!processedItem && (processedItem.level === 0 || this.isItemActive(processedItem)) && this.isItemVisible(processedItem);
- }, "isVisibleItem"),
- isValidItem: /* @__PURE__ */ __name(function isValidItem2(processedItem) {
- return !!processedItem && !this.isItemDisabled(processedItem) && !this.getItemProp(processedItem, "separator");
- }, "isValidItem"),
- findFirstItem: /* @__PURE__ */ __name(function findFirstItem() {
- var _this3 = this;
- return this.visibleItems.find(function(processedItem) {
- return _this3.isValidItem(processedItem);
- });
- }, "findFirstItem"),
- findLastItem: /* @__PURE__ */ __name(function findLastItem() {
- var _this4 = this;
- return findLast(this.visibleItems, function(processedItem) {
- return _this4.isValidItem(processedItem);
- });
- }, "findLastItem"),
- findNextItem: /* @__PURE__ */ __name(function findNextItem(processedItem) {
- var _this5 = this;
- var index = this.visibleItems.findIndex(function(item8) {
- return item8.key === processedItem.key;
- });
- var matchedItem = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).find(function(pItem) {
- return _this5.isValidItem(pItem);
- }) : void 0;
- return matchedItem || processedItem;
- }, "findNextItem"),
- findPrevItem: /* @__PURE__ */ __name(function findPrevItem(processedItem) {
- var _this6 = this;
- var index = this.visibleItems.findIndex(function(item8) {
- return item8.key === processedItem.key;
- });
- var matchedItem = index > 0 ? findLast(this.visibleItems.slice(0, index), function(pItem) {
- return _this6.isValidItem(pItem);
- }) : void 0;
- return matchedItem || processedItem;
- }, "findPrevItem"),
- searchItems: /* @__PURE__ */ __name(function searchItems2(event2, _char) {
- var _this7 = this;
- this.searchValue = (this.searchValue || "") + _char;
- var matchedItem = null;
- var matched = false;
- if (isNotEmpty(this.focusedItem)) {
- var focusedItemIndex = this.visibleItems.findIndex(function(processedItem) {
- return processedItem.key === _this7.focusedItem.key;
- });
- matchedItem = this.visibleItems.slice(focusedItemIndex).find(function(processedItem) {
- return _this7.isItemMatched(processedItem);
- });
- matchedItem = isEmpty(matchedItem) ? this.visibleItems.slice(0, focusedItemIndex).find(function(processedItem) {
- return _this7.isItemMatched(processedItem);
- }) : matchedItem;
- } else {
- matchedItem = this.visibleItems.find(function(processedItem) {
- return _this7.isItemMatched(processedItem);
- });
- }
- if (isNotEmpty(matchedItem)) {
- matched = true;
- }
- if (isEmpty(matchedItem) && isEmpty(this.focusedItem)) {
- matchedItem = this.findFirstItem();
- }
- if (isNotEmpty(matchedItem)) {
- this.changeFocusedItem({
- originalEvent: event2,
- processedItem: matchedItem,
- allowHeaderFocus: false
- });
- }
- if (this.searchTimeout) {
- clearTimeout(this.searchTimeout);
- }
- this.searchTimeout = setTimeout(function() {
- _this7.searchValue = "";
- _this7.searchTimeout = null;
- }, 500);
- return matched;
- }, "searchItems"),
- changeFocusedItem: /* @__PURE__ */ __name(function changeFocusedItem(event2) {
- var originalEvent = event2.originalEvent, processedItem = event2.processedItem, focusOnNext = event2.focusOnNext, selfCheck = event2.selfCheck, _event$allowHeaderFoc = event2.allowHeaderFocus, allowHeaderFocus = _event$allowHeaderFoc === void 0 ? true : _event$allowHeaderFoc;
- if (isNotEmpty(this.focusedItem) && this.focusedItem.key !== processedItem.key) {
- this.focusedItem = processedItem;
- this.scrollInView();
- } else if (allowHeaderFocus) {
- this.$emit("header-focus", {
- originalEvent,
- focusOnNext,
- selfCheck
- });
- }
- }, "changeFocusedItem"),
- scrollInView: /* @__PURE__ */ __name(function scrollInView5() {
- var element = findSingle(this.$el, 'li[id="'.concat("".concat(this.focusedItemId), '"]'));
- if (element) {
- element.scrollIntoView && element.scrollIntoView({
- block: "nearest",
- inline: "start"
- });
- }
- }, "scrollInView"),
- autoUpdateActiveItemPath: /* @__PURE__ */ __name(function autoUpdateActiveItemPath(expandedKeys4) {
- var _this8 = this;
- this.activeItemPath = Object.entries(expandedKeys4 || {}).reduce(function(acc, _ref) {
- var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], val = _ref2[1];
- if (val) {
- var processedItem = _this8.findProcessedItemByItemKey(key);
- processedItem && acc.push(processedItem);
- }
- return acc;
- }, []);
- }, "autoUpdateActiveItemPath"),
- findProcessedItemByItemKey: /* @__PURE__ */ __name(function findProcessedItemByItemKey(key, processedItems3) {
- var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
- processedItems3 = processedItems3 || level === 0 && this.processedItems;
- if (!processedItems3) return null;
- for (var i = 0; i < processedItems3.length; i++) {
- var processedItem = processedItems3[i];
- if (this.getItemProp(processedItem, "key") === key) return processedItem;
- var matchedItem = this.findProcessedItemByItemKey(key, processedItem.items, level + 1);
- if (matchedItem) return matchedItem;
- }
- }, "findProcessedItemByItemKey"),
- createProcessedItems: /* @__PURE__ */ __name(function createProcessedItems2(items2) {
- var _this9 = this;
- var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- var parent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- var parentKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
- var processedItems3 = [];
- items2 && items2.forEach(function(item8, index) {
- var key = (parentKey !== "" ? parentKey + "_" : "") + index;
- var newItem = {
- item: item8,
- index,
- level,
- key,
- parent,
- parentKey
- };
- newItem["items"] = _this9.createProcessedItems(item8.items, level + 1, newItem, key);
- processedItems3.push(newItem);
- });
- return processedItems3;
- }, "createProcessedItems"),
- flatItems: /* @__PURE__ */ __name(function flatItems(processedItems3) {
- var _this10 = this;
- var processedFlattenItems = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
- processedItems3 && processedItems3.forEach(function(processedItem) {
- if (_this10.isVisibleItem(processedItem)) {
- processedFlattenItems.push(processedItem);
- _this10.flatItems(processedItem.items, processedFlattenItems);
- }
- });
- return processedFlattenItems;
- }, "flatItems")
- },
- computed: {
- processedItems: /* @__PURE__ */ __name(function processedItems2() {
- return this.createProcessedItems(this.items || []);
- }, "processedItems"),
- visibleItems: /* @__PURE__ */ __name(function visibleItems2() {
- return this.flatItems(this.processedItems);
- }, "visibleItems"),
- focusedItemId: /* @__PURE__ */ __name(function focusedItemId2() {
- return isNotEmpty(this.focusedItem) ? "".concat(this.panelId, "_").concat(this.focusedItem.key) : null;
- }, "focusedItemId")
- },
- components: {
- PanelMenuSub: script$2$1
- }
-};
-function render$1$1(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_PanelMenuSub = resolveComponent("PanelMenuSub");
- return openBlock(), createBlock(_component_PanelMenuSub, mergeProps({
- id: $props.panelId + "_list",
- "class": _ctx.cx("rootList"),
- role: "tree",
- tabindex: -1,
- "aria-activedescendant": $data.focused ? $options.focusedItemId : void 0,
- panelId: $props.panelId,
- focusedItemId: $data.focused ? $options.focusedItemId : void 0,
- items: $options.processedItems,
- templates: $props.templates,
- activeItemPath: $data.activeItemPath,
- onFocus: $options.onFocus,
- onBlur: $options.onBlur,
- onKeydown: $options.onKeyDown,
- onItemToggle: $options.onItemToggle,
- onItemMousemove: $options.onItemMouseMove,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, _ctx.ptm("rootList")), null, 16, ["id", "class", "aria-activedescendant", "panelId", "focusedItemId", "items", "templates", "activeItemPath", "onFocus", "onBlur", "onKeydown", "onItemToggle", "onItemMousemove", "pt", "unstyled"]);
-}
-__name(render$1$1, "render$1$1");
-script$1$e.render = render$1$1;
-function _typeof$b(o) {
- "@babel/helpers - typeof";
- return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$b(o);
-}
-__name(_typeof$b, "_typeof$b");
-function ownKeys$a(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$a, "ownKeys$a");
-function _objectSpread$a(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$a(Object(t2), true).forEach(function(r2) {
- _defineProperty$b(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$a(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$a, "_objectSpread$a");
-function _defineProperty$b(e, r, t2) {
- return (r = _toPropertyKey$b(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$b, "_defineProperty$b");
-function _toPropertyKey$b(t2) {
- var i = _toPrimitive$b(t2, "string");
- return "symbol" == _typeof$b(i) ? i : i + "";
-}
-__name(_toPropertyKey$b, "_toPropertyKey$b");
-function _toPrimitive$b(t2, r) {
- if ("object" != _typeof$b(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$b(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$b, "_toPrimitive$b");
-var script$p = {
- name: "PanelMenu",
- "extends": script$3$1,
- inheritAttrs: false,
- emits: ["update:expandedKeys", "panel-open", "panel-close"],
- data: /* @__PURE__ */ __name(function data25() {
- return {
- id: this.$attrs.id,
- activeItem: null,
- activeItems: []
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId9(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId")
- },
- mounted: /* @__PURE__ */ __name(function mounted27() {
- this.id = this.id || UniqueComponentId();
- }, "mounted"),
- methods: {
- getItemProp: /* @__PURE__ */ __name(function getItemProp7(item8, name4) {
- return item8 ? resolve(item8[name4]) : void 0;
- }, "getItemProp"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel5(item8) {
- return this.getItemProp(item8, "label");
- }, "getItemLabel"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions8(key, item8, index) {
- return this.ptm(key, {
- context: {
- index,
- active: this.isItemActive(item8),
- focused: this.isItemFocused(item8),
- disabled: this.isItemDisabled(item8)
- }
- });
- }, "getPTOptions"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive6(item8) {
- return this.expandedKeys ? this.expandedKeys[this.getItemProp(item8, "key")] : this.multiple ? this.activeItems.some(function(subItem) {
- return equals(item8, subItem);
- }) : equals(item8, this.activeItem);
- }, "isItemActive"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible5(item8) {
- return this.getItemProp(item8, "visible") !== false;
- }, "isItemVisible"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled5(item8) {
- return this.getItemProp(item8, "disabled");
- }, "isItemDisabled"),
- isItemFocused: /* @__PURE__ */ __name(function isItemFocused4(item8) {
- return equals(item8, this.activeItem);
- }, "isItemFocused"),
- isItemGroup: /* @__PURE__ */ __name(function isItemGroup5(item8) {
- return isNotEmpty(item8.items);
- }, "isItemGroup"),
- getPanelId: /* @__PURE__ */ __name(function getPanelId(index) {
- return "".concat(this.id, "_").concat(index);
- }, "getPanelId"),
- getPanelKey: /* @__PURE__ */ __name(function getPanelKey(index) {
- return this.getPanelId(index);
- }, "getPanelKey"),
- getHeaderId: /* @__PURE__ */ __name(function getHeaderId(index) {
- return "".concat(this.getPanelId(index), "_header");
- }, "getHeaderId"),
- getContentId: /* @__PURE__ */ __name(function getContentId(index) {
- return "".concat(this.getPanelId(index), "_content");
- }, "getContentId"),
- onHeaderClick: /* @__PURE__ */ __name(function onHeaderClick(event2, item8) {
- if (this.isItemDisabled(item8)) {
- event2.preventDefault();
- return;
- }
- if (item8.command) {
- item8.command({
- originalEvent: event2,
- item: item8
- });
- }
- this.changeActiveItem(event2, item8);
- focus(event2.currentTarget);
- }, "onHeaderClick"),
- onHeaderKeyDown: /* @__PURE__ */ __name(function onHeaderKeyDown(event2, item8) {
- switch (event2.code) {
- case "ArrowDown":
- this.onHeaderArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onHeaderArrowUpKey(event2);
- break;
- case "Home":
- this.onHeaderHomeKey(event2);
- break;
- case "End":
- this.onHeaderEndKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space":
- this.onHeaderEnterKey(event2, item8);
- break;
- }
- }, "onHeaderKeyDown"),
- onHeaderArrowDownKey: /* @__PURE__ */ __name(function onHeaderArrowDownKey(event2) {
- var rootList2 = getAttribute(event2.currentTarget, "data-p-active") === true ? findSingle(event2.currentTarget.nextElementSibling, '[data-pc-section="rootlist"]') : null;
- rootList2 ? focus(rootList2) : this.updateFocusedHeader({
- originalEvent: event2,
- focusOnNext: true
- });
- event2.preventDefault();
- }, "onHeaderArrowDownKey"),
- onHeaderArrowUpKey: /* @__PURE__ */ __name(function onHeaderArrowUpKey(event2) {
- var prevHeader = this.findPrevHeader(event2.currentTarget.parentElement) || this.findLastHeader();
- var rootList2 = getAttribute(prevHeader, "data-p-active") === true ? findSingle(prevHeader.nextElementSibling, '[data-pc-section="rootlist"]') : null;
- rootList2 ? focus(rootList2) : this.updateFocusedHeader({
- originalEvent: event2,
- focusOnNext: false
- });
- event2.preventDefault();
- }, "onHeaderArrowUpKey"),
- onHeaderHomeKey: /* @__PURE__ */ __name(function onHeaderHomeKey(event2) {
- this.changeFocusedHeader(event2, this.findFirstHeader());
- event2.preventDefault();
- }, "onHeaderHomeKey"),
- onHeaderEndKey: /* @__PURE__ */ __name(function onHeaderEndKey(event2) {
- this.changeFocusedHeader(event2, this.findLastHeader());
- event2.preventDefault();
- }, "onHeaderEndKey"),
- onHeaderEnterKey: /* @__PURE__ */ __name(function onHeaderEnterKey(event2, item8) {
- var headerAction = findSingle(event2.currentTarget, '[data-pc-section="headerlink"]');
- headerAction ? headerAction.click() : this.onHeaderClick(event2, item8);
- event2.preventDefault();
- }, "onHeaderEnterKey"),
- findNextHeader: /* @__PURE__ */ __name(function findNextHeader(panelElement) {
- var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var nextPanelElement = selfCheck ? panelElement : panelElement.nextElementSibling;
- var headerElement = findSingle(nextPanelElement, '[data-pc-section="header"]');
- return headerElement ? getAttribute(headerElement, "data-p-disabled") ? this.findNextHeader(headerElement.parentElement) : headerElement : null;
- }, "findNextHeader"),
- findPrevHeader: /* @__PURE__ */ __name(function findPrevHeader(panelElement) {
- var selfCheck = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- var prevPanelElement = selfCheck ? panelElement : panelElement.previousElementSibling;
- var headerElement = findSingle(prevPanelElement, '[data-pc-section="header"]');
- return headerElement ? getAttribute(headerElement, "data-p-disabled") ? this.findPrevHeader(headerElement.parentElement) : headerElement : null;
- }, "findPrevHeader"),
- findFirstHeader: /* @__PURE__ */ __name(function findFirstHeader() {
- return this.findNextHeader(this.$el.firstElementChild, true);
- }, "findFirstHeader"),
- findLastHeader: /* @__PURE__ */ __name(function findLastHeader() {
- return this.findPrevHeader(this.$el.lastElementChild, true);
- }, "findLastHeader"),
- updateFocusedHeader: /* @__PURE__ */ __name(function updateFocusedHeader(event2) {
- var originalEvent = event2.originalEvent, focusOnNext = event2.focusOnNext, selfCheck = event2.selfCheck;
- var panelElement = originalEvent.currentTarget.closest('[data-pc-section="panel"]');
- var header2 = selfCheck ? findSingle(panelElement, '[data-pc-section="header"]') : focusOnNext ? this.findNextHeader(panelElement) : this.findPrevHeader(panelElement);
- header2 ? this.changeFocusedHeader(originalEvent, header2) : focusOnNext ? this.onHeaderHomeKey(originalEvent) : this.onHeaderEndKey(originalEvent);
- }, "updateFocusedHeader"),
- changeActiveItem: /* @__PURE__ */ __name(function changeActiveItem(event2, item8) {
- var selfActive = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
- if (!this.isItemDisabled(item8)) {
- var active3 = this.isItemActive(item8);
- var eventName = !active3 ? "panel-open" : "panel-close";
- this.activeItem = selfActive ? item8 : this.activeItem && equals(item8, this.activeItem) ? null : item8;
- if (this.multiple) {
- if (this.activeItems.some(function(subItem) {
- return equals(item8, subItem);
- })) {
- this.activeItems = this.activeItems.filter(function(subItem) {
- return !equals(item8, subItem);
- });
- } else {
- this.activeItems.push(item8);
- }
- }
- this.changeExpandedKeys({
- item: item8,
- expanded: !active3
- });
- this.$emit(eventName, {
- originalEvent: event2,
- item: item8
- });
- }
- }, "changeActiveItem"),
- changeExpandedKeys: /* @__PURE__ */ __name(function changeExpandedKeys(_ref) {
- var item8 = _ref.item, _ref$expanded = _ref.expanded, expanded3 = _ref$expanded === void 0 ? false : _ref$expanded;
- if (this.expandedKeys) {
- var _keys = _objectSpread$a({}, this.expandedKeys);
- if (expanded3) _keys[item8.key] = true;
- else delete _keys[item8.key];
- this.$emit("update:expandedKeys", _keys);
- }
- }, "changeExpandedKeys"),
- changeFocusedHeader: /* @__PURE__ */ __name(function changeFocusedHeader(event2, element) {
- element && focus(element);
- }, "changeFocusedHeader"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps6(item8, index) {
- return {
- icon: mergeProps({
- "class": [this.cx("headerIcon"), this.getItemProp(item8, "icon")]
- }, this.getPTOptions("headerIcon", item8, index)),
- label: mergeProps({
- "class": this.cx("headerLabel")
- }, this.getPTOptions("headerLabel", item8, index))
- };
- }, "getMenuItemProps")
- },
- components: {
- PanelMenuList: script$1$e,
- ChevronRightIcon: script$1i,
- ChevronDownIcon: script$1h
- }
-};
-var _hoisted_1$d = ["id"];
-var _hoisted_2$9 = ["id", "tabindex", "aria-label", "aria-expanded", "aria-controls", "aria-disabled", "onClick", "onKeydown", "data-p-active", "data-p-disabled"];
-var _hoisted_3$6 = ["href"];
-var _hoisted_4$4 = ["id", "aria-labelledby"];
-function render$m(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_PanelMenuList = resolveComponent("PanelMenuList");
- return openBlock(), createElementBlock("div", mergeProps({
- id: $data.id,
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, index) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.getPanelKey(index)
- }, [$options.isItemVisible(item8) ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- style: $options.getItemProp(item8, "style"),
- "class": [_ctx.cx("panel"), $options.getItemProp(item8, "class")],
- ref_for: true
- }, _ctx.ptm("panel")), [createBaseVNode("div", mergeProps({
- id: $options.getHeaderId(index),
- "class": [_ctx.cx("header", {
- item: item8
- }), $options.getItemProp(item8, "headerClass")],
- tabindex: $options.isItemDisabled(item8) ? -1 : _ctx.tabindex,
- role: "button",
- "aria-label": $options.getItemLabel(item8),
- "aria-expanded": $options.isItemActive(item8),
- "aria-controls": $options.getContentId(index),
- "aria-disabled": $options.isItemDisabled(item8),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onHeaderClick($event, item8);
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onHeaderKeyDown($event, item8);
- }, "onKeydown"),
- ref_for: true
- }, $options.getPTOptions("header", item8, index), {
- "data-p-active": $options.isItemActive(item8),
- "data-p-disabled": $options.isItemDisabled(item8)
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("headerContent"),
- ref_for: true
- }, $options.getPTOptions("headerContent", item8, index)), [!_ctx.$slots.item ? (openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- href: $options.getItemProp(item8, "url"),
- "class": _ctx.cx("headerLink"),
- tabindex: -1,
- ref_for: true
- }, $options.getPTOptions("headerLink", item8, index)), [$options.getItemProp(item8, "items") ? renderSlot(_ctx.$slots, "submenuicon", {
- key: 0,
- active: $options.isItemActive(item8)
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($options.isItemActive(item8) ? "ChevronDownIcon" : "ChevronRightIcon"), mergeProps({
- "class": _ctx.cx("submenuIcon"),
- ref_for: true
- }, $options.getPTOptions("submenuIcon", item8, index)), null, 16, ["class"]))];
- }) : createCommentVNode("", true), _ctx.$slots.headericon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.headericon), {
- key: 1,
- item: item8,
- "class": normalizeClass([_ctx.cx("headerIcon"), $options.getItemProp(item8, "icon")])
- }, null, 8, ["item", "class"])) : $options.getItemProp(item8, "icon") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 2,
- "class": [_ctx.cx("headerIcon"), $options.getItemProp(item8, "icon")],
- ref_for: true
- }, $options.getPTOptions("headerIcon", item8, index)), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("headerLabel"),
- ref_for: true
- }, $options.getPTOptions("headerLabel", item8, index)), toDisplayString($options.getItemLabel(item8)), 17)], 16, _hoisted_3$6)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.item), {
- key: 1,
- item: item8,
- root: true,
- active: $options.isItemActive(item8),
- hasSubmenu: $options.isItemGroup(item8),
- label: $options.getItemLabel(item8),
- props: $options.getMenuItemProps(item8, index)
- }, null, 8, ["item", "active", "hasSubmenu", "label", "props"]))], 16)], 16, _hoisted_2$9), createVNode(Transition, mergeProps({
- name: "p-toggleable-content",
- ref_for: true
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [withDirectives(createBaseVNode("div", mergeProps({
- id: $options.getContentId(index),
- "class": _ctx.cx("contentContainer"),
- role: "region",
- "aria-labelledby": $options.getHeaderId(index),
- ref_for: true
- }, _ctx.ptm("contentContainer")), [$options.getItemProp(item8, "items") ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("content"),
- ref_for: true
- }, _ctx.ptm("content")), [createVNode(_component_PanelMenuList, {
- panelId: $options.getPanelId(index),
- items: $options.getItemProp(item8, "items"),
- templates: _ctx.$slots,
- expandedKeys: _ctx.expandedKeys,
- onItemToggle: $options.changeExpandedKeys,
- onHeaderFocus: $options.updateFocusedHeader,
- pt: _ctx.pt,
- unstyled: _ctx.unstyled
- }, null, 8, ["panelId", "items", "templates", "expandedKeys", "onItemToggle", "onHeaderFocus", "pt", "unstyled"])], 16)) : createCommentVNode("", true)], 16, _hoisted_4$4), [[vShow, $options.isItemActive(item8)]])];
- }),
- _: 2
- }, 1040)], 16)) : createCommentVNode("", true)], 64);
- }), 128))], 16, _hoisted_1$d);
-}
-__name(render$m, "render$m");
-script$p.render = render$m;
-var script$o = {
- name: "EyeSlashIcon",
- "extends": script$1j
-};
-function render$l(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M13.9414 6.74792C13.9437 6.75295 13.9455 6.757 13.9469 6.76003C13.982 6.8394 14.0001 6.9252 14.0001 7.01195C14.0001 7.0987 13.982 7.1845 13.9469 7.26386C13.6004 8.00059 13.1711 8.69549 12.6674 9.33515C12.6115 9.4071 12.54 9.46538 12.4582 9.50556C12.3765 9.54574 12.2866 9.56678 12.1955 9.56707C12.0834 9.56671 11.9737 9.53496 11.8788 9.47541C11.7838 9.41586 11.7074 9.3309 11.6583 9.23015C11.6092 9.12941 11.5893 9.01691 11.6008 8.90543C11.6124 8.79394 11.6549 8.68793 11.7237 8.5994C12.1065 8.09726 12.4437 7.56199 12.7313 6.99995C12.2595 6.08027 10.3402 2.8014 6.99732 2.8014C6.63723 2.80218 6.27816 2.83969 5.92569 2.91336C5.77666 2.93304 5.62568 2.89606 5.50263 2.80972C5.37958 2.72337 5.29344 2.59398 5.26125 2.44714C5.22907 2.30031 5.2532 2.14674 5.32885 2.01685C5.40451 1.88696 5.52618 1.79021 5.66978 1.74576C6.10574 1.64961 6.55089 1.60134 6.99732 1.60181C11.5916 1.60181 13.7864 6.40856 13.9414 6.74792ZM2.20333 1.61685C2.35871 1.61411 2.5091 1.67179 2.6228 1.77774L12.2195 11.3744C12.3318 11.4869 12.3949 11.6393 12.3949 11.7983C12.3949 11.9572 12.3318 12.1097 12.2195 12.2221C12.107 12.3345 11.9546 12.3976 11.7956 12.3976C11.6367 12.3976 11.4842 12.3345 11.3718 12.2221L10.5081 11.3584C9.46549 12.0426 8.24432 12.4042 6.99729 12.3981C2.403 12.3981 0.208197 7.59135 0.0532336 7.25198C0.0509364 7.24694 0.0490875 7.2429 0.0476856 7.23986C0.0162332 7.16518 3.05176e-05 7.08497 3.05176e-05 7.00394C3.05176e-05 6.92291 0.0162332 6.8427 0.0476856 6.76802C0.631261 5.47831 1.46902 4.31959 2.51084 3.36119L1.77509 2.62545C1.66914 2.51175 1.61146 2.36136 1.61421 2.20597C1.61695 2.05059 1.6799 1.90233 1.78979 1.79244C1.89968 1.68254 2.04794 1.6196 2.20333 1.61685ZM7.45314 8.35147L5.68574 6.57609V6.5361C5.5872 6.78938 5.56498 7.06597 5.62183 7.33173C5.67868 7.59749 5.8121 7.84078 6.00563 8.03158C6.19567 8.21043 6.43052 8.33458 6.68533 8.39089C6.94014 8.44721 7.20543 8.43359 7.45314 8.35147ZM1.26327 6.99994C1.7351 7.91163 3.64645 11.1985 6.99729 11.1985C7.9267 11.2048 8.8408 10.9618 9.64438 10.4947L8.35682 9.20718C7.86027 9.51441 7.27449 9.64491 6.69448 9.57752C6.11446 9.51014 5.57421 9.24881 5.16131 8.83592C4.74842 8.42303 4.4871 7.88277 4.41971 7.30276C4.35232 6.72274 4.48282 6.13697 4.79005 5.64041L3.35855 4.2089C2.4954 5.00336 1.78523 5.94935 1.26327 6.99994Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$l, "render$l");
-script$o.render = render$l;
-var theme$c = /* @__PURE__ */ __name(function theme27(_ref) {
- var dt = _ref.dt;
- return "\n.p-password {\n display: inline-flex;\n position: relative;\n}\n\n.p-password .p-password-overlay {\n min-width: 100%;\n}\n\n.p-password-meter {\n height: ".concat(dt("password.meter.height"), ";\n background: ").concat(dt("password.meter.background"), ";\n border-radius: ").concat(dt("password.meter.border.radius"), ";\n}\n\n.p-password-meter-label {\n height: 100%;\n width: 0;\n transition: width 1s ease-in-out;\n border-radius: ").concat(dt("password.meter.border.radius"), ";\n}\n\n.p-password-meter-weak {\n background: ").concat(dt("password.strength.weak.background"), ";\n}\n\n.p-password-meter-medium {\n background: ").concat(dt("password.strength.medium.background"), ";\n}\n\n.p-password-meter-strong {\n background: ").concat(dt("password.strength.strong.background"), ";\n}\n\n.p-password-fluid {\n display: flex;\n}\n\n.p-password-fluid .p-password-input {\n width: 100%;\n}\n\n.p-password-input::-ms-reveal,\n.p-password-input::-ms-clear {\n display: none;\n}\n\n.p-password-overlay {\n padding: ").concat(dt("password.overlay.padding"), ";\n background: ").concat(dt("password.overlay.background"), ";\n color: ").concat(dt("password.overlay.color"), ";\n border: 1px solid ").concat(dt("password.overlay.border.color"), ";\n box-shadow: ").concat(dt("password.overlay.shadow"), ";\n border-radius: ").concat(dt("password.overlay.border.radius"), ";\n}\n\n.p-password-content {\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("password.content.gap"), ";\n}\n\n.p-password-toggle-mask-icon {\n inset-inline-end: ").concat(dt("form.field.padding.x"), ";\n color: ").concat(dt("password.icon.color"), ";\n position: absolute;\n top: 50%;\n margin-top: calc(-1 * calc(").concat(dt("icon.size"), " / 2));\n width: ").concat(dt("icon.size"), ";\n height: ").concat(dt("icon.size"), ";\n}\n\n.p-password:has(.p-password-toggle-mask-icon) .p-password-input {\n padding-inline-end: calc((").concat(dt("form.field.padding.x"), " * 2) + ").concat(dt("icon.size"), ");\n}\n");
-}, "theme");
-var inlineStyles$4 = {
- root: /* @__PURE__ */ __name(function root21(_ref2) {
- var props = _ref2.props;
- return {
- position: props.appendTo === "self" ? "relative" : void 0
- };
- }, "root")
-};
-var classes$d = {
- root: /* @__PURE__ */ __name(function root22(_ref3) {
- var instance = _ref3.instance;
- return ["p-password p-component p-inputwrapper", {
- "p-inputwrapper-filled": instance.$filled,
- "p-inputwrapper-focus": instance.focused,
- "p-password-fluid": instance.$fluid
- }];
- }, "root"),
- pcInputText: "p-password-input",
- maskIcon: "p-password-toggle-mask-icon p-password-mask-icon",
- unmaskIcon: "p-password-toggle-mask-icon p-password-unmask-icon",
- overlay: "p-password-overlay p-component",
- content: "p-password-content",
- meter: "p-password-meter",
- meterLabel: /* @__PURE__ */ __name(function meterLabel(_ref4) {
- var instance = _ref4.instance;
- return "p-password-meter-label ".concat(instance.meter ? "p-password-meter-" + instance.meter.strength : "");
- }, "meterLabel"),
- meterText: "p-password-meter-text"
-};
-var PasswordStyle = BaseStyle.extend({
- name: "password",
- theme: theme$c,
- classes: classes$d,
- inlineStyles: inlineStyles$4
-});
-var script$1$d = {
- name: "BasePassword",
- "extends": script$1k,
- props: {
- promptLabel: {
- type: String,
- "default": null
- },
- mediumRegex: {
- type: [String, RegExp],
- "default": "^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"
- // eslint-disable-line
- },
- strongRegex: {
- type: [String, RegExp],
- "default": "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})"
- // eslint-disable-line
- },
- weakLabel: {
- type: String,
- "default": null
- },
- mediumLabel: {
- type: String,
- "default": null
- },
- strongLabel: {
- type: String,
- "default": null
- },
- feedback: {
- type: Boolean,
- "default": true
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- toggleMask: {
- type: Boolean,
- "default": false
- },
- hideIcon: {
- type: String,
- "default": void 0
- },
- maskIcon: {
- type: String,
- "default": void 0
- },
- showIcon: {
- type: String,
- "default": void 0
- },
- unmaskIcon: {
- type: String,
- "default": void 0
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- placeholder: {
- type: String,
- "default": null
- },
- required: {
- type: Boolean,
- "default": false
- },
- inputId: {
- type: String,
- "default": null
- },
- inputClass: {
- type: [String, Object],
- "default": null
- },
- inputStyle: {
- type: Object,
- "default": null
- },
- inputProps: {
- type: null,
- "default": null
- },
- panelId: {
- type: String,
- "default": null
- },
- panelClass: {
- type: [String, Object],
- "default": null
- },
- panelStyle: {
- type: Object,
- "default": null
- },
- panelProps: {
- type: null,
- "default": null
- },
- overlayId: {
- type: String,
- "default": null
- },
- overlayClass: {
- type: [String, Object],
- "default": null
- },
- overlayStyle: {
- type: Object,
- "default": null
- },
- overlayProps: {
- type: null,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- autofocus: {
- type: Boolean,
- "default": null
- }
- },
- style: PasswordStyle,
- provide: /* @__PURE__ */ __name(function provide37() {
- return {
- $pcPassword: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$n = {
- name: "Password",
- "extends": script$1$d,
- inheritAttrs: false,
- emits: ["change", "focus", "blur", "invalid"],
- inject: {
- $pcFluid: {
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data26() {
- return {
- id: this.$attrs.id,
- overlayVisible: false,
- meter: null,
- infoText: null,
- focused: false,
- unmasked: false
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId10(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId")
- },
- mediumCheckRegExp: null,
- strongCheckRegExp: null,
- resizeListener: null,
- scrollHandler: null,
- overlay: null,
- mounted: /* @__PURE__ */ __name(function mounted28() {
- this.id = this.id || UniqueComponentId();
- this.infoText = this.promptText;
- this.mediumCheckRegExp = new RegExp(this.mediumRegex);
- this.strongCheckRegExp = new RegExp(this.strongRegex);
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount11() {
- this.unbindResizeListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- if (this.overlay) {
- ZIndex.clear(this.overlay);
- this.overlay = null;
- }
- }, "beforeUnmount"),
- methods: {
- onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter4(el) {
- ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
- addStyle(el, {
- position: "absolute",
- top: "0",
- left: "0"
- });
- this.alignOverlay();
- this.bindScrollListener();
- this.bindResizeListener();
- }, "onOverlayEnter"),
- onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave4() {
- this.unbindScrollListener();
- this.unbindResizeListener();
- this.overlay = null;
- }, "onOverlayLeave"),
- onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave4(el) {
- ZIndex.clear(el);
- }, "onOverlayAfterLeave"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay5() {
- if (this.appendTo === "self") {
- relativePosition(this.overlay, this.$refs.input.$el);
- } else {
- this.overlay.style.minWidth = getOuterWidth(this.$refs.input.$el) + "px";
- absolutePosition(this.overlay, this.$refs.input.$el);
- }
- }, "alignOverlay"),
- testStrength: /* @__PURE__ */ __name(function testStrength(str) {
- var level = 0;
- if (this.strongCheckRegExp.test(str)) level = 3;
- else if (this.mediumCheckRegExp.test(str)) level = 2;
- else if (str.length) level = 1;
- return level;
- }, "testStrength"),
- onInput: /* @__PURE__ */ __name(function onInput5(event2) {
- this.writeValue(event2.target.value, event2);
- this.$emit("change", event2);
- }, "onInput"),
- onFocus: /* @__PURE__ */ __name(function onFocus11(event2) {
- this.focused = true;
- if (this.feedback) {
- this.setPasswordMeter(this.d_value);
- this.overlayVisible = true;
- }
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur11(event2) {
- this.focused = false;
- if (this.feedback) {
- this.overlayVisible = false;
- }
- this.$emit("blur", event2);
- }, "onBlur"),
- onKeyUp: /* @__PURE__ */ __name(function onKeyUp(event2) {
- if (this.feedback) {
- var value2 = event2.target.value;
- var _this$checkPasswordSt = this.checkPasswordStrength(value2), meter = _this$checkPasswordSt.meter, label12 = _this$checkPasswordSt.label;
- this.meter = meter;
- this.infoText = label12;
- if (event2.code === "Escape") {
- this.overlayVisible && (this.overlayVisible = false);
- return;
- }
- if (!this.overlayVisible) {
- this.overlayVisible = true;
- }
- }
- }, "onKeyUp"),
- setPasswordMeter: /* @__PURE__ */ __name(function setPasswordMeter() {
- if (!this.d_value) {
- this.meter = null;
- this.infoText = this.promptText;
- return;
- }
- var _this$checkPasswordSt2 = this.checkPasswordStrength(this.d_value), meter = _this$checkPasswordSt2.meter, label12 = _this$checkPasswordSt2.label;
- this.meter = meter;
- this.infoText = label12;
- if (!this.overlayVisible) {
- this.overlayVisible = true;
- }
- }, "setPasswordMeter"),
- checkPasswordStrength: /* @__PURE__ */ __name(function checkPasswordStrength(value2) {
- var label12 = null;
- var meter = null;
- switch (this.testStrength(value2)) {
- case 1:
- label12 = this.weakText;
- meter = {
- strength: "weak",
- width: "33.33%"
- };
- break;
- case 2:
- label12 = this.mediumText;
- meter = {
- strength: "medium",
- width: "66.66%"
- };
- break;
- case 3:
- label12 = this.strongText;
- meter = {
- strength: "strong",
- width: "100%"
- };
- break;
- default:
- label12 = this.promptText;
- meter = null;
- break;
- }
- return {
- label: label12,
- meter
- };
- }, "checkPasswordStrength"),
- onInvalid: /* @__PURE__ */ __name(function onInvalid(event2) {
- this.$emit("invalid", event2);
- }, "onInvalid"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener6() {
- var _this = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.input.$el, function() {
- if (_this.overlayVisible) {
- _this.overlayVisible = false;
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener6() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener6() {
- var _this2 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this2.overlayVisible && !isTouchDevice()) {
- _this2.overlayVisible = false;
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener6() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- overlayRef: /* @__PURE__ */ __name(function overlayRef4(el) {
- this.overlay = el;
- }, "overlayRef"),
- onMaskToggle: /* @__PURE__ */ __name(function onMaskToggle() {
- this.unmasked = !this.unmasked;
- }, "onMaskToggle"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick5(event2) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.$el
- });
- }, "onOverlayClick")
- },
- computed: {
- inputType: /* @__PURE__ */ __name(function inputType2() {
- return this.unmasked ? "text" : "password";
- }, "inputType"),
- weakText: /* @__PURE__ */ __name(function weakText() {
- return this.weakLabel || this.$primevue.config.locale.weak;
- }, "weakText"),
- mediumText: /* @__PURE__ */ __name(function mediumText() {
- return this.mediumLabel || this.$primevue.config.locale.medium;
- }, "mediumText"),
- strongText: /* @__PURE__ */ __name(function strongText() {
- return this.strongLabel || this.$primevue.config.locale.strong;
- }, "strongText"),
- promptText: /* @__PURE__ */ __name(function promptText() {
- return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
- }, "promptText"),
- overlayUniqueId: /* @__PURE__ */ __name(function overlayUniqueId() {
- return this.id + "_overlay";
- }, "overlayUniqueId")
- },
- components: {
- InputText: script$1l,
- Portal: script$1m,
- EyeSlashIcon: script$o,
- EyeIcon: script$N
- }
-};
-function _typeof$a(o) {
- "@babel/helpers - typeof";
- return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$a(o);
-}
-__name(_typeof$a, "_typeof$a");
-function ownKeys$9(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$9, "ownKeys$9");
-function _objectSpread$9(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$9(Object(t2), true).forEach(function(r2) {
- _defineProperty$a(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$9(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$9, "_objectSpread$9");
-function _defineProperty$a(e, r, t2) {
- return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$a, "_defineProperty$a");
-function _toPropertyKey$a(t2) {
- var i = _toPrimitive$a(t2, "string");
- return "symbol" == _typeof$a(i) ? i : i + "";
-}
-__name(_toPropertyKey$a, "_toPropertyKey$a");
-function _toPrimitive$a(t2, r) {
- if ("object" != _typeof$a(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$a(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$a, "_toPrimitive$a");
-var _hoisted_1$c = ["id"];
-function render$k(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_InputText = resolveComponent("InputText");
- var _component_Portal = resolveComponent("Portal");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- style: _ctx.sx("root")
- }, _ctx.ptmi("root")), [createVNode(_component_InputText, mergeProps({
- ref: "input",
- id: _ctx.inputId,
- type: $options.inputType,
- "class": [_ctx.cx("pcInputText"), _ctx.inputClass],
- style: _ctx.inputStyle,
- value: _ctx.d_value,
- name: _ctx.$formName,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel,
- "aria-controls": _ctx.overlayProps && _ctx.overlayProps.id || _ctx.overlayId || _ctx.panelProps && _ctx.panelProps.id || _ctx.panelId || $options.overlayUniqueId,
- "aria-expanded": $data.overlayVisible,
- "aria-haspopup": true,
- placeholder: _ctx.placeholder,
- required: _ctx.required,
- fluid: _ctx.fluid,
- disabled: _ctx.disabled,
- variant: _ctx.variant,
- invalid: _ctx.invalid,
- size: _ctx.size,
- autofocus: _ctx.autofocus,
- onInput: $options.onInput,
- onFocus: $options.onFocus,
- onBlur: $options.onBlur,
- onKeyup: $options.onKeyUp,
- onInvalid: $options.onInvalid
- }, _ctx.inputProps, {
- pt: _ctx.ptm("pcInputText"),
- unstyled: _ctx.unstyled
- }), null, 16, ["id", "type", "class", "style", "value", "name", "aria-labelledby", "aria-label", "aria-controls", "aria-expanded", "placeholder", "required", "fluid", "disabled", "variant", "invalid", "size", "autofocus", "onInput", "onFocus", "onBlur", "onKeyup", "onInvalid", "pt", "unstyled"]), _ctx.toggleMask && $data.unmasked ? renderSlot(_ctx.$slots, _ctx.$slots.maskicon ? "maskicon" : "hideicon", {
- key: 0,
- toggleCallback: $options.onMaskToggle
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.maskIcon ? "i" : "EyeSlashIcon"), mergeProps({
- "class": [_ctx.cx("maskIcon"), _ctx.maskIcon],
- onClick: $options.onMaskToggle
- }, _ctx.ptm("maskIcon")), null, 16, ["class", "onClick"]))];
- }) : createCommentVNode("", true), _ctx.toggleMask && !$data.unmasked ? renderSlot(_ctx.$slots, _ctx.$slots.unmaskicon ? "unmaskicon" : "showicon", {
- key: 1,
- toggleCallback: $options.onMaskToggle
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.unmaskIcon ? "i" : "EyeIcon"), mergeProps({
- "class": [_ctx.cx("unmaskIcon"), _ctx.unmaskIcon],
- onClick: $options.onMaskToggle
- }, _ctx.ptm("unmaskIcon")), null, 16, ["class", "onClick"]))];
- }) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": "p-hidden-accessible",
- "aria-live": "polite"
- }, _ctx.ptm("hiddenAccesible"), {
- "data-p-hidden-accessible": true
- }), toDisplayString($data.infoText), 17), createVNode(_component_Portal, {
- appendTo: _ctx.appendTo
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: $options.onOverlayEnter,
- onLeave: $options.onOverlayLeave,
- onAfterLeave: $options.onOverlayAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.overlayRef,
- id: _ctx.overlayId || _ctx.panelId || $options.overlayUniqueId,
- "class": [_ctx.cx("overlay"), _ctx.panelClass, _ctx.overlayClass],
- style: [_ctx.overlayStyle, _ctx.panelStyle],
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- })
- }, _objectSpread$9(_objectSpread$9(_objectSpread$9({}, _ctx.panelProps), _ctx.overlayProps), _ctx.ptm("overlay"))), [renderSlot(_ctx.$slots, "header"), renderSlot(_ctx.$slots, "content", {}, function() {
- return [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("content")
- }, _ctx.ptm("content")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("meter")
- }, _ctx.ptm("meter")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("meterLabel"),
- style: {
- width: $data.meter ? $data.meter.width : ""
- }
- }, _ctx.ptm("meterLabel")), null, 16)], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("meterText")
- }, _ctx.ptm("meterText")), toDisplayString($data.infoText), 17)], 16)];
- }), renderSlot(_ctx.$slots, "footer")], 16, _hoisted_1$c)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onLeave", "onAfterLeave"])];
- }),
- _: 3
- }, 8, ["appendTo"])], 16);
-}
-__name(render$k, "render$k");
-script$n.render = render$k;
-var theme$b = /* @__PURE__ */ __name(function theme28(_ref) {
- var dt = _ref.dt;
- return "\n.p-picklist {\n display: flex;\n gap: ".concat(dt("picklist.gap"), ";\n}\n\n.p-picklist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: ").concat(dt("picklist.controls.gap"), ";\n}\n\n.p-picklist-list-container {\n flex: 1 1 50%;\n}\n\n.p-picklist .p-listbox {\n height: 100%;\n}\n");
-}, "theme");
-var classes$c = {
- root: "p-picklist p-component",
- sourceControls: "p-picklist-controls p-picklist-source-controls",
- sourceListContainer: "p-picklist-list-container p-picklist-source-list-container",
- transferControls: "p-picklist-controls p-picklist-transfer-controls",
- targetListContainer: "p-picklist-list-container p-picklist-target-list-container",
- targetControls: "p-picklist-controls p-picklist-target-controls"
-};
-var PickListStyle = BaseStyle.extend({
- name: "picklist",
- theme: theme$b,
- classes: classes$c
-});
-var script$1$c = {
- name: "BasePickList",
- "extends": script$1f,
- props: {
- modelValue: {
- type: Array,
- "default": /* @__PURE__ */ __name(function _default13() {
- return [[], []];
- }, "_default")
- },
- selection: {
- type: Array,
- "default": /* @__PURE__ */ __name(function _default14() {
- return [[], []];
- }, "_default")
- },
- dataKey: {
- type: String,
- "default": null
- },
- listStyle: {
- type: null,
- "default": null
- },
- metaKeySelection: {
- type: Boolean,
- "default": false
- },
- autoOptionFocus: {
- type: Boolean,
- "default": true
- },
- focusOnHover: {
- type: Boolean,
- "default": true
- },
- responsive: {
- type: Boolean,
- "default": true
- },
- breakpoint: {
- type: String,
- "default": "960px"
- },
- striped: {
- type: Boolean,
- "default": false
- },
- scrollHeight: {
- type: String,
- "default": "14rem"
- },
- showSourceControls: {
- type: Boolean,
- "default": true
- },
- showTargetControls: {
- type: Boolean,
- "default": true
- },
- buttonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default15() {
- return {
- severity: "secondary"
- };
- }, "_default")
- },
- moveUpButtonProps: {
- type: null,
- "default": null
- },
- moveTopButtonProps: {
- type: null,
- "default": null
- },
- moveDownButtonProps: {
- type: null,
- "default": null
- },
- moveBottomButtonProps: {
- type: null,
- "default": null
- },
- moveToTargetProps: {
- type: null,
- "default": null
- },
- moveAllToTargetProps: {
- type: null,
- "default": null
- },
- moveToSourceProps: {
- type: null,
- "default": null
- },
- moveAllToSourceProps: {
- type: null,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": 0
- },
- disabled: {
- type: Boolean,
- "default": false
- }
- },
- style: PickListStyle,
- provide: /* @__PURE__ */ __name(function provide38() {
- return {
- $pcPickList: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _toConsumableArray$4(r) {
- return _arrayWithoutHoles$4(r) || _iterableToArray$4(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread$4();
-}
-__name(_toConsumableArray$4, "_toConsumableArray$4");
-function _nonIterableSpread$4() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$4, "_nonIterableSpread$4");
-function _unsupportedIterableToArray$4(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$4(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$4(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$4, "_unsupportedIterableToArray$4");
-function _iterableToArray$4(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$4, "_iterableToArray$4");
-function _arrayWithoutHoles$4(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$4(r);
-}
-__name(_arrayWithoutHoles$4, "_arrayWithoutHoles$4");
-function _arrayLikeToArray$4(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$4, "_arrayLikeToArray$4");
-var script$m = {
- name: "PickList",
- "extends": script$1$c,
- inheritAttrs: false,
- emits: ["update:modelValue", "reorder", "update:selection", "selection-change", "move-to-target", "move-to-source", "move-all-to-target", "move-all-to-source", "focus", "blur"],
- itemTouched: false,
- reorderDirection: null,
- styleElement: null,
- media: null,
- mediaChangeListener: null,
- data: /* @__PURE__ */ __name(function data27() {
- return {
- id: this.$attrs.id,
- d_selection: this.selection,
- viewChanged: false
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId11(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- selection: /* @__PURE__ */ __name(function selection(newValue) {
- this.d_selection = newValue;
- }, "selection"),
- breakpoint: /* @__PURE__ */ __name(function breakpoint() {
- this.destroyMedia();
- this.initMedia();
- }, "breakpoint")
- },
- updated: /* @__PURE__ */ __name(function updated6() {
- if (this.reorderDirection) {
- this.updateListScroll(this.$refs.sourceList.$el);
- this.updateListScroll(this.$refs.targetList.$el);
- this.reorderDirection = null;
- }
- }, "updated"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount12() {
- this.destroyStyle();
- this.destroyMedia();
- }, "beforeUnmount"),
- mounted: /* @__PURE__ */ __name(function mounted29() {
- this.id = this.id || UniqueComponentId();
- if (this.responsive) {
- this.createStyle();
- this.initMedia();
- }
- }, "mounted"),
- methods: {
- updateSelection: /* @__PURE__ */ __name(function updateSelection2(event2) {
- this.$emit("update:selection", this.d_selection);
- this.$emit("selection-change", {
- originalEvent: event2,
- value: this.d_selection
- });
- }, "updateSelection"),
- onChangeSelection: /* @__PURE__ */ __name(function onChangeSelection2(params, listIndex) {
- this.d_selection[listIndex] = params.value;
- this.updateSelection(params.event);
- }, "onChangeSelection"),
- onListFocus: /* @__PURE__ */ __name(function onListFocus4(event2, listType) {
- this.$emit("focus", event2, listType);
- }, "onListFocus"),
- onListBlur: /* @__PURE__ */ __name(function onListBlur4(event2, listType) {
- this.$emit("blur", event2, listType);
- }, "onListBlur"),
- onReorderUpdate: /* @__PURE__ */ __name(function onReorderUpdate2(event2, value2, listIndex) {
- this.$emit("update:modelValue", value2);
- this.$emit("reorder", {
- originalEvent: event2,
- value: value2,
- direction: this.reorderDirection,
- listIndex
- });
- }, "onReorderUpdate"),
- onItemDblClick: /* @__PURE__ */ __name(function onItemDblClick(event2, listIndex) {
- if (listIndex === 0) this.moveToTarget({
- event: event2.originalEvent
- });
- else if (listIndex === 1) this.moveToSource({
- event: event2.originalEvent
- });
- }, "onItemDblClick"),
- moveUp: /* @__PURE__ */ __name(function moveUp2(event2, listIndex) {
- if (this.d_selection && this.d_selection[listIndex]) {
- var valueList = _toConsumableArray$4(this.modelValue[listIndex]);
- var selectionList = this.d_selection[listIndex];
- for (var i = 0; i < selectionList.length; i++) {
- var selectedItem = selectionList[i];
- var selectedItemIndex = findIndexInList(selectedItem, valueList);
- if (selectedItemIndex !== 0) {
- var movedItem = valueList[selectedItemIndex];
- var temp = valueList[selectedItemIndex - 1];
- valueList[selectedItemIndex - 1] = movedItem;
- valueList[selectedItemIndex] = temp;
- } else {
- break;
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[listIndex] = valueList;
- this.reorderDirection = "up";
- this.onReorderUpdate(event2, value2, listIndex);
- }
- }, "moveUp"),
- moveTop: /* @__PURE__ */ __name(function moveTop2(event2, listIndex) {
- if (this.d_selection) {
- var valueList = _toConsumableArray$4(this.modelValue[listIndex]);
- var selectionList = this.d_selection[listIndex];
- for (var i = 0; i < selectionList.length; i++) {
- var selectedItem = selectionList[i];
- var selectedItemIndex = findIndexInList(selectedItem, valueList);
- if (selectedItemIndex !== 0) {
- var movedItem = valueList.splice(selectedItemIndex, 1)[0];
- valueList.unshift(movedItem);
- } else {
- break;
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[listIndex] = valueList;
- this.reorderDirection = "top";
- this.onReorderUpdate(event2, value2, listIndex);
- }
- }, "moveTop"),
- moveDown: /* @__PURE__ */ __name(function moveDown2(event2, listIndex) {
- if (this.d_selection) {
- var valueList = _toConsumableArray$4(this.modelValue[listIndex]);
- var selectionList = this.d_selection[listIndex];
- for (var i = selectionList.length - 1; i >= 0; i--) {
- var selectedItem = selectionList[i];
- var selectedItemIndex = findIndexInList(selectedItem, valueList);
- if (selectedItemIndex !== valueList.length - 1) {
- var movedItem = valueList[selectedItemIndex];
- var temp = valueList[selectedItemIndex + 1];
- valueList[selectedItemIndex + 1] = movedItem;
- valueList[selectedItemIndex] = temp;
- } else {
- break;
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[listIndex] = valueList;
- this.reorderDirection = "down";
- this.onReorderUpdate(event2, value2, listIndex);
- }
- }, "moveDown"),
- moveBottom: /* @__PURE__ */ __name(function moveBottom2(event2, listIndex) {
- if (this.d_selection) {
- var valueList = _toConsumableArray$4(this.modelValue[listIndex]);
- var selectionList = this.d_selection[listIndex];
- for (var i = selectionList.length - 1; i >= 0; i--) {
- var selectedItem = selectionList[i];
- var selectedItemIndex = findIndexInList(selectedItem, valueList);
- if (selectedItemIndex !== valueList.length - 1) {
- var movedItem = valueList.splice(selectedItemIndex, 1)[0];
- valueList.push(movedItem);
- } else {
- break;
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[listIndex] = valueList;
- this.reorderDirection = "bottom";
- this.onReorderUpdate(event2, value2, listIndex);
- }
- }, "moveBottom"),
- moveToTarget: /* @__PURE__ */ __name(function moveToTarget(event2) {
- var selection2 = this.d_selection && this.d_selection[0] ? this.d_selection[0] : null;
- var sourceList2 = _toConsumableArray$4(this.modelValue[0]);
- var targetList2 = _toConsumableArray$4(this.modelValue[1]);
- if (selection2) {
- for (var i = 0; i < selection2.length; i++) {
- var selectedItem = selection2[i];
- if (findIndexInList(selectedItem, targetList2) == -1) {
- targetList2.push(sourceList2.splice(findIndexInList(selectedItem, sourceList2), 1)[0]);
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[0] = sourceList2;
- value2[1] = targetList2;
- this.$emit("update:modelValue", value2);
- this.$emit("move-to-target", {
- originalEvent: event2,
- items: _toConsumableArray$4(new Set(selection2))
- });
- this.d_selection[0] = [];
- this.updateSelection(event2);
- }
- }, "moveToTarget"),
- moveAllToTarget: /* @__PURE__ */ __name(function moveAllToTarget(event2) {
- if (this.modelValue[0]) {
- var sourceList2 = _toConsumableArray$4(this.modelValue[0]);
- var targetList2 = _toConsumableArray$4(this.modelValue[1]);
- this.$emit("move-all-to-target", {
- originalEvent: event2,
- items: sourceList2
- });
- targetList2 = [].concat(_toConsumableArray$4(targetList2), _toConsumableArray$4(sourceList2));
- sourceList2 = [];
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[0] = sourceList2;
- value2[1] = targetList2;
- this.$emit("update:modelValue", value2);
- this.d_selection = [[], []];
- this.updateSelection(event2);
- }
- }, "moveAllToTarget"),
- moveToSource: /* @__PURE__ */ __name(function moveToSource(event2) {
- var selection2 = this.d_selection && this.d_selection[1] ? this.d_selection[1] : null;
- var sourceList2 = _toConsumableArray$4(this.modelValue[0]);
- var targetList2 = _toConsumableArray$4(this.modelValue[1]);
- if (selection2) {
- for (var i = 0; i < selection2.length; i++) {
- var selectedItem = selection2[i];
- if (findIndexInList(selectedItem, sourceList2) == -1) {
- sourceList2.push(targetList2.splice(findIndexInList(selectedItem, targetList2), 1)[0]);
- }
- }
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[0] = sourceList2;
- value2[1] = targetList2;
- this.$emit("update:modelValue", value2);
- this.$emit("move-to-source", {
- originalEvent: event2,
- items: _toConsumableArray$4(new Set(selection2))
- });
- this.d_selection[1] = [];
- this.updateSelection(event2);
- }
- }, "moveToSource"),
- moveAllToSource: /* @__PURE__ */ __name(function moveAllToSource(event2) {
- if (this.modelValue[1]) {
- var sourceList2 = _toConsumableArray$4(this.modelValue[0]);
- var targetList2 = _toConsumableArray$4(this.modelValue[1]);
- this.$emit("move-all-to-source", {
- originalEvent: event2,
- items: targetList2
- });
- sourceList2 = [].concat(_toConsumableArray$4(sourceList2), _toConsumableArray$4(targetList2));
- targetList2 = [];
- var value2 = _toConsumableArray$4(this.modelValue);
- value2[0] = sourceList2;
- value2[1] = targetList2;
- this.$emit("update:modelValue", value2);
- this.d_selection = [[], []];
- this.updateSelection(event2);
- }
- }, "moveAllToSource"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick6(event2, item8, index, listIndex) {
- var listType = listIndex === 0 ? "sourceList" : "targetList";
- this.itemTouched = false;
- var selectionList = this.d_selection[listIndex];
- var selectedIndex = findIndexInList(item8, selectionList);
- var selected3 = selectedIndex != -1;
- var metaSelection = this.itemTouched ? false : this.metaKeySelection;
- var selectedId = find(this.$refs[listType].$el, '[data-pc-section="item"]')[index].getAttribute("id");
- this.focusedOptionIndex = selectedId;
- var _selection;
- if (metaSelection) {
- var metaKey = event2.metaKey || event2.ctrlKey;
- if (selected3 && metaKey) {
- _selection = selectionList.filter(function(val, index2) {
- return index2 !== selectedIndex;
- });
- } else {
- _selection = metaKey ? selectionList ? _toConsumableArray$4(selectionList) : [] : [];
- _selection.push(item8);
- }
- } else {
- if (selected3) {
- _selection = selectionList.filter(function(val, index2) {
- return index2 !== selectedIndex;
- });
- } else {
- _selection = selectionList ? _toConsumableArray$4(selectionList) : [];
- _selection.push(item8);
- }
- }
- var newSelection = _toConsumableArray$4(this.d_selection);
- newSelection[listIndex] = _selection;
- this.d_selection = newSelection;
- this.updateSelection(event2);
- }, "onItemClick"),
- updateListScroll: /* @__PURE__ */ __name(function updateListScroll2(listElement) {
- var listItems = find(listElement, '[data-pc-section="item"][data-p-selected="true"]');
- if (listItems && listItems.length) {
- switch (this.reorderDirection) {
- case "up":
- scrollInView(listElement, listItems[0]);
- break;
- case "top":
- listElement.scrollTop = 0;
- break;
- case "down":
- scrollInView(listElement, listItems[listItems.length - 1]);
- break;
- case "bottom":
- listElement.scrollTop = listElement.scrollHeight;
- break;
- }
- }
- }, "updateListScroll"),
- initMedia: /* @__PURE__ */ __name(function initMedia() {
- this.media = window.matchMedia("(max-width: ".concat(this.breakpoint, ")"));
- this.viewChanged = this.media.matches;
- this.bindMediaChangeListener();
- }, "initMedia"),
- destroyMedia: /* @__PURE__ */ __name(function destroyMedia() {
- this.unbindMediaChangeListener();
- }, "destroyMedia"),
- bindMediaChangeListener: /* @__PURE__ */ __name(function bindMediaChangeListener() {
- var _this = this;
- if (this.media && !this.mediaChangeListener) {
- this.mediaChangeListener = function(event2) {
- _this.viewChanged = event2.matches;
- };
- this.media.addEventListener("change", this.mediaChangeListener);
- }
- }, "bindMediaChangeListener"),
- unbindMediaChangeListener: /* @__PURE__ */ __name(function unbindMediaChangeListener() {
- if (this.media && this.mediaChangeListener) {
- this.media.removeEventListener("change", this.mediaChangeListener);
- this.mediaChangeListener = null;
- }
- }, "unbindMediaChangeListener"),
- createStyle: /* @__PURE__ */ __name(function createStyle2() {
- if (!this.styleElement && !this.isUnstyled) {
- var _this$$primevue;
- this.styleElement = document.createElement("style");
- this.styleElement.type = "text/css";
- setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
- document.head.appendChild(this.styleElement);
- var innerHTML = "\n@media screen and (max-width: ".concat(this.breakpoint, ") {\n .p-picklist[").concat(this.$attrSelector, "] {\n flex-direction: column;\n }\n\n .p-picklist[").concat(this.$attrSelector, "] .p-picklist-controls {\n flex-direction: row;\n }\n}\n");
- this.styleElement.innerHTML = innerHTML;
- }
- }, "createStyle"),
- destroyStyle: /* @__PURE__ */ __name(function destroyStyle2() {
- if (this.styleElement) {
- document.head.removeChild(this.styleElement);
- this.styleElement = null;
- }
- }, "destroyStyle"),
- moveDisabled: /* @__PURE__ */ __name(function moveDisabled2(index) {
- return this.disabled ? true : this.d_selection && (!this.d_selection[index] || !this.d_selection[index].length) ? true : false;
- }, "moveDisabled"),
- moveAllDisabled: /* @__PURE__ */ __name(function moveAllDisabled(list2) {
- return this.disabled ? true : isEmpty(this[list2]);
- }, "moveAllDisabled")
- },
- computed: {
- idSource: /* @__PURE__ */ __name(function idSource() {
- return "".concat(this.id, "_source");
- }, "idSource"),
- idTarget: /* @__PURE__ */ __name(function idTarget() {
- return "".concat(this.id, "_target");
- }, "idTarget"),
- sourceList: /* @__PURE__ */ __name(function sourceList() {
- return this.modelValue && this.modelValue[0] ? this.modelValue[0] : null;
- }, "sourceList"),
- targetList: /* @__PURE__ */ __name(function targetList() {
- return this.modelValue && this.modelValue[1] ? this.modelValue[1] : null;
- }, "targetList"),
- moveUpAriaLabel: /* @__PURE__ */ __name(function moveUpAriaLabel2() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveUp : void 0;
- }, "moveUpAriaLabel"),
- moveTopAriaLabel: /* @__PURE__ */ __name(function moveTopAriaLabel2() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveTop : void 0;
- }, "moveTopAriaLabel"),
- moveDownAriaLabel: /* @__PURE__ */ __name(function moveDownAriaLabel2() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveDown : void 0;
- }, "moveDownAriaLabel"),
- moveBottomAriaLabel: /* @__PURE__ */ __name(function moveBottomAriaLabel2() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveBottom : void 0;
- }, "moveBottomAriaLabel"),
- moveToTargetAriaLabel: /* @__PURE__ */ __name(function moveToTargetAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveToTarget : void 0;
- }, "moveToTargetAriaLabel"),
- moveAllToTargetAriaLabel: /* @__PURE__ */ __name(function moveAllToTargetAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveAllToTarget : void 0;
- }, "moveAllToTargetAriaLabel"),
- moveToSourceAriaLabel: /* @__PURE__ */ __name(function moveToSourceAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveToSource : void 0;
- }, "moveToSourceAriaLabel"),
- moveAllToSourceAriaLabel: /* @__PURE__ */ __name(function moveAllToSourceAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveAllToSource : void 0;
- }, "moveAllToSourceAriaLabel")
- },
- components: {
- Listbox: script$1N,
- Button: script$1d,
- AngleRightIcon: script$1o,
- AngleLeftIcon: script$1Q,
- AngleDownIcon: script$1G,
- AngleUpIcon: script$1O,
- AngleDoubleRightIcon: script$1R,
- AngleDoubleLeftIcon: script$1S,
- AngleDoubleDownIcon: script$u,
- AngleDoubleUpIcon: script$t
- },
- directives: {
- ripple: Ripple
- }
-};
-function _typeof$9(o) {
- "@babel/helpers - typeof";
- return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$9(o);
-}
-__name(_typeof$9, "_typeof$9");
-function ownKeys$8(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$8, "ownKeys$8");
-function _objectSpread$8(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$8(Object(t2), true).forEach(function(r2) {
- _defineProperty$9(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$8(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$8, "_objectSpread$8");
-function _defineProperty$9(e, r, t2) {
- return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$9, "_defineProperty$9");
-function _toPropertyKey$9(t2) {
- var i = _toPrimitive$9(t2, "string");
- return "symbol" == _typeof$9(i) ? i : i + "";
-}
-__name(_toPropertyKey$9, "_toPropertyKey$9");
-function _toPrimitive$9(t2, r) {
- if ("object" != _typeof$9(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$9(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$9, "_toPrimitive$9");
-function render$j(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_AngleUpIcon = resolveComponent("AngleUpIcon");
- var _component_Button = resolveComponent("Button");
- var _component_AngleDoubleUpIcon = resolveComponent("AngleDoubleUpIcon");
- var _component_AngleDownIcon = resolveComponent("AngleDownIcon");
- var _component_AngleDoubleDownIcon = resolveComponent("AngleDoubleDownIcon");
- var _component_Listbox = resolveComponent("Listbox");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [_ctx.showSourceControls ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("sourceControls")
- }, _ctx.ptm("sourceControls"), {
- "data-pc-group-section": "controls"
- }), [renderSlot(_ctx.$slots, "sourcecontrolsstart"), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveUpAriaLabel,
- disabled: $options.moveDisabled(0),
- onClick: _cache[0] || (_cache[0] = function($event) {
- return $options.moveUp($event, 0);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveUpButtonProps), {
- pt: _ctx.ptm("pcSourceMoveUpButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "moveupicon", {}, function() {
- return [createVNode(_component_AngleUpIcon, mergeProps(_ctx.ptm("pcSourceMoveUpButton")["icon"], {
- "data-pc-section": "moveupicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveTopAriaLabel,
- disabled: $options.moveDisabled(0),
- onClick: _cache[1] || (_cache[1] = function($event) {
- return $options.moveTop($event, 0);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveTopButtonProps), {
- pt: _ctx.ptm("pcSourceMoveTopButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movetopicon", {}, function() {
- return [createVNode(_component_AngleDoubleUpIcon, mergeProps(_ctx.ptm("pcSourceMoveTopButton")["icon"], {
- "data-pc-section": "movetopicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveDownAriaLabel,
- disabled: $options.moveDisabled(0),
- onClick: _cache[2] || (_cache[2] = function($event) {
- return $options.moveDown($event, 0);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveDownButtonProps), {
- pt: _ctx.ptm("pcSourceMoveDownButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movedownicon", {}, function() {
- return [createVNode(_component_AngleDownIcon, mergeProps(_ctx.ptm("pcSourceMoveDownButton")["icon"], {
- "data-pc-section": "movedownicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveBottomAriaLabel,
- disabled: $options.moveDisabled(0),
- onClick: _cache[3] || (_cache[3] = function($event) {
- return $options.moveBottom($event, 0);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveBottomButtonProps), {
- pt: _ctx.ptm("pcSourceMoveBottomButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movebottomicon", {}, function() {
- return [createVNode(_component_AngleDoubleDownIcon, mergeProps(_ctx.ptm("pcSourceMoveBottomButton")["icon"], {
- "data-pc-section": "movebottomicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "sourcecontrolsend")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("sourceListContainer")
- }, _ctx.ptm("sourceListContainer"), {
- "data-pc-group-section": "listcontainer"
- }), [createVNode(_component_Listbox, {
- ref: "sourceList",
- id: $options.idSource + "_list",
- modelValue: $data.d_selection[0],
- options: $options.sourceList,
- multiple: "",
- metaKeySelection: _ctx.metaKeySelection,
- listStyle: _ctx.listStyle,
- scrollHeight: _ctx.scrollHeight,
- tabindex: $options.sourceList && $options.sourceList.length > 0 ? _ctx.tabindex : -1,
- dataKey: _ctx.dataKey,
- autoOptionFocus: _ctx.autoOptionFocus,
- focusOnHover: _ctx.focusOnHover,
- striped: _ctx.striped,
- disabled: _ctx.disabled,
- pt: _ctx.ptm("pcListbox"),
- unstyled: _ctx.unstyled,
- onFocus: _cache[4] || (_cache[4] = function($event) {
- return $options.onListFocus($event, "sourceList");
- }),
- onBlur: _cache[5] || (_cache[5] = function($event) {
- return $options.onListBlur($event, "sourceList");
- }),
- onChange: _cache[6] || (_cache[6] = function($event) {
- return $options.onChangeSelection($event, 0);
- }),
- onItemDblclick: _cache[7] || (_cache[7] = function($event) {
- return $options.onItemDblClick($event, 0);
- }),
- "data-pc-group-section": "list"
- }, createSlots({
- option: withCtx(function(_ref) {
- var option4 = _ref.option, selected3 = _ref.selected, index = _ref.index;
- return [renderSlot(_ctx.$slots, _ctx.$slots.option ? "option" : "item", {
- item: option4,
- option: option4,
- selected: selected3,
- index
- })];
- }),
- _: 2
- }, [_ctx.$slots.sourceheader ? {
- name: "header",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "sourceheader")];
- }),
- key: "0"
- } : void 0]), 1032, ["id", "modelValue", "options", "metaKeySelection", "listStyle", "scrollHeight", "tabindex", "dataKey", "autoOptionFocus", "focusOnHover", "striped", "disabled", "pt", "unstyled"])], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("transferControls")
- }, _ctx.ptm("transferControls"), {
- "data-pc-group-section": "controls"
- }), [renderSlot(_ctx.$slots, "movecontrolsstart"), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveToTargetAriaLabel,
- onClick: $options.moveToTarget,
- disabled: $options.moveDisabled(0)
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveToTargetProps), {
- pt: _ctx.ptm("pcMoveToTargetButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movetotargeticon", {
- viewChanged: $data.viewChanged
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? "AngleDownIcon" : "AngleRightIcon"), mergeProps(_ctx.ptm("pcMoveToTargetButton")["icon"], {
- "data-pc-section": "movetotargeticon"
- }), null, 16))];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveAllToTargetAriaLabel,
- onClick: $options.moveAllToTarget,
- disabled: $options.moveAllDisabled("sourceList")
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveAllToTargetProps), {
- pt: _ctx.ptm("pcMoveAllToTargetButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movealltotargeticon", {
- viewChanged: $data.viewChanged
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? "AngleDoubleDownIcon" : "AngleDoubleRightIcon"), mergeProps(_ctx.ptm("pcMoveAllToTargetButton")["icon"], {
- "data-pc-section": "movealltotargeticon"
- }), null, 16))];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveToSourceAriaLabel,
- onClick: $options.moveToSource,
- disabled: $options.moveDisabled(1)
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveToSourceProps), {
- pt: _ctx.ptm("pcMoveToSourceButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movetosourceicon", {
- viewChanged: $data.viewChanged
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? "AngleUpIcon" : "AngleLeftIcon"), mergeProps(_ctx.ptm("pcMoveToSourceButton")["icon"], {
- "data-pc-section": "movetosourceicon"
- }), null, 16))];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveAllToSourceAriaLabel,
- onClick: $options.moveAllToSource,
- disabled: $options.moveAllDisabled("targetList")
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveAllToSourceProps), {
- pt: _ctx.ptm("pcMoveAllToSourceButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movealltosourceicon", {
- viewChanged: $data.viewChanged
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? "AngleDoubleUpIcon" : "AngleDoubleLeftIcon"), mergeProps(_ctx.ptm("pcMoveAllToSourceButton")["icon"], {
- "data-pc-section": "movealltosourceicon"
- }), null, 16))];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "movecontrolsend")], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("targetListContainer")
- }, _ctx.ptm("targetListContainer"), {
- "data-pc-group-section": "listcontainer"
- }), [createVNode(_component_Listbox, {
- ref: "targetList",
- id: $options.idTarget + "_list",
- modelValue: $data.d_selection[1],
- options: $options.targetList,
- multiple: "",
- metaKeySelection: _ctx.metaKeySelection,
- listStyle: _ctx.listStyle,
- scrollHeight: _ctx.scrollHeight,
- tabindex: $options.targetList && $options.targetList.length > 0 ? _ctx.tabindex : -1,
- dataKey: _ctx.dataKey,
- autoOptionFocus: _ctx.autoOptionFocus,
- focusOnHover: _ctx.focusOnHover,
- striped: _ctx.striped,
- disabled: _ctx.disabled,
- pt: _ctx.ptm("pcListbox"),
- unstyled: _ctx.unstyled,
- onFocus: _cache[8] || (_cache[8] = function($event) {
- return $options.onListFocus($event, "targetList");
- }),
- onBlur: _cache[9] || (_cache[9] = function($event) {
- return $options.onListBlur($event, "targetList");
- }),
- onChange: _cache[10] || (_cache[10] = function($event) {
- return $options.onChangeSelection($event, 1);
- }),
- onItemDblclick: _cache[11] || (_cache[11] = function($event) {
- return $options.onItemDblClick($event, 1);
- }),
- "data-pc-group-section": "list"
- }, createSlots({
- option: withCtx(function(_ref2) {
- var option4 = _ref2.option, selected3 = _ref2.selected, index = _ref2.index;
- return [renderSlot(_ctx.$slots, _ctx.$slots.option ? "option" : "item", {
- item: option4,
- option: option4,
- selected: selected3,
- index
- })];
- }),
- _: 2
- }, [_ctx.$slots.targetheader ? {
- name: "header",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "targetheader")];
- }),
- key: "0"
- } : void 0]), 1032, ["id", "modelValue", "options", "metaKeySelection", "listStyle", "scrollHeight", "tabindex", "dataKey", "autoOptionFocus", "focusOnHover", "striped", "disabled", "pt", "unstyled"])], 16), _ctx.showTargetControls ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("targetControls")
- }, _ctx.ptm("targetControls"), {
- "data-pc-group-section": "controls"
- }), [renderSlot(_ctx.$slots, "targetcontrolsstart"), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveUpAriaLabel,
- disabled: $options.moveDisabled(1),
- onClick: _cache[12] || (_cache[12] = function($event) {
- return $options.moveUp($event, 1);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveUpButtonProps), {
- pt: _ctx.ptm("pcTargetMoveUpButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "moveupicon", {}, function() {
- return [createVNode(_component_AngleUpIcon, mergeProps(_ctx.ptm("pcTargetMoveUpButton")["icon"], {
- "data-pc-section": "moveupicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveTopAriaLabel,
- disabled: $options.moveDisabled(1),
- onClick: _cache[13] || (_cache[13] = function($event) {
- return $options.moveTop($event, 1);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveTopButtonProps), {
- pt: _ctx.ptm("pcTargetMoveTopButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movetopicon", {}, function() {
- return [createVNode(_component_AngleDoubleUpIcon, mergeProps(_ctx.ptm("pcTargetMoveTopButton")["icon"], {
- "data-pc-section": "movetopicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveDownAriaLabel,
- disabled: $options.moveDisabled(1),
- onClick: _cache[14] || (_cache[14] = function($event) {
- return $options.moveDown($event, 1);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveDownButtonProps), {
- pt: _ctx.ptm("pcTargetMoveDownButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movedownicon", {}, function() {
- return [createVNode(_component_AngleDownIcon, mergeProps(_ctx.ptm("pcTargetMoveDownButton")["icon"], {
- "data-pc-section": "movedownicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({
- "aria-label": $options.moveBottomAriaLabel,
- disabled: $options.moveDisabled(1),
- onClick: _cache[15] || (_cache[15] = function($event) {
- return $options.moveBottom($event, 1);
- })
- }, _objectSpread$8(_objectSpread$8({}, _ctx.buttonProps), _ctx.moveBottomButtonProps), {
- pt: _ctx.ptm("pcTargetMoveBottomButton"),
- unstyled: _ctx.unstyled
- }), {
- icon: withCtx(function() {
- return [renderSlot(_ctx.$slots, "movebottomicon", {}, function() {
- return [createVNode(_component_AngleDoubleDownIcon, mergeProps(_ctx.ptm("pcTargetMoveBottomButton")["icon"], {
- "data-pc-section": "movebottomicon"
- }), null, 16)];
- })];
- }),
- _: 3
- }, 16, ["aria-label", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "targetcontrolsend")], 16)) : createCommentVNode("", true)], 16);
-}
-__name(render$j, "render$j");
-script$m.render = render$j;
-var PortalStyle = BaseStyle.extend({
- name: "portal"
-});
-var theme$a = /* @__PURE__ */ __name(function theme29(_ref) {
- _ref.dt;
- return "\n.p-radiobutton-group {\n display: inline-flex;\n}\n";
-}, "theme");
-var classes$b = {
- root: "p-radiobutton-group p-component"
-};
-var RadioButtonGroupStyle = BaseStyle.extend({
- name: "radiobuttongroup",
- theme: theme$a,
- classes: classes$b
-});
-var script$1$b = {
- name: "BaseRadioButtonGroup",
- "extends": script$1r,
- style: RadioButtonGroupStyle,
- provide: /* @__PURE__ */ __name(function provide39() {
- return {
- $pcRadioButtonGroup: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$l = {
- name: "RadioButtonGroup",
- "extends": script$1$b,
- inheritAttrs: false,
- data: /* @__PURE__ */ __name(function data28() {
- return {
- groupName: this.name
- };
- }, "data"),
- watch: {
- name: /* @__PURE__ */ __name(function name2(newValue) {
- this.groupName = newValue || uuid("radiobutton-group-");
- }, "name")
- },
- mounted: /* @__PURE__ */ __name(function mounted30() {
- this.groupName = this.groupName || uuid("radiobutton-group-");
- }, "mounted")
-};
-function render$i(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16);
-}
-__name(render$i, "render$i");
-script$l.render = render$i;
-var script$k = {
- name: "BanIcon",
- "extends": script$1j
-};
-function render$h(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- d: "M7 0C5.61553 0 4.26215 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.00303296 5.6003 -0.13559 7.00776 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C14 5.14348 13.2625 3.36301 11.9497 2.05025C10.637 0.737498 8.85652 0 7 0ZM1.16667 7C1.16549 5.65478 1.63303 4.35118 2.48889 3.31333L10.6867 11.5111C9.83309 12.2112 8.79816 12.6544 7.70243 12.789C6.60669 12.9236 5.49527 12.744 4.49764 12.2713C3.50001 11.7986 2.65724 11.0521 2.06751 10.1188C1.47778 9.18558 1.16537 8.10397 1.16667 7ZM11.5111 10.6867L3.31334 2.48889C4.43144 1.57388 5.84966 1.10701 7.29265 1.1789C8.73565 1.2508 10.1004 1.85633 11.1221 2.87795C12.1437 3.89956 12.7492 5.26435 12.8211 6.70735C12.893 8.15034 12.4261 9.56856 11.5111 10.6867Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$h, "render$h");
-script$k.render = render$h;
-var script$j = {
- name: "StarIcon",
- "extends": script$1j
-};
-function render$g(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- d: "M10.9741 13.6721C10.8806 13.6719 10.7886 13.6483 10.7066 13.6033L7.00002 11.6545L3.29345 13.6033C3.19926 13.6539 3.09281 13.6771 2.98612 13.6703C2.87943 13.6636 2.77676 13.6271 2.6897 13.5651C2.60277 13.5014 2.53529 13.4147 2.4948 13.3148C2.45431 13.215 2.44241 13.1058 2.46042 12.9995L3.17881 8.87264L0.167699 5.95324C0.0922333 5.8777 0.039368 5.78258 0.0150625 5.67861C-0.00924303 5.57463 -0.00402231 5.46594 0.030136 5.36477C0.0621323 5.26323 0.122141 5.17278 0.203259 5.10383C0.284377 5.03488 0.383311 4.99023 0.488681 4.97501L4.63087 4.37126L6.48797 0.618832C6.54083 0.530159 6.61581 0.456732 6.70556 0.405741C6.79532 0.35475 6.89678 0.327942 7.00002 0.327942C7.10325 0.327942 7.20471 0.35475 7.29447 0.405741C7.38422 0.456732 7.4592 0.530159 7.51206 0.618832L9.36916 4.37126L13.5114 4.97501C13.6167 4.99023 13.7157 5.03488 13.7968 5.10383C13.8779 5.17278 13.9379 5.26323 13.9699 5.36477C14.0041 5.46594 14.0093 5.57463 13.985 5.67861C13.9607 5.78258 13.9078 5.8777 13.8323 5.95324L10.8212 8.87264L11.532 12.9995C11.55 13.1058 11.5381 13.215 11.4976 13.3148C11.4571 13.4147 11.3896 13.5014 11.3027 13.5651C11.2059 13.632 11.0917 13.6692 10.9741 13.6721ZM7.00002 10.4393C7.09251 10.4404 7.18371 10.4613 7.2675 10.5005L10.2098 12.029L9.65193 8.75036C9.6368 8.6584 9.64343 8.56418 9.6713 8.47526C9.69918 8.38633 9.74751 8.30518 9.81242 8.23832L12.1969 5.94559L8.90298 5.45648C8.81188 5.44198 8.72555 5.406 8.65113 5.35152C8.57671 5.29703 8.51633 5.2256 8.475 5.14314L7.00002 2.1626L5.52503 5.15078C5.4837 5.23324 5.42332 5.30467 5.3489 5.35916C5.27448 5.41365 5.18815 5.44963 5.09705 5.46412L1.80318 5.94559L4.18761 8.23832C4.25252 8.30518 4.30085 8.38633 4.32873 8.47526C4.3566 8.56418 4.36323 8.6584 4.3481 8.75036L3.7902 12.0519L6.73253 10.5234C6.81451 10.4762 6.9058 10.4475 7.00002 10.4393Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$g, "render$g");
-script$j.render = render$g;
-var script$i = {
- name: "StarFillIcon",
- "extends": script$1j
-};
-function render$f(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- d: "M13.9718 5.36453C13.9398 5.26298 13.8798 5.17252 13.7986 5.10356C13.7175 5.0346 13.6186 4.98994 13.5132 4.97472L9.37043 4.37088L7.51307 0.617955C7.46021 0.529271 7.38522 0.455834 7.29545 0.404836C7.20568 0.353838 7.1042 0.327026 7.00096 0.327026C6.89771 0.327026 6.79624 0.353838 6.70647 0.404836C6.6167 0.455834 6.54171 0.529271 6.48885 0.617955L4.63149 4.37088L0.488746 4.97472C0.383363 4.98994 0.284416 5.0346 0.203286 5.10356C0.122157 5.17252 0.0621407 5.26298 0.03014 5.36453C-0.00402286 5.46571 -0.00924428 5.57442 0.0150645 5.67841C0.0393733 5.7824 0.0922457 5.87753 0.167722 5.95308L3.17924 8.87287L2.4684 13.0003C2.45038 13.1066 2.46229 13.2158 2.50278 13.3157C2.54328 13.4156 2.61077 13.5022 2.6977 13.5659C2.78477 13.628 2.88746 13.6644 2.99416 13.6712C3.10087 13.678 3.20733 13.6547 3.30153 13.6042L7.00096 11.6551L10.708 13.6042C10.79 13.6491 10.882 13.6728 10.9755 13.673C11.0958 13.6716 11.2129 13.6343 11.3119 13.5659C11.3988 13.5022 11.4663 13.4156 11.5068 13.3157C11.5473 13.2158 11.5592 13.1066 11.5412 13.0003L10.8227 8.87287L13.8266 5.95308C13.9033 5.87835 13.9577 5.7836 13.9833 5.67957C14.009 5.57554 14.005 5.4664 13.9718 5.36453Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$f, "render$f");
-script$i.render = render$f;
-var theme$9 = /* @__PURE__ */ __name(function theme30(_ref) {
- var dt = _ref.dt;
- return "\n.p-rating {\n position: relative;\n display: flex;\n align-items: center;\n gap: ".concat(dt("rating.gap"), ";\n}\n\n.p-rating-option {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n outline-color: transparent;\n border-radius: 50%;\n transition: background ").concat(dt("rating.transition.duration"), ", color ").concat(dt("rating.transition.duration"), ", border-color ").concat(dt("rating.transition.duration"), ", outline-color ").concat(dt("rating.transition.duration"), ", box-shadow ").concat(dt("rating.transition.duration"), ";\n}\n\n.p-rating-option.p-focus-visible {\n box-shadow: ").concat(dt("rating.focus.ring.shadow"), ";\n outline: ").concat(dt("rating.focus.ring.width"), " ").concat(dt("rating.focus.ring.style"), " ").concat(dt("rating.focus.ring.color"), ";\n outline-offset: ").concat(dt("rating.focus.ring.offset"), ";\n}\n\n.p-rating-icon {\n color: ").concat(dt("rating.icon.color"), ";\n transition: background ").concat(dt("rating.transition.duration"), ", color ").concat(dt("rating.transition.duration"), ", border-color ").concat(dt("rating.transition.duration"), ", outline-color ").concat(dt("rating.transition.duration"), ", box-shadow ").concat(dt("rating.transition.duration"), ";\n font-size: ").concat(dt("rating.icon.size"), ";\n width: ").concat(dt("rating.icon.size"), ";\n height: ").concat(dt("rating.icon.size"), ";\n}\n\n.p-rating:not(.p-disabled):not(.p-readonly) .p-rating-option:hover .p-rating-icon {\n color: ").concat(dt("rating.icon.hover.color"), ";\n}\n\n.p-rating-option-active .p-rating-icon {\n color: ").concat(dt("rating.icon.active.color"), ";\n}\n\n.p-rating-icon.p-invalid { /* @todo */\n stroke: ").concat(dt("rating.invalid.icon.color"), ";\n}\n");
-}, "theme");
-var classes$a = {
- root: /* @__PURE__ */ __name(function root23(_ref2) {
- var props = _ref2.props;
- return ["p-rating", {
- "p-readonly": props.readonly,
- "p-disabled": props.disabled
- }];
- }, "root"),
- option: /* @__PURE__ */ __name(function option3(_ref3) {
- var instance = _ref3.instance, value2 = _ref3.value;
- return ["p-rating-option", {
- "p-rating-option-active": value2 <= instance.d_value,
- "p-focus-visible": value2 === instance.focusedOptionIndex && instance.isFocusVisibleItem
- }];
- }, "option"),
- onIcon: /* @__PURE__ */ __name(function onIcon(_ref4) {
- var instance = _ref4.instance;
- return ["p-rating-icon p-rating-on-icon", {
- "p-invalid": instance.$invalid
- }];
- }, "onIcon"),
- offIcon: /* @__PURE__ */ __name(function offIcon(_ref5) {
- var instance = _ref5.instance;
- return ["p-rating-icon p-rating-off-icon", {
- "p-invalid": instance.$invalid
- }];
- }, "offIcon")
-};
-var RatingStyle = BaseStyle.extend({
- name: "rating",
- theme: theme$9,
- classes: classes$a
-});
-var script$1$a = {
- name: "BaseRating",
- "extends": script$1r,
- props: {
- readonly: {
- type: Boolean,
- "default": false
- },
- stars: {
- type: Number,
- "default": 5
- },
- onIcon: {
- type: String,
- "default": void 0
- },
- offIcon: {
- type: String,
- "default": void 0
- }
- },
- style: RatingStyle,
- provide: /* @__PURE__ */ __name(function provide40() {
- return {
- $pcRating: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$h = {
- name: "Rating",
- "extends": script$1$a,
- inheritAttrs: false,
- emits: ["change", "focus", "blur"],
- data: /* @__PURE__ */ __name(function data29() {
- return {
- d_name: this.name,
- focusedOptionIndex: -1,
- isFocusVisibleItem: true
- };
- }, "data"),
- watch: {
- name: /* @__PURE__ */ __name(function name3(newValue) {
- this.d_name = newValue || UniqueComponentId();
- }, "name")
- },
- mounted: /* @__PURE__ */ __name(function mounted31() {
- this.d_name = this.d_name || UniqueComponentId();
- }, "mounted"),
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions9(key, value2) {
- return this.ptm(key, {
- context: {
- active: value2 <= this.d_value,
- focused: value2 === this.focusedOptionIndex
- }
- });
- }, "getPTOptions"),
- onOptionClick: /* @__PURE__ */ __name(function onOptionClick3(event2, value2) {
- if (!this.readonly && !this.disabled) {
- this.onOptionSelect(event2, value2);
- this.isFocusVisibleItem = false;
- var firstFocusableEl = getFirstFocusableElement(event2.currentTarget);
- firstFocusableEl && focus(firstFocusableEl);
- }
- }, "onOptionClick"),
- onFocus: /* @__PURE__ */ __name(function onFocus12(event2, value2) {
- this.focusedOptionIndex = value2;
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur12(event2) {
- var _this$formField$onBlu, _this$formField;
- this.focusedOptionIndex = -1;
- this.$emit("blur", event2);
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
- }, "onBlur"),
- onChange: /* @__PURE__ */ __name(function onChange(event2, value2) {
- this.onOptionSelect(event2, value2);
- this.isFocusVisibleItem = true;
- }, "onChange"),
- onOptionSelect: /* @__PURE__ */ __name(function onOptionSelect3(event2, value2) {
- if (this.focusedOptionIndex === value2 || this.d_value === value2) {
- this.focusedOptionIndex = -1;
- this.updateModel(event2, null);
- } else {
- this.focusedOptionIndex = value2;
- this.updateModel(event2, value2 || null);
- }
- }, "onOptionSelect"),
- updateModel: /* @__PURE__ */ __name(function updateModel7(event2, value2) {
- this.writeValue(value2, event2);
- this.$emit("change", {
- originalEvent: event2,
- value: value2
- });
- }, "updateModel"),
- starAriaLabel: /* @__PURE__ */ __name(function starAriaLabel(value2) {
- return value2 === 1 ? this.$primevue.config.locale.aria.star : this.$primevue.config.locale.aria.stars.replace(/{star}/g, value2);
- }, "starAriaLabel")
- },
- components: {
- StarFillIcon: script$i,
- StarIcon: script$j,
- BanIcon: script$k
- }
-};
-var _hoisted_1$b = ["onClick", "data-p-active", "data-p-focused"];
-var _hoisted_2$8 = ["value", "name", "checked", "disabled", "readonly", "aria-label", "onFocus", "onChange"];
-function render$e(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stars, function(value2) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: value2,
- "class": _ctx.cx("option", {
- value: value2
- }),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onOptionClick($event, value2);
- }, "onClick"),
- ref_for: true
- }, $options.getPTOptions("option", value2), {
- "data-p-active": value2 <= _ctx.d_value,
- "data-p-focused": value2 === $data.focusedOptionIndex
- }), [createBaseVNode("span", mergeProps({
- "class": "p-hidden-accessible",
- ref_for: true
- }, _ctx.ptm("hiddenOptionInputContainer"), {
- "data-p-hidden-accessible": true
- }), [createBaseVNode("input", mergeProps({
- type: "radio",
- value: value2,
- name: $data.d_name,
- checked: _ctx.d_value === value2,
- disabled: _ctx.disabled,
- readonly: _ctx.readonly,
- "aria-label": $options.starAriaLabel(value2),
- onFocus: /* @__PURE__ */ __name(function onFocus15($event) {
- return $options.onFocus($event, value2);
- }, "onFocus"),
- onBlur: _cache[0] || (_cache[0] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- }),
- onChange: /* @__PURE__ */ __name(function onChange2($event) {
- return $options.onChange($event, value2);
- }, "onChange"),
- ref_for: true
- }, _ctx.ptm("hiddenOptionInput")), null, 16, _hoisted_2$8)], 16), value2 <= _ctx.d_value ? renderSlot(_ctx.$slots, "onicon", {
- key: 0,
- value: value2,
- "class": normalizeClass(_ctx.cx("onIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.onIcon ? "span" : "StarFillIcon"), mergeProps({
- "class": [_ctx.cx("onIcon"), _ctx.onIcon],
- ref_for: true
- }, _ctx.ptm("onIcon")), null, 16, ["class"]))];
- }) : renderSlot(_ctx.$slots, "officon", {
- key: 1,
- value: value2,
- "class": normalizeClass(_ctx.cx("offIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.offIcon ? "span" : "StarIcon"), mergeProps({
- "class": [_ctx.cx("offIcon"), _ctx.offIcon],
- ref_for: true
- }, _ctx.ptm("offIcon")), null, 16, ["class"]))];
- })], 16, _hoisted_1$b);
- }), 128))], 16);
-}
-__name(render$e, "render$e");
-script$h.render = render$e;
-var script$g = {
- name: "Row",
- "extends": script$1f,
- inject: ["$rows"],
- mounted: /* @__PURE__ */ __name(function mounted32() {
- var _this$$rows;
- (_this$$rows = this.$rows) === null || _this$$rows === void 0 || _this$$rows.add(this.$);
- }, "mounted"),
- unmounted: /* @__PURE__ */ __name(function unmounted4() {
- var _this$$rows2;
- (_this$$rows2 = this.$rows) === null || _this$$rows2 === void 0 || _this$$rows2["delete"](this.$);
- }, "unmounted"),
- render: /* @__PURE__ */ __name(function render2() {
- return null;
- }, "render")
-};
-var RowStyle = BaseStyle.extend({
- name: "row"
-});
-var theme$8 = /* @__PURE__ */ __name(function theme31(_ref) {
- _ref.dt;
- return "\n.p-scrolltop.p-button {\n position: fixed !important;\n inset-block-end: 20px;\n inset-inline-end: 20px;\n}\n\n.p-scrolltop-sticky.p-button {\n position: sticky !important;\n display: flex;\n margin-inline-start: auto;\n}\n\n.p-scrolltop-enter-from {\n opacity: 0;\n}\n\n.p-scrolltop-enter-active {\n transition: opacity 0.15s;\n}\n\n.p-scrolltop.p-scrolltop-leave-to {\n opacity: 0;\n}\n\n.p-scrolltop-leave-active {\n transition: opacity 0.15s;\n}\n";
-}, "theme");
-var classes$9 = {
- root: /* @__PURE__ */ __name(function root24(_ref2) {
- var props = _ref2.props;
- return ["p-scrolltop", {
- "p-scrolltop-sticky": props.target !== "window"
- }];
- }, "root"),
- icon: "p-scrolltop-icon"
-};
-var ScrollTopStyle = BaseStyle.extend({
- name: "scrolltop",
- theme: theme$8,
- classes: classes$9
-});
-var script$1$9 = {
- name: "BaseScrollTop",
- "extends": script$1f,
- props: {
- target: {
- type: String,
- "default": "window"
- },
- threshold: {
- type: Number,
- "default": 400
- },
- icon: {
- type: String,
- "default": void 0
- },
- behavior: {
- type: String,
- "default": "smooth"
- },
- buttonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default16() {
- return {
- rounded: true
- };
- }, "_default")
- }
- },
- style: ScrollTopStyle,
- provide: /* @__PURE__ */ __name(function provide41() {
- return {
- $pcScrollTop: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$f = {
- name: "ScrollTop",
- "extends": script$1$9,
- inheritAttrs: false,
- scrollListener: null,
- container: null,
- data: /* @__PURE__ */ __name(function data30() {
- return {
- visible: false
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted33() {
- if (this.target === "window") this.bindDocumentScrollListener();
- else if (this.target === "parent") this.bindParentScrollListener();
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount13() {
- if (this.target === "window") this.unbindDocumentScrollListener();
- else if (this.target === "parent") this.unbindParentScrollListener();
- if (this.container) {
- ZIndex.clear(this.container);
- this.overlay = null;
- }
- }, "beforeUnmount"),
- methods: {
- onClick: /* @__PURE__ */ __name(function onClick5() {
- var scrollElement = this.target === "window" ? window : this.$el.parentElement;
- scrollElement.scroll({
- top: 0,
- behavior: this.behavior
- });
- }, "onClick"),
- checkVisibility: /* @__PURE__ */ __name(function checkVisibility(scrollY) {
- if (scrollY > this.threshold) this.visible = true;
- else this.visible = false;
- }, "checkVisibility"),
- bindParentScrollListener: /* @__PURE__ */ __name(function bindParentScrollListener() {
- var _this = this;
- this.scrollListener = function() {
- _this.checkVisibility(_this.$el.parentElement.scrollTop);
- };
- this.$el.parentElement.addEventListener("scroll", this.scrollListener);
- }, "bindParentScrollListener"),
- bindDocumentScrollListener: /* @__PURE__ */ __name(function bindDocumentScrollListener() {
- var _this2 = this;
- this.scrollListener = function() {
- _this2.checkVisibility(getWindowScrollTop());
- };
- window.addEventListener("scroll", this.scrollListener);
- }, "bindDocumentScrollListener"),
- unbindParentScrollListener: /* @__PURE__ */ __name(function unbindParentScrollListener() {
- if (this.scrollListener) {
- this.$el.parentElement.removeEventListener("scroll", this.scrollListener);
- this.scrollListener = null;
- }
- }, "unbindParentScrollListener"),
- unbindDocumentScrollListener: /* @__PURE__ */ __name(function unbindDocumentScrollListener() {
- if (this.scrollListener) {
- window.removeEventListener("scroll", this.scrollListener);
- this.scrollListener = null;
- }
- }, "unbindDocumentScrollListener"),
- onEnter: /* @__PURE__ */ __name(function onEnter3(el) {
- ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
- }, "onEnter"),
- onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave3(el) {
- ZIndex.clear(el);
- }, "onAfterLeave"),
- containerRef: /* @__PURE__ */ __name(function containerRef4(el) {
- this.container = el ? el.$el : void 0;
- }, "containerRef")
- },
- computed: {
- scrollTopAriaLabel: /* @__PURE__ */ __name(function scrollTopAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.scrollTop : void 0;
- }, "scrollTopAriaLabel")
- },
- components: {
- ChevronUpIcon: script$1g,
- Button: script$1d
- }
-};
-function render$d(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Button = resolveComponent("Button");
- return openBlock(), createBlock(Transition, mergeProps({
- name: "p-scrolltop",
- appear: "",
- onEnter: $options.onEnter,
- onAfterLeave: $options.onAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.visible ? (openBlock(), createBlock(_component_Button, mergeProps({
- key: 0,
- ref: $options.containerRef,
- "class": _ctx.cx("root"),
- onClick: $options.onClick,
- "aria-label": $options.scrollTopAriaLabel,
- unstyled: _ctx.unstyled
- }, _ctx.buttonProps, {
- pt: _ctx.pt
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "icon", {
- "class": normalizeClass(_ctx.cx("icon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ? "span" : "ChevronUpIcon"), mergeProps({
- "class": [_ctx.cx("icon"), _ctx.icon, slotProps["class"]]
- }, _ctx.ptm("icon")), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "onClick", "aria-label", "unstyled", "pt"])) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onAfterLeave"]);
-}
-__name(render$d, "render$d");
-script$f.render = render$d;
-var script$e = {
- name: "Sidebar",
- "extends": script$1T,
- mounted: /* @__PURE__ */ __name(function mounted34() {
- console.warn("Deprecated since v4. Use Drawer component instead.");
- }, "mounted")
-};
-var SidebarStyle = BaseStyle.extend({
- name: "sidebar"
-});
-var theme$7 = /* @__PURE__ */ __name(function theme32(_ref) {
- var dt = _ref.dt;
- return "\n.p-skeleton {\n overflow: hidden;\n background: ".concat(dt("skeleton.background"), ";\n border-radius: ").concat(dt("skeleton.border.radius"), ';\n}\n\n.p-skeleton::after {\n content: "";\n animation: p-skeleton-animation 1.2s infinite;\n height: 100%;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n transform: translateX(-100%);\n z-index: 1;\n background: linear-gradient(90deg, rgba(255, 255, 255, 0), ').concat(dt("skeleton.animation.background"), ", rgba(255, 255, 255, 0));\n}\n\n[dir='rtl'] .p-skeleton::after {\n animation-name: p-skeleton-animation-rtl;\n}\n\n.p-skeleton-circle {\n border-radius: 50%;\n}\n\n.p-skeleton-animation-none::after {\n animation: none;\n}\n\n@keyframes p-skeleton-animation {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n@keyframes p-skeleton-animation-rtl {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(-100%);\n }\n}\n");
-}, "theme");
-var inlineStyles$3 = {
- root: {
- position: "relative"
- }
-};
-var classes$8 = {
- root: /* @__PURE__ */ __name(function root25(_ref2) {
- var props = _ref2.props;
- return ["p-skeleton p-component", {
- "p-skeleton-circle": props.shape === "circle",
- "p-skeleton-animation-none": props.animation === "none"
- }];
- }, "root")
-};
-var SkeletonStyle = BaseStyle.extend({
- name: "skeleton",
- theme: theme$7,
- classes: classes$8,
- inlineStyles: inlineStyles$3
-});
-var script$1$8 = {
- name: "BaseSkeleton",
- "extends": script$1f,
- props: {
- shape: {
- type: String,
- "default": "rectangle"
- },
- size: {
- type: String,
- "default": null
- },
- width: {
- type: String,
- "default": "100%"
- },
- height: {
- type: String,
- "default": "1rem"
- },
- borderRadius: {
- type: String,
- "default": null
- },
- animation: {
- type: String,
- "default": "wave"
- }
- },
- style: SkeletonStyle,
- provide: /* @__PURE__ */ __name(function provide42() {
- return {
- $pcSkeleton: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$d = {
- name: "Skeleton",
- "extends": script$1$8,
- inheritAttrs: false,
- computed: {
- containerStyle: /* @__PURE__ */ __name(function containerStyle() {
- if (this.size) return {
- width: this.size,
- height: this.size,
- borderRadius: this.borderRadius
- };
- else return {
- width: this.width,
- height: this.height,
- borderRadius: this.borderRadius
- };
- }, "containerStyle")
- }
-};
-function render$c(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- style: [_ctx.sx("root"), $options.containerStyle],
- "aria-hidden": "true"
- }, _ctx.ptmi("root")), null, 16);
-}
-__name(render$c, "render$c");
-script$d.render = render$c;
-function _typeof$8(o) {
- "@babel/helpers - typeof";
- return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$8(o);
-}
-__name(_typeof$8, "_typeof$8");
-function _defineProperty$8(e, r, t2) {
- return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$8, "_defineProperty$8");
-function _toPropertyKey$8(t2) {
- var i = _toPrimitive$8(t2, "string");
- return "symbol" == _typeof$8(i) ? i : i + "";
-}
-__name(_toPropertyKey$8, "_toPropertyKey$8");
-function _toPrimitive$8(t2, r) {
- if ("object" != _typeof$8(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$8(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$8, "_toPrimitive$8");
-var theme$6 = /* @__PURE__ */ __name(function theme33(_ref) {
- var dt = _ref.dt;
- return "\n.p-speeddial {\n position: static;\n display: flex;\n gap: ".concat(dt("speeddial.gap"), ";\n}\n\n.p-speeddial-button {\n z-index: 1;\n}\n\n.p-speeddial-button.p-speeddial-rotate {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, background ").concat(dt("speeddial.transition.duration"), ", color ").concat(dt("speeddial.transition.duration"), ", border-color ").concat(dt("speeddial.transition.duration"), ",\n box-shadow ").concat(dt("speeddial.transition.duration"), ", outline-color ").concat(dt("speeddial.transition.duration"), ";\n will-change: transform;\n}\n\n.p-speeddial-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: inset-block-start 0s linear ").concat(dt("speeddial.transition.duration"), ";\n pointer-events: none;\n outline: 0 none;\n z-index: 2;\n gap: ").concat(dt("speeddial.gap"), ";\n}\n\n.p-speeddial-item {\n transform: scale(0);\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, opacity 0.8s;\n will-change: transform;\n}\n\n.p-speeddial-circle .p-speeddial-item,\n.p-speeddial-semi-circle .p-speeddial-item,\n.p-speeddial-quarter-circle .p-speeddial-item {\n position: absolute;\n}\n\n.p-speeddial-mask {\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n background: ").concat(dt("mask.background"), ";\n border-radius: 6px;\n transition: opacity 150ms;\n}\n\n.p-speeddial-mask-visible {\n pointer-events: none;\n opacity: 1;\n transition: opacity 150ms;\n}\n\n.p-speeddial-open .p-speeddial-list {\n pointer-events: auto;\n}\n\n.p-speeddial-open .p-speeddial-item {\n transform: scale(1);\n opacity: 1;\n}\n\n.p-speeddial-open .p-speeddial-rotate {\n transform: rotate(45deg);\n}\n");
-}, "theme");
-var inlineStyles$2 = {
- root: /* @__PURE__ */ __name(function root26(_ref2) {
- var props = _ref2.props;
- return {
- alignItems: (props.direction === "up" || props.direction === "down") && "center",
- justifyContent: (props.direction === "left" || props.direction === "right") && "center",
- flexDirection: props.direction === "up" ? "column-reverse" : props.direction === "down" ? "column" : props.direction === "left" ? "row-reverse" : props.direction === "right" ? "row" : null
- };
- }, "root"),
- list: /* @__PURE__ */ __name(function list(_ref3) {
- var props = _ref3.props;
- return {
- flexDirection: props.direction === "up" ? "column-reverse" : props.direction === "down" ? "column" : props.direction === "left" ? "row-reverse" : props.direction === "right" ? "row" : null
- };
- }, "list")
-};
-var classes$7 = {
- root: /* @__PURE__ */ __name(function root27(_ref4) {
- var instance = _ref4.instance, props = _ref4.props;
- return ["p-speeddial p-component p-speeddial-".concat(props.type), _defineProperty$8(_defineProperty$8(_defineProperty$8({}, "p-speeddial-direction-".concat(props.direction), props.type !== "circle"), "p-speeddial-open", instance.d_visible), "p-disabled", props.disabled)];
- }, "root"),
- pcButton: /* @__PURE__ */ __name(function pcButton(_ref6) {
- var props = _ref6.props;
- return ["p-speeddial-button", {
- "p-speeddial-rotate": props.rotateAnimation && !props.hideIcon
- }];
- }, "pcButton"),
- list: "p-speeddial-list",
- item: "p-speeddial-item",
- action: "p-speeddial-action",
- actionIcon: "p-speeddial-action-icon",
- mask: /* @__PURE__ */ __name(function mask2(_ref7) {
- var instance = _ref7.instance;
- return ["p-speeddial-mask", {
- "p-speeddial-mask-visible": instance.d_visible
- }];
- }, "mask")
-};
-var SpeedDialStyle = BaseStyle.extend({
- name: "speeddial",
- theme: theme$6,
- classes: classes$7,
- inlineStyles: inlineStyles$2
-});
-var script$1$7 = {
- name: "BaseSpeedDial",
- "extends": script$1f,
- props: {
- model: null,
- visible: {
- type: Boolean,
- "default": false
- },
- direction: {
- type: String,
- "default": "up"
- },
- transitionDelay: {
- type: Number,
- "default": 30
- },
- type: {
- type: String,
- "default": "linear"
- },
- radius: {
- type: Number,
- "default": 0
- },
- mask: {
- type: Boolean,
- "default": false
- },
- disabled: {
- type: Boolean,
- "default": false
- },
- hideOnClickOutside: {
- type: Boolean,
- "default": true
- },
- buttonClass: null,
- maskStyle: null,
- maskClass: null,
- showIcon: {
- type: String,
- "default": void 0
- },
- hideIcon: {
- type: String,
- "default": void 0
- },
- rotateAnimation: {
- type: Boolean,
- "default": true
- },
- tooltipOptions: null,
- style: null,
- "class": null,
- buttonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default17() {
- return {
- rounded: true
- };
- }, "_default")
- },
- actionButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default18() {
- return {
- severity: "secondary",
- rounded: true,
- size: "small"
- };
- }, "_default")
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: SpeedDialStyle,
- provide: /* @__PURE__ */ __name(function provide43() {
- return {
- $pcSpeedDial: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _typeof$7(o) {
- "@babel/helpers - typeof";
- return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$7(o);
-}
-__name(_typeof$7, "_typeof$7");
-function ownKeys$7(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$7, "ownKeys$7");
-function _objectSpread$7(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$7(Object(t2), true).forEach(function(r2) {
- _defineProperty$7(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$7(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$7, "_objectSpread$7");
-function _defineProperty$7(e, r, t2) {
- return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$7, "_defineProperty$7");
-function _toPropertyKey$7(t2) {
- var i = _toPrimitive$7(t2, "string");
- return "symbol" == _typeof$7(i) ? i : i + "";
-}
-__name(_toPropertyKey$7, "_toPropertyKey$7");
-function _toPrimitive$7(t2, r) {
- if ("object" != _typeof$7(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$7(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$7, "_toPrimitive$7");
-function _toConsumableArray$3(r) {
- return _arrayWithoutHoles$3(r) || _iterableToArray$3(r) || _unsupportedIterableToArray$3(r) || _nonIterableSpread$3();
-}
-__name(_toConsumableArray$3, "_toConsumableArray$3");
-function _nonIterableSpread$3() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$3, "_nonIterableSpread$3");
-function _unsupportedIterableToArray$3(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$3(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray$3");
-function _iterableToArray$3(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$3, "_iterableToArray$3");
-function _arrayWithoutHoles$3(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$3(r);
-}
-__name(_arrayWithoutHoles$3, "_arrayWithoutHoles$3");
-function _arrayLikeToArray$3(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$3, "_arrayLikeToArray$3");
-var Math_PI = 3.14159265358979;
-var script$c = {
- name: "SpeedDial",
- "extends": script$1$7,
- inheritAttrs: false,
- emits: ["click", "show", "hide", "focus", "blur"],
- documentClickListener: null,
- container: null,
- list: null,
- data: /* @__PURE__ */ __name(function data31() {
- return {
- id: this.$attrs.id,
- d_visible: this.visible,
- isItemClicked: false,
- focused: false,
- focusedOptionIndex: -1
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId12(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- visible: /* @__PURE__ */ __name(function visible4(newValue) {
- this.d_visible = newValue;
- }, "visible")
- },
- mounted: /* @__PURE__ */ __name(function mounted35() {
- this.id = this.id || UniqueComponentId();
- if (this.type !== "linear") {
- var button = findSingle(this.container, '[data-pc-name="pcbutton"]');
- var firstItem = findSingle(this.list, '[data-pc-section="item"]');
- if (button && firstItem) {
- var wDiff = Math.abs(button.offsetWidth - firstItem.offsetWidth);
- var hDiff = Math.abs(button.offsetHeight - firstItem.offsetHeight);
- this.list.style.setProperty($dt("item.diff.x").name, "".concat(wDiff / 2, "px"));
- this.list.style.setProperty($dt("item.diff.y").name, "".concat(hDiff / 2, "px"));
- }
- }
- if (this.hideOnClickOutside) {
- this.bindDocumentClickListener();
- }
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount14() {
- this.unbindDocumentClickListener();
- }, "beforeUnmount"),
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions10(id4, key) {
- return this.ptm(key, {
- context: {
- active: this.isItemActive(id4),
- hidden: !this.d_visible
- }
- });
- }, "getPTOptions"),
- onFocus: /* @__PURE__ */ __name(function onFocus13(event2) {
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur13(event2) {
- this.focusedOptionIndex = -1;
- this.$emit("blur", event2);
- }, "onBlur"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick7(e, item8) {
- if (item8.command) {
- item8.command({
- originalEvent: e,
- item: item8
- });
- }
- this.hide();
- this.isItemClicked = true;
- e.preventDefault();
- }, "onItemClick"),
- onClick: /* @__PURE__ */ __name(function onClick6(event2) {
- this.d_visible ? this.hide() : this.show();
- this.isItemClicked = true;
- this.$emit("click", event2);
- }, "onClick"),
- show: /* @__PURE__ */ __name(function show5() {
- this.d_visible = true;
- this.$emit("show");
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide5() {
- this.d_visible = false;
- this.$emit("hide");
- }, "hide"),
- calculateTransitionDelay: /* @__PURE__ */ __name(function calculateTransitionDelay(index) {
- var length = this.model.length;
- var visible7 = this.d_visible;
- return (visible7 ? index : length - index - 1) * this.transitionDelay;
- }, "calculateTransitionDelay"),
- onTogglerKeydown: /* @__PURE__ */ __name(function onTogglerKeydown(event2) {
- switch (event2.code) {
- case "ArrowDown":
- case "ArrowLeft":
- this.onTogglerArrowDown(event2);
- break;
- case "ArrowUp":
- case "ArrowRight":
- this.onTogglerArrowUp(event2);
- break;
- case "Escape":
- this.onEscapeKey();
- break;
- }
- }, "onTogglerKeydown"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown11(event2) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDown(event2);
- break;
- case "ArrowUp":
- this.onArrowUp(event2);
- break;
- case "ArrowLeft":
- this.onArrowLeft(event2);
- break;
- case "ArrowRight":
- this.onArrowRight(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- }
- }, "onKeyDown"),
- onTogglerArrowUp: /* @__PURE__ */ __name(function onTogglerArrowUp(event2) {
- this.show();
- this.navigatePrevItem(event2);
- event2.preventDefault();
- }, "onTogglerArrowUp"),
- onTogglerArrowDown: /* @__PURE__ */ __name(function onTogglerArrowDown(event2) {
- this.show();
- this.navigateNextItem(event2);
- event2.preventDefault();
- }, "onTogglerArrowDown"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey7(event2) {
- var _this = this;
- var items2 = find(this.container, '[data-pc-section="item"]');
- var itemIndex = _toConsumableArray$3(items2).findIndex(function(item8) {
- return item8.id === _this.focusedOptionIndex;
- });
- var buttonEl = findSingle(this.container, "button");
- this.onItemClick(event2, this.model[itemIndex]);
- this.onBlur(event2);
- buttonEl && focus(buttonEl);
- }, "onEnterKey"),
- onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey4() {
- this.hide();
- var buttonEl = findSingle(this.container, "button");
- buttonEl && focus(buttonEl);
- }, "onEscapeKey"),
- onArrowUp: /* @__PURE__ */ __name(function onArrowUp(event2) {
- if (this.direction === "down") {
- this.navigatePrevItem(event2);
- } else {
- this.navigateNextItem(event2);
- }
- }, "onArrowUp"),
- onArrowDown: /* @__PURE__ */ __name(function onArrowDown(event2) {
- if (this.direction === "down") {
- this.navigateNextItem(event2);
- } else {
- this.navigatePrevItem(event2);
- }
- }, "onArrowDown"),
- onArrowLeft: /* @__PURE__ */ __name(function onArrowLeft(event2) {
- var leftValidDirections = ["left", "up-right", "down-left"];
- var rightValidDirections = ["right", "up-left", "down-right"];
- if (leftValidDirections.includes(this.direction)) {
- this.navigateNextItem(event2);
- } else if (rightValidDirections.includes(this.direction)) {
- this.navigatePrevItem(event2);
- } else {
- this.navigatePrevItem(event2);
- }
- }, "onArrowLeft"),
- onArrowRight: /* @__PURE__ */ __name(function onArrowRight(event2) {
- var leftValidDirections = ["left", "up-right", "down-left"];
- var rightValidDirections = ["right", "up-left", "down-right"];
- if (leftValidDirections.includes(this.direction)) {
- this.navigatePrevItem(event2);
- } else if (rightValidDirections.includes(this.direction)) {
- this.navigateNextItem(event2);
- } else {
- this.navigateNextItem(event2);
- }
- }, "onArrowRight"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey8(event2) {
- event2.preventDefault();
- this.focusedOptionIndex = -1;
- this.navigatePrevItem(event2);
- }, "onEndKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey8(event2) {
- event2.preventDefault();
- this.focusedOptionIndex = -1;
- this.navigateNextItem(event2);
- }, "onHomeKey"),
- navigateNextItem: /* @__PURE__ */ __name(function navigateNextItem(event2) {
- var optionIndex = this.findNextOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- event2.preventDefault();
- }, "navigateNextItem"),
- navigatePrevItem: /* @__PURE__ */ __name(function navigatePrevItem(event2) {
- var optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex);
- this.changeFocusedOptionIndex(optionIndex);
- event2.preventDefault();
- }, "navigatePrevItem"),
- changeFocusedOptionIndex: /* @__PURE__ */ __name(function changeFocusedOptionIndex5(index) {
- var items2 = find(this.container, '[data-pc-section="item"]');
- var filteredItems = _toConsumableArray$3(items2).filter(function(item8) {
- return !hasClass(findSingle(item8, "a"), "p-disabled");
- });
- if (filteredItems[index]) {
- this.focusedOptionIndex = filteredItems[index].getAttribute("id");
- var buttonEl = findSingle(filteredItems[index], '[type="button"]');
- buttonEl && focus(buttonEl);
- }
- }, "changeFocusedOptionIndex"),
- findPrevOptionIndex: /* @__PURE__ */ __name(function findPrevOptionIndex5(index) {
- var items2 = find(this.container, '[data-pc-section="item"]');
- var filteredItems = _toConsumableArray$3(items2).filter(function(item8) {
- return !hasClass(findSingle(item8, "a"), "p-disabled");
- });
- var newIndex = index === -1 ? filteredItems[filteredItems.length - 1].id : index;
- var matchedOptionIndex = filteredItems.findIndex(function(link) {
- return link.getAttribute("id") === newIndex;
- });
- matchedOptionIndex = index === -1 ? filteredItems.length - 1 : matchedOptionIndex - 1;
- return matchedOptionIndex;
- }, "findPrevOptionIndex"),
- findNextOptionIndex: /* @__PURE__ */ __name(function findNextOptionIndex5(index) {
- var items2 = find(this.container, '[data-pc-section="item"]');
- var filteredItems = _toConsumableArray$3(items2).filter(function(item8) {
- return !hasClass(findSingle(item8, "a"), "p-disabled");
- });
- var newIndex = index === -1 ? filteredItems[0].id : index;
- var matchedOptionIndex = filteredItems.findIndex(function(link) {
- return link.getAttribute("id") === newIndex;
- });
- matchedOptionIndex = index === -1 ? 0 : matchedOptionIndex + 1;
- return matchedOptionIndex;
- }, "findNextOptionIndex"),
- calculatePointStyle: /* @__PURE__ */ __name(function calculatePointStyle(index) {
- var type = this.type;
- if (type !== "linear") {
- var length = this.model.length;
- var radius = this.radius || length * 20;
- if (type === "circle") {
- var step = 2 * Math_PI / length;
- return {
- left: "calc(".concat(radius * Math.cos(step * index), "px + ").concat($dt("item.diff.x", "0px").variable, ")"),
- top: "calc(".concat(radius * Math.sin(step * index), "px + ").concat($dt("item.diff.y", "0px").variable, ")")
- };
- } else if (type === "semi-circle") {
- var direction = this.direction;
- var _step = Math_PI / (length - 1);
- var x = "calc(".concat(radius * Math.cos(_step * index), "px + ").concat($dt("item.diff.x", "0px").variable, ")");
- var y = "calc(".concat(radius * Math.sin(_step * index), "px + ").concat($dt("item.diff.y", "0px").variable, ")");
- if (direction === "up") {
- return {
- left: x,
- bottom: y
- };
- } else if (direction === "down") {
- return {
- left: x,
- top: y
- };
- } else if (direction === "left") {
- return {
- right: y,
- top: x
- };
- } else if (direction === "right") {
- return {
- left: y,
- top: x
- };
- }
- } else if (type === "quarter-circle") {
- var _direction = this.direction;
- var _step2 = Math_PI / (2 * (length - 1));
- var _x = "calc(".concat(radius * Math.cos(_step2 * index), "px + ").concat($dt("item.diff.x", "0px").variable, ")");
- var _y = "calc(".concat(radius * Math.sin(_step2 * index), "px + ").concat($dt("item.diff.y", "0px").variable, ")");
- if (_direction === "up-left") {
- return {
- right: _x,
- bottom: _y
- };
- } else if (_direction === "up-right") {
- return {
- left: _x,
- bottom: _y
- };
- } else if (_direction === "down-left") {
- return {
- right: _y,
- top: _x
- };
- } else if (_direction === "down-right") {
- return {
- left: _y,
- top: _x
- };
- }
- }
- }
- return {};
- }, "calculatePointStyle"),
- getItemStyle: /* @__PURE__ */ __name(function getItemStyle(index) {
- var transitionDelay = this.calculateTransitionDelay(index);
- var pointStyle = this.calculatePointStyle(index);
- return _objectSpread$7({
- transitionDelay: "".concat(transitionDelay, "ms")
- }, pointStyle);
- }, "getItemStyle"),
- bindDocumentClickListener: /* @__PURE__ */ __name(function bindDocumentClickListener() {
- var _this2 = this;
- if (!this.documentClickListener) {
- this.documentClickListener = function(event2) {
- if (_this2.d_visible && _this2.isOutsideClicked(event2)) {
- _this2.hide();
- }
- _this2.isItemClicked = false;
- };
- document.addEventListener("click", this.documentClickListener);
- }
- }, "bindDocumentClickListener"),
- unbindDocumentClickListener: /* @__PURE__ */ __name(function unbindDocumentClickListener() {
- if (this.documentClickListener) {
- document.removeEventListener("click", this.documentClickListener);
- this.documentClickListener = null;
- }
- }, "unbindDocumentClickListener"),
- isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked3(event2) {
- return this.container && !(this.container.isSameNode(event2.target) || this.container.contains(event2.target) || this.isItemClicked);
- }, "isOutsideClicked"),
- isItemVisible: /* @__PURE__ */ __name(function isItemVisible6(item8) {
- return typeof item8.visible === "function" ? item8.visible() : item8.visible !== false;
- }, "isItemVisible"),
- isItemActive: /* @__PURE__ */ __name(function isItemActive7(id4) {
- return id4 === this.focusedOptionId;
- }, "isItemActive"),
- containerRef: /* @__PURE__ */ __name(function containerRef5(el) {
- this.container = el;
- }, "containerRef"),
- listRef: /* @__PURE__ */ __name(function listRef3(el) {
- this.list = el;
- }, "listRef")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass3() {
- return [this.cx("root"), this["class"]];
- }, "containerClass"),
- focusedOptionId: /* @__PURE__ */ __name(function focusedOptionId6() {
- return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;
- }, "focusedOptionId")
- },
- components: {
- Button: script$1d,
- PlusIcon: script$1w
- },
- directives: {
- ripple: Ripple,
- tooltip: Tooltip
- }
-};
-var _hoisted_1$a = ["id"];
-var _hoisted_2$7 = ["id", "data-p-active"];
-function render$b(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Button = resolveComponent("Button");
- var _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("div", mergeProps({
- ref: $options.containerRef,
- "class": $options.containerClass,
- style: [_ctx.style, _ctx.sx("root")]
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "button", {
- visible: $data.d_visible,
- toggleCallback: $options.onClick
- }, function() {
- return [createVNode(_component_Button, mergeProps({
- "class": [_ctx.cx("pcButton"), _ctx.buttonClass],
- disabled: _ctx.disabled,
- "aria-expanded": $data.d_visible,
- "aria-haspopup": true,
- "aria-controls": $data.id + "_list",
- "aria-label": _ctx.ariaLabel,
- "aria-labelledby": _ctx.ariaLabelledby,
- unstyled: _ctx.unstyled,
- onClick: _cache[0] || (_cache[0] = function($event) {
- return $options.onClick($event);
- }),
- onKeydown: $options.onTogglerKeydown
- }, _ctx.buttonProps, {
- pt: _ctx.ptm("pcButton")
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "icon", {
- visible: $data.d_visible
- }, function() {
- return [$data.d_visible && !!_ctx.hideIcon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.hideIcon ? "span" : "PlusIcon"), mergeProps({
- key: 0,
- "class": [_ctx.hideIcon, slotProps["class"]]
- }, _ctx.ptm("pcButton")["icon"], {
- "data-pc-section": "icon"
- }), null, 16, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.showIcon ? "span" : "PlusIcon"), mergeProps({
- key: 1,
- "class": [$data.d_visible && !!_ctx.hideIcon ? _ctx.hideIcon : _ctx.showIcon, slotProps["class"]]
- }, _ctx.ptm("pcButton")["icon"], {
- "data-pc-section": "icon"
- }), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "disabled", "aria-expanded", "aria-controls", "aria-label", "aria-labelledby", "unstyled", "onKeydown", "pt"])];
- }), createBaseVNode("ul", mergeProps({
- ref: $options.listRef,
- id: $data.id + "_list",
- "class": _ctx.cx("list"),
- style: _ctx.sx("list"),
- role: "menu",
- tabindex: "-1",
- onFocus: _cache[1] || (_cache[1] = function() {
- return $options.onFocus && $options.onFocus.apply($options, arguments);
- }),
- onBlur: _cache[2] || (_cache[2] = function() {
- return $options.onBlur && $options.onBlur.apply($options, arguments);
- }),
- onKeydown: _cache[3] || (_cache[3] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- })
- }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, index) {
- return openBlock(), createElementBlock(Fragment, {
- key: index
- }, [$options.isItemVisible(item8) ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- id: "".concat($data.id, "_").concat(index),
- "class": _ctx.cx("item", {
- id: "".concat($data.id, "_").concat(index)
- }),
- style: $options.getItemStyle(index),
- role: "none",
- "data-p-active": $options.isItemActive("".concat($data.id, "_").concat(index)),
- ref_for: true
- }, $options.getPTOptions("".concat($data.id, "_").concat(index), "item")), [!_ctx.$slots.item ? withDirectives((openBlock(), createBlock(_component_Button, mergeProps({
- key: 0,
- tabindex: -1,
- role: "menuitem",
- "class": _ctx.cx("pcAction", {
- item: item8
- }),
- "aria-label": item8.label,
- disabled: _ctx.disabled,
- unstyled: _ctx.unstyled,
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, item8);
- }, "onClick"),
- ref_for: true
- }, _ctx.actionButtonProps, {
- pt: $options.getPTOptions("".concat($data.id, "_").concat(index), "pcAction")
- }), createSlots({
- _: 2
- }, [item8.icon ? {
- name: "icon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "itemicon", {
- item: item8,
- "class": normalizeClass(slotProps["class"])
- }, function() {
- return [createBaseVNode("span", mergeProps({
- "class": [item8.icon, slotProps["class"]],
- ref_for: true
- }, $options.getPTOptions("".concat($data.id, "_").concat(index), "actionIcon")), null, 16)];
- })];
- }),
- key: "0"
- } : void 0]), 1040, ["class", "aria-label", "disabled", "unstyled", "onClick", "pt"])), [[_directive_tooltip, {
- value: item8.label,
- disabled: !_ctx.tooltipOptions
- }, _ctx.tooltipOptions]]) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.item), {
- key: 1,
- item: item8,
- onClick: /* @__PURE__ */ __name(function onClick11(event2) {
- return $options.onItemClick(event2, item8);
- }, "onClick"),
- toggleCallback: /* @__PURE__ */ __name(function toggleCallback(event2) {
- return $options.onItemClick(event2, item8);
- }, "toggleCallback")
- }, null, 8, ["item", "onClick", "toggleCallback"]))], 16, _hoisted_2$7)) : createCommentVNode("", true)], 64);
- }), 128))], 16, _hoisted_1$a)], 16), _ctx.mask ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": [_ctx.cx("mask"), _ctx.maskClass],
- style: _ctx.maskStyle
- }, _ctx.ptm("mask")), null, 16)) : createCommentVNode("", true)], 64);
-}
-__name(render$b, "render$b");
-script$c.render = render$b;
-var classes$6 = {
- root: /* @__PURE__ */ __name(function root28(_ref) {
- var instance = _ref.instance;
- return ["p-stepitem", {
- "p-stepitem-active": instance.isActive
- }];
- }, "root")
-};
-var StepItemStyle = BaseStyle.extend({
- name: "stepitem",
- classes: classes$6
-});
-var script$1$6 = {
- name: "BaseStepItem",
- "extends": script$1f,
- props: {
- value: {
- type: [String, Number],
- "default": void 0
- }
- },
- style: StepItemStyle,
- provide: /* @__PURE__ */ __name(function provide44() {
- return {
- $pcStepItem: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$b = {
- name: "StepItem",
- "extends": script$1$6,
- inheritAttrs: false,
- inject: ["$pcStepper"],
- computed: {
- isActive: /* @__PURE__ */ __name(function isActive() {
- var _this$$pcStepper;
- return ((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.d_value) === this.value;
- }, "isActive")
- }
-};
-var _hoisted_1$9 = ["data-p-active"];
-function render$a(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- "data-p-active": $options.isActive
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$9);
-}
-__name(render$a, "render$a");
-script$b.render = render$a;
-var theme$5 = /* @__PURE__ */ __name(function theme34(_ref) {
- var dt = _ref.dt;
- return '\n.p-steps {\n position: relative;\n}\n\n.p-steps-list {\n padding: 0;\n margin: 0;\n list-style-type: none;\n display: flex;\n}\n\n.p-steps-item {\n position: relative;\n display: flex;\n justify-content: center;\n flex: 1 1 auto;\n}\n\n.p-steps-item.p-disabled,\n.p-steps-item.p-disabled * {\n opacity: 1;\n pointer-events: auto;\n user-select: auto;\n cursor: auto;\n}\n\n.p-steps-item:before {\n content: " ";\n border-top: 2px solid '.concat(dt("steps.separator.background"), ";\n width: 100%;\n top: 50%;\n left: 0;\n display: block;\n position: absolute;\n margin-top: calc(-1rem + 1px);\n}\n\n.p-steps-item:first-child::before {\n width: calc(50% + 1rem);\n transform: translateX(100%);\n}\n\n.p-steps-item:last-child::before {\n width: 50%;\n}\n\n.p-steps-item-link {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n overflow: hidden;\n text-decoration: none;\n transition: outline-color ").concat(dt("steps.transition.duration"), ", box-shadow ").concat(dt("steps.transition.duration"), ";\n border-radius: ").concat(dt("steps.item.link.border.radius"), ";\n outline-color: transparent;\n gap: ").concat(dt("steps.item.link.gap"), ";\n}\n\n.p-steps-item-link:not(.p-disabled):focus-visible {\n box-shadow: ").concat(dt("steps.item.link.focus.ring.shadow"), ";\n outline: ").concat(dt("steps.item.link.focus.ring.width"), " ").concat(dt("steps.item.link.focus.ring.style"), " ").concat(dt("steps.item.link.focus.ring.color"), ";\n outline-offset: ").concat(dt("steps.item.link.focus.ring.offset"), ";\n}\n\n.p-steps-item-label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("steps.item.label.color"), ";\n display: block;\n font-weight: ").concat(dt("steps.item.label.font.weight"), ";\n}\n\n.p-steps-item-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("steps.item.number.color"), ";\n border: 2px solid ").concat(dt("steps.item.number.border.color"), ";\n background: ").concat(dt("steps.item.number.background"), ";\n min-width: ").concat(dt("steps.item.number.size"), ";\n height: ").concat(dt("steps.item.number.size"), ";\n line-height: ").concat(dt("steps.item.number.size"), ";\n font-size: ").concat(dt("steps.item.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("steps.item.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("steps.item.number.font.weight"), ';\n}\n\n.p-steps-item-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("steps.item.number.border.radius"), ";\n box-shadow: ").concat(dt("steps.item.number.shadow"), ";\n}\n\n.p-steps:not(.p-readonly) .p-steps-item {\n cursor: pointer;\n}\n\n.p-steps-item-active .p-steps-item-number {\n background: ").concat(dt("steps.item.number.active.background"), ";\n border-color: ").concat(dt("steps.item.number.active.border.color"), ";\n color: ").concat(dt("steps.item.number.active.color"), ";\n}\n\n.p-steps-item-active .p-steps-item-label {\n color: ").concat(dt("steps.item.label.active.color"), ";\n}\n");
-}, "theme");
-var classes$5 = {
- root: /* @__PURE__ */ __name(function root29(_ref2) {
- var props = _ref2.props;
- return ["p-steps p-component", {
- "p-readonly": props.readonly
- }];
- }, "root"),
- list: "p-steps-list",
- item: /* @__PURE__ */ __name(function item6(_ref3) {
- var instance = _ref3.instance, _item = _ref3.item, index = _ref3.index;
- return ["p-steps-item", {
- "p-steps-item-active": instance.isActive(index),
- "p-disabled": instance.isItemDisabled(_item, index)
- }];
- }, "item"),
- itemLink: "p-steps-item-link",
- itemNumber: "p-steps-item-number",
- itemLabel: "p-steps-item-label"
-};
-var StepsStyle = BaseStyle.extend({
- name: "steps",
- theme: theme$5,
- classes: classes$5
-});
-var script$1$5 = {
- name: "BaseSteps",
- "extends": script$1f,
- props: {
- id: {
- type: String
- },
- model: {
- type: Array,
- "default": null
- },
- readonly: {
- type: Boolean,
- "default": true
- },
- activeStep: {
- type: Number,
- "default": 0
- }
- },
- style: StepsStyle,
- provide: /* @__PURE__ */ __name(function provide45() {
- return {
- $pcSteps: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$a = {
- name: "Steps",
- "extends": script$1$5,
- inheritAttrs: false,
- emits: ["update:activeStep", "step-change"],
- data: /* @__PURE__ */ __name(function data32() {
- return {
- d_activeStep: this.activeStep
- };
- }, "data"),
- watch: {
- activeStep: /* @__PURE__ */ __name(function activeStep(newValue) {
- this.d_activeStep = newValue;
- }, "activeStep")
- },
- mounted: /* @__PURE__ */ __name(function mounted36() {
- var firstItem = this.findFirstItem();
- firstItem && (firstItem.tabIndex = "0");
- }, "mounted"),
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions11(key, item8, index) {
- return this.ptm(key, {
- context: {
- item: item8,
- index,
- active: this.isActive(index),
- disabled: this.isItemDisabled(item8, index)
- }
- });
- }, "getPTOptions"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick8(event2, item8, index) {
- if (this.disabled(item8) || this.readonly) {
- event2.preventDefault();
- return;
- }
- if (item8.command) {
- item8.command({
- originalEvent: event2,
- item: item8
- });
- }
- if (index !== this.d_activeStep) {
- this.d_activeStep = index;
- this.$emit("update:activeStep", this.d_activeStep);
- }
- this.$emit("step-change", {
- originalEvent: event2,
- index
- });
- }, "onItemClick"),
- onItemKeydown: /* @__PURE__ */ __name(function onItemKeydown(event2, item8) {
- switch (event2.code) {
- case "ArrowRight": {
- this.navigateToNextItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- this.navigateToPrevItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "Home": {
- this.navigateToFirstItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "End": {
- this.navigateToLastItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "Tab":
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space": {
- this.onItemClick(event2, item8);
- event2.preventDefault();
- break;
- }
- }
- }, "onItemKeydown"),
- navigateToNextItem: /* @__PURE__ */ __name(function navigateToNextItem(target) {
- var nextItem = this.findNextItem(target);
- nextItem && this.setFocusToMenuitem(target, nextItem);
- }, "navigateToNextItem"),
- navigateToPrevItem: /* @__PURE__ */ __name(function navigateToPrevItem(target) {
- var prevItem = this.findPrevItem(target);
- prevItem && this.setFocusToMenuitem(target, prevItem);
- }, "navigateToPrevItem"),
- navigateToFirstItem: /* @__PURE__ */ __name(function navigateToFirstItem(target) {
- var firstItem = this.findFirstItem(target);
- firstItem && this.setFocusToMenuitem(target, firstItem);
- }, "navigateToFirstItem"),
- navigateToLastItem: /* @__PURE__ */ __name(function navigateToLastItem(target) {
- var lastItem = this.findLastItem(target);
- lastItem && this.setFocusToMenuitem(target, lastItem);
- }, "navigateToLastItem"),
- findNextItem: /* @__PURE__ */ __name(function findNextItem2(item8) {
- var nextItem = item8.parentElement.nextElementSibling;
- return nextItem ? nextItem.children[0] : null;
- }, "findNextItem"),
- findPrevItem: /* @__PURE__ */ __name(function findPrevItem2(item8) {
- var prevItem = item8.parentElement.previousElementSibling;
- return prevItem ? prevItem.children[0] : null;
- }, "findPrevItem"),
- findFirstItem: /* @__PURE__ */ __name(function findFirstItem2() {
- var firstSibling = findSingle(this.$refs.list, '[data-pc-section="item"]');
- return firstSibling ? firstSibling.children[0] : null;
- }, "findFirstItem"),
- findLastItem: /* @__PURE__ */ __name(function findLastItem2() {
- var siblings = find(this.$refs.list, '[data-pc-section="item"]');
- return siblings ? siblings[siblings.length - 1].children[0] : null;
- }, "findLastItem"),
- setFocusToMenuitem: /* @__PURE__ */ __name(function setFocusToMenuitem(target, focusableItem) {
- target.tabIndex = "-1";
- focusableItem.tabIndex = "0";
- focusableItem.focus();
- }, "setFocusToMenuitem"),
- isActive: /* @__PURE__ */ __name(function isActive2(index) {
- return index === this.d_activeStep;
- }, "isActive"),
- isItemDisabled: /* @__PURE__ */ __name(function isItemDisabled6(item8, index) {
- return this.disabled(item8) || this.readonly && !this.isActive(index);
- }, "isItemDisabled"),
- visible: /* @__PURE__ */ __name(function visible5(item8) {
- return typeof item8.visible === "function" ? item8.visible() : item8.visible !== false;
- }, "visible"),
- disabled: /* @__PURE__ */ __name(function disabled5(item8) {
- return typeof item8.disabled === "function" ? item8.disabled() : item8.disabled;
- }, "disabled"),
- label: /* @__PURE__ */ __name(function label8(item8) {
- return typeof item8.label === "function" ? item8.label() : item8.label;
- }, "label"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps7(item8, index) {
- var _this = this;
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return _this.onItemClick($event, item8);
- }, "onClick"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown15($event) {
- return _this.onItemKeydown($event, item8);
- }, "onKeyDown")
- }, this.getPTOptions("itemLink", item8, index)),
- step: mergeProps({
- "class": this.cx("itemNumber")
- }, this.getPTOptions("itemNumber", item8, index)),
- label: mergeProps({
- "class": this.cx("itemLabel")
- }, this.getPTOptions("itemLabel", item8, index))
- };
- }, "getMenuItemProps")
- }
-};
-var _hoisted_1$8 = ["id"];
-var _hoisted_2$6 = ["aria-current", "onClick", "onKeydown", "data-p-active", "data-p-disabled"];
-function render$9(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("nav", mergeProps({
- id: _ctx.id,
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("ol", mergeProps({
- ref: "list",
- "class": _ctx.cx("list")
- }, _ctx.ptm("list")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, index) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.label(item8) + "_" + index.toString()
- }, [$options.visible(item8) ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- "class": [_ctx.cx("item", {
- item: item8,
- index
- }), item8["class"]],
- style: item8.style,
- "aria-current": $options.isActive(index) ? "step" : void 0,
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, item8, index);
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onItemKeydown($event, item8, index);
- }, "onKeydown"),
- ref_for: true
- }, $options.getPTOptions("item", item8, index), {
- "data-p-active": $options.isActive(index),
- "data-p-disabled": $options.isItemDisabled(item8, index)
- }), [!_ctx.$slots.item ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("itemLink"),
- ref_for: true
- }, $options.getPTOptions("itemLink", item8, index)), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemNumber"),
- ref_for: true
- }, $options.getPTOptions("itemNumber", item8, index)), toDisplayString(index + 1), 17), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemLabel"),
- ref_for: true
- }, $options.getPTOptions("itemLabel", item8, index)), toDisplayString($options.label(item8)), 17)], 16)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.item), {
- key: 1,
- item: item8,
- index,
- active: index === $data.d_activeStep,
- label: $options.label(item8),
- props: $options.getMenuItemProps(item8, index)
- }, null, 8, ["item", "index", "active", "label", "props"]))], 16, _hoisted_2$6)) : createCommentVNode("", true)], 64);
- }), 128))], 16)], 16, _hoisted_1$8);
-}
-__name(render$9, "render$9");
-script$a.render = render$9;
-var StyleClassStyle = BaseStyle.extend({
- name: "styleclass-directive"
-});
-var BaseStyleClass = BaseDirective.extend({
- style: StyleClassStyle
-});
-var StyleClass = BaseStyleClass.extend("styleclass", {
- mounted: /* @__PURE__ */ __name(function mounted37(el, binding) {
- el.setAttribute("data-pd-styleclass", true);
- this.bind(el, binding);
- }, "mounted"),
- unmounted: /* @__PURE__ */ __name(function unmounted5(el) {
- this.unbind(el);
- }, "unmounted"),
- methods: {
- bind: /* @__PURE__ */ __name(function bind(el, binding) {
- var _this = this;
- var target = this.resolveTarget(el, binding);
- this.$el = target;
- el.$_pstyleclass_clicklistener = function() {
- if (binding.value.toggleClass) {
- if (hasClass(target, binding.value.toggleClass)) removeClass(target, binding.value.toggleClass);
- else addClass(target, binding.value.toggleClass);
- } else {
- if (target.offsetParent === null) _this.enter(target, el, binding);
- else _this.leave(target, binding);
- }
- };
- el.addEventListener("click", el.$_pstyleclass_clicklistener);
- }, "bind"),
- unbind: /* @__PURE__ */ __name(function unbind(el) {
- if (el.$_pstyleclass_clicklistener) {
- el.removeEventListener("click", el.$_pstyleclass_clicklistener);
- el.$_pstyleclass_clicklistener = null;
- }
- this.unbindDocumentListener(el);
- }, "unbind"),
- enter: /* @__PURE__ */ __name(function enter2(target, el, binding) {
- if (binding.value.enterActiveClass) {
- if (!target.$_pstyleclass_animating) {
- target.$_pstyleclass_animating = true;
- if (binding.value.enterActiveClass.includes("slidedown")) {
- target.style.height = "0px";
- removeClass(target, binding.value.hiddenClass || binding.value.enterFromClass);
- target.style.maxHeight = target.scrollHeight + "px";
- addClass(target, binding.value.hiddenClass || binding.value.enterActiveClass);
- target.style.height = "";
- }
- addClass(target, binding.value.enterActiveClass);
- if (binding.value.enterFromClass) {
- removeClass(target, binding.value.enterFromClass);
- }
- target.$p_styleclass_enterlistener = function() {
- removeClass(target, binding.value.enterActiveClass);
- if (binding.value.enterToClass) {
- addClass(target, binding.value.enterToClass);
- }
- target.removeEventListener("animationend", target.$p_styleclass_enterlistener);
- if (binding.value.enterActiveClass.includes("slidedown")) {
- target.style.maxHeight = "";
- }
- target.$_pstyleclass_animating = false;
- };
- target.addEventListener("animationend", target.$p_styleclass_enterlistener);
- }
- } else {
- if (binding.value.enterFromClass) {
- removeClass(target, binding.value.enterFromClass);
- }
- if (binding.value.enterToClass) {
- addClass(target, binding.value.enterToClass);
- }
- }
- if (binding.value.hideOnOutsideClick) {
- this.bindDocumentListener(target, el, binding);
- }
- }, "enter"),
- leave: /* @__PURE__ */ __name(function leave2(target, binding) {
- if (binding.value.leaveActiveClass) {
- if (!target.$_pstyleclass_animating) {
- target.$_pstyleclass_animating = true;
- addClass(target, binding.value.leaveActiveClass);
- if (binding.value.leaveFromClass) {
- removeClass(target, binding.value.leaveFromClass);
- }
- target.$p_styleclass_leavelistener = function() {
- removeClass(target, binding.value.leaveActiveClass);
- if (binding.value.leaveToClass) {
- addClass(target, binding.value.leaveToClass);
- }
- target.removeEventListener("animationend", target.$p_styleclass_leavelistener);
- target.$_pstyleclass_animating = false;
- };
- target.addEventListener("animationend", target.$p_styleclass_leavelistener);
- }
- } else {
- if (binding.value.leaveFromClass) {
- removeClass(target, binding.value.leaveFromClass);
- }
- if (binding.value.leaveToClass) {
- addClass(target, binding.value.leaveToClass);
- }
- }
- if (binding.value.hideOnOutsideClick) {
- this.unbindDocumentListener(target);
- }
- }, "leave"),
- resolveTarget: /* @__PURE__ */ __name(function resolveTarget(el, binding) {
- switch (binding.value.selector) {
- case "@next":
- return el.nextElementSibling;
- case "@prev":
- return el.previousElementSibling;
- case "@parent":
- return el.parentElement;
- case "@grandparent":
- return el.parentElement.parentElement;
- default:
- return document.querySelector(binding.value.selector);
- }
- }, "resolveTarget"),
- bindDocumentListener: /* @__PURE__ */ __name(function bindDocumentListener(target, el, binding) {
- var _this2 = this;
- if (!target.$p_styleclass_documentlistener) {
- target.$p_styleclass_documentlistener = function(event2) {
- if (!_this2.isVisible(target) || getComputedStyle(target).getPropertyValue("position") === "static") {
- _this2.unbindDocumentListener(target);
- } else if (_this2.isOutsideClick(event2, target, el)) {
- _this2.leave(target, binding);
- }
- };
- target.ownerDocument.addEventListener("click", target.$p_styleclass_documentlistener);
- }
- }, "bindDocumentListener"),
- unbindDocumentListener: /* @__PURE__ */ __name(function unbindDocumentListener(target) {
- if (target.$p_styleclass_documentlistener) {
- target.ownerDocument.removeEventListener("click", target.$p_styleclass_documentlistener);
- target.$p_styleclass_documentlistener = null;
- }
- }, "unbindDocumentListener"),
- isVisible: /* @__PURE__ */ __name(function isVisible(target) {
- return target.offsetParent !== null;
- }, "isVisible"),
- isOutsideClick: /* @__PURE__ */ __name(function isOutsideClick(event2, target, el) {
- return !el.isSameNode(event2.target) && !el.contains(event2.target) && !target.contains(event2.target);
- }, "isOutsideClick")
- }
-});
-var theme$4 = /* @__PURE__ */ __name(function theme35(_ref) {
- var dt = _ref.dt;
- return "\n.p-tabmenu {\n overflow-x: auto;\n}\n\n.p-tabmenu-tablist {\n display: flex;\n margin: 0;\n padding: 0;\n list-style-type: none;\n background: ".concat(dt("tabmenu.tablist.background"), ";\n border-style: solid;\n border-color: ").concat(dt("tabmenu.tablist.border.color"), ";\n border-width: ").concat(dt("tabmenu.tablist.border.width"), ";\n position: relative;\n}\n\n.p-tabmenu-item-link {\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n text-decoration: none;\n position: relative;\n overflow: hidden;\n background: ").concat(dt("tabmenu.item.background"), ";\n border-style: solid;\n border-width: ").concat(dt("tabmenu.item.border.width"), ";\n border-color: ").concat(dt("tabmenu.item.border.color"), ";\n color: ").concat(dt("tabmenu.item.color"), ";\n padding: ").concat(dt("tabmenu.item.padding"), ";\n font-weight: ").concat(dt("tabmenu.item.font.weight"), ";\n transition: background ").concat(dt("tabmenu.transition.duration"), ", border-color ").concat(dt("tabmenu.transition.duration"), ", color ").concat(dt("tabmenu.transition.duration"), ", outline-color ").concat(dt("tabmenu.transition.duration"), ", box-shadow ").concat(dt("tabmenu.transition.duration"), ";\n margin: ").concat(dt("tabmenu.item.margin"), ";\n outline-color: transparent;\n gap: ").concat(dt("tabmenu.item.gap"), ";\n}\n\n.p-tabmenu-item-link:focus-visible {\n z-index: 1;\n box-shadow: ").concat(dt("tabmenu.item.focus.ring.shadow"), ";\n outline: ").concat(dt("tabmenu.item.focus.ring.width"), " ").concat(dt("tabmenu.item.focus.ring.style"), " ").concat(dt("tabmenu.item.focus.ring.color"), ";\n outline-offset: ").concat(dt("tabmenu.item.focus.ring.offset"), ";\n}\n\n.p-tabmenu-item-icon {\n color: ").concat(dt("tabmenu.item.icon.color"), ";\n transition: background ").concat(dt("tabmenu.transition.duration"), ", border-color ").concat(dt("tabmenu.transition.duration"), ", color ").concat(dt("tabmenu.transition.duration"), ", outline-color ").concat(dt("tabmenu.transition.duration"), ", box-shadow ").concat(dt("tabmenu.transition.duration"), ";\n}\n\n.p-tabmenu-item-label {\n line-height: 1;\n}\n\n.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-link {\n background: ").concat(dt("tabmenu.item.hover.background"), ";\n border-color: ").concat(dt("tabmenu.item.hover.border.color"), ";\n color: ").concat(dt("tabmenu.item.hover.color"), ";\n}\n\n.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-icon {\n color: ").concat(dt("tabmenu.item.icon.hover.color"), ";\n}\n\n.p-tabmenu-item-active .p-tabmenu-item-link {\n background: ").concat(dt("tabmenu.item.active.background"), ";\n border-color: ").concat(dt("tabmenu.item.active.border.color"), ";\n color: ").concat(dt("tabmenu.item.active.color"), ";\n}\n\n.p-tabmenu-item-active .p-tabmenu-item-icon {\n color: ").concat(dt("tabmenu.item.icon.active.color"), ";\n}\n\n.p-tabmenu-active-bar {\n z-index: 1;\n display: block;\n position: absolute;\n bottom: ").concat(dt("tabmenu.active.bar.bottom"), ";\n height: ").concat(dt("tabmenu.active.bar.height"), ";\n background: ").concat(dt("tabmenu.active.bar.background"), ";\n transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);\n}\n\n.p-tabmenu::-webkit-scrollbar {\n display: none;\n}\n");
-}, "theme");
-var classes$4 = {
- root: "p-tabmenu p-component",
- tablist: "p-tabmenu-tablist",
- item: /* @__PURE__ */ __name(function item7(_ref2) {
- var instance = _ref2.instance, index = _ref2.index, _item = _ref2.item;
- return ["p-tabmenu-item", {
- "p-tabmenu-item-active": instance.d_activeIndex === index,
- "p-disabled": instance.disabled(_item)
- }];
- }, "item"),
- itemLink: "p-tabmenu-item-link",
- itemIcon: "p-tabmenu-item-icon",
- itemLabel: "p-tabmenu-item-label",
- activeBar: "p-tabmenu-active-bar"
-};
-var TabMenuStyle = BaseStyle.extend({
- name: "tabmenu",
- theme: theme$4,
- classes: classes$4
-});
-var script$1$4 = {
- name: "BaseTabMenu",
- "extends": script$1f,
- props: {
- model: {
- type: Array,
- "default": null
- },
- activeIndex: {
- type: Number,
- "default": 0
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- }
- },
- style: TabMenuStyle,
- provide: /* @__PURE__ */ __name(function provide46() {
- return {
- $pcTabMenu: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$9 = {
- name: "TabMenu",
- "extends": script$1$4,
- inheritAttrs: false,
- emits: ["update:activeIndex", "tab-change"],
- data: /* @__PURE__ */ __name(function data33() {
- return {
- d_activeIndex: this.activeIndex
- };
- }, "data"),
- watch: {
- activeIndex: {
- flush: "post",
- handler: /* @__PURE__ */ __name(function handler3(newValue) {
- this.d_activeIndex = newValue;
- this.updateInkBar();
- }, "handler")
- }
- },
- mounted: /* @__PURE__ */ __name(function mounted38() {
- var _this = this;
- this.$nextTick(function() {
- _this.updateInkBar();
- });
- var activeItem2 = this.findActiveItem();
- activeItem2 && (activeItem2.tabIndex = "0");
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated7() {
- this.updateInkBar();
- }, "updated"),
- methods: {
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions12(key, item8, index) {
- return this.ptm(key, {
- context: {
- item: item8,
- index
- }
- });
- }, "getPTOptions"),
- onItemClick: /* @__PURE__ */ __name(function onItemClick9(event2, item8, index) {
- if (this.disabled(item8)) {
- event2.preventDefault();
- return;
- }
- if (item8.command) {
- item8.command({
- originalEvent: event2,
- item: item8
- });
- }
- if (index !== this.d_activeIndex) {
- this.d_activeIndex = index;
- this.$emit("update:activeIndex", this.d_activeIndex);
- }
- this.$emit("tab-change", {
- originalEvent: event2,
- index
- });
- }, "onItemClick"),
- onKeydownItem: /* @__PURE__ */ __name(function onKeydownItem(event2, item8, index) {
- switch (event2.code) {
- case "ArrowRight": {
- this.navigateToNextItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "ArrowLeft": {
- this.navigateToPrevItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "Home": {
- this.navigateToFirstItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "End": {
- this.navigateToLastItem(event2.target);
- event2.preventDefault();
- break;
- }
- case "Space":
- case "NumpadEnter":
- case "Enter": {
- this.onItemClick(event2, item8, index);
- event2.preventDefault();
- break;
- }
- case "Tab": {
- this.onTabKey();
- break;
- }
- }
- }, "onKeydownItem"),
- navigateToNextItem: /* @__PURE__ */ __name(function navigateToNextItem2(target) {
- var nextItem = this.findNextItem(target);
- nextItem && this.setFocusToMenuitem(target, nextItem);
- }, "navigateToNextItem"),
- navigateToPrevItem: /* @__PURE__ */ __name(function navigateToPrevItem2(target) {
- var prevItem = this.findPrevItem(target);
- prevItem && this.setFocusToMenuitem(target, prevItem);
- }, "navigateToPrevItem"),
- navigateToFirstItem: /* @__PURE__ */ __name(function navigateToFirstItem2(target) {
- var firstItem = this.findFirstItem(target);
- firstItem && this.setFocusToMenuitem(target, firstItem);
- }, "navigateToFirstItem"),
- navigateToLastItem: /* @__PURE__ */ __name(function navigateToLastItem2(target) {
- var lastItem = this.findLastItem(target);
- lastItem && this.setFocusToMenuitem(target, lastItem);
- }, "navigateToLastItem"),
- findNextItem: /* @__PURE__ */ __name(function findNextItem3(item8) {
- var nextItem = item8.parentElement.nextElementSibling;
- return nextItem ? getAttribute(nextItem, "data-p-disabled") === true ? this.findNextItem(nextItem.children[0]) : nextItem.children[0] : null;
- }, "findNextItem"),
- findPrevItem: /* @__PURE__ */ __name(function findPrevItem3(item8) {
- var prevItem = item8.parentElement.previousElementSibling;
- return prevItem ? getAttribute(prevItem, "data-p-disabled") === true ? this.findPrevItem(prevItem.children[0]) : prevItem.children[0] : null;
- }, "findPrevItem"),
- findFirstItem: /* @__PURE__ */ __name(function findFirstItem3() {
- var firstSibling = findSingle(this.$refs.nav, '[data-pc-section="item"][data-p-disabled="false"]');
- return firstSibling ? firstSibling.children[0] : null;
- }, "findFirstItem"),
- findLastItem: /* @__PURE__ */ __name(function findLastItem3() {
- var siblings = find(this.$refs.nav, '[data-pc-section="item"][data-p-disabled="false"]');
- return siblings ? siblings[siblings.length - 1].children[0] : null;
- }, "findLastItem"),
- findActiveItem: /* @__PURE__ */ __name(function findActiveItem() {
- var activeItem2 = findSingle(this.$refs.nav, '[data-pc-section="item"][data-p-disabled="false"][data-p-active="true"]');
- return activeItem2 ? activeItem2.children[0] : null;
- }, "findActiveItem"),
- setFocusToMenuitem: /* @__PURE__ */ __name(function setFocusToMenuitem2(target, focusableItem) {
- target.tabIndex = "-1";
- focusableItem.tabIndex = "0";
- focusableItem.focus();
- }, "setFocusToMenuitem"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey4() {
- var activeItem2 = findSingle(this.$refs.nav, '[data-pc-section="item"][data-p-disabled="false"][data-p-active="true"]');
- var focusedItem = findSingle(this.$refs.nav, '[data-pc-section="itemlink"][tabindex="0"]');
- if (focusedItem !== activeItem2.children[0]) {
- activeItem2 && (activeItem2.children[0].tabIndex = "0");
- focusedItem.tabIndex = "-1";
- }
- }, "onTabKey"),
- visible: /* @__PURE__ */ __name(function visible6(item8) {
- return typeof item8.visible === "function" ? item8.visible() : item8.visible !== false;
- }, "visible"),
- disabled: /* @__PURE__ */ __name(function disabled6(item8) {
- return typeof item8.disabled === "function" ? item8.disabled() : item8.disabled === true;
- }, "disabled"),
- label: /* @__PURE__ */ __name(function label9(item8) {
- return typeof item8.label === "function" ? item8.label() : item8.label;
- }, "label"),
- updateInkBar: /* @__PURE__ */ __name(function updateInkBar() {
- var tabs2 = this.$refs.nav.children;
- var inkHighlighted = false;
- for (var i = 0; i < tabs2.length; i++) {
- var tab = tabs2[i];
- if (getAttribute(tab, "data-p-active")) {
- this.$refs.inkbar.style.width = getWidth(tab) + "px";
- this.$refs.inkbar.style.left = getOffset(tab).left - getOffset(this.$refs.nav).left + "px";
- inkHighlighted = true;
- }
- }
- if (!inkHighlighted) {
- this.$refs.inkbar.style.width = "0px";
- this.$refs.inkbar.style.left = "0px";
- }
- }, "updateInkBar"),
- getMenuItemProps: /* @__PURE__ */ __name(function getMenuItemProps8(item8, index) {
- var _this2 = this;
- return {
- action: mergeProps({
- "class": this.cx("itemLink"),
- tabindex: -1,
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return _this2.onItemClick($event, item8, index);
- }, "onClick"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown15($event) {
- return _this2.onKeydownItem($event, item8, index);
- }, "onKeyDown")
- }, this.getPTOptions("itemLink", item8, index)),
- icon: mergeProps({
- "class": [this.cx("itemIcon"), item8.icon]
- }, this.getPTOptions("itemIcon", item8, index)),
- label: mergeProps({
- "class": this.cx("itemLabel")
- }, this.getPTOptions("itemLabel", item8, index))
- };
- }, "getMenuItemProps")
- },
- directives: {
- ripple: Ripple
- }
-};
-var _hoisted_1$7 = ["aria-labelledby", "aria-label"];
-var _hoisted_2$5 = ["onClick", "onKeydown", "data-p-active", "data-p-disabled"];
-var _hoisted_3$5 = ["href", "target", "aria-label", "aria-disabled"];
-function render$8(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [createBaseVNode("ul", mergeProps({
- ref: "nav",
- "class": _ctx.cx("tablist"),
- role: "menubar",
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel
- }, _ctx.ptm("tablist")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model, function(item8, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.label(item8) + "_" + i.toString()
- }, [$options.visible(item8) ? (openBlock(), createElementBlock("li", mergeProps({
- key: 0,
- ref_for: true,
- ref: "tab",
- "class": [_ctx.cx("item", {
- item: item8,
- index: i
- }), item8["class"]],
- role: "presentation",
- onClick: /* @__PURE__ */ __name(function onClick11($event) {
- return $options.onItemClick($event, item8, i);
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown5($event) {
- return $options.onKeydownItem($event, item8, i);
- }, "onKeydown")
- }, $options.getPTOptions("item", item8, i), {
- "data-p-active": $data.d_activeIndex === i,
- "data-p-disabled": $options.disabled(item8)
- }), [!_ctx.$slots.item ? withDirectives((openBlock(), createElementBlock("a", mergeProps({
- key: 0,
- ref_for: true,
- ref: "tabLink",
- role: "menuitem",
- href: item8.url,
- "class": _ctx.cx("itemLink"),
- target: item8.target,
- "aria-label": $options.label(item8),
- "aria-disabled": $options.disabled(item8),
- tabindex: -1
- }, $options.getPTOptions("itemLink", item8, i)), [_ctx.$slots.itemicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.itemicon), {
- key: 0,
- item: item8,
- "class": normalizeClass(_ctx.cx("itemIcon"))
- }, null, 8, ["item", "class"])) : item8.icon ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": [_ctx.cx("itemIcon"), item8.icon],
- ref_for: true
- }, $options.getPTOptions("itemIcon", item8, i)), null, 16)) : createCommentVNode("", true), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("itemLabel"),
- ref_for: true
- }, $options.getPTOptions("itemLabel", item8, i)), toDisplayString($options.label(item8)), 17)], 16, _hoisted_3$5)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.item), {
- key: 1,
- item: item8,
- index: i,
- active: i === $data.d_activeIndex,
- label: $options.label(item8),
- props: $options.getMenuItemProps(item8, i)
- }, null, 8, ["item", "index", "active", "label", "props"]))], 16, _hoisted_2$5)) : createCommentVNode("", true)], 64);
- }), 128)), createBaseVNode("li", mergeProps({
- ref: "inkbar",
- role: "none",
- "class": _ctx.cx("activeBar")
- }, _ctx.ptm("activeBar")), null, 16)], 16, _hoisted_1$7)], 16);
-}
-__name(render$8, "render$8");
-script$9.render = render$8;
-var TerminalService = EventBus();
-var theme$3 = /* @__PURE__ */ __name(function theme36(_ref) {
- var dt = _ref.dt;
- return "\n.p-terminal {\n height: ".concat(dt("terminal.height"), ";\n overflow: auto;\n background: ").concat(dt("terminal.background"), ";\n color: ").concat(dt("terminal.color"), ";\n border: 1px solid ").concat(dt("terminal.border.color"), ";\n padding: ").concat(dt("terminal.padding"), ";\n border-radius: ").concat(dt("terminal.border.radius"), ";\n}\n\n.p-terminal-prompt {\n display: flex;\n align-items: center;\n}\n\n.p-terminal-prompt-value {\n flex: 1 1 auto;\n border: 0 none;\n background: transparent;\n color: inherit;\n padding: 0;\n outline: 0 none;\n font-family: inherit;\n font-feature-settings: inherit;\n font-size: 1rem;\n}\n\n.p-terminal-prompt-label {\n margin-inline-end: ").concat(dt("terminal.prompt.gap"), ";\n}\n\n.p-terminal-input::-ms-clear {\n display: none;\n}\n\n.p-terminal-command-response {\n margin: ").concat(dt("terminal.command.response.margin"), ";\n}\n");
-}, "theme");
-var classes$3 = {
- root: "p-terminal p-component",
- welcomeMessage: "p-terminal-welcome-message",
- commandList: "p-terminal-command-list",
- command: "p-terminal-command",
- commandValue: "p-terminal-command-value",
- commandResponse: "p-terminal-command-response",
- prompt: "p-terminal-prompt",
- promptLabel: "p-terminal-prompt-label",
- promptValue: "p-terminal-prompt-value"
-};
-var TerminalStyle = BaseStyle.extend({
- name: "terminal",
- theme: theme$3,
- classes: classes$3
-});
-var script$1$3 = {
- name: "BaseTerminal",
- "extends": script$1f,
- props: {
- welcomeMessage: {
- type: String,
- "default": null
- },
- prompt: {
- type: String,
- "default": null
- }
- },
- style: TerminalStyle,
- provide: /* @__PURE__ */ __name(function provide47() {
- return {
- $pcTerminal: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$8 = {
- name: "Terminal",
- "extends": script$1$3,
- inheritAttrs: false,
- data: /* @__PURE__ */ __name(function data34() {
- return {
- commandText: null,
- commands: []
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted39() {
- TerminalService.on("response", this.responseListener);
- this.$refs.input.focus();
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated8() {
- this.$el.scrollTop = this.$el.scrollHeight;
- }, "updated"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount15() {
- TerminalService.off("response", this.responseListener);
- }, "beforeUnmount"),
- methods: {
- onClick: /* @__PURE__ */ __name(function onClick7() {
- this.$refs.input.focus();
- }, "onClick"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown4(event2) {
- if (event2.key === "Enter" && this.commandText) {
- this.commands.push({
- text: this.commandText
- });
- TerminalService.emit("command", this.commandText);
- this.commandText = "";
- }
- }, "onKeydown"),
- responseListener: /* @__PURE__ */ __name(function responseListener(response) {
- this.commands[this.commands.length - 1].response = response;
- }, "responseListener")
- }
-};
-function render$7(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- onClick: _cache[2] || (_cache[2] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- })
- }, _ctx.ptmi("root")), [_ctx.welcomeMessage ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("welcomeMessage")
- }, _ctx.ptm("welcomeMessage")), toDisplayString(_ctx.welcomeMessage), 17)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("commandList")
- }, _ctx.ptm("content")), [(openBlock(true), createElementBlock(Fragment, null, renderList($data.commands, function(command, i) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: command.text + i.toString(),
- "class": _ctx.cx("command"),
- ref_for: true
- }, _ctx.ptm("commands")), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("promptLabel"),
- ref_for: true
- }, _ctx.ptm("prompt")), toDisplayString(_ctx.prompt), 17), createBaseVNode("span", mergeProps({
- "class": _ctx.cx("commandValue"),
- ref_for: true
- }, _ctx.ptm("command")), toDisplayString(command.text), 17), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("commandResponse"),
- "aria-live": "polite",
- ref_for: true
- }, _ctx.ptm("response")), toDisplayString(command.response), 17)], 16);
- }), 128))], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("prompt")
- }, _ctx.ptm("container")), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("promptLabel")
- }, _ctx.ptm("prompt")), toDisplayString(_ctx.prompt), 17), withDirectives(createBaseVNode("input", mergeProps({
- ref: "input",
- "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
- return $data.commandText = $event;
- }),
- "class": _ctx.cx("promptValue"),
- type: "text",
- autocomplete: "off",
- onKeydown: _cache[1] || (_cache[1] = function() {
- return $options.onKeydown && $options.onKeydown.apply($options, arguments);
- })
- }, _ctx.ptm("commandText")), null, 16), [[vModelText, $data.commandText]])], 16)], 16);
-}
-__name(render$7, "render$7");
-script$8.render = render$7;
-var theme$2 = /* @__PURE__ */ __name(function theme37(_ref) {
- var dt = _ref.dt;
- return "\n.p-timeline {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n direction: ltr;\n}\n\n.p-timeline-left .p-timeline-event-opposite {\n text-align: right;\n}\n\n.p-timeline-left .p-timeline-event-content {\n text-align: left;\n}\n\n.p-timeline-right .p-timeline-event {\n flex-direction: row-reverse;\n}\n\n.p-timeline-right .p-timeline-event-opposite {\n text-align: left;\n}\n\n.p-timeline-right .p-timeline-event-content {\n text-align: right;\n}\n\n.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: row-reverse;\n}\n\n.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite {\n text-align: right;\n}\n\n.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content {\n text-align: left;\n}\n\n.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite {\n text-align: left;\n}\n\n.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content {\n text-align: right;\n}\n\n.p-timeline-vertical .p-timeline-event-opposite,\n.p-timeline-vertical .p-timeline-event-content {\n padding: ".concat(dt("timeline.vertical.event.content.padding"), ";\n}\n\n.p-timeline-vertical .p-timeline-event-connector {\n width: ").concat(dt("timeline.event.connector.size"), ";\n}\n\n.p-timeline-event {\n display: flex;\n position: relative;\n min-height: ").concat(dt("timeline.event.min.height"), ";\n}\n\n.p-timeline-event:last-child {\n min-height: 0;\n}\n\n.p-timeline-event-opposite {\n flex: 1;\n}\n\n.p-timeline-event-content {\n flex: 1;\n}\n\n.p-timeline-event-separator {\n flex: 0;\n display: flex;\n align-items: center;\n flex-direction: column;\n}\n\n.p-timeline-event-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n align-self: baseline;\n border-width: ").concat(dt("timeline.event.marker.border.width"), ";\n border-style: solid;\n border-color: ").concat(dt("timeline.event.marker.border.color"), ";\n border-radius: ").concat(dt("timeline.event.marker.border.radius"), ";\n width: ").concat(dt("timeline.event.marker.size"), ";\n height: ").concat(dt("timeline.event.marker.size"), ";\n background: ").concat(dt("timeline.event.marker.background"), ';\n}\n\n.p-timeline-event-marker::before {\n content: " ";\n border-radius: ').concat(dt("timeline.event.marker.content.border.radius"), ";\n width: ").concat(dt("timeline.event.marker.content.size"), ";\n height:").concat(dt("timeline.event.marker.content.size"), ";\n background: ").concat(dt("timeline.event.marker.content.background"), ';\n}\n\n.p-timeline-event-marker::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("timeline.event.marker.border.radius"), ";\n box-shadow: ").concat(dt("timeline.event.marker.content.inset.shadow"), ";\n}\n\n.p-timeline-event-connector {\n flex-grow: 1;\n background: ").concat(dt("timeline.event.connector.color"), ";\n}\n\n.p-timeline-horizontal {\n flex-direction: row;\n}\n\n.p-timeline-horizontal .p-timeline-event {\n flex-direction: column;\n flex: 1;\n}\n\n.p-timeline-horizontal .p-timeline-event:last-child {\n flex: 0;\n}\n\n.p-timeline-horizontal .p-timeline-event-separator {\n flex-direction: row;\n}\n\n.p-timeline-horizontal .p-timeline-event-connector {\n width: 100%;\n height: ").concat(dt("timeline.event.connector.size"), ";\n}\n\n.p-timeline-horizontal .p-timeline-event-opposite,\n.p-timeline-horizontal .p-timeline-event-content {\n padding: ").concat(dt("timeline.horizontal.event.content.padding"), ";\n}\n\n.p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) {\n flex-direction: column-reverse;\n}\n\n.p-timeline-bottom .p-timeline-event {\n flex-direction: column-reverse;\n}\n");
-}, "theme");
-var classes$2 = {
- root: /* @__PURE__ */ __name(function root30(_ref2) {
- var props = _ref2.props;
- return ["p-timeline p-component", "p-timeline-" + props.align, "p-timeline-" + props.layout];
- }, "root"),
- event: "p-timeline-event",
- eventOpposite: "p-timeline-event-opposite",
- eventSeparator: "p-timeline-event-separator",
- eventMarker: "p-timeline-event-marker",
- eventConnector: "p-timeline-event-connector",
- eventContent: "p-timeline-event-content"
-};
-var TimelineStyle = BaseStyle.extend({
- name: "timeline",
- theme: theme$2,
- classes: classes$2
-});
-var script$1$2 = {
- name: "BaseTimeline",
- "extends": script$1f,
- props: {
- value: null,
- align: {
- mode: String,
- "default": "left"
- },
- layout: {
- mode: String,
- "default": "vertical"
- },
- dataKey: null
- },
- style: TimelineStyle,
- provide: /* @__PURE__ */ __name(function provide48() {
- return {
- $pcTimeline: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$7 = {
- name: "Timeline",
- "extends": script$1$2,
- inheritAttrs: false,
- methods: {
- getKey: /* @__PURE__ */ __name(function getKey3(item8, index) {
- return this.dataKey ? resolveFieldData(item8, this.dataKey) : index;
- }, "getKey"),
- getPTOptions: /* @__PURE__ */ __name(function getPTOptions13(key, index) {
- return this.ptm(key, {
- context: {
- index,
- count: this.value.length
- }
- });
- }, "getPTOptions")
- }
-};
-function render$6(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root")
- }, _ctx.ptmi("root")), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.value, function(item8, index) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: $options.getKey(item8, index),
- "class": _ctx.cx("event"),
- ref_for: true
- }, $options.getPTOptions("event", index)), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("eventOpposite", {
- index
- }),
- ref_for: true
- }, $options.getPTOptions("eventOpposite", index)), [renderSlot(_ctx.$slots, "opposite", {
- item: item8,
- index
- })], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("eventSeparator"),
- ref_for: true
- }, $options.getPTOptions("eventSeparator", index)), [renderSlot(_ctx.$slots, "marker", {
- item: item8,
- index
- }, function() {
- return [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("eventMarker"),
- ref_for: true
- }, $options.getPTOptions("eventMarker", index)), null, 16)];
- }), index !== _ctx.value.length - 1 ? renderSlot(_ctx.$slots, "connector", {
- key: 0,
- item: item8,
- index
- }, function() {
- return [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("eventConnector"),
- ref_for: true
- }, $options.getPTOptions("eventConnector", index)), null, 16)];
- }) : createCommentVNode("", true)], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("eventContent"),
- ref_for: true
- }, $options.getPTOptions("eventContent", index)), [renderSlot(_ctx.$slots, "content", {
- item: item8,
- index
- })], 16)], 16);
- }), 128))], 16);
-}
-__name(render$6, "render$6");
-script$7.render = render$6;
-var theme$1 = /* @__PURE__ */ __name(function theme38(_ref) {
- var dt = _ref.dt;
- return "\n.p-treeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n background: ".concat(dt("treeselect.background"), ";\n border: 1px solid ").concat(dt("treeselect.border.color"), ";\n transition: background ").concat(dt("treeselect.transition.duration"), ", color ").concat(dt("treeselect.transition.duration"), ", border-color ").concat(dt("treeselect.transition.duration"), ", outline-color ").concat(dt("treeselect.transition.duration"), ", box-shadow ").concat(dt("treeselect.transition.duration"), ";\n border-radius: ").concat(dt("treeselect.border.radius"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("treeselect.shadow"), ";\n}\n\n.p-treeselect:not(.p-disabled):hover {\n border-color: ").concat(dt("treeselect.hover.border.color"), ";\n}\n\n.p-treeselect:not(.p-disabled).p-focus {\n border-color: ").concat(dt("treeselect.focus.border.color"), ";\n box-shadow: ").concat(dt("treeselect.focus.ring.shadow"), ";\n outline: ").concat(dt("treeselect.focus.ring.width"), " ").concat(dt("treeselect.focus.ring.style"), " ").concat(dt("treeselect.focus.ring.color"), ";\n outline-offset: ").concat(dt("treeselect.focus.ring.offset"), ";\n}\n\n.p-treeselect.p-variant-filled {\n background: ").concat(dt("treeselect.filled.background"), ";\n}\n\n.p-treeselect.p-variant-filled:not(.p-disabled):hover {\n background: ").concat(dt("treeselect.filled.hover.background"), ";\n}\n\n.p-treeselect.p-variant-filled.p-focus {\n background: ").concat(dt("treeselect.filled.focus.background"), ";\n}\n\n.p-treeselect.p-invalid {\n border-color: ").concat(dt("treeselect.invalid.border.color"), ";\n}\n\n.p-treeselect.p-disabled {\n opacity: 1;\n background: ").concat(dt("treeselect.disabled.background"), ";\n}\n\n.p-treeselect-clear-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n color: ").concat(dt("treeselect.clear.icon.color"), ";\n inset-inline-end: ").concat(dt("treeselect.dropdown.width"), ";\n}\n\n.p-treeselect-dropdown {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n background: transparent;\n color: ").concat(dt("treeselect.dropdown.color"), ";\n width: ").concat(dt("treeselect.dropdown.width"), ";\n border-start-end-radius: ").concat(dt("border.radius.md"), ";\n border-end-end-radius: ").concat(dt("border.radius.md"), ";\n}\n\n.p-treeselect-label-container {\n overflow: hidden;\n flex: 1 1 auto;\n cursor: pointer;\n}\n\n.p-treeselect-label {\n display: flex;\n align-items: center;\n gap: calc(").concat(dt("treeselect.padding.y"), " / 2);\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: ").concat(dt("treeselect.padding.y"), " ").concat(dt("treeselect.padding.x"), ";\n color: ").concat(dt("treeselect.color"), ";\n}\n\n.p-treeselect-label.p-placeholder {\n color: ").concat(dt("treeselect.placeholder.color"), ";\n}\n\n.p-treeselect.p-invalid .p-treeselect-label.p-placeholder {\n color: ").concat(dt("treeselect.invalid.placeholder.color"), ";\n}\n\n.p-treeselect.p-disabled .p-treeselect-label {\n color: ").concat(dt("treeselect.disabled.color"), ";\n}\n\n.p-treeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n\n.p-treeselect .p-treeselect-overlay {\n min-width: 100%;\n}\n\n.p-treeselect-overlay {\n position: absolute;\n top: 0;\n left: 0;\n background: ").concat(dt("treeselect.overlay.background"), ";\n color: ").concat(dt("treeselect.overlay.color"), ";\n border: 1px solid ").concat(dt("treeselect.overlay.border.color"), ";\n border-radius: ").concat(dt("treeselect.overlay.border.radius"), ";\n box-shadow: ").concat(dt("treeselect.overlay.shadow"), ";\n overflow: hidden;\n}\n\n.p-treeselect-tree-container {\n overflow: auto;\n}\n\n.p-treeselect-empty-message {\n padding: ").concat(dt("treeselect.empty.message.padding"), ";\n background: transparent;\n}\n\n.p-treeselect-fluid {\n display: flex;\n}\n\n.p-treeselect-overlay .p-tree {\n padding: ").concat(dt("treeselect.tree.padding"), ";\n}\n\n.p-treeselect-overlay .p-tree-loading {\n min-height: 3rem;\n}\n\n.p-treeselect-label .p-chip {\n padding-block-start: calc(").concat(dt("treeselect.padding.y"), " / 2);\n padding-block-end: calc(").concat(dt("treeselect.padding.y"), " / 2);\n border-radius: ").concat(dt("treeselect.chip.border.radius"), ";\n}\n\n.p-treeselect-label:has(.p-chip) {\n padding: calc(").concat(dt("treeselect.padding.y"), " / 2) calc(").concat(dt("treeselect.padding.x"), " / 2);\n}\n\n.p-treeselect-sm .p-treeselect-label {\n font-size: ").concat(dt("treeselect.sm.font.size"), ";\n padding-block: ").concat(dt("treeselect.sm.padding.y"), ";\n padding-inline: ").concat(dt("treeselect.sm.padding.x"), ";\n}\n\n.p-treeselect-sm .p-treeselect-dropdown .p-icon {\n font-size: ").concat(dt("treeselect.sm.font.size"), ";\n width: ").concat(dt("treeselect.sm.font.size"), ";\n height: ").concat(dt("treeselect.sm.font.size"), ";\n}\n\n.p-treeselect-lg .p-treeselect-label {\n font-size: ").concat(dt("treeselect.lg.font.size"), ";\n padding-block: ").concat(dt("treeselect.lg.padding.y"), ";\n padding-inline: ").concat(dt("treeselect.lg.padding.x"), ";\n}\n\n.p-treeselect-lg .p-treeselect-dropdown .p-icon {\n font-size: ").concat(dt("treeselect.lg.font.size"), ";\n width: ").concat(dt("treeselect.lg.font.size"), ";\n height: ").concat(dt("treeselect.lg.font.size"), ";\n}\n");
-}, "theme");
-var inlineStyles$1 = {
- root: /* @__PURE__ */ __name(function root31(_ref2) {
- var props = _ref2.props;
- return {
- position: props.appendTo === "self" ? "relative" : void 0
- };
- }, "root")
-};
-var classes$1 = {
- root: /* @__PURE__ */ __name(function root32(_ref3) {
- var instance = _ref3.instance, props = _ref3.props;
- return ["p-treeselect p-component p-inputwrapper", {
- "p-treeselect-display-chip": props.display === "chip",
- "p-disabled": props.disabled,
- "p-invalid": instance.$invalid,
- "p-focus": instance.focused,
- "p-variant-filled": instance.$variant === "filled",
- "p-inputwrapper-filled": instance.$filled,
- "p-inputwrapper-focus": instance.focused || instance.overlayVisible,
- "p-treeselect-open": instance.overlayVisible,
- "p-treeselect-fluid": instance.$fluid,
- "p-treeselect-sm p-inputfield-sm": props.size === "small",
- "p-treeselect-lg p-inputfield-lg": props.size === "large"
- }];
- }, "root"),
- labelContainer: "p-treeselect-label-container",
- label: /* @__PURE__ */ __name(function label10(_ref4) {
- var instance = _ref4.instance, props = _ref4.props;
- return ["p-treeselect-label", {
- "p-placeholder": instance.label === props.placeholder,
- "p-treeselect-label-empty": !props.placeholder && instance.emptyValue
- }];
- }, "label"),
- clearIcon: "p-treeselect-clear-icon",
- chip: "p-treeselect-chip-item",
- pcChip: "p-treeselect-chip",
- dropdown: "p-treeselect-dropdown",
- dropdownIcon: "p-treeselect-dropdown-icon",
- panel: "p-treeselect-overlay p-component",
- treeContainer: "p-treeselect-tree-container",
- emptyMessage: "p-treeselect-empty-message"
-};
-var TreeSelectStyle = BaseStyle.extend({
- name: "treeselect",
- theme: theme$1,
- classes: classes$1,
- inlineStyles: inlineStyles$1
-});
-var script$1$1 = {
- name: "BaseTreeSelect",
- "extends": script$1k,
- props: {
- options: Array,
- scrollHeight: {
- type: String,
- "default": "20rem"
- },
- placeholder: {
- type: String,
- "default": null
- },
- tabindex: {
- type: Number,
- "default": null
- },
- selectionMode: {
- type: String,
- "default": "single"
- },
- selectedItemsLabel: {
- type: String,
- "default": null
- },
- maxSelectedLabels: {
- type: Number,
- "default": null
- },
- appendTo: {
- type: [String, Object],
- "default": "body"
- },
- emptyMessage: {
- type: String,
- "default": null
- },
- display: {
- type: String,
- "default": "comma"
- },
- metaKeySelection: {
- type: Boolean,
- "default": false
- },
- loading: {
- type: Boolean,
- "default": false
- },
- loadingIcon: {
- type: String,
- "default": void 0
- },
- loadingMode: {
- type: String,
- "default": "mask"
- },
- showClear: {
- type: Boolean,
- "default": false
- },
- clearIcon: {
- type: String,
- "default": void 0
- },
- filter: {
- type: Boolean,
- "default": false
- },
- filterBy: {
- type: [String, Function],
- "default": "label"
- },
- filterMode: {
- type: String,
- "default": "lenient"
- },
- filterPlaceholder: {
- type: String,
- "default": null
- },
- filterLocale: {
- type: String,
- "default": void 0
- },
- inputId: {
- type: String,
- "default": null
- },
- inputClass: {
- type: [String, Object],
- "default": null
- },
- inputStyle: {
- type: Object,
- "default": null
- },
- inputProps: {
- type: null,
- "default": null
- },
- panelClass: {
- type: [String, Object],
- "default": null
- },
- panelProps: {
- type: null,
- "default": null
- },
- ariaLabelledby: {
- type: String,
- "default": null
- },
- ariaLabel: {
- type: String,
- "default": null
- },
- expandedKeys: {
- type: null,
- "default": null
- }
- },
- style: TreeSelectStyle,
- provide: /* @__PURE__ */ __name(function provide49() {
- return {
- $pcTreeSelect: this,
- $parentInstance: this
- };
- }, "provide")
-};
-function _typeof$1$1(o) {
- "@babel/helpers - typeof";
- return _typeof$1$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$1$1(o);
-}
-__name(_typeof$1$1, "_typeof$1$1");
-function ownKeys$1$1(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$1$1, "ownKeys$1$1");
-function _objectSpread$1$1(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$1$1(Object(t2), true).forEach(function(r2) {
- _defineProperty$1$1(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1$1(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$1$1, "_objectSpread$1$1");
-function _defineProperty$1$1(e, r, t2) {
- return (r = _toPropertyKey$1$1(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$1$1, "_defineProperty$1$1");
-function _toPropertyKey$1$1(t2) {
- var i = _toPrimitive$1$1(t2, "string");
- return "symbol" == _typeof$1$1(i) ? i : i + "";
-}
-__name(_toPropertyKey$1$1, "_toPropertyKey$1$1");
-function _toPrimitive$1$1(t2, r) {
- if ("object" != _typeof$1$1(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$1$1(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$1$1, "_toPrimitive$1$1");
-function _createForOfIteratorHelper$2(r, e) {
- var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t2) {
- if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$2(r)) || e) {
- t2 && (r = t2);
- var _n = 0, F = /* @__PURE__ */ __name(function F2() {
- }, "F");
- return { s: F, n: /* @__PURE__ */ __name(function n() {
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- throw r2;
- }, "e"), f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o, a = true, u = false;
- return { s: /* @__PURE__ */ __name(function s() {
- t2 = t2.call(r);
- }, "s"), n: /* @__PURE__ */ __name(function n() {
- var r2 = t2.next();
- return a = r2.done, r2;
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- u = true, o = r2;
- }, "e"), f: /* @__PURE__ */ __name(function f() {
- try {
- a || null == t2["return"] || t2["return"]();
- } finally {
- if (u) throw o;
- }
- }, "f") };
-}
-__name(_createForOfIteratorHelper$2, "_createForOfIteratorHelper$2");
-function _toConsumableArray$2(r) {
- return _arrayWithoutHoles$2(r) || _iterableToArray$2(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread$2();
-}
-__name(_toConsumableArray$2, "_toConsumableArray$2");
-function _nonIterableSpread$2() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$2, "_nonIterableSpread$2");
-function _unsupportedIterableToArray$2(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$2(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2");
-function _iterableToArray$2(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$2, "_iterableToArray$2");
-function _arrayWithoutHoles$2(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$2(r);
-}
-__name(_arrayWithoutHoles$2, "_arrayWithoutHoles$2");
-function _arrayLikeToArray$2(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$2, "_arrayLikeToArray$2");
-var script$6 = {
- name: "TreeSelect",
- "extends": script$1$1,
- inheritAttrs: false,
- emits: ["before-show", "before-hide", "change", "show", "hide", "node-select", "node-unselect", "node-expand", "node-collapse", "focus", "blur", "update:expandedKeys"],
- inject: {
- $pcFluid: {
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data35() {
- return {
- id: this.$attrs.id,
- focused: false,
- overlayVisible: false,
- d_expandedKeys: this.expandedKeys || {}
- };
- }, "data"),
- watch: {
- "$attrs.id": /* @__PURE__ */ __name(function $attrsId13(newValue) {
- this.id = newValue || UniqueComponentId();
- }, "$attrsId"),
- modelValue: {
- handler: /* @__PURE__ */ __name(function handler4() {
- if (!this.selfChange) {
- this.updateTreeState();
- }
- this.selfChange = false;
- }, "handler"),
- immediate: true
- },
- options: /* @__PURE__ */ __name(function options3() {
- this.updateTreeState();
- }, "options"),
- expandedKeys: /* @__PURE__ */ __name(function expandedKeys2(value2) {
- this.d_expandedKeys = value2;
- }, "expandedKeys")
- },
- outsideClickListener: null,
- resizeListener: null,
- scrollHandler: null,
- overlay: null,
- selfChange: false,
- selfClick: false,
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount16() {
- this.unbindOutsideClickListener();
- this.unbindResizeListener();
- if (this.scrollHandler) {
- this.scrollHandler.destroy();
- this.scrollHandler = null;
- }
- if (this.overlay) {
- ZIndex.clear(this.overlay);
- this.overlay = null;
- }
- }, "beforeUnmount"),
- mounted: /* @__PURE__ */ __name(function mounted40() {
- this.id = this.id || UniqueComponentId();
- this.updateTreeState();
- }, "mounted"),
- methods: {
- show: /* @__PURE__ */ __name(function show6() {
- this.$emit("before-show");
- this.overlayVisible = true;
- }, "show"),
- hide: /* @__PURE__ */ __name(function hide6() {
- this.$emit("before-hide");
- this.overlayVisible = false;
- this.$refs.focusInput.focus();
- }, "hide"),
- onFocus: /* @__PURE__ */ __name(function onFocus14(event2) {
- this.focused = true;
- this.$emit("focus", event2);
- }, "onFocus"),
- onBlur: /* @__PURE__ */ __name(function onBlur14(event2) {
- var _this$formField$onBlu, _this$formField;
- this.focused = false;
- this.$emit("blur", event2);
- (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);
- }, "onBlur"),
- onClick: /* @__PURE__ */ __name(function onClick8(event2) {
- if (this.disabled) {
- return;
- }
- if (event2.target.tagName === "INPUT" || event2.target.getAttribute("data-pc-section") === "clearicon" || event2.target.closest('[data-pc-section="clearicon"]')) {
- return;
- } else if (!this.overlay || !this.overlay.contains(event2.target)) {
- if (this.overlayVisible) this.hide();
- else this.show();
- focus(this.$refs.focusInput);
- }
- }, "onClick"),
- onClearClick: /* @__PURE__ */ __name(function onClearClick3() {
- this.onSelectionChange(null);
- }, "onClearClick"),
- onSelectionChange: /* @__PURE__ */ __name(function onSelectionChange(keys) {
- this.selfChange = true;
- this.writeValue(keys);
- this.$emit("change", keys);
- }, "onSelectionChange"),
- onNodeSelect: /* @__PURE__ */ __name(function onNodeSelect(node2) {
- this.$emit("node-select", node2);
- if (this.selectionMode === "single") {
- this.hide();
- }
- }, "onNodeSelect"),
- onNodeUnselect: /* @__PURE__ */ __name(function onNodeUnselect(node2) {
- this.$emit("node-unselect", node2);
- }, "onNodeUnselect"),
- onNodeToggle: /* @__PURE__ */ __name(function onNodeToggle2(keys) {
- this.d_expandedKeys = keys;
- this.$emit("update:expandedKeys", this.d_expandedKeys);
- }, "onNodeToggle"),
- getSelectedItemsLabel: /* @__PURE__ */ __name(function getSelectedItemsLabel2() {
- var pattern = /{(.*?)}/;
- var selectedItemsLabel = this.selectedItemsLabel || this.$primevue.config.locale.selectionMessage;
- if (pattern.test(selectedItemsLabel)) {
- return selectedItemsLabel.replace(selectedItemsLabel.match(pattern)[0], Object.keys(this.d_value).length + "");
- }
- return selectedItemsLabel;
- }, "getSelectedItemsLabel"),
- onFirstHiddenFocus: /* @__PURE__ */ __name(function onFirstHiddenFocus2(event2) {
- var focusableEl = event2.relatedTarget === this.$refs.focusInput ? getFirstFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
- focus(focusableEl);
- }, "onFirstHiddenFocus"),
- onLastHiddenFocus: /* @__PURE__ */ __name(function onLastHiddenFocus2(event2) {
- var focusableEl = event2.relatedTarget === this.$refs.focusInput ? getLastFocusableElement(this.overlay, ':not([data-p-hidden-focusable="true"])') : this.$refs.focusInput;
- focus(focusableEl);
- }, "onLastHiddenFocus"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown12(event2) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "Space":
- case "Enter":
- case "NumpadEnter":
- this.onEnterKey(event2);
- break;
- case "Escape":
- this.onEscapeKey(event2);
- break;
- case "Tab":
- this.onTabKey(event2);
- break;
- }
- }, "onKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey8(event2) {
- var _this = this;
- if (this.overlayVisible) return;
- this.show();
- this.$nextTick(function() {
- var treeNodeEl = find(_this.$refs.tree.$el, '[data-pc-section="treeitem"]');
- var focusedElement = _toConsumableArray$2(treeNodeEl).find(function(item8) {
- return item8.getAttribute("tabindex") === "0";
- });
- focus(focusedElement);
- });
- event2.preventDefault();
- }, "onArrowDownKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey8(event2) {
- if (this.overlayVisible) {
- this.hide();
- } else {
- this.onArrowDownKey(event2);
- }
- event2.preventDefault();
- }, "onEnterKey"),
- onEscapeKey: /* @__PURE__ */ __name(function onEscapeKey5(event2) {
- if (this.overlayVisible) {
- this.hide();
- event2.preventDefault();
- }
- }, "onEscapeKey"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey5(event2) {
- var pressedInInputText = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
- if (!pressedInInputText) {
- if (this.overlayVisible && this.hasFocusableElements()) {
- focus(this.$refs.firstHiddenFocusableElementOnOverlay);
- event2.preventDefault();
- }
- }
- }, "onTabKey"),
- hasFocusableElements: /* @__PURE__ */ __name(function hasFocusableElements2() {
- return getFocusableElements(this.overlay, ':not([data-p-hidden-focusable="true"])').length > 0;
- }, "hasFocusableElements"),
- onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter5(el) {
- ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay);
- addStyle(el, {
- position: "absolute",
- top: "0",
- left: "0"
- });
- this.alignOverlay();
- this.focus();
- }, "onOverlayEnter"),
- onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter3() {
- this.bindOutsideClickListener();
- this.bindScrollListener();
- this.bindResizeListener();
- this.scrollValueInView();
- this.$emit("show");
- }, "onOverlayAfterEnter"),
- onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave5() {
- this.unbindOutsideClickListener();
- this.unbindScrollListener();
- this.unbindResizeListener();
- this.$emit("hide");
- this.overlay = null;
- }, "onOverlayLeave"),
- onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave5(el) {
- ZIndex.clear(el);
- }, "onOverlayAfterLeave"),
- focus: /* @__PURE__ */ __name(function focus3() {
- var focusableElements = getFocusableElements(this.overlay);
- if (focusableElements && focusableElements.length > 0) {
- focusableElements[0].focus();
- }
- }, "focus"),
- alignOverlay: /* @__PURE__ */ __name(function alignOverlay6() {
- if (this.appendTo === "self") {
- relativePosition(this.overlay, this.$el);
- } else {
- this.overlay.style.minWidth = getOuterWidth(this.$el) + "px";
- absolutePosition(this.overlay, this.$el);
- }
- }, "alignOverlay"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener6() {
- var _this2 = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event2) {
- if (_this2.overlayVisible && !_this2.selfClick && _this2.isOutsideClicked(event2)) {
- _this2.hide();
- }
- _this2.selfClick = false;
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener6() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener7() {
- var _this3 = this;
- if (!this.scrollHandler) {
- this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function() {
- if (_this3.overlayVisible) {
- _this3.hide();
- }
- });
- }
- this.scrollHandler.bindScrollListener();
- }, "bindScrollListener"),
- unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener7() {
- if (this.scrollHandler) {
- this.scrollHandler.unbindScrollListener();
- }
- }, "unbindScrollListener"),
- bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener7() {
- var _this4 = this;
- if (!this.resizeListener) {
- this.resizeListener = function() {
- if (_this4.overlayVisible && !isTouchDevice()) {
- _this4.hide();
- }
- };
- window.addEventListener("resize", this.resizeListener);
- }
- }, "bindResizeListener"),
- unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener7() {
- if (this.resizeListener) {
- window.removeEventListener("resize", this.resizeListener);
- this.resizeListener = null;
- }
- }, "unbindResizeListener"),
- isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked4(event2) {
- return !(this.$el.isSameNode(event2.target) || this.$el.contains(event2.target) || this.overlay && this.overlay.contains(event2.target));
- }, "isOutsideClicked"),
- overlayRef: /* @__PURE__ */ __name(function overlayRef5(el) {
- this.overlay = el;
- }, "overlayRef"),
- onOverlayClick: /* @__PURE__ */ __name(function onOverlayClick6(event2) {
- OverlayEventBus.emit("overlay-click", {
- originalEvent: event2,
- target: this.$el
- });
- this.selfClick = true;
- }, "onOverlayClick"),
- onOverlayKeydown: /* @__PURE__ */ __name(function onOverlayKeydown(event2) {
- if (event2.code === "Escape") this.hide();
- }, "onOverlayKeydown"),
- findSelectedNodes: /* @__PURE__ */ __name(function findSelectedNodes(node2, keys, selectedNodes2) {
- if (node2) {
- if (this.isSelected(node2, keys)) {
- selectedNodes2.push(node2);
- delete keys[node2.key];
- }
- if (Object.keys(keys).length && node2.children) {
- var _iterator = _createForOfIteratorHelper$2(node2.children), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var childNode = _step.value;
- this.findSelectedNodes(childNode, keys, selectedNodes2);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- }
- } else {
- var _iterator2 = _createForOfIteratorHelper$2(this.options), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var _childNode = _step2.value;
- this.findSelectedNodes(_childNode, keys, selectedNodes2);
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- }
- }, "findSelectedNodes"),
- isSelected: /* @__PURE__ */ __name(function isSelected5(node2, keys) {
- return this.selectionMode === "checkbox" ? keys[node2.key] && keys[node2.key].checked : keys[node2.key];
- }, "isSelected"),
- updateTreeState: /* @__PURE__ */ __name(function updateTreeState() {
- var keys = _objectSpread$1$1({}, this.d_value);
- if (keys && this.options) {
- this.updateTreeBranchState(null, null, keys);
- }
- }, "updateTreeState"),
- updateTreeBranchState: /* @__PURE__ */ __name(function updateTreeBranchState(node2, path, keys) {
- if (node2) {
- if (this.isSelected(node2, keys)) {
- this.expandPath(path);
- delete keys[node2.key];
- }
- if (Object.keys(keys).length && node2.children) {
- var _iterator3 = _createForOfIteratorHelper$2(node2.children), _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- var childNode = _step3.value;
- path.push(node2.key);
- this.updateTreeBranchState(childNode, path, keys);
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- }
- } else {
- var _iterator4 = _createForOfIteratorHelper$2(this.options), _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
- var _childNode2 = _step4.value;
- this.updateTreeBranchState(_childNode2, [], keys);
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- }
- }, "updateTreeBranchState"),
- expandPath: /* @__PURE__ */ __name(function expandPath(path) {
- if (path.length > 0) {
- var _iterator5 = _createForOfIteratorHelper$2(path), _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
- var key = _step5.value;
- this.d_expandedKeys[key] = true;
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- this.d_expandedKeys = _objectSpread$1$1({}, this.d_expandedKeys);
- this.$emit("update:expandedKeys", this.d_expandedKeys);
- }
- }, "expandPath"),
- scrollValueInView: /* @__PURE__ */ __name(function scrollValueInView() {
- if (this.overlay) {
- var selectedItem = findSingle(this.overlay, '[data-p-selected="true"]');
- if (selectedItem) {
- selectedItem.scrollIntoView({
- block: "nearest",
- inline: "start"
- });
- }
- }
- }, "scrollValueInView")
- },
- computed: {
- selectedNodes: /* @__PURE__ */ __name(function selectedNodes() {
- var selectedNodes2 = [];
- if (this.d_value && this.options) {
- var keys = _objectSpread$1$1({}, this.d_value);
- this.findSelectedNodes(null, keys, selectedNodes2);
- }
- return selectedNodes2;
- }, "selectedNodes"),
- label: /* @__PURE__ */ __name(function label11() {
- var value2 = this.selectedNodes;
- var label12;
- if (value2.length) {
- if (isNotEmpty(this.maxSelectedLabels) && value2.length > this.maxSelectedLabels) {
- label12 = this.getSelectedItemsLabel();
- } else {
- label12 = value2.map(function(node2) {
- return node2.label;
- }).join(", ");
- }
- } else {
- label12 = this.placeholder;
- }
- return label12;
- }, "label"),
- chipSelectedItems: /* @__PURE__ */ __name(function chipSelectedItems2() {
- return isNotEmpty(this.maxSelectedLabels) && this.d_value && Object.keys(this.d_value).length > this.maxSelectedLabels;
- }, "chipSelectedItems"),
- emptyMessageText: /* @__PURE__ */ __name(function emptyMessageText4() {
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
- }, "emptyMessageText"),
- emptyValue: /* @__PURE__ */ __name(function emptyValue() {
- return !this.$filled;
- }, "emptyValue"),
- emptyOptions: /* @__PURE__ */ __name(function emptyOptions() {
- return !this.options || this.options.length === 0;
- }, "emptyOptions"),
- listId: /* @__PURE__ */ __name(function listId() {
- return this.id + "_list";
- }, "listId"),
- hasFluid: /* @__PURE__ */ __name(function hasFluid2() {
- return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;
- }, "hasFluid"),
- isClearIconVisible: /* @__PURE__ */ __name(function isClearIconVisible3() {
- return this.showClear && this.d_value != null && isNotEmpty(this.options);
- }, "isClearIconVisible")
- },
- components: {
- TSTree: script$1U,
- Chip: script$1s,
- Portal: script$1m,
- ChevronDownIcon: script$1h,
- TimesIcon: script$1q
- },
- directives: {
- ripple: Ripple
- }
-};
-function _typeof$6(o) {
- "@babel/helpers - typeof";
- return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$6(o);
-}
-__name(_typeof$6, "_typeof$6");
-function ownKeys$6(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$6, "ownKeys$6");
-function _objectSpread$6(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$6(Object(t2), true).forEach(function(r2) {
- _defineProperty$6(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$6(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$6, "_objectSpread$6");
-function _defineProperty$6(e, r, t2) {
- return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$6, "_defineProperty$6");
-function _toPropertyKey$6(t2) {
- var i = _toPrimitive$6(t2, "string");
- return "symbol" == _typeof$6(i) ? i : i + "";
-}
-__name(_toPropertyKey$6, "_toPropertyKey$6");
-function _toPrimitive$6(t2, r) {
- if ("object" != _typeof$6(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$6(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$6, "_toPrimitive$6");
-var _hoisted_1$6 = ["id", "disabled", "tabindex", "aria-labelledby", "aria-label", "aria-expanded", "aria-controls"];
-var _hoisted_2$4 = {
- key: 0
-};
-var _hoisted_3$4 = ["aria-expanded"];
-function render$5(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Chip = resolveComponent("Chip");
- var _component_TSTree = resolveComponent("TSTree");
- var _component_Portal = resolveComponent("Portal");
- return openBlock(), createElementBlock("div", mergeProps({
- ref: "container",
- "class": _ctx.cx("root"),
- style: _ctx.sx("root"),
- onClick: _cache[10] || (_cache[10] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- })
- }, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
- "class": "p-hidden-accessible"
- }, _ctx.ptm("hiddenInputContainer"), {
- "data-p-hidden-accessible": true
- }), [createBaseVNode("input", mergeProps({
- ref: "focusInput",
- id: _ctx.inputId,
- type: "text",
- role: "combobox",
- "class": _ctx.inputClass,
- style: _ctx.inputStyle,
- readonly: "",
- disabled: _ctx.disabled,
- tabindex: !_ctx.disabled ? _ctx.tabindex : -1,
- "aria-labelledby": _ctx.ariaLabelledby,
- "aria-label": _ctx.ariaLabel,
- "aria-haspopup": "tree",
- "aria-expanded": $data.overlayVisible,
- "aria-controls": $options.listId,
- onFocus: _cache[0] || (_cache[0] = function($event) {
- return $options.onFocus($event);
- }),
- onBlur: _cache[1] || (_cache[1] = function($event) {
- return $options.onBlur($event);
- }),
- onKeydown: _cache[2] || (_cache[2] = function($event) {
- return $options.onKeyDown($event);
- })
- }, _objectSpread$6(_objectSpread$6({}, _ctx.inputProps), _ctx.ptm("hiddenInput"))), null, 16, _hoisted_1$6)], 16), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("labelContainer")
- }, _ctx.ptm("labelContainer")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("label")
- }, _ctx.ptm("label")), [renderSlot(_ctx.$slots, "value", {
- value: $options.selectedNodes,
- placeholder: _ctx.placeholder
- }, function() {
- return [_ctx.display === "comma" ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [createTextVNode(toDisplayString($options.label || "empty"), 1)], 64)) : _ctx.display === "chip" ? (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [$options.chipSelectedItems ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString($options.label), 1)) : (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList($options.selectedNodes, function(node2) {
- return openBlock(), createElementBlock("div", mergeProps({
- key: node2.key,
- "class": _ctx.cx("chipItem"),
- ref_for: true
- }, _ctx.ptm("chipItem")), [createVNode(_component_Chip, {
- "class": normalizeClass(_ctx.cx("pcChip")),
- label: node2.label,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcChip")
- }, null, 8, ["class", "label", "unstyled", "pt"])], 16);
- }), 128)), $options.emptyValue ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [createTextVNode(toDisplayString(_ctx.placeholder || "empty"), 1)], 64)) : createCommentVNode("", true)], 64))], 64)) : createCommentVNode("", true)];
- })], 16)], 16), $options.isClearIconVisible ? renderSlot(_ctx.$slots, "clearicon", {
- key: 0,
- "class": normalizeClass(_ctx.cx("clearIcon")),
- clearCallback: $options.onClearClick
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon ? "i" : "TimesIcon"), mergeProps({
- ref: "clearIcon",
- "class": [_ctx.cx("clearIcon"), _ctx.clearIcon],
- onClick: $options.onClearClick
- }, _ctx.ptm("clearIcon"), {
- "data-pc-section": "clearicon"
- }), null, 16, ["class", "onClick"]))];
- }) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("dropdown"),
- role: "button",
- "aria-haspopup": "tree",
- "aria-expanded": $data.overlayVisible
- }, _ctx.ptm("dropdown")), [renderSlot(_ctx.$slots, _ctx.$slots.dropdownicon ? "dropdownicon" : "triggericon", {
- "class": normalizeClass(_ctx.cx("dropdownIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent("ChevronDownIcon"), mergeProps({
- "class": _ctx.cx("dropdownIcon")
- }, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
- })], 16, _hoisted_3$4), createVNode(_component_Portal, {
- appendTo: _ctx.appendTo
- }, {
- "default": withCtx(function() {
- return [createVNode(Transition, mergeProps({
- name: "p-connected-overlay",
- onEnter: $options.onOverlayEnter,
- onAfterEnter: $options.onOverlayAfterEnter,
- onLeave: $options.onOverlayLeave,
- onAfterLeave: $options.onOverlayAfterLeave
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [$data.overlayVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.overlayRef,
- onClick: _cache[8] || (_cache[8] = function() {
- return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);
- }),
- "class": [_ctx.cx("panel"), _ctx.panelClass],
- onKeydown: _cache[9] || (_cache[9] = function() {
- return $options.onOverlayKeydown && $options.onOverlayKeydown.apply($options, arguments);
- })
- }, _objectSpread$6(_objectSpread$6({}, _ctx.panelProps), _ctx.ptm("panel"))), [createBaseVNode("span", mergeProps({
- ref: "firstHiddenFocusableElementOnOverlay",
- role: "presentation",
- "class": "p-hidden-accessible p-hidden-focusable",
- tabindex: 0,
- onFocus: _cache[3] || (_cache[3] = function() {
- return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);
- })
- }, _ctx.ptm("hiddenFirstFocusableEl"), {
- "data-p-hidden-accessible": true,
- "data-p-hidden-focusable": true
- }), null, 16), renderSlot(_ctx.$slots, "header", {
- value: _ctx.d_value,
- options: _ctx.options
- }), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("treeContainer"),
- style: {
- "max-height": _ctx.scrollHeight
- }
- }, _ctx.ptm("treeContainer")), [createVNode(_component_TSTree, {
- ref: "tree",
- id: $options.listId,
- value: _ctx.options,
- selectionMode: _ctx.selectionMode,
- loading: _ctx.loading,
- loadingIcon: _ctx.loadingIcon,
- loadingMode: _ctx.loadingMode,
- filter: _ctx.filter,
- filterBy: _ctx.filterBy,
- filterMode: _ctx.filterMode,
- filterPlaceholder: _ctx.filterPlaceholder,
- filterLocale: _ctx.filterLocale,
- "onUpdate:selectionKeys": $options.onSelectionChange,
- selectionKeys: _ctx.d_value,
- expandedKeys: $data.d_expandedKeys,
- "onUpdate:expandedKeys": $options.onNodeToggle,
- metaKeySelection: _ctx.metaKeySelection,
- onNodeExpand: _cache[4] || (_cache[4] = function($event) {
- return _ctx.$emit("node-expand", $event);
- }),
- onNodeCollapse: _cache[5] || (_cache[5] = function($event) {
- return _ctx.$emit("node-collapse", $event);
- }),
- onNodeSelect: $options.onNodeSelect,
- onNodeUnselect: $options.onNodeUnselect,
- onClick: _cache[6] || (_cache[6] = withModifiers(function() {
- }, ["stop"])),
- level: 0,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcTree")
- }, createSlots({
- _: 2
- }, [_ctx.$slots.option ? {
- name: "default",
- fn: withCtx(function(optionSlotProps) {
- return [renderSlot(_ctx.$slots, "option", {
- node: optionSlotProps.node,
- expanded: optionSlotProps.expanded,
- selected: optionSlotProps.selected
- })];
- }),
- key: "0"
- } : void 0, _ctx.$slots.itemtoggleicon ? {
- name: "toggleicon",
- fn: withCtx(function(iconSlotProps) {
- return [renderSlot(_ctx.$slots, "itemtoggleicon", {
- node: iconSlotProps.node,
- expanded: iconSlotProps.expanded,
- "class": normalizeClass(iconSlotProps["class"])
- })];
- }),
- key: "1"
- } : _ctx.$slots.itemtogglericon ? {
- name: "togglericon",
- fn: withCtx(function(iconSlotProps) {
- return [renderSlot(_ctx.$slots, "itemtogglericon", {
- node: iconSlotProps.node,
- expanded: iconSlotProps.expanded,
- "class": normalizeClass(iconSlotProps["class"])
- })];
- }),
- key: "2"
- } : void 0, _ctx.$slots.itemcheckboxicon ? {
- name: "checkboxicon",
- fn: withCtx(function(iconSlotProps) {
- return [renderSlot(_ctx.$slots, "itemcheckboxicon", {
- checked: iconSlotProps.checked,
- partialChecked: iconSlotProps.partialChecked,
- "class": normalizeClass(iconSlotProps["class"])
- })];
- }),
- key: "3"
- } : void 0]), 1032, ["id", "value", "selectionMode", "loading", "loadingIcon", "loadingMode", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "onUpdate:selectionKeys", "selectionKeys", "expandedKeys", "onUpdate:expandedKeys", "metaKeySelection", "onNodeSelect", "onNodeUnselect", "unstyled", "pt"]), $options.emptyOptions && !_ctx.loading ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("emptyMessage")
- }, _ctx.ptm("emptyMessage")), [renderSlot(_ctx.$slots, "empty", {}, function() {
- return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];
- })], 16)) : createCommentVNode("", true)], 16), renderSlot(_ctx.$slots, "footer", {
- value: _ctx.d_value,
- options: _ctx.options
- }), createBaseVNode("span", mergeProps({
- ref: "lastHiddenFocusableElementOnOverlay",
- role: "presentation",
- "class": "p-hidden-accessible p-hidden-focusable",
- tabindex: 0,
- onFocus: _cache[7] || (_cache[7] = function() {
- return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);
- })
- }, _ctx.ptm("hiddenLastFocusableEl"), {
- "data-p-hidden-accessible": true,
- "data-p-hidden-focusable": true
- }), null, 16)], 16)) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
- }),
- _: 3
- }, 8, ["appendTo"])], 16);
-}
-__name(render$5, "render$5");
-script$6.render = render$5;
-var theme39 = /* @__PURE__ */ __name(function theme40(_ref) {
- var dt = _ref.dt;
- return "\n.p-treetable {\n position: relative;\n}\n\n.p-treetable-table {\n border-spacing: 0;\n border-collapse: separate;\n width: 100%;\n}\n\n.p-treetable-scrollable > .p-treetable-table-container {\n position: relative;\n}\n\n.p-treetable-scrollable-table > .p-treetable-thead {\n inset-block-start: 0;\n z-index: 1;\n}\n\n.p-treetable-scrollable-table > .p-treetable-frozen-tbody {\n position: sticky;\n z-index: 1;\n}\n\n.p-treetable-scrollable-table > .p-treetable-tfoot {\n inset-block-end: 0;\n z-index: 1;\n}\n\n.p-treetable-scrollable .p-treetable-frozen-column {\n position: sticky;\n background: ".concat(dt("treetable.header.cell.background"), ";\n}\n\n.p-treetable-scrollable th.p-treetable-frozen-column {\n z-index: 1;\n}\n\n.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-thead {\n background: ").concat(dt("treetable.header.cell.background"), ";\n}\n\n.p-treetable-scrollable > .p-treetable-table-container > .p-treetable-table > .p-treetable-tfoot {\n background: ").concat(dt("treetable.footer.cell.background"), ";\n}\n\n.p-treetable-flex-scrollable {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.p-treetable-flex-scrollable > .p-treetable-table-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n height: 100%;\n}\n\n.p-treetable-scrollable-table > .p-treetable-tbody > .p-treetable-row-group-header {\n position: sticky;\n z-index: 1;\n}\n\n.p-treetable-resizable-table > .p-treetable-thead > tr > th,\n.p-treetable-resizable-table > .p-treetable-tfoot > tr > td,\n.p-treetable-resizable-table > .p-treetable-tbody > tr > td {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.p-treetable-resizable-table > .p-treetable-thead > tr > th.p-treetable-resizable-column:not(.p-treetable-frozen-column) {\n background-clip: padding-box;\n position: relative;\n}\n\n.p-treetable-resizable-table-fit > .p-treetable-thead > tr > th.p-treetable-resizable-column:last-child .p-treetable-column-resizer {\n display: none;\n}\n\n.p-treetable-column-resizer {\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n margin: 0;\n width: ").concat(dt("treetable.column.resizer.width"), ";\n height: 100%;\n padding: 0;\n cursor: col-resize;\n border: 1px solid transparent;\n}\n\n.p-treetable-column-header-content {\n display: flex;\n align-items: center;\n gap: ").concat(dt("treetable.header.cell.gap"), ";\n}\n\n.p-treetable-column-resize-indicator {\n width: ").concat(dt("treetable.resize.indicator.width"), ";\n position: absolute;\n z-index: 10;\n display: none;\n background: ").concat(dt("treetable.resize.indicator.color"), ";\n}\n\n.p-treetable-mask {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2;\n}\n\n.p-treetable-paginator-top {\n border-color: ").concat(dt("treetable.paginator.top.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("treetable.paginator.top.border.width"), ";\n}\n\n.p-treetable-paginator-bottom {\n border-color: ").concat(dt("treetable.paginator.bottom.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("treetable.paginator.bottom.border.width"), ";\n}\n\n.p-treetable-header {\n background: ").concat(dt("treetable.header.background"), ";\n color: ").concat(dt("treetable.header.color"), ";\n border-color: ").concat(dt("treetable.header.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("treetable.header.border.width"), ";\n padding: ").concat(dt("treetable.header.padding"), ";\n}\n\n.p-treetable-footer {\n background: ").concat(dt("treetable.footer.background"), ";\n color: ").concat(dt("treetable.footer.color"), ";\n border-color: ").concat(dt("treetable.footer.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("treetable.footer.border.width"), ";\n padding: ").concat(dt("treetable.footer.padding"), ";\n}\n\n.p-treetable-header-cell {\n padding: ").concat(dt("treetable.header.cell.padding"), ";\n background: ").concat(dt("treetable.header.cell.background"), ";\n border-color: ").concat(dt("treetable.header.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("treetable.header.cell.color"), ";\n font-weight: normal;\n text-align: start;\n transition: background ").concat(dt("treetable.transition.duration"), ", color ").concat(dt("treetable.transition.duration"), ", border-color ").concat(dt("treetable.transition.duration"), ",\n outline-color ").concat(dt("treetable.transition.duration"), ", box-shadow ").concat(dt("treetable.transition.duration"), ";\n}\n\n.p-treetable-column-title {\n font-weight: ").concat(dt("treetable.column.title.font.weight"), ";\n}\n\n.p-treetable-tbody > tr {\n outline-color: transparent;\n background: ").concat(dt("treetable.row.background"), ";\n color: ").concat(dt("treetable.row.color"), ";\n transition: background ").concat(dt("treetable.transition.duration"), ", color ").concat(dt("treetable.transition.duration"), ", border-color ").concat(dt("treetable.transition.duration"), ",\n outline-color ").concat(dt("treetable.transition.duration"), ", box-shadow ").concat(dt("treetable.transition.duration"), ";\n}\n\n.p-treetable-tbody > tr > td {\n text-align: start;\n border-color: ").concat(dt("treetable.body.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n padding: ").concat(dt("treetable.body.cell.padding"), ";\n}\n\n.p-treetable-hoverable .p-treetable-tbody > tr:not(.p-treetable-row-selected):hover {\n background: ").concat(dt("treetable.row.hover.background"), ";\n color: ").concat(dt("treetable.row.hover.color"), ";\n}\n\n.p-treetable-tbody > tr.p-treetable-row-selected {\n background: ").concat(dt("treetable.row.selected.background"), ";\n color: ").concat(dt("treetable.row.selected.color"), ";\n}\n\n.p-treetable-tbody > tr:has(+ .p-treetable-row-selected) > td {\n border-block-end-color: ").concat(dt("treetable.body.cell.selected.border.color"), ";\n}\n\n.p-treetable-tbody > tr.p-treetable-row-selected > td {\n border-block-end-color: ").concat(dt("treetable.body.cell.selected.border.color"), ";\n}\n\n.p-treetable-tbody > tr:focus-visible,\n.p-treetable-tbody > tr.p-treetable-contextmenu-row-selected {\n box-shadow: ").concat(dt("treetable.row.focus.ring.shadow"), ";\n outline: ").concat(dt("treetable.row.focus.ring.width"), " ").concat(dt("treetable.row.focus.ring.style"), " ").concat(dt("treetable.row.focus.ring.color"), ";\n outline-offset: ").concat(dt("treetable.row.focus.ring.offset"), ";\n}\n\n.p-treetable-tfoot > tr > td {\n text-align: start;\n padding: ").concat(dt("treetable.footer.cell.padding"), ";\n border-color: ").concat(dt("treetable.footer.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("treetable.footer.cell.color"), ";\n background: ").concat(dt("treetable.footer.cell.background"), ";\n}\n\n.p-treetable-column-footer {\n font-weight: ").concat(dt("treetable.column.footer.font.weight"), ";\n}\n\n.p-treetable-sortable-column {\n cursor: pointer;\n user-select: none;\n outline-color: transparent;\n}\n\n.p-treetable-column-title,\n.p-treetable-sort-icon,\n.p-treetable-sort-badge {\n vertical-align: middle;\n}\n\n.p-treetable-sort-icon {\n color: ").concat(dt("treetable.sort.icon.color"), ";\n font-size: ").concat(dt("treetable.sort.icon.size"), ";\n width: ").concat(dt("treetable.sort.icon.size"), ";\n height: ").concat(dt("treetable.sort.icon.size"), ";\n transition: color ").concat(dt("treetable.transition.duration"), ";\n}\n\n.p-treetable-sortable-column:not(.p-treetable-column-sorted):hover {\n background: ").concat(dt("treetable.header.cell.hover.background"), ";\n color: ").concat(dt("treetable.header.cell.hover.color"), ";\n}\n\n.p-treetable-sortable-column:not(.p-treetable-column-sorted):hover .p-treetable-sort-icon {\n color: ").concat(dt("treetable.sort.icon.hover.color"), ";\n}\n\n.p-treetable-column-sorted {\n background: ").concat(dt("treetable.header.cell.selected.background"), ";\n color: ").concat(dt("treetable.header.cell.selected.color"), ";\n}\n\n.p-treetable-column-sorted .p-treetable-sort-icon {\n color: ").concat(dt("treetable.header.cell.selected.color"), ";\n}\n\n.p-treetable-sortable-column:focus-visible {\n box-shadow: ").concat(dt("treetable.header.cell.focus.ring.shadow"), ";\n outline: ").concat(dt("treetable.header.cell.focus.ring.width"), " ").concat(dt("treetable.header.cell.focus.ring.style"), " ").concat(dt("treetable.header.cell.focus.ring.color"), ";\n outline-offset: ").concat(dt("treetable.header.cell.focus.ring.offset"), ";\n}\n\n.p-treetable-hoverable .p-treetable-selectable-row {\n cursor: pointer;\n}\n\n.p-treetable-loading-icon {\n font-size: ").concat(dt("treetable.loading.icon.size"), ";\n width: ").concat(dt("treetable.loading.icon.size"), ";\n height: ").concat(dt("treetable.loading.icon.size"), ";\n}\n\n.p-treetable-gridlines .p-treetable-header {\n border-width: 1px 1px 0 1px;\n}\n\n.p-treetable-gridlines .p-treetable-footer {\n border-width: 0 1px 1px 1px;\n}\n\n.p-treetable-gridlines .p-treetable-paginator-top {\n border-width: 1px 1px 0 1px;\n}\n\n.p-treetable-gridlines .p-treetable-paginator-bottom {\n border-width: 0 1px 1px 1px;\n}\n\n.p-treetable-gridlines .p-treetable-thead > tr > th {\n border-width: 1px 0 1px 1px;\n}\n\n.p-treetable-gridlines .p-treetable-thead > tr > th:last-child {\n border-width: 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tbody > tr > td {\n border-width: 1px 0 0 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tbody > tr > td:last-child {\n border-width: 1px 1px 0 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tbody > tr:last-child > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tbody > tr:last-child > td:last-child {\n border-width: 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tfoot > tr > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-treetable-gridlines .p-treetable-tfoot > tr > td:last-child {\n border-width: 1px 1px 1px 1px;\n}\n\n.p-treetable.p-treetable-gridlines .p-treetable-thead + .p-treetable-tfoot > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-treetable.p-treetable-gridlines .p-treetable-thead + .p-treetable-tfoot > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-treetable.p-treetable-gridlines:has(.p-treetable-thead):has(.p-treetable-tbody) .p-treetable-tbody > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-treetable.p-treetable-gridlines:has(.p-treetable-thead):has(.p-treetable-tbody) .p-treetable-tbody > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-treetable.p-treetable-gridlines:has(.p-treetable-tbody):has(.p-treetable-tfoot) .p-treetable-tbody > tr:last-child > td {\n border-width: 0 0 0 1px;\n}\n\n.p-treetable.p-treetable-gridlines:has(.p-treetable-tbody):has(.p-treetable-tfoot) .p-treetable-tbody > tr:last-child > td:last-child {\n border-width: 0 1px 0 1px;\n}\n\n.p-treetable.p-treetable-sm .p-treetable-header {\n padding: 0.375rem 0.5rem;\n}\n\n.p-treetable.p-treetable-sm .p-treetable-thead > tr > th {\n padding: 0.375rem 0.5rem;\n}\n\n.p-treetable.p-treetable-sm .p-treetable-tbody > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-treetable.p-treetable-sm .p-treetable-tfoot > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-treetable.p-treetable-sm .p-treetable-footer {\n padding: 0.375rem 0.5rem;\n}\n\n.p-treetable.p-treetable-lg .p-treetable-header {\n padding: 0.9375rem 1.25rem;\n}\n\n.p-treetable.p-treetable-lg .p-treetable-thead > tr > th {\n padding: 0.9375rem 1.25rem;\n}\n\n.p-treetable.p-treetable-lg .p-treetable-tbody > tr > td {\n padding: 0.9375rem 1.25rem;\n}\n\n.p-treetable.p-treetable-lg .p-treetable-tfoot > tr > td {\n padding: 0.9375rem 1.25rem;\n}\n\n.p-treetable.p-treetable-lg .p-treetable-footer {\n padding: 0.9375rem 1.25rem;\n}\n\n.p-treetable-body-cell-content {\n display: flex;\n align-items: center;\n gap: ").concat(dt("treetable.body.cell.gap"), ";\n}\n\n.p-treetable-tbody > tr.p-treetable-row-selected .p-treetable-node-toggle-button {\n color: inherit;\n}\n\n.p-treetable-node-toggle-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("treetable.node.toggle.button.size"), ";\n height: ").concat(dt("treetable.node.toggle.button.size"), ";\n color: ").concat(dt("treetable.node.toggle.button.color"), ";\n border: 0 none;\n background: transparent;\n cursor: pointer;\n border-radius: ").concat(dt("treetable.node.toggle.button.border.radius"), ";\n transition: background ").concat(dt("treetable.transition.duration"), ", color ").concat(dt("treetable.transition.duration"), ", border-color ").concat(dt("treetable.transition.duration"), ",\n outline-color ").concat(dt("treetable.transition.duration"), ", box-shadow ").concat(dt("treetable.transition.duration"), ";\n outline-color: transparent;\n user-select: none;\n}\n\n.p-treetable-node-toggle-button:enabled:hover {\n color: ").concat(dt("treetable.node.toggle.button.hover.color"), ";\n background: ").concat(dt("treetable.node.toggle.button.hover.background"), ";\n}\n\n.p-treetable-tbody > tr.p-treetable-row-selected .p-treetable-node-toggle-button:hover {\n background: ").concat(dt("treetable.node.toggle.button.selected.hover.background"), ";\n color: ").concat(dt("treetable.node.toggle.button.selected.hover.color"), ";\n}\n\n.p-treetable-node-toggle-button:focus-visible {\n box-shadow: ").concat(dt("treetable.node.toggle.button.focus.ring.shadow"), ";\n outline: ").concat(dt("treetable.node.toggle.button.focus.ring.width"), " ").concat(dt("treetable.node.toggle.button.focus.ring.style"), " ").concat(dt("treetable.node.toggle.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("treetable.node.toggle.button.focus.ring.offset"), ";\n}\n\n.p-treetable-node-toggle-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n");
-}, "theme");
-var classes = {
- root: /* @__PURE__ */ __name(function root33(_ref2) {
- var instance = _ref2.instance, props = _ref2.props;
- return ["p-treetable p-component", {
- "p-treetable-hoverable": props.rowHover || instance.rowSelectionMode,
- "p-treetable-resizable": props.resizableColumns,
- "p-treetable-resizable-fit": props.resizableColumns && props.columnResizeMode === "fit",
- "p-treetable-scrollable": props.scrollable,
- "p-treetable-flex-scrollable": props.scrollable && props.scrollHeight === "flex",
- "p-treetable-gridlines": props.showGridlines,
- "p-treetable-sm": props.size === "small",
- "p-treetable-lg": props.size === "large"
- }];
- }, "root"),
- loading: "p-treetable-loading",
- //TODO: required?
- mask: "p-treetable-mask p-overlay-mask",
- loadingIcon: "p-treetable-loading-icon",
- header: "p-treetable-header",
- paginator: /* @__PURE__ */ __name(function paginator(_ref3) {
- var position = _ref3.position;
- return "p-treetable-paginator-" + position;
- }, "paginator"),
- tableContainer: "p-treetable-table-container",
- table: /* @__PURE__ */ __name(function table(_ref4) {
- var props = _ref4.props;
- return ["p-treetable-table", {
- "p-treetable-scrollable-table": props.scrollable,
- "p-treetable-resizable-table": props.resizableColumns,
- "p-treetable-resizable-table-fit": props.resizableColumns && props.columnResizeMode === "fit"
- }];
- }, "table"),
- thead: "p-treetable-thead",
- headerCell: /* @__PURE__ */ __name(function headerCell(_ref5) {
- var instance = _ref5.instance, props = _ref5.props, context = _ref5.context;
- return ["p-treetable-header-cell", {
- "p-treetable-sortable-column": instance.columnProp("sortable"),
- "p-treetable-resizable-column": props.resizableColumns,
- "p-treetable-column-sorted": context === null || context === void 0 ? void 0 : context.sorted,
- "p-treetable-frozen-column": instance.columnProp("frozen")
- }];
- }, "headerCell"),
- columnResizer: "p-treetable-column-resizer",
- columnHeaderContent: "p-treetable-column-header-content",
- columnTitle: "p-treetable-column-title",
- sortIcon: "p-treetable-sort-icon",
- pcSortBadge: "p-treetable-sort-badge",
- tbody: "p-treetable-tbody",
- row: /* @__PURE__ */ __name(function row(_ref6) {
- var props = _ref6.props, instance = _ref6.instance;
- return [{
- "p-treetable-row-selected": instance.selected,
- "p-treetable-contextmenu-row-selected": props.contextMenuSelection && instance.isSelectedWithContextMenu
- }];
- }, "row"),
- bodyCell: /* @__PURE__ */ __name(function bodyCell(_ref7) {
- var instance = _ref7.instance;
- return [{
- "p-treetable-frozen-column": instance.columnProp("frozen")
- }];
- }, "bodyCell"),
- bodyCellContent: /* @__PURE__ */ __name(function bodyCellContent(_ref8) {
- var instance = _ref8.instance;
- return ["p-treetable-body-cell-content", {
- "p-treetable-body-cell-content-expander": instance.columnProp("expander")
- }];
- }, "bodyCellContent"),
- nodeToggleButton: "p-treetable-node-toggle-button",
- nodeToggleIcon: "p-treetable-node-toggle-icon",
- pcNodeCheckbox: "p-treetable-node-checkbox",
- emptyMessage: "p-treetable-empty-message",
- tfoot: "p-treetable-tfoot",
- footerCell: /* @__PURE__ */ __name(function footerCell(_ref9) {
- var instance = _ref9.instance;
- return [{
- "p-treetable-frozen-column": instance.columnProp("frozen")
- }];
- }, "footerCell"),
- footer: "p-treetable-footer",
- columnResizeIndicator: "p-treetable-column-resize-indicator"
-};
-var inlineStyles = {
- tableContainer: {
- overflow: "auto"
- },
- thead: {
- position: "sticky"
- },
- tfoot: {
- position: "sticky"
- }
-};
-var TreeTableStyle = BaseStyle.extend({
- name: "treetable",
- theme: theme39,
- classes,
- inlineStyles
-});
-var script$5 = {
- name: "BaseTreeTable",
- "extends": script$1f,
- props: {
- value: {
- type: null,
- "default": null
- },
- dataKey: {
- type: [String, Function],
- "default": "key"
- },
- expandedKeys: {
- type: null,
- "default": null
- },
- selectionKeys: {
- type: null,
- "default": null
- },
- selectionMode: {
- type: String,
- "default": null
- },
- metaKeySelection: {
- type: Boolean,
- "default": false
- },
- contextMenu: {
- type: Boolean,
- "default": false
- },
- contextMenuSelection: {
- type: Object,
- "default": null
- },
- rows: {
- type: Number,
- "default": 0
- },
- first: {
- type: Number,
- "default": 0
- },
- totalRecords: {
- type: Number,
- "default": 0
- },
- paginator: {
- type: Boolean,
- "default": false
- },
- paginatorPosition: {
- type: String,
- "default": "bottom"
- },
- alwaysShowPaginator: {
- type: Boolean,
- "default": true
- },
- paginatorTemplate: {
- type: String,
- "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
- },
- pageLinkSize: {
- type: Number,
- "default": 5
- },
- rowsPerPageOptions: {
- type: Array,
- "default": null
- },
- currentPageReportTemplate: {
- type: String,
- "default": "({currentPage} of {totalPages})"
- },
- lazy: {
- type: Boolean,
- "default": false
- },
- loading: {
- type: Boolean,
- "default": false
- },
- loadingIcon: {
- type: String,
- "default": void 0
- },
- loadingMode: {
- type: String,
- "default": "mask"
- },
- rowHover: {
- type: Boolean,
- "default": false
- },
- autoLayout: {
- type: Boolean,
- "default": false
- },
- sortField: {
- type: [String, Function],
- "default": null
- },
- sortOrder: {
- type: Number,
- "default": null
- },
- defaultSortOrder: {
- type: Number,
- "default": 1
- },
- multiSortMeta: {
- type: Array,
- "default": null
- },
- sortMode: {
- type: String,
- "default": "single"
- },
- removableSort: {
- type: Boolean,
- "default": false
- },
- filters: {
- type: Object,
- "default": null
- },
- filterMode: {
- type: String,
- "default": "lenient"
- },
- filterLocale: {
- type: String,
- "default": void 0
- },
- resizableColumns: {
- type: Boolean,
- "default": false
- },
- columnResizeMode: {
- type: String,
- "default": "fit"
- },
- indentation: {
- type: Number,
- "default": 1
- },
- showGridlines: {
- type: Boolean,
- "default": false
- },
- scrollable: {
- type: Boolean,
- "default": false
- },
- scrollHeight: {
- type: String,
- "default": null
- },
- size: {
- type: String,
- "default": null
- },
- tableStyle: {
- type: null,
- "default": null
- },
- tableClass: {
- type: [String, Object],
- "default": null
- },
- tableProps: {
- type: Object,
- "default": null
- }
- },
- style: TreeTableStyle,
- provide: /* @__PURE__ */ __name(function provide50() {
- return {
- $pcTreeTable: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$4 = {
- name: "FooterCell",
- hostName: "TreeTable",
- "extends": script$1f,
- props: {
- column: {
- type: Object,
- "default": null
- },
- index: {
- type: Number,
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data36() {
- return {
- styleObject: {}
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted41() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated9() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "updated"),
- methods: {
- columnProp: /* @__PURE__ */ __name(function columnProp(prop) {
- return getVNodeProp(this.column, prop);
- }, "columnProp"),
- getColumnPT: /* @__PURE__ */ __name(function getColumnPT(key) {
- var _this$$parentInstance;
- var columnMetaData = {
- props: this.column.props,
- parent: {
- instance: this,
- props: this.$props,
- state: this.$data
- },
- context: {
- index: this.index,
- frozen: this.columnProp("frozen"),
- size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size
- }
- };
- return mergeProps(this.ptm("column.".concat(key), {
- column: columnMetaData
- }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));
- }, "getColumnPT"),
- getColumnProp: /* @__PURE__ */ __name(function getColumnProp() {
- return this.column.props && this.column.props.pt ? this.column.props.pt : void 0;
- }, "getColumnProp"),
- updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition() {
- if (this.columnProp("frozen")) {
- var align = this.columnProp("alignFrozen");
- if (align === "right") {
- var pos = 0;
- var next = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (next) {
- pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
- }
- this.styleObject.insetInlineEnd = pos + "px";
- } else {
- var _pos = 0;
- var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (prev) {
- _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
- }
- this.styleObject.insetInlineStart = _pos + "px";
- }
- }
- }, "updateStickyPosition")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass4() {
- return [this.columnProp("footerClass"), this.columnProp("class"), this.cx("footerCell")];
- }, "containerClass"),
- containerStyle: /* @__PURE__ */ __name(function containerStyle2() {
- var bodyStyle = this.columnProp("footerStyle");
- var columnStyle = this.columnProp("style");
- return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle];
- }, "containerStyle")
- }
-};
-function _typeof$5(o) {
- "@babel/helpers - typeof";
- return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$5(o);
-}
-__name(_typeof$5, "_typeof$5");
-function ownKeys$5(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$5, "ownKeys$5");
-function _objectSpread$5(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$5(Object(t2), true).forEach(function(r2) {
- _defineProperty$5(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$5(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$5, "_objectSpread$5");
-function _defineProperty$5(e, r, t2) {
- return (r = _toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$5, "_defineProperty$5");
-function _toPropertyKey$5(t2) {
- var i = _toPrimitive$5(t2, "string");
- return "symbol" == _typeof$5(i) ? i : i + "";
-}
-__name(_toPropertyKey$5, "_toPropertyKey$5");
-function _toPrimitive$5(t2, r) {
- if ("object" != _typeof$5(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$5(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$5, "_toPrimitive$5");
-var _hoisted_1$4 = ["data-p-frozen-column"];
-function render$4(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("td", mergeProps({
- style: $options.containerStyle,
- "class": $options.containerClass,
- role: "cell"
- }, _objectSpread$5(_objectSpread$5({}, $options.getColumnPT("root")), $options.getColumnPT("footerCell")), {
- "data-p-frozen-column": $options.columnProp("frozen")
- }), [$props.column.children && $props.column.children.footer ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.footer), {
- key: 0,
- column: $props.column
- }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("footer") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": _ctx.cx("columnFooter")
- }, $options.getColumnPT("columnFooter")), toDisplayString($options.columnProp("footer")), 17)) : createCommentVNode("", true)], 16, _hoisted_1$4);
-}
-__name(render$4, "render$4");
-script$4.render = render$4;
-var script$3 = {
- name: "HeaderCell",
- hostName: "TreeTable",
- "extends": script$1f,
- emits: ["column-click", "column-resizestart"],
- props: {
- column: {
- type: Object,
- "default": null
- },
- resizableColumns: {
- type: Boolean,
- "default": false
- },
- sortField: {
- type: [String, Function],
- "default": null
- },
- sortOrder: {
- type: Number,
- "default": null
- },
- multiSortMeta: {
- type: Array,
- "default": null
- },
- sortMode: {
- type: String,
- "default": "single"
- },
- index: {
- type: Number,
- "default": null
- }
- },
- data: /* @__PURE__ */ __name(function data37() {
- return {
- styleObject: {}
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted42() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated10() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "updated"),
- methods: {
- columnProp: /* @__PURE__ */ __name(function columnProp2(prop) {
- return getVNodeProp(this.column, prop);
- }, "columnProp"),
- getColumnPT: /* @__PURE__ */ __name(function getColumnPT2(key) {
- var _this$$parentInstance;
- var columnMetaData = {
- props: this.column.props,
- parent: {
- instance: this,
- props: this.$props,
- state: this.$data
- },
- context: {
- index: this.index,
- sorted: this.isColumnSorted(),
- frozen: this.$parentInstance.scrollable && this.columnProp("frozen"),
- resizable: this.resizableColumns,
- scrollable: this.$parentInstance.scrollable,
- showGridlines: this.$parentInstance.showGridlines,
- size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size
- }
- };
- return mergeProps(this.ptm("column.".concat(key), {
- column: columnMetaData
- }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));
- }, "getColumnPT"),
- getColumnProp: /* @__PURE__ */ __name(function getColumnProp2() {
- return this.column.props && this.column.props.pt ? this.column.props.pt : void 0;
- }, "getColumnProp"),
- updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition2() {
- if (this.columnProp("frozen")) {
- var align = this.columnProp("alignFrozen");
- if (align === "right") {
- var pos = 0;
- var next = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (next) {
- pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
- }
- this.styleObject.insetInlineEnd = pos + "px";
- } else {
- var _pos = 0;
- var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (prev) {
- _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
- }
- this.styleObject.insetInlineStart = _pos + "px";
- }
- var filterRow = this.$el.parentElement.nextElementSibling;
- if (filterRow) {
- var index = getIndex(this.$el);
- filterRow.children[index].style.left = this.styleObject.left;
- filterRow.children[index].style.right = this.styleObject.right;
- }
- }
- }, "updateStickyPosition"),
- onClick: /* @__PURE__ */ __name(function onClick9(event2) {
- this.$emit("column-click", {
- originalEvent: event2,
- column: this.column
- });
- }, "onClick"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown13(event2) {
- if ((event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") && event2.currentTarget.nodeName === "TH" && getAttribute(event2.currentTarget, "data-p-sortable-column")) {
- this.$emit("column-click", {
- originalEvent: event2,
- column: this.column
- });
- event2.preventDefault();
- }
- }, "onKeyDown"),
- onResizeStart: /* @__PURE__ */ __name(function onResizeStart(event2) {
- this.$emit("column-resizestart", event2);
- }, "onResizeStart"),
- getMultiSortMetaIndex: /* @__PURE__ */ __name(function getMultiSortMetaIndex() {
- var index = -1;
- for (var i = 0; i < this.multiSortMeta.length; i++) {
- var meta = this.multiSortMeta[i];
- if (meta.field === this.columnProp("field") || meta.field === this.columnProp("sortField")) {
- index = i;
- break;
- }
- }
- return index;
- }, "getMultiSortMetaIndex"),
- isMultiSorted: /* @__PURE__ */ __name(function isMultiSorted() {
- return this.columnProp("sortable") && this.getMultiSortMetaIndex() > -1;
- }, "isMultiSorted"),
- isColumnSorted: /* @__PURE__ */ __name(function isColumnSorted() {
- return this.sortMode === "single" ? this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField")) : this.isMultiSorted();
- }, "isColumnSorted")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass5() {
- return [this.columnProp("headerClass"), this.columnProp("class"), this.cx("headerCell")];
- }, "containerClass"),
- containerStyle: /* @__PURE__ */ __name(function containerStyle3() {
- var headerStyle = this.columnProp("headerStyle");
- var columnStyle = this.columnProp("style");
- return this.columnProp("frozen") ? [columnStyle, headerStyle, this.styleObject] : [columnStyle, headerStyle];
- }, "containerStyle"),
- sortState: /* @__PURE__ */ __name(function sortState() {
- var sorted2 = false;
- var sortOrder3 = null;
- if (this.sortMode === "single") {
- sorted2 = this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField"));
- sortOrder3 = sorted2 ? this.sortOrder : 0;
- } else if (this.sortMode === "multiple") {
- var metaIndex = this.getMultiSortMetaIndex();
- if (metaIndex > -1) {
- sorted2 = true;
- sortOrder3 = this.multiSortMeta[metaIndex].order;
- }
- }
- return {
- sorted: sorted2,
- sortOrder: sortOrder3
- };
- }, "sortState"),
- sortableColumnIcon: /* @__PURE__ */ __name(function sortableColumnIcon() {
- var _this$sortState = this.sortState, sorted2 = _this$sortState.sorted, sortOrder3 = _this$sortState.sortOrder;
- if (!sorted2) return script$1V;
- else if (sorted2 && sortOrder3 > 0) return script$1W;
- else if (sorted2 && sortOrder3 < 0) return script$1X;
- return null;
- }, "sortableColumnIcon"),
- ariaSort: /* @__PURE__ */ __name(function ariaSort() {
- if (this.columnProp("sortable")) {
- var _this$sortState2 = this.sortState, sorted2 = _this$sortState2.sorted, sortOrder3 = _this$sortState2.sortOrder;
- if (sorted2 && sortOrder3 < 0) return "descending";
- else if (sorted2 && sortOrder3 > 0) return "ascending";
- else return "none";
- } else {
- return null;
- }
- }, "ariaSort")
- },
- components: {
- Badge: script$1y,
- SortAltIcon: script$1V,
- SortAmountUpAltIcon: script$1W,
- SortAmountDownIcon: script$1X
- }
-};
-function _typeof$4(o) {
- "@babel/helpers - typeof";
- return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$4(o);
-}
-__name(_typeof$4, "_typeof$4");
-function ownKeys$4(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$4, "ownKeys$4");
-function _objectSpread$4(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$4(Object(t2), true).forEach(function(r2) {
- _defineProperty$4(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$4(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$4, "_objectSpread$4");
-function _defineProperty$4(e, r, t2) {
- return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$4, "_defineProperty$4");
-function _toPropertyKey$4(t2) {
- var i = _toPrimitive$4(t2, "string");
- return "symbol" == _typeof$4(i) ? i : i + "";
-}
-__name(_toPropertyKey$4, "_toPropertyKey$4");
-function _toPrimitive$4(t2, r) {
- if ("object" != _typeof$4(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$4(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$4, "_toPrimitive$4");
-var _hoisted_1$3$1 = ["tabindex", "aria-sort", "data-p-sortable-column", "data-p-resizable-column", "data-p-sorted", "data-p-frozen-column"];
-function render$3(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Badge = resolveComponent("Badge");
- return openBlock(), createElementBlock("th", mergeProps({
- "class": $options.containerClass,
- style: [$options.containerStyle],
- onClick: _cache[1] || (_cache[1] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- }),
- tabindex: $options.columnProp("sortable") ? "0" : null,
- "aria-sort": $options.ariaSort,
- role: "columnheader"
- }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT("root")), $options.getColumnPT("headerCell")), {
- "data-p-sortable-column": $options.columnProp("sortable"),
- "data-p-resizable-column": $props.resizableColumns,
- "data-p-sorted": $options.isColumnSorted(),
- "data-p-frozen-column": $options.columnProp("frozen")
- }), [$props.resizableColumns && !$options.columnProp("frozen") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 0,
- "class": _ctx.cx("columnResizer"),
- onMousedown: _cache[0] || (_cache[0] = function() {
- return $options.onResizeStart && $options.onResizeStart.apply($options, arguments);
- })
- }, $options.getColumnPT("columnResizer")), null, 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("columnHeaderContent")
- }, $options.getColumnPT("columnHeaderContent")), [$props.column.children && $props.column.children.header ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.header), {
- key: 0,
- column: $props.column
- }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("header") ? (openBlock(), createElementBlock("span", mergeProps({
- key: 1,
- "class": _ctx.cx("columnTitle")
- }, $options.getColumnPT("columnTitle")), toDisplayString($options.columnProp("header")), 17)) : createCommentVNode("", true), $options.columnProp("sortable") ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({
- key: 2
- }, $options.getColumnPT("sort"))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.sorticon || $options.sortableColumnIcon), mergeProps({
- sorted: $options.sortState.sorted,
- sortOrder: $options.sortState.sortOrder,
- "class": _ctx.cx("sortIcon")
- }, $options.getColumnPT("sortIcon")), null, 16, ["sorted", "sortOrder", "class"]))], 16)) : createCommentVNode("", true), $options.isMultiSorted() ? (openBlock(), createBlock(_component_Badge, mergeProps({
- key: 3,
- "class": _ctx.cx("pcSortBadge")
- }, $options.getColumnPT("pcSortBadge"), {
- value: $options.getMultiSortMetaIndex() + 1,
- size: "small"
- }), null, 16, ["class", "value"])) : createCommentVNode("", true)], 16)], 16, _hoisted_1$3$1);
-}
-__name(render$3, "render$3");
-script$3.render = render$3;
-var script$2 = {
- name: "BodyCell",
- hostName: "TreeTable",
- "extends": script$1f,
- emits: ["node-toggle", "checkbox-toggle"],
- props: {
- node: {
- type: Object,
- "default": null
- },
- column: {
- type: Object,
- "default": null
- },
- level: {
- type: Number,
- "default": 0
- },
- indentation: {
- type: Number,
- "default": 1
- },
- leaf: {
- type: Boolean,
- "default": false
- },
- expanded: {
- type: Boolean,
- "default": false
- },
- selectionMode: {
- type: String,
- "default": null
- },
- checked: {
- type: Boolean,
- "default": false
- },
- partialChecked: {
- type: Boolean,
- "default": false
- },
- templates: {
- type: Object,
- "default": null
- },
- index: {
- type: Number,
- "default": null
- },
- loadingMode: {
- type: String,
- "default": "mask"
- }
- },
- data: /* @__PURE__ */ __name(function data38() {
- return {
- styleObject: {}
- };
- }, "data"),
- mounted: /* @__PURE__ */ __name(function mounted43() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "mounted"),
- updated: /* @__PURE__ */ __name(function updated11() {
- if (this.columnProp("frozen")) {
- this.updateStickyPosition();
- }
- }, "updated"),
- methods: {
- toggle: /* @__PURE__ */ __name(function toggle4() {
- this.$emit("node-toggle", this.node);
- }, "toggle"),
- columnProp: /* @__PURE__ */ __name(function columnProp3(prop) {
- return getVNodeProp(this.column, prop);
- }, "columnProp"),
- getColumnPT: /* @__PURE__ */ __name(function getColumnPT3(key) {
- var _this$$parentInstance;
- var columnMetaData = {
- props: this.column.props,
- parent: {
- instance: this,
- props: this.$props,
- state: this.$data
- },
- context: {
- index: this.index,
- selectable: this.$parentInstance.rowHover || this.$parentInstance.rowSelectionMode,
- selected: this.$parent.selected,
- frozen: this.columnProp("frozen"),
- scrollable: this.$parentInstance.scrollable,
- showGridlines: this.$parentInstance.showGridlines,
- size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size
- }
- };
- return mergeProps(this.ptm("column.".concat(key), {
- column: columnMetaData
- }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));
- }, "getColumnPT"),
- getColumnProp: /* @__PURE__ */ __name(function getColumnProp3() {
- return this.column.props && this.column.props.pt ? this.column.props.pt : void 0;
- }, "getColumnProp"),
- getColumnCheckboxPT: /* @__PURE__ */ __name(function getColumnCheckboxPT(key) {
- var columnMetaData = {
- props: this.column.props,
- parent: {
- instance: this,
- props: this.$props,
- state: this.$data
- },
- context: {
- checked: this.checked,
- partialChecked: this.partialChecked
- }
- };
- return mergeProps(this.ptm("column.".concat(key), {
- column: columnMetaData
- }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));
- }, "getColumnCheckboxPT"),
- updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition3() {
- if (this.columnProp("frozen")) {
- var align = this.columnProp("alignFrozen");
- if (align === "right") {
- var pos = 0;
- var next = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (next) {
- pos = getOuterWidth(next) + parseFloat(next.style.right || 0);
- }
- this.styleObject.insetInlineEnd = pos + "px";
- } else {
- var _pos = 0;
- var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]');
- if (prev) {
- _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);
- }
- this.styleObject.insetInlineStart = _pos + "px";
- }
- }
- }, "updateStickyPosition"),
- resolveFieldData: /* @__PURE__ */ __name(function resolveFieldData$1(rowData, field) {
- return resolveFieldData(rowData, field);
- }, "resolveFieldData$1"),
- toggleCheckbox: /* @__PURE__ */ __name(function toggleCheckbox() {
- this.$emit("checkbox-toggle");
- }, "toggleCheckbox")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass6() {
- return [this.columnProp("bodyClass"), this.columnProp("class"), this.cx("bodyCell")];
- }, "containerClass"),
- containerStyle: /* @__PURE__ */ __name(function containerStyle4() {
- var bodyStyle = this.columnProp("bodyStyle");
- var columnStyle = this.columnProp("style");
- return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle];
- }, "containerStyle"),
- togglerStyle: /* @__PURE__ */ __name(function togglerStyle() {
- return {
- marginLeft: this.level * this.indentation + "rem",
- visibility: this.leaf ? "hidden" : "visible"
- };
- }, "togglerStyle"),
- checkboxSelectionMode: /* @__PURE__ */ __name(function checkboxSelectionMode() {
- return this.selectionMode === "checkbox";
- }, "checkboxSelectionMode")
- },
- components: {
- Checkbox: script$1I,
- ChevronRightIcon: script$1i,
- ChevronDownIcon: script$1h,
- CheckIcon: script$1C,
- MinusIcon: script$1x,
- SpinnerIcon: script$1p
- },
- directives: {
- ripple: Ripple
- }
-};
-function _typeof$3(o) {
- "@babel/helpers - typeof";
- return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$3(o);
-}
-__name(_typeof$3, "_typeof$3");
-function ownKeys$3(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$3, "ownKeys$3");
-function _objectSpread$3(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$3(Object(t2), true).forEach(function(r2) {
- _defineProperty$3(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$3(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$3, "_objectSpread$3");
-function _defineProperty$3(e, r, t2) {
- return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$3, "_defineProperty$3");
-function _toPropertyKey$3(t2) {
- var i = _toPrimitive$3(t2, "string");
- return "symbol" == _typeof$3(i) ? i : i + "";
-}
-__name(_toPropertyKey$3, "_toPropertyKey$3");
-function _toPrimitive$3(t2, r) {
- if ("object" != _typeof$3(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$3(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$3, "_toPrimitive$3");
-var _hoisted_1$2$1 = ["data-p-frozen-column"];
-function render$2(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
- var _component_Checkbox = resolveComponent("Checkbox");
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("td", mergeProps({
- style: $options.containerStyle,
- "class": $options.containerClass,
- role: "cell"
- }, _objectSpread$3(_objectSpread$3({}, $options.getColumnPT("root")), $options.getColumnPT("bodyCell")), {
- "data-p-frozen-column": $options.columnProp("frozen")
- }), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("bodyCellContent")
- }, $options.getColumnPT("bodyCellContent")), [$options.columnProp("expander") ? withDirectives((openBlock(), createElementBlock("button", mergeProps({
- key: 0,
- type: "button",
- "class": _ctx.cx("nodeToggleButton"),
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.toggle && $options.toggle.apply($options, arguments);
- }),
- style: $options.togglerStyle,
- tabindex: "-1"
- }, $options.getColumnPT("nodeToggleButton"), {
- "data-pc-group-section": "rowactionbutton"
- }), [$props.node.loading && $props.loadingMode === "icon" ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [$props.templates["nodetoggleicon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["nodetoggleicon"]), {
- key: 0
- })) : createCommentVNode("", true), $props.templates["nodetogglericon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["nodetogglericon"]), {
- key: 1
- })) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
- key: 2,
- spin: ""
- }, _ctx.ptm("nodetoggleicon")), null, 16))], 64)) : (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [$props.column.children && $props.column.children.rowtoggleicon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowtoggleicon), {
- key: 0,
- node: $props.node,
- expanded: $props.expanded,
- "class": normalizeClass(_ctx.cx("nodeToggleIcon"))
- }, null, 8, ["node", "expanded", "class"])) : createCommentVNode("", true), $props.column.children && $props.column.children.rowtogglericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowtogglericon), {
- key: 1,
- node: $props.node,
- expanded: $props.expanded,
- "class": normalizeClass(_ctx.cx("nodeToggleIcon"))
- }, null, 8, ["node", "expanded", "class"])) : $props.expanded ? (openBlock(), createBlock(resolveDynamicComponent($props.node.expandedIcon ? "span" : "ChevronDownIcon"), mergeProps({
- key: 2,
- "class": _ctx.cx("nodeToggleIcon")
- }, $options.getColumnPT("nodeToggleIcon")), null, 16, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent($props.node.collapsedIcon ? "span" : "ChevronRightIcon"), mergeProps({
- key: 3,
- "class": _ctx.cx("nodeToggleIcon")
- }, $options.getColumnPT("nodeToggleIcon")), null, 16, ["class"]))], 64))], 16)), [[_directive_ripple]]) : createCommentVNode("", true), $options.checkboxSelectionMode && $options.columnProp("expander") ? (openBlock(), createBlock(_component_Checkbox, {
- key: 1,
- modelValue: $props.checked,
- binary: true,
- "class": normalizeClass(_ctx.cx("pcNodeCheckbox")),
- disabled: $props.node.selectable === false,
- onChange: $options.toggleCheckbox,
- tabindex: -1,
- indeterminate: $props.partialChecked,
- unstyled: _ctx.unstyled,
- pt: $options.getColumnCheckboxPT("pcNodeCheckbox"),
- "data-p-partialchecked": $props.partialChecked
- }, {
- icon: withCtx(function(slotProps) {
- return [$props.templates["checkboxicon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["checkboxicon"]), {
- key: 0,
- checked: slotProps.checked,
- partialChecked: $props.partialChecked,
- "class": normalizeClass(slotProps["class"])
- }, null, 8, ["checked", "partialChecked", "class"])) : createCommentVNode("", true)];
- }),
- _: 1
- }, 8, ["modelValue", "class", "disabled", "onChange", "indeterminate", "unstyled", "pt", "data-p-partialchecked"])) : createCommentVNode("", true), $props.column.children && $props.column.children.body ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), {
- key: 2,
- node: $props.node,
- column: $props.column
- }, null, 8, ["node", "column"])) : (openBlock(), createElementBlock(Fragment, {
- key: 3
- }, [createTextVNode(toDisplayString($options.resolveFieldData($props.node.data, $options.columnProp("field"))), 1)], 64))], 16)], 16, _hoisted_1$2$1);
-}
-__name(render$2, "render$2");
-script$2.render = render$2;
-function _typeof$2(o) {
- "@babel/helpers - typeof";
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$2(o);
-}
-__name(_typeof$2, "_typeof$2");
-function _createForOfIteratorHelper$1(r, e) {
- var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t2) {
- if (Array.isArray(r) || (t2 = _unsupportedIterableToArray$1(r)) || e) {
- t2 && (r = t2);
- var _n = 0, F = /* @__PURE__ */ __name(function F2() {
- }, "F");
- return { s: F, n: /* @__PURE__ */ __name(function n() {
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- throw r2;
- }, "e"), f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o, a = true, u = false;
- return { s: /* @__PURE__ */ __name(function s() {
- t2 = t2.call(r);
- }, "s"), n: /* @__PURE__ */ __name(function n() {
- var r2 = t2.next();
- return a = r2.done, r2;
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- u = true, o = r2;
- }, "e"), f: /* @__PURE__ */ __name(function f() {
- try {
- a || null == t2["return"] || t2["return"]();
- } finally {
- if (u) throw o;
- }
- }, "f") };
-}
-__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper$1");
-function ownKeys$2(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$2, "ownKeys$2");
-function _objectSpread$2(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$2(Object(t2), true).forEach(function(r2) {
- _defineProperty$2(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$2(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$2, "_objectSpread$2");
-function _defineProperty$2(e, r, t2) {
- return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$2, "_defineProperty$2");
-function _toPropertyKey$2(t2) {
- var i = _toPrimitive$2(t2, "string");
- return "symbol" == _typeof$2(i) ? i : i + "";
-}
-__name(_toPropertyKey$2, "_toPropertyKey$2");
-function _toPrimitive$2(t2, r) {
- if ("object" != _typeof$2(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$2(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$2, "_toPrimitive$2");
-function _toConsumableArray$1(r) {
- return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1();
-}
-__name(_toConsumableArray$1, "_toConsumableArray$1");
-function _nonIterableSpread$1() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread$1, "_nonIterableSpread$1");
-function _unsupportedIterableToArray$1(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1");
-function _iterableToArray$1(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray$1, "_iterableToArray$1");
-function _arrayWithoutHoles$1(r) {
- if (Array.isArray(r)) return _arrayLikeToArray$1(r);
-}
-__name(_arrayWithoutHoles$1, "_arrayWithoutHoles$1");
-function _arrayLikeToArray$1(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray$1, "_arrayLikeToArray$1");
-var script$1 = {
- name: "TreeTableRow",
- hostName: "TreeTable",
- "extends": script$1f,
- emits: ["node-click", "node-toggle", "checkbox-change", "nodeClick", "nodeToggle", "checkboxChange", "row-rightclick", "rowRightclick"],
- props: {
- node: {
- type: null,
- "default": null
- },
- dataKey: {
- type: [String, Function],
- "default": "key"
- },
- parentNode: {
- type: null,
- "default": null
- },
- columns: {
- type: null,
- "default": null
- },
- expandedKeys: {
- type: null,
- "default": null
- },
- selectionKeys: {
- type: null,
- "default": null
- },
- selectionMode: {
- type: String,
- "default": null
- },
- level: {
- type: Number,
- "default": 0
- },
- indentation: {
- type: Number,
- "default": 1
- },
- tabindex: {
- type: Number,
- "default": -1
- },
- ariaSetSize: {
- type: Number,
- "default": null
- },
- ariaPosInset: {
- type: Number,
- "default": null
- },
- loadingMode: {
- type: String,
- "default": "mask"
- },
- templates: {
- type: Object,
- "default": null
- },
- contextMenu: {
- type: Boolean,
- "default": false
- },
- contextMenuSelection: {
- type: Object,
- "default": null
- }
- },
- nodeTouched: false,
- methods: {
- columnProp: /* @__PURE__ */ __name(function columnProp4(col, prop) {
- return getVNodeProp(col, prop);
- }, "columnProp"),
- toggle: /* @__PURE__ */ __name(function toggle5() {
- this.$emit("node-toggle", this.node);
- }, "toggle"),
- onClick: /* @__PURE__ */ __name(function onClick10(event2) {
- if (isClickable(event2.target) || getAttribute(event2.target, "data-pc-section") === "nodetogglebutton" || getAttribute(event2.target, "data-pc-section") === "nodetoggleicon" || event2.target.tagName === "path") {
- return;
- }
- this.setTabIndexForSelectionMode(event2, this.nodeTouched);
- this.$emit("node-click", {
- originalEvent: event2,
- nodeTouched: this.nodeTouched,
- node: this.node
- });
- this.nodeTouched = false;
- }, "onClick"),
- onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick(event2) {
- this.$emit("row-rightclick", {
- originalEvent: event2,
- node: this.node
- });
- }, "onRowRightClick"),
- onTouchEnd: /* @__PURE__ */ __name(function onTouchEnd2() {
- this.nodeTouched = true;
- }, "onTouchEnd"),
- nodeKey: /* @__PURE__ */ __name(function nodeKey(node2) {
- return resolveFieldData(node2, this.dataKey);
- }, "nodeKey"),
- onKeyDown: /* @__PURE__ */ __name(function onKeyDown14(event2, item8) {
- switch (event2.code) {
- case "ArrowDown":
- this.onArrowDownKey(event2);
- break;
- case "ArrowUp":
- this.onArrowUpKey(event2);
- break;
- case "ArrowLeft":
- this.onArrowLeftKey(event2);
- break;
- case "ArrowRight":
- this.onArrowRightKey(event2);
- break;
- case "Home":
- this.onHomeKey(event2);
- break;
- case "End":
- this.onEndKey(event2);
- break;
- case "Enter":
- case "NumpadEnter":
- case "Space":
- if (!isClickable(event2.target)) {
- this.onEnterKey(event2, item8);
- }
- break;
- case "Tab":
- this.onTabKey(event2);
- break;
- }
- }, "onKeyDown"),
- onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey9(event2) {
- var nextElementSibling = event2.currentTarget.nextElementSibling;
- nextElementSibling && this.focusRowChange(event2.currentTarget, nextElementSibling);
- event2.preventDefault();
- }, "onArrowDownKey"),
- onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey8(event2) {
- var previousElementSibling = event2.currentTarget.previousElementSibling;
- previousElementSibling && this.focusRowChange(event2.currentTarget, previousElementSibling);
- event2.preventDefault();
- }, "onArrowUpKey"),
- onArrowRightKey: /* @__PURE__ */ __name(function onArrowRightKey4(event2) {
- var _this = this;
- var ishiddenIcon = findSingle(event2.currentTarget, "button").style.visibility === "hidden";
- var togglerElement = findSingle(this.$refs.node, '[data-pc-section="nodetogglebutton"]');
- if (ishiddenIcon) return;
- !this.expanded && togglerElement.click();
- this.$nextTick(function() {
- _this.onArrowDownKey(event2);
- });
- event2.preventDefault();
- }, "onArrowRightKey"),
- onArrowLeftKey: /* @__PURE__ */ __name(function onArrowLeftKey5(event2) {
- if (this.level === 0 && !this.expanded) {
- return;
- }
- var currentTarget = event2.currentTarget;
- var ishiddenIcon = findSingle(currentTarget, "button").style.visibility === "hidden";
- var togglerElement = findSingle(currentTarget, '[data-pc-section="nodetogglebutton"]');
- if (this.expanded && !ishiddenIcon) {
- togglerElement.click();
- return;
- }
- var target = this.findBeforeClickableNode(currentTarget);
- target && this.focusRowChange(currentTarget, target);
- }, "onArrowLeftKey"),
- onHomeKey: /* @__PURE__ */ __name(function onHomeKey9(event2) {
- var findFirstElement = findSingle(event2.currentTarget.parentElement, 'tr[aria-level="'.concat(this.level + 1, '"]'));
- findFirstElement && focus(findFirstElement);
- event2.preventDefault();
- }, "onHomeKey"),
- onEndKey: /* @__PURE__ */ __name(function onEndKey9(event2) {
- var nodes = find(event2.currentTarget.parentElement, 'tr[aria-level="'.concat(this.level + 1, '"]'));
- var findFirstElement = nodes[nodes.length - 1];
- focus(findFirstElement);
- event2.preventDefault();
- }, "onEndKey"),
- onEnterKey: /* @__PURE__ */ __name(function onEnterKey9(event2) {
- event2.preventDefault();
- this.setTabIndexForSelectionMode(event2, this.nodeTouched);
- if (this.selectionMode === "checkbox") {
- this.toggleCheckbox();
- return;
- }
- this.$emit("node-click", {
- originalEvent: event2,
- nodeTouched: this.nodeTouched,
- node: this.node
- });
- this.nodeTouched = false;
- }, "onEnterKey"),
- onTabKey: /* @__PURE__ */ __name(function onTabKey6() {
- var rows3 = _toConsumableArray$1(find(this.$refs.node.parentElement, "tr"));
- var hasSelectedRow = rows3.some(function(row2) {
- return getAttribute(row2, "data-p-selected") || row2.getAttribute("aria-checked") === "true";
- });
- rows3.forEach(function(row2) {
- row2.tabIndex = -1;
- });
- if (hasSelectedRow) {
- var selectedNodes2 = rows3.filter(function(node2) {
- return getAttribute(node2, "data-p-selected") || node2.getAttribute("aria-checked") === "true";
- });
- selectedNodes2[0].tabIndex = 0;
- return;
- }
- rows3[0].tabIndex = 0;
- }, "onTabKey"),
- focusRowChange: /* @__PURE__ */ __name(function focusRowChange(firstFocusableRow, currentFocusedRow) {
- firstFocusableRow.tabIndex = "-1";
- currentFocusedRow.tabIndex = "0";
- focus(currentFocusedRow);
- }, "focusRowChange"),
- findBeforeClickableNode: /* @__PURE__ */ __name(function findBeforeClickableNode(node2) {
- var prevNode = node2.previousElementSibling;
- if (prevNode) {
- var prevNodeButton = prevNode.querySelector("button");
- if (prevNodeButton && prevNodeButton.style.visibility !== "hidden") {
- return prevNode;
- }
- return this.findBeforeClickableNode(prevNode);
- }
- return null;
- }, "findBeforeClickableNode"),
- toggleCheckbox: /* @__PURE__ */ __name(function toggleCheckbox2() {
- var _selectionKeys = this.selectionKeys ? _objectSpread$2({}, this.selectionKeys) : {};
- var _check = !this.checked;
- this.propagateDown(this.node, _check, _selectionKeys);
- this.$emit("checkbox-change", {
- node: this.node,
- check: _check,
- selectionKeys: _selectionKeys
- });
- }, "toggleCheckbox"),
- propagateDown: /* @__PURE__ */ __name(function propagateDown(node2, check, selectionKeys) {
- if (check) selectionKeys[this.nodeKey(node2)] = {
- checked: true,
- partialChecked: false
- };
- else delete selectionKeys[this.nodeKey(node2)];
- if (node2.children && node2.children.length) {
- var _iterator = _createForOfIteratorHelper$1(node2.children), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var child = _step.value;
- this.propagateDown(child, check, selectionKeys);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- }
- }, "propagateDown"),
- propagateUp: /* @__PURE__ */ __name(function propagateUp(event2) {
- var check = event2.check;
- var _selectionKeys = _objectSpread$2({}, event2.selectionKeys);
- var checkedChildCount = 0;
- var childPartialSelected = false;
- var _iterator2 = _createForOfIteratorHelper$1(this.node.children), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var child = _step2.value;
- if (_selectionKeys[this.nodeKey(child)] && _selectionKeys[this.nodeKey(child)].checked) checkedChildCount++;
- else if (_selectionKeys[this.nodeKey(child)] && _selectionKeys[this.nodeKey(child)].partialChecked) childPartialSelected = true;
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- if (check && checkedChildCount === this.node.children.length) {
- _selectionKeys[this.nodeKey(this.node)] = {
- checked: true,
- partialChecked: false
- };
- } else {
- if (!check) {
- delete _selectionKeys[this.nodeKey(this.node)];
- }
- if (childPartialSelected || checkedChildCount > 0 && checkedChildCount !== this.node.children.length) _selectionKeys[this.nodeKey(this.node)] = {
- checked: false,
- partialChecked: true
- };
- else _selectionKeys[this.nodeKey(this.node)] = {
- checked: false,
- partialChecked: false
- };
- }
- this.$emit("checkbox-change", {
- node: event2.node,
- check: event2.check,
- selectionKeys: _selectionKeys
- });
- }, "propagateUp"),
- onCheckboxChange: /* @__PURE__ */ __name(function onCheckboxChange(event2) {
- var check = event2.check;
- var _selectionKeys = _objectSpread$2({}, event2.selectionKeys);
- var checkedChildCount = 0;
- var childPartialSelected = false;
- var _iterator3 = _createForOfIteratorHelper$1(this.node.children), _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- var child = _step3.value;
- if (_selectionKeys[this.nodeKey(child)] && _selectionKeys[this.nodeKey(child)].checked) checkedChildCount++;
- else if (_selectionKeys[this.nodeKey(child)] && _selectionKeys[this.nodeKey(child)].partialChecked) childPartialSelected = true;
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- if (check && checkedChildCount === this.node.children.length) {
- _selectionKeys[this.nodeKey(this.node)] = {
- checked: true,
- partialChecked: false
- };
- } else {
- if (!check) {
- delete _selectionKeys[this.nodeKey(this.node)];
- }
- if (childPartialSelected || checkedChildCount > 0 && checkedChildCount !== this.node.children.length) _selectionKeys[this.nodeKey(this.node)] = {
- checked: false,
- partialChecked: true
- };
- else _selectionKeys[this.nodeKey(this.node)] = {
- checked: false,
- partialChecked: false
- };
- }
- this.$emit("checkbox-change", {
- node: event2.node,
- check: event2.check,
- selectionKeys: _selectionKeys
- });
- }, "onCheckboxChange"),
- setTabIndexForSelectionMode: /* @__PURE__ */ __name(function setTabIndexForSelectionMode(event2, nodeTouched) {
- if (this.selectionMode !== null) {
- var elements = _toConsumableArray$1(find(this.$refs.node.parentElement, "tr"));
- event2.currentTarget.tabIndex = nodeTouched === false ? -1 : 0;
- if (elements.every(function(element) {
- return element.tabIndex === -1;
- })) {
- elements[0].tabIndex = 0;
- }
- }
- }, "setTabIndexForSelectionMode")
- },
- computed: {
- containerClass: /* @__PURE__ */ __name(function containerClass7() {
- return [this.node.styleClass, this.cx("row")];
- }, "containerClass"),
- expanded: /* @__PURE__ */ __name(function expanded2() {
- return this.expandedKeys && this.expandedKeys[this.nodeKey(this.node)] === true;
- }, "expanded"),
- leaf: /* @__PURE__ */ __name(function leaf2() {
- return this.node.leaf === false ? false : !(this.node.children && this.node.children.length);
- }, "leaf"),
- selected: /* @__PURE__ */ __name(function selected2() {
- return this.selectionMode && this.selectionKeys ? this.selectionKeys[this.nodeKey(this.node)] === true : false;
- }, "selected"),
- isSelectedWithContextMenu: /* @__PURE__ */ __name(function isSelectedWithContextMenu() {
- if (this.node && this.contextMenuSelection) {
- return equals(this.node, this.contextMenuSelection, this.dataKey);
- }
- return false;
- }, "isSelectedWithContextMenu"),
- checked: /* @__PURE__ */ __name(function checked() {
- return this.selectionKeys ? this.selectionKeys[this.nodeKey(this.node)] && this.selectionKeys[this.nodeKey(this.node)].checked : false;
- }, "checked"),
- partialChecked: /* @__PURE__ */ __name(function partialChecked() {
- return this.selectionKeys ? this.selectionKeys[this.nodeKey(this.node)] && this.selectionKeys[this.nodeKey(this.node)].partialChecked : false;
- }, "partialChecked"),
- getAriaSelected: /* @__PURE__ */ __name(function getAriaSelected() {
- return this.selectionMode === "single" || this.selectionMode === "multiple" ? this.selected : null;
- }, "getAriaSelected"),
- ptmOptions: /* @__PURE__ */ __name(function ptmOptions2() {
- return {
- context: {
- selectable: this.$parentInstance.rowHover || this.$parentInstance.rowSelectionMode,
- selected: this.selected,
- scrollable: this.$parentInstance.scrollable
- }
- };
- }, "ptmOptions")
- },
- components: {
- TTBodyCell: script$2
- }
-};
-var _hoisted_1$1$1 = ["tabindex", "aria-expanded", "aria-level", "aria-setsize", "aria-posinset", "aria-selected", "aria-checked", "data-p-selected", "data-p-selected-contextmenu"];
-function render$1(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_TTBodyCell = resolveComponent("TTBodyCell");
- var _component_TreeTableRow = resolveComponent("TreeTableRow", true);
- return openBlock(), createElementBlock(Fragment, null, [createBaseVNode("tr", mergeProps({
- ref: "node",
- "class": $options.containerClass,
- style: $props.node.style,
- tabindex: $props.tabindex,
- role: "row",
- "aria-expanded": $props.node.children && $props.node.children.length ? $options.expanded : void 0,
- "aria-level": $props.level + 1,
- "aria-setsize": $props.ariaSetSize,
- "aria-posinset": $props.ariaPosInset,
- "aria-selected": $options.getAriaSelected,
- "aria-checked": $options.checked || void 0,
- onClick: _cache[1] || (_cache[1] = function() {
- return $options.onClick && $options.onClick.apply($options, arguments);
- }),
- onKeydown: _cache[2] || (_cache[2] = function() {
- return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);
- }),
- onTouchend: _cache[3] || (_cache[3] = function() {
- return $options.onTouchEnd && $options.onTouchEnd.apply($options, arguments);
- }),
- onContextmenu: _cache[4] || (_cache[4] = function() {
- return $options.onRowRightClick && $options.onRowRightClick.apply($options, arguments);
- })
- }, _ctx.ptm("row", $options.ptmOptions), {
- "data-p-selected": $options.selected,
- "data-p-selected-contextmenu": $props.contextMenuSelection && $options.isSelectedWithContextMenu
- }), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i
- }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_TTBodyCell, {
- key: 0,
- column: col,
- node: $props.node,
- level: $props.level,
- leaf: $options.leaf,
- indentation: $props.indentation,
- expanded: $options.expanded,
- selectionMode: $props.selectionMode,
- checked: $options.checked,
- partialChecked: $options.partialChecked,
- templates: $props.templates,
- onNodeToggle: _cache[0] || (_cache[0] = function($event) {
- return _ctx.$emit("node-toggle", $event);
- }),
- onCheckboxToggle: $options.toggleCheckbox,
- index: i,
- loadingMode: $props.loadingMode,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["column", "node", "level", "leaf", "indentation", "expanded", "selectionMode", "checked", "partialChecked", "templates", "onCheckboxToggle", "index", "loadingMode", "unstyled", "pt"])) : createCommentVNode("", true)], 64);
- }), 128))], 16, _hoisted_1$1$1), $options.expanded && $props.node.children && $props.node.children.length ? (openBlock(true), createElementBlock(Fragment, {
- key: 0
- }, renderList($props.node.children, function(childNode) {
- return openBlock(), createBlock(_component_TreeTableRow, {
- key: $options.nodeKey(childNode),
- dataKey: $props.dataKey,
- columns: $props.columns,
- node: childNode,
- parentNode: $props.node,
- level: $props.level + 1,
- expandedKeys: $props.expandedKeys,
- selectionMode: $props.selectionMode,
- selectionKeys: $props.selectionKeys,
- contextMenu: $props.contextMenu,
- contextMenuSelection: $props.contextMenuSelection,
- indentation: $props.indentation,
- ariaPosInset: $props.node.children.indexOf(childNode) + 1,
- ariaSetSize: $props.node.children.length,
- templates: $props.templates,
- onNodeToggle: _cache[5] || (_cache[5] = function($event) {
- return _ctx.$emit("node-toggle", $event);
- }),
- onNodeClick: _cache[6] || (_cache[6] = function($event) {
- return _ctx.$emit("node-click", $event);
- }),
- onRowRightclick: _cache[7] || (_cache[7] = function($event) {
- return _ctx.$emit("row-rightclick", $event);
- }),
- onCheckboxChange: $options.onCheckboxChange,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["dataKey", "columns", "node", "parentNode", "level", "expandedKeys", "selectionMode", "selectionKeys", "contextMenu", "contextMenuSelection", "indentation", "ariaPosInset", "ariaSetSize", "templates", "onCheckboxChange", "unstyled", "pt"]);
- }), 128)) : createCommentVNode("", true)], 64);
-}
-__name(render$1, "render$1");
-script$1.render = render$1;
-function _typeof$1(o) {
- "@babel/helpers - typeof";
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$1(o);
-}
-__name(_typeof$1, "_typeof$1");
-function _createForOfIteratorHelper(r, e) {
- var t2 = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t2) {
- if (Array.isArray(r) || (t2 = _unsupportedIterableToArray(r)) || e) {
- t2 && (r = t2);
- var _n = 0, F = /* @__PURE__ */ __name(function F2() {
- }, "F");
- return { s: F, n: /* @__PURE__ */ __name(function n() {
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- throw r2;
- }, "e"), f: F };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o, a = true, u = false;
- return { s: /* @__PURE__ */ __name(function s() {
- t2 = t2.call(r);
- }, "s"), n: /* @__PURE__ */ __name(function n() {
- var r2 = t2.next();
- return a = r2.done, r2;
- }, "n"), e: /* @__PURE__ */ __name(function e2(r2) {
- u = true, o = r2;
- }, "e"), f: /* @__PURE__ */ __name(function f() {
- try {
- a || null == t2["return"] || t2["return"]();
- } finally {
- if (u) throw o;
- }
- }, "f") };
-}
-__name(_createForOfIteratorHelper, "_createForOfIteratorHelper");
-function ownKeys$1(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys$1, "ownKeys$1");
-function _objectSpread$1(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$1(Object(t2), true).forEach(function(r2) {
- _defineProperty$1(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$1, "_objectSpread$1");
-function _defineProperty$1(e, r, t2) {
- return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty$1, "_defineProperty$1");
-function _toPropertyKey$1(t2) {
- var i = _toPrimitive$1(t2, "string");
- return "symbol" == _typeof$1(i) ? i : i + "";
-}
-__name(_toPropertyKey$1, "_toPropertyKey$1");
-function _toPrimitive$1(t2, r) {
- if ("object" != _typeof$1(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof$1(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive$1, "_toPrimitive$1");
-function _toConsumableArray(r) {
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
-}
-__name(_toConsumableArray, "_toConsumableArray");
-function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread, "_nonIterableSpread");
-function _unsupportedIterableToArray(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
- var t2 = {}.toString.call(r).slice(8, -1);
- return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
-function _iterableToArray(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray, "_iterableToArray");
-function _arrayWithoutHoles(r) {
- if (Array.isArray(r)) return _arrayLikeToArray(r);
-}
-__name(_arrayWithoutHoles, "_arrayWithoutHoles");
-function _arrayLikeToArray(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray, "_arrayLikeToArray");
-var script = {
- name: "TreeTable",
- "extends": script$5,
- inheritAttrs: false,
- emits: ["node-expand", "node-collapse", "update:expandedKeys", "update:selectionKeys", "node-select", "node-unselect", "update:first", "update:rows", "page", "update:sortField", "update:sortOrder", "update:multiSortMeta", "sort", "filter", "column-resize-end", "update:contextMenuSelection", "row-contextmenu"],
- provide: /* @__PURE__ */ __name(function provide51() {
- return {
- $columns: this.d_columns
- };
- }, "provide"),
- data: /* @__PURE__ */ __name(function data39() {
- return {
- d_expandedKeys: this.expandedKeys || {},
- d_first: this.first,
- d_rows: this.rows,
- d_sortField: this.sortField,
- d_sortOrder: this.sortOrder,
- d_multiSortMeta: this.multiSortMeta ? _toConsumableArray(this.multiSortMeta) : [],
- hasASelectedNode: false,
- d_columns: new _default({
- type: "Column"
- })
- };
- }, "data"),
- documentColumnResizeListener: null,
- documentColumnResizeEndListener: null,
- lastResizeHelperX: null,
- resizeColumnElement: null,
- watch: {
- expandedKeys: /* @__PURE__ */ __name(function expandedKeys3(newValue) {
- this.d_expandedKeys = newValue;
- }, "expandedKeys"),
- first: /* @__PURE__ */ __name(function first2(newValue) {
- this.d_first = newValue;
- }, "first"),
- rows: /* @__PURE__ */ __name(function rows2(newValue) {
- this.d_rows = newValue;
- }, "rows"),
- sortField: /* @__PURE__ */ __name(function sortField2(newValue) {
- this.d_sortField = newValue;
- }, "sortField"),
- sortOrder: /* @__PURE__ */ __name(function sortOrder2(newValue) {
- this.d_sortOrder = newValue;
- }, "sortOrder"),
- multiSortMeta: /* @__PURE__ */ __name(function multiSortMeta(newValue) {
- this.d_multiSortMeta = newValue;
- }, "multiSortMeta")
- },
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount17() {
- this.destroyStyleElement();
- this.d_columns.clear();
- }, "beforeUnmount"),
- methods: {
- columnProp: /* @__PURE__ */ __name(function columnProp5(col, prop) {
- return getVNodeProp(col, prop);
- }, "columnProp"),
- ptHeaderCellOptions: /* @__PURE__ */ __name(function ptHeaderCellOptions(column2) {
- return {
- context: {
- frozen: this.columnProp(column2, "frozen")
- }
- };
- }, "ptHeaderCellOptions"),
- onNodeToggle: /* @__PURE__ */ __name(function onNodeToggle3(node2) {
- var key = this.nodeKey(node2);
- if (this.d_expandedKeys[key]) {
- delete this.d_expandedKeys[key];
- this.$emit("node-collapse", node2);
- } else {
- this.d_expandedKeys[key] = true;
- this.$emit("node-expand", node2);
- }
- this.d_expandedKeys = _objectSpread$1({}, this.d_expandedKeys);
- this.$emit("update:expandedKeys", this.d_expandedKeys);
- }, "onNodeToggle"),
- onNodeClick: /* @__PURE__ */ __name(function onNodeClick3(event2) {
- if (this.rowSelectionMode && event2.node.selectable !== false) {
- var metaSelection = event2.nodeTouched ? false : this.metaKeySelection;
- var _selectionKeys = metaSelection ? this.handleSelectionWithMetaKey(event2) : this.handleSelectionWithoutMetaKey(event2);
- this.$emit("update:selectionKeys", _selectionKeys);
- }
- }, "onNodeClick"),
- nodeKey: /* @__PURE__ */ __name(function nodeKey2(node2) {
- return resolveFieldData(node2, this.dataKey);
- }, "nodeKey"),
- handleSelectionWithMetaKey: /* @__PURE__ */ __name(function handleSelectionWithMetaKey(event2) {
- var originalEvent = event2.originalEvent;
- var node2 = event2.node;
- var nodeKey3 = this.nodeKey(node2);
- var metaKey = originalEvent.metaKey || originalEvent.ctrlKey;
- var selected3 = this.isNodeSelected(node2);
- var _selectionKeys;
- if (selected3 && metaKey) {
- if (this.isSingleSelectionMode()) {
- _selectionKeys = {};
- } else {
- _selectionKeys = _objectSpread$1({}, this.selectionKeys);
- delete _selectionKeys[nodeKey3];
- }
- this.$emit("node-unselect", node2);
- } else {
- if (this.isSingleSelectionMode()) {
- _selectionKeys = {};
- } else if (this.isMultipleSelectionMode()) {
- _selectionKeys = !metaKey ? {} : this.selectionKeys ? _objectSpread$1({}, this.selectionKeys) : {};
- }
- _selectionKeys[nodeKey3] = true;
- this.$emit("node-select", node2);
- }
- return _selectionKeys;
- }, "handleSelectionWithMetaKey"),
- handleSelectionWithoutMetaKey: /* @__PURE__ */ __name(function handleSelectionWithoutMetaKey(event2) {
- var node2 = event2.node;
- var nodeKey3 = this.nodeKey(node2);
- var selected3 = this.isNodeSelected(node2);
- var _selectionKeys;
- if (this.isSingleSelectionMode()) {
- if (selected3) {
- _selectionKeys = {};
- this.$emit("node-unselect", node2);
- } else {
- _selectionKeys = {};
- _selectionKeys[nodeKey3] = true;
- this.$emit("node-select", node2);
- }
- } else {
- if (selected3) {
- _selectionKeys = _objectSpread$1({}, this.selectionKeys);
- delete _selectionKeys[nodeKey3];
- this.$emit("node-unselect", node2);
- } else {
- _selectionKeys = this.selectionKeys ? _objectSpread$1({}, this.selectionKeys) : {};
- _selectionKeys[nodeKey3] = true;
- this.$emit("node-select", node2);
- }
- }
- return _selectionKeys;
- }, "handleSelectionWithoutMetaKey"),
- onCheckboxChange: /* @__PURE__ */ __name(function onCheckboxChange2(event2) {
- this.$emit("update:selectionKeys", event2.selectionKeys);
- if (event2.check) this.$emit("node-select", event2.node);
- else this.$emit("node-unselect", event2.node);
- }, "onCheckboxChange"),
- onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick2(event2) {
- if (this.contextMenu) {
- clearSelection();
- event2.originalEvent.target.focus();
- }
- this.$emit("update:contextMenuSelection", event2.node);
- this.$emit("row-contextmenu", event2);
- }, "onRowRightClick"),
- isSingleSelectionMode: /* @__PURE__ */ __name(function isSingleSelectionMode() {
- return this.selectionMode === "single";
- }, "isSingleSelectionMode"),
- isMultipleSelectionMode: /* @__PURE__ */ __name(function isMultipleSelectionMode() {
- return this.selectionMode === "multiple";
- }, "isMultipleSelectionMode"),
- onPage: /* @__PURE__ */ __name(function onPage2(event2) {
- this.d_first = event2.first;
- this.d_rows = event2.rows;
- var pageEvent = this.createLazyLoadEvent(event2);
- pageEvent.pageCount = event2.pageCount;
- pageEvent.page = event2.page;
- this.d_expandedKeys = {};
- this.$emit("update:expandedKeys", this.d_expandedKeys);
- this.$emit("update:first", this.d_first);
- this.$emit("update:rows", this.d_rows);
- this.$emit("page", pageEvent);
- }, "onPage"),
- resetPage: /* @__PURE__ */ __name(function resetPage2() {
- this.d_first = 0;
- this.$emit("update:first", this.d_first);
- }, "resetPage"),
- getFilterColumnHeaderClass: /* @__PURE__ */ __name(function getFilterColumnHeaderClass(column2) {
- return [this.cx("headerCell", {
- column: column2
- }), this.columnProp(column2, "filterHeaderClass")];
- }, "getFilterColumnHeaderClass"),
- onColumnHeaderClick: /* @__PURE__ */ __name(function onColumnHeaderClick(e) {
- var event2 = e.originalEvent;
- var column2 = e.column;
- if (this.columnProp(column2, "sortable")) {
- var targetNode = event2.target;
- var columnField = this.columnProp(column2, "sortField") || this.columnProp(column2, "field");
- if (getAttribute(targetNode, "data-p-sortable-column") === true || getAttribute(targetNode, "data-pc-section") === "columntitle" || getAttribute(targetNode, "data-pc-section") === "columnheadercontent" || getAttribute(targetNode, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement.parentElement, "data-pc-section") === "sorticon" || targetNode.closest('[data-p-sortable-column="true"]')) {
- clearSelection();
- if (this.sortMode === "single") {
- if (this.d_sortField === columnField) {
- if (this.removableSort && this.d_sortOrder * -1 === this.defaultSortOrder) {
- this.d_sortOrder = null;
- this.d_sortField = null;
- } else {
- this.d_sortOrder = this.d_sortOrder * -1;
- }
- } else {
- this.d_sortOrder = this.defaultSortOrder;
- this.d_sortField = columnField;
- }
- this.$emit("update:sortField", this.d_sortField);
- this.$emit("update:sortOrder", this.d_sortOrder);
- this.resetPage();
- } else if (this.sortMode === "multiple") {
- var metaKey = event2.metaKey || event2.ctrlKey;
- if (!metaKey) {
- this.d_multiSortMeta = this.d_multiSortMeta.filter(function(meta) {
- return meta.field === columnField;
- });
- }
- this.addMultiSortField(columnField);
- this.$emit("update:multiSortMeta", this.d_multiSortMeta);
- }
- this.$emit("sort", this.createLazyLoadEvent(event2));
- }
- }
- }, "onColumnHeaderClick"),
- addMultiSortField: /* @__PURE__ */ __name(function addMultiSortField(field) {
- var index = this.d_multiSortMeta.findIndex(function(meta) {
- return meta.field === field;
- });
- if (index >= 0) {
- if (this.removableSort && this.d_multiSortMeta[index].order * -1 === this.defaultSortOrder) this.d_multiSortMeta.splice(index, 1);
- else this.d_multiSortMeta[index] = {
- field,
- order: this.d_multiSortMeta[index].order * -1
- };
- } else {
- this.d_multiSortMeta.push({
- field,
- order: this.defaultSortOrder
- });
- }
- this.d_multiSortMeta = _toConsumableArray(this.d_multiSortMeta);
- }, "addMultiSortField"),
- sortSingle: /* @__PURE__ */ __name(function sortSingle(nodes) {
- return this.sortNodesSingle(nodes);
- }, "sortSingle"),
- sortNodesSingle: /* @__PURE__ */ __name(function sortNodesSingle(nodes) {
- var _this = this;
- var _nodes = _toConsumableArray(nodes);
- var comparer = localeComparator();
- _nodes.sort(function(node1, node2) {
- var value1 = resolveFieldData(node1.data, _this.d_sortField);
- var value2 = resolveFieldData(node2.data, _this.d_sortField);
- return sort(value1, value2, _this.d_sortOrder, comparer);
- });
- return _nodes;
- }, "sortNodesSingle"),
- sortMultiple: /* @__PURE__ */ __name(function sortMultiple(nodes) {
- return this.sortNodesMultiple(nodes);
- }, "sortMultiple"),
- sortNodesMultiple: /* @__PURE__ */ __name(function sortNodesMultiple(nodes) {
- var _this2 = this;
- var _nodes = _toConsumableArray(nodes);
- _nodes.sort(function(node1, node2) {
- return _this2.multisortField(node1, node2, 0);
- });
- return _nodes;
- }, "sortNodesMultiple"),
- multisortField: /* @__PURE__ */ __name(function multisortField(node1, node2, index) {
- var value1 = resolveFieldData(node1.data, this.d_multiSortMeta[index].field);
- var value2 = resolveFieldData(node2.data, this.d_multiSortMeta[index].field);
- var comparer = localeComparator();
- if (value1 === value2) {
- return this.d_multiSortMeta.length - 1 > index ? this.multisortField(node1, node2, index + 1) : 0;
- }
- return sort(value1, value2, this.d_multiSortMeta[index].order, comparer);
- }, "multisortField"),
- filter: /* @__PURE__ */ __name(function filter(value2) {
- var filteredNodes = [];
- var strict = this.filterMode === "strict";
- var _iterator = _createForOfIteratorHelper(value2), _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- var node2 = _step.value;
- var copyNode = _objectSpread$1({}, node2);
- var localMatch = true;
- var globalMatch = false;
- for (var j = 0; j < this.columns.length; j++) {
- var col = this.columns[j];
- var filterField = this.columnProp(col, "filterField") || this.columnProp(col, "field");
- if (Object.prototype.hasOwnProperty.call(this.filters, filterField)) {
- var filterMatchMode = this.columnProp(col, "filterMatchMode") || "startsWith";
- var filterValue = this.filters[filterField];
- var filterConstraint = FilterService.filters[filterMatchMode];
- var paramsWithoutNode = {
- filterField,
- filterValue,
- filterConstraint,
- strict
- };
- if (strict && !(this.findFilteredNodes(copyNode, paramsWithoutNode) || this.isFilterMatched(copyNode, paramsWithoutNode)) || !strict && !(this.isFilterMatched(copyNode, paramsWithoutNode) || this.findFilteredNodes(copyNode, paramsWithoutNode))) {
- localMatch = false;
- }
- if (!localMatch) {
- break;
- }
- }
- if (this.hasGlobalFilter() && !globalMatch) {
- var copyNodeForGlobal = _objectSpread$1({}, copyNode);
- var _filterValue = this.filters["global"];
- var _filterConstraint = FilterService.filters["contains"];
- var globalFilterParamsWithoutNode = {
- filterField,
- filterValue: _filterValue,
- filterConstraint: _filterConstraint,
- strict
- };
- if (strict && (this.findFilteredNodes(copyNodeForGlobal, globalFilterParamsWithoutNode) || this.isFilterMatched(copyNodeForGlobal, globalFilterParamsWithoutNode)) || !strict && (this.isFilterMatched(copyNodeForGlobal, globalFilterParamsWithoutNode) || this.findFilteredNodes(copyNodeForGlobal, globalFilterParamsWithoutNode))) {
- globalMatch = true;
- copyNode = copyNodeForGlobal;
- }
- }
- }
- var matches = localMatch;
- if (this.hasGlobalFilter()) {
- matches = localMatch && globalMatch;
- }
- if (matches) {
- filteredNodes.push(copyNode);
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- var filterEvent = this.createLazyLoadEvent(event);
- filterEvent.filteredValue = filteredNodes;
- this.$emit("filter", filterEvent);
- return filteredNodes;
- }, "filter"),
- findFilteredNodes: /* @__PURE__ */ __name(function findFilteredNodes(node2, paramsWithoutNode) {
- if (node2) {
- var matched = false;
- if (node2.children) {
- var childNodes = _toConsumableArray(node2.children);
- node2.children = [];
- var _iterator2 = _createForOfIteratorHelper(childNodes), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var childNode = _step2.value;
- var copyChildNode = _objectSpread$1({}, childNode);
- if (this.isFilterMatched(copyChildNode, paramsWithoutNode)) {
- matched = true;
- node2.children.push(copyChildNode);
- }
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- }
- if (matched) {
- return true;
- }
- }
- }, "findFilteredNodes"),
- isFilterMatched: /* @__PURE__ */ __name(function isFilterMatched(node2, _ref) {
- var filterField = _ref.filterField, filterValue = _ref.filterValue, filterConstraint = _ref.filterConstraint, strict = _ref.strict;
- var matched = false;
- var dataFieldValue = resolveFieldData(node2.data, filterField);
- if (filterConstraint(dataFieldValue, filterValue, this.filterLocale)) {
- matched = true;
- }
- if (!matched || strict && !this.isNodeLeaf(node2)) {
- matched = this.findFilteredNodes(node2, {
- filterField,
- filterValue,
- filterConstraint,
- strict
- }) || matched;
- }
- return matched;
- }, "isFilterMatched"),
- isNodeSelected: /* @__PURE__ */ __name(function isNodeSelected(node2) {
- return this.selectionMode && this.selectionKeys ? this.selectionKeys[this.nodeKey(node2)] === true : false;
- }, "isNodeSelected"),
- isNodeLeaf: /* @__PURE__ */ __name(function isNodeLeaf(node2) {
- return node2.leaf === false ? false : !(node2.children && node2.children.length);
- }, "isNodeLeaf"),
- createLazyLoadEvent: /* @__PURE__ */ __name(function createLazyLoadEvent(event2) {
- var _this3 = this;
- var filterMatchModes;
- if (this.hasFilters()) {
- filterMatchModes = {};
- this.columns.forEach(function(col) {
- if (_this3.columnProp(col, "field")) {
- filterMatchModes[col.props.field] = _this3.columnProp(col, "filterMatchMode");
- }
- });
- }
- return {
- originalEvent: event2,
- first: this.d_first,
- rows: this.d_rows,
- sortField: this.d_sortField,
- sortOrder: this.d_sortOrder,
- multiSortMeta: this.d_multiSortMeta,
- filters: this.filters,
- filterMatchModes
- };
- }, "createLazyLoadEvent"),
- onColumnResizeStart: /* @__PURE__ */ __name(function onColumnResizeStart(event2) {
- var containerLeft = getOffset(this.$el).left;
- this.resizeColumnElement = event2.target.parentElement;
- this.columnResizing = true;
- this.lastResizeHelperX = event2.pageX - containerLeft + this.$el.scrollLeft;
- this.bindColumnResizeEvents();
- }, "onColumnResizeStart"),
- onColumnResize: /* @__PURE__ */ __name(function onColumnResize(event2) {
- var containerLeft = getOffset(this.$el).left;
- this.$el.setAttribute("data-p-unselectable-text", "true");
- !this.isUnstyled && addStyle(this.$el, {
- "user-select": "none"
- });
- this.$refs.resizeHelper.style.height = this.$el.offsetHeight + "px";
- this.$refs.resizeHelper.style.top = "0px";
- this.$refs.resizeHelper.style.left = event2.pageX - containerLeft + this.$el.scrollLeft + "px";
- this.$refs.resizeHelper.style.display = "block";
- }, "onColumnResize"),
- onColumnResizeEnd: /* @__PURE__ */ __name(function onColumnResizeEnd() {
- var delta = isRTL(this.$el) ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;
- var columnWidth = this.resizeColumnElement.offsetWidth;
- var newColumnWidth = columnWidth + delta;
- var minWidth = this.resizeColumnElement.style.minWidth || 15;
- if (columnWidth + delta > parseInt(minWidth, 10)) {
- if (this.columnResizeMode === "fit") {
- var nextColumn = this.resizeColumnElement.nextElementSibling;
- var nextColumnWidth = nextColumn.offsetWidth - delta;
- if (newColumnWidth > 15 && nextColumnWidth > 15) {
- this.resizeTableCells(newColumnWidth, nextColumnWidth);
- }
- } else if (this.columnResizeMode === "expand") {
- var tableWidth = this.$refs.table.offsetWidth + delta + "px";
- var updateTableWidth = /* @__PURE__ */ __name(function updateTableWidth2(el) {
- !!el && (el.style.width = el.style.minWidth = tableWidth);
- }, "updateTableWidth");
- this.resizeTableCells(newColumnWidth);
- updateTableWidth(this.$refs.table);
- }
- this.$emit("column-resize-end", {
- element: this.resizeColumnElement,
- delta
- });
- }
- this.$refs.resizeHelper.style.display = "none";
- this.resizeColumn = null;
- this.$el.removeAttribute("data-p-unselectable-text");
- !this.isUnstyled && (this.$el.style["user-select"] = "");
- this.unbindColumnResizeEvents();
- }, "onColumnResizeEnd"),
- resizeTableCells: /* @__PURE__ */ __name(function resizeTableCells(newColumnWidth, nextColumnWidth) {
- var colIndex = getIndex(this.resizeColumnElement);
- var widths = [];
- var headers = find(this.$refs.table, 'thead[data-pc-section="thead"] > tr > th');
- headers.forEach(function(header2) {
- return widths.push(getOuterWidth(header2));
- });
- this.destroyStyleElement();
- this.createStyleElement();
- var innerHTML = "";
- var selector = '[data-pc-name="treetable"]['.concat(this.$attrSelector, '] > [data-pc-section="tablecontainer"] > table[data-pc-section="table"]');
- widths.forEach(function(width, index) {
- var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;
- var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important");
- innerHTML += "\n ".concat(selector, ' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(index + 1, ") {\n ").concat(style, "\n }\n ");
- });
- this.styleElement.innerHTML = innerHTML;
- }, "resizeTableCells"),
- bindColumnResizeEvents: /* @__PURE__ */ __name(function bindColumnResizeEvents() {
- var _this4 = this;
- if (!this.documentColumnResizeListener) {
- this.documentColumnResizeListener = document.addEventListener("mousemove", function(event2) {
- if (_this4.columnResizing) {
- _this4.onColumnResize(event2);
- }
- });
- }
- if (!this.documentColumnResizeEndListener) {
- this.documentColumnResizeEndListener = document.addEventListener("mouseup", function() {
- if (_this4.columnResizing) {
- _this4.columnResizing = false;
- _this4.onColumnResizeEnd();
- }
- });
- }
- }, "bindColumnResizeEvents"),
- unbindColumnResizeEvents: /* @__PURE__ */ __name(function unbindColumnResizeEvents() {
- if (this.documentColumnResizeListener) {
- document.removeEventListener("document", this.documentColumnResizeListener);
- this.documentColumnResizeListener = null;
- }
- if (this.documentColumnResizeEndListener) {
- document.removeEventListener("document", this.documentColumnResizeEndListener);
- this.documentColumnResizeEndListener = null;
- }
- }, "unbindColumnResizeEvents"),
- onColumnKeyDown: /* @__PURE__ */ __name(function onColumnKeyDown(event2, col) {
- if ((event2.code === "Enter" || event2.code === "NumpadEnter") && event2.currentTarget.nodeName === "TH" && getAttribute(event2.currentTarget, "data-p-sortable-column")) {
- this.onColumnHeaderClick(event2, col);
- }
- }, "onColumnKeyDown"),
- hasColumnFilter: /* @__PURE__ */ __name(function hasColumnFilter() {
- if (this.columns) {
- var _iterator3 = _createForOfIteratorHelper(this.columns), _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- var col = _step3.value;
- if (col.children && col.children.filter) {
- return true;
- }
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- }
- return false;
- }, "hasColumnFilter"),
- hasFilters: /* @__PURE__ */ __name(function hasFilters() {
- return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object;
- }, "hasFilters"),
- hasGlobalFilter: /* @__PURE__ */ __name(function hasGlobalFilter() {
- return this.filters && Object.prototype.hasOwnProperty.call(this.filters, "global");
- }, "hasGlobalFilter"),
- getItemLabel: /* @__PURE__ */ __name(function getItemLabel6(node2) {
- return node2.data.name;
- }, "getItemLabel"),
- createStyleElement: /* @__PURE__ */ __name(function createStyleElement() {
- var _this$$primevue;
- this.styleElement = document.createElement("style");
- this.styleElement.type = "text/css";
- setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
- document.head.appendChild(this.styleElement);
- }, "createStyleElement"),
- destroyStyleElement: /* @__PURE__ */ __name(function destroyStyleElement() {
- if (this.styleElement) {
- document.head.removeChild(this.styleElement);
- this.styleElement = null;
- }
- }, "destroyStyleElement"),
- setTabindex: /* @__PURE__ */ __name(function setTabindex(node2, index) {
- if (this.isNodeSelected(node2)) {
- this.hasASelectedNode = true;
- return 0;
- }
- if (this.selectionMode) {
- if (!this.isNodeSelected(node2) && index === 0 && !this.hasASelectedNode) return 0;
- } else if (!this.selectionMode && index === 0) {
- return 0;
- }
- return -1;
- }, "setTabindex")
- },
- computed: {
- columns: /* @__PURE__ */ __name(function columns() {
- return this.d_columns.get(this);
- }, "columns"),
- processedData: /* @__PURE__ */ __name(function processedData() {
- if (this.lazy) {
- return this.value;
- } else {
- if (this.value && this.value.length) {
- var data40 = this.value;
- if (this.sorted) {
- if (this.sortMode === "single") data40 = this.sortSingle(data40);
- else if (this.sortMode === "multiple") data40 = this.sortMultiple(data40);
- }
- if (this.hasFilters()) {
- data40 = this.filter(data40);
- }
- return data40;
- } else {
- return null;
- }
- }
- }, "processedData"),
- dataToRender: /* @__PURE__ */ __name(function dataToRender() {
- var data40 = this.processedData;
- if (this.paginator) {
- var first3 = this.lazy ? 0 : this.d_first;
- return data40.slice(first3, first3 + this.d_rows);
- } else {
- return data40;
- }
- }, "dataToRender"),
- empty: /* @__PURE__ */ __name(function empty2() {
- var data40 = this.processedData;
- return !data40 || data40.length === 0;
- }, "empty"),
- sorted: /* @__PURE__ */ __name(function sorted() {
- return this.d_sortField || this.d_multiSortMeta && this.d_multiSortMeta.length > 0;
- }, "sorted"),
- hasFooter: /* @__PURE__ */ __name(function hasFooter() {
- var hasFooter2 = false;
- var _iterator4 = _createForOfIteratorHelper(this.columns), _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
- var col = _step4.value;
- if (this.columnProp(col, "footer") || col.children && col.children.footer) {
- hasFooter2 = true;
- break;
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- return hasFooter2;
- }, "hasFooter"),
- paginatorTop: /* @__PURE__ */ __name(function paginatorTop2() {
- return this.paginator && (this.paginatorPosition !== "bottom" || this.paginatorPosition === "both");
- }, "paginatorTop"),
- paginatorBottom: /* @__PURE__ */ __name(function paginatorBottom2() {
- return this.paginator && (this.paginatorPosition !== "top" || this.paginatorPosition === "both");
- }, "paginatorBottom"),
- singleSelectionMode: /* @__PURE__ */ __name(function singleSelectionMode() {
- return this.selectionMode && this.selectionMode === "single";
- }, "singleSelectionMode"),
- multipleSelectionMode: /* @__PURE__ */ __name(function multipleSelectionMode() {
- return this.selectionMode && this.selectionMode === "multiple";
- }, "multipleSelectionMode"),
- rowSelectionMode: /* @__PURE__ */ __name(function rowSelectionMode() {
- return this.singleSelectionMode || this.multipleSelectionMode;
- }, "rowSelectionMode"),
- totalRecordsLength: /* @__PURE__ */ __name(function totalRecordsLength() {
- if (this.lazy) {
- return this.totalRecords;
- } else {
- var data40 = this.processedData;
- return data40 ? data40.length : 0;
- }
- }, "totalRecordsLength")
- },
- components: {
- TTRow: script$1,
- TTPaginator: script$1t,
- TTHeaderCell: script$3,
- TTFooterCell: script$4,
- SpinnerIcon: script$1p
- }
-};
-function _typeof(o) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof(o);
-}
-__name(_typeof, "_typeof");
-function ownKeys(e, r) {
- var t2 = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t2.push.apply(t2, o);
- }
- return t2;
-}
-__name(ownKeys, "ownKeys");
-function _objectSpread(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t2 = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys(Object(t2), true).forEach(function(r2) {
- _defineProperty(e, r2, t2[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t2, r2));
- });
- }
- return e;
-}
-__name(_objectSpread, "_objectSpread");
-function _defineProperty(e, r, t2) {
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t2, enumerable: true, configurable: true, writable: true }) : e[r] = t2, e;
-}
-__name(_defineProperty, "_defineProperty");
-function _toPropertyKey(t2) {
- var i = _toPrimitive(t2, "string");
- return "symbol" == _typeof(i) ? i : i + "";
-}
-__name(_toPropertyKey, "_toPropertyKey");
-function _toPrimitive(t2, r) {
- if ("object" != _typeof(t2) || !t2) return t2;
- var e = t2[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t2, r || "default");
- if ("object" != _typeof(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t2);
-}
-__name(_toPrimitive, "_toPrimitive");
-var _hoisted_1$5 = ["colspan"];
-function render3(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_TTPaginator = resolveComponent("TTPaginator");
- var _component_TTHeaderCell = resolveComponent("TTHeaderCell");
- var _component_TTRow = resolveComponent("TTRow");
- var _component_TTFooterCell = resolveComponent("TTFooterCell");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": _ctx.cx("root"),
- "data-scrollselectors": ".p-treetable-scrollable-body"
- }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), _ctx.loading && _ctx.loadingMode === "mask" ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("loading")
- }, _ctx.ptm("loading")), [createBaseVNode("div", mergeProps({
- "class": _ctx.cx("mask")
- }, _ctx.ptm("mask")), [renderSlot(_ctx.$slots, "loadingicon", {
- "class": normalizeClass(_ctx.cx("loadingIcon"))
- }, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon ? "span" : "SpinnerIcon"), mergeProps({
- spin: "",
- "class": [_ctx.cx("loadingIcon"), _ctx.loadingIcon]
- }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))];
- })], 16)], 16)) : createCommentVNode("", true), _ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": _ctx.cx("header")
- }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), $options.paginatorTop ? (openBlock(), createBlock(_component_TTPaginator, {
- key: 2,
- rows: $data.d_rows,
- first: $data.d_first,
- totalRecords: $options.totalRecordsLength,
- pageLinkSize: _ctx.pageLinkSize,
- template: _ctx.paginatorTemplate,
- rowsPerPageOptions: _ctx.rowsPerPageOptions,
- currentPageReportTemplate: _ctx.currentPageReportTemplate,
- "class": normalizeClass(_ctx.cx("pcPaginator", {
- position: "top"
- })),
- onPage: _cache[0] || (_cache[0] = function($event) {
- return $options.onPage($event);
- }),
- alwaysShow: _ctx.alwaysShowPaginator,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcPaginator")
- }, createSlots({
- _: 2
- }, [_ctx.$slots.paginatorcontainer ? {
- name: "container",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorcontainer", {
- first: slotProps.first,
- last: slotProps.last,
- rows: slotProps.rows,
- page: slotProps.page,
- pageCount: slotProps.pageCount,
- totalRecords: slotProps.totalRecords,
- firstPageCallback: slotProps.firstPageCallback,
- lastPageCallback: slotProps.lastPageCallback,
- prevPageCallback: slotProps.prevPageCallback,
- nextPageCallback: slotProps.nextPageCallback,
- rowChangeCallback: slotProps.rowChangeCallback
- })];
- }),
- key: "0"
- } : void 0, _ctx.$slots.paginatorstart ? {
- name: "start",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorstart")];
- }),
- key: "1"
- } : void 0, _ctx.$slots.paginatorend ? {
- name: "end",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorend")];
- }),
- key: "2"
- } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? {
- name: "firstpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "3"
- } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? {
- name: "prevpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "4"
- } : void 0, _ctx.$slots.paginatornextpagelinkicon ? {
- name: "nextpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "5"
- } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? {
- name: "lastpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "6"
- } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? {
- name: "jumptopagedropdownicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "7"
- } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? {
- name: "rowsperpagedropdownicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "8"
- } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("tableContainer"),
- style: [_ctx.sx("tableContainer"), {
- maxHeight: _ctx.scrollHeight
- }]
- }, _ctx.ptm("tableContainer")), [createBaseVNode("table", mergeProps({
- ref: "table",
- role: "table",
- "class": [_ctx.cx("table"), _ctx.tableClass],
- style: _ctx.tableStyle
- }, _objectSpread(_objectSpread({}, _ctx.tableProps), _ctx.ptm("table"))), [createBaseVNode("thead", mergeProps({
- "class": _ctx.cx("thead"),
- style: _ctx.sx("thead"),
- role: "rowgroup"
- }, _ctx.ptm("thead")), [createBaseVNode("tr", mergeProps({
- role: "row"
- }, _ctx.ptm("headerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.columns, function(col, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i
- }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_TTHeaderCell, {
- key: 0,
- column: col,
- resizableColumns: _ctx.resizableColumns,
- sortField: $data.d_sortField,
- sortOrder: $data.d_sortOrder,
- multiSortMeta: $data.d_multiSortMeta,
- sortMode: _ctx.sortMode,
- onColumnClick: _cache[1] || (_cache[1] = function($event) {
- return $options.onColumnHeaderClick($event);
- }),
- onColumnResizestart: _cache[2] || (_cache[2] = function($event) {
- return $options.onColumnResizeStart($event);
- }),
- index: i,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["column", "resizableColumns", "sortField", "sortOrder", "multiSortMeta", "sortMode", "index", "unstyled", "pt"])) : createCommentVNode("", true)], 64);
- }), 128))], 16), $options.hasColumnFilter() ? (openBlock(), createElementBlock("tr", normalizeProps(mergeProps({
- key: 0
- }, _ctx.ptm("headerRow"))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.columns, function(col, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i
- }, [!$options.columnProp(col, "hidden") ? (openBlock(), createElementBlock("th", mergeProps({
- key: 0,
- "class": $options.getFilterColumnHeaderClass(col),
- style: [$options.columnProp(col, "style"), $options.columnProp(col, "filterHeaderStyle")],
- ref_for: true
- }, _ctx.ptm("headerCell", $options.ptHeaderCellOptions(col))), [col.children && col.children.filter ? (openBlock(), createBlock(resolveDynamicComponent(col.children.filter), {
- key: 0,
- column: col,
- index: i
- }, null, 8, ["column", "index"])) : createCommentVNode("", true)], 16)) : createCommentVNode("", true)], 64);
- }), 128))], 16)) : createCommentVNode("", true)], 16), createBaseVNode("tbody", mergeProps({
- "class": _ctx.cx("tbody"),
- role: "rowgroup"
- }, _ctx.ptm("tbody")), [!$options.empty ? (openBlock(true), createElementBlock(Fragment, {
- key: 0
- }, renderList($options.dataToRender, function(node2, index) {
- return openBlock(), createBlock(_component_TTRow, {
- key: $options.nodeKey(node2),
- dataKey: _ctx.dataKey,
- columns: $options.columns,
- node: node2,
- level: 0,
- expandedKeys: $data.d_expandedKeys,
- indentation: _ctx.indentation,
- selectionMode: _ctx.selectionMode,
- selectionKeys: _ctx.selectionKeys,
- ariaSetSize: $options.dataToRender.length,
- ariaPosInset: index + 1,
- tabindex: $options.setTabindex(node2, index),
- loadingMode: _ctx.loadingMode,
- contextMenu: _ctx.contextMenu,
- contextMenuSelection: _ctx.contextMenuSelection,
- templates: _ctx.$slots,
- onNodeToggle: $options.onNodeToggle,
- onNodeClick: $options.onNodeClick,
- onCheckboxChange: $options.onCheckboxChange,
- onRowRightclick: _cache[3] || (_cache[3] = function($event) {
- return $options.onRowRightClick($event);
- }),
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["dataKey", "columns", "node", "expandedKeys", "indentation", "selectionMode", "selectionKeys", "ariaSetSize", "ariaPosInset", "tabindex", "loadingMode", "contextMenu", "contextMenuSelection", "templates", "onNodeToggle", "onNodeClick", "onCheckboxChange", "unstyled", "pt"]);
- }), 128)) : (openBlock(), createElementBlock("tr", mergeProps({
- key: 1,
- "class": _ctx.cx("emptyMessage")
- }, _ctx.ptm("emptyMessage")), [createBaseVNode("td", mergeProps({
- colspan: $options.columns.length
- }, _ctx.ptm("emptyMessageCell")), [renderSlot(_ctx.$slots, "empty")], 16, _hoisted_1$5)], 16))], 16), $options.hasFooter ? (openBlock(), createElementBlock("tfoot", mergeProps({
- key: 0,
- "class": _ctx.cx("tfoot"),
- style: _ctx.sx("tfoot"),
- role: "rowgroup"
- }, _ctx.ptm("tfoot")), [createBaseVNode("tr", mergeProps({
- role: "row"
- }, _ctx.ptm("footerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.columns, function(col, i) {
- return openBlock(), createElementBlock(Fragment, {
- key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i
- }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_TTFooterCell, {
- key: 0,
- column: col,
- index: i,
- unstyled: _ctx.unstyled,
- pt: _ctx.pt
- }, null, 8, ["column", "index", "unstyled", "pt"])) : createCommentVNode("", true)], 64);
- }), 128))], 16)], 16)) : createCommentVNode("", true)], 16)], 16), $options.paginatorBottom ? (openBlock(), createBlock(_component_TTPaginator, {
- key: 3,
- rows: $data.d_rows,
- first: $data.d_first,
- totalRecords: $options.totalRecordsLength,
- pageLinkSize: _ctx.pageLinkSize,
- template: _ctx.paginatorTemplate,
- rowsPerPageOptions: _ctx.rowsPerPageOptions,
- currentPageReportTemplate: _ctx.currentPageReportTemplate,
- "class": normalizeClass(_ctx.cx("pcPaginator", {
- position: "bottom"
- })),
- onPage: _cache[4] || (_cache[4] = function($event) {
- return $options.onPage($event);
- }),
- alwaysShow: _ctx.alwaysShowPaginator,
- unstyled: _ctx.unstyled,
- pt: _ctx.ptm("pcPaginator")
- }, createSlots({
- _: 2
- }, [_ctx.$slots.paginatorcontainer ? {
- name: "container",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorcontainer", {
- first: slotProps.first,
- last: slotProps.last,
- rows: slotProps.rows,
- page: slotProps.page,
- pageCount: slotProps.pageCount,
- totalRecords: slotProps.totalRecords,
- firstPageCallback: slotProps.firstPageCallback,
- lastPageCallback: slotProps.lastPageCallback,
- prevPageCallback: slotProps.prevPageCallback,
- nextPageCallback: slotProps.nextPageCallback,
- rowChangeCallback: slotProps.rowChangeCallback
- })];
- }),
- key: "0"
- } : void 0, _ctx.$slots.paginatorstart ? {
- name: "start",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorstart")];
- }),
- key: "1"
- } : void 0, _ctx.$slots.paginatorend ? {
- name: "end",
- fn: withCtx(function() {
- return [renderSlot(_ctx.$slots, "paginatorend")];
- }),
- key: "2"
- } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? {
- name: "firstpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "3"
- } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? {
- name: "prevpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "4"
- } : void 0, _ctx.$slots.paginatornextpagelinkicon ? {
- name: "nextpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "5"
- } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? {
- name: "lastpagelinkicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "6"
- } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? {
- name: "jumptopagedropdownicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "7"
- } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? {
- name: "rowsperpagedropdownicon",
- fn: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", {
- "class": normalizeClass(slotProps["class"])
- })];
- }),
- key: "8"
- } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
- key: 4,
- "class": _ctx.cx("footer")
- }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
- ref: "resizeHelper",
- "class": _ctx.cx("columnResizeIndicator"),
- style: {
- "display": "none"
- }
- }, _ctx.ptm("columnResizeIndicator")), null, 16)], 16);
-}
-__name(render3, "render");
-script.render = render3;
-const electron = electronAPI();
-const openUrl = /* @__PURE__ */ __name((url) => {
- window.open(url, "_blank");
- return true;
-}, "openUrl");
-const DESKTOP_MAINTENANCE_TASKS = [
- {
- id: "basePath",
- execute: /* @__PURE__ */ __name(async () => await electron.setBasePath(), "execute"),
- name: "Base path",
- shortDescription: "Change the application base path.",
- errorDescription: "Unable to open the base path. Please select a new one.",
- description: "The base path is the default location where ComfyUI stores data. It is the location fo the python environment, and may also contain models, custom nodes, and other extensions.",
- isInstallationFix: true,
- button: {
- icon: PrimeIcons.QUESTION,
- text: "Select"
- }
- },
- {
- id: "git",
- headerImg: "/assets/images/Git-Logo-White.svg",
- execute: /* @__PURE__ */ __name(() => openUrl("https://git-scm.com/downloads/"), "execute"),
- name: "Download git",
- shortDescription: "Open the git download page.",
- errorDescription: "Git is missing. Please download and install git, then restart ComfyUI Desktop.",
- description: "Git is required to download and manage custom nodes and other extensions. This task opens the download page in your default browser, where you can download the latest version of git. Once you have installed git, please restart ComfyUI Desktop.",
- button: {
- icon: PrimeIcons.EXTERNAL_LINK,
- text: "Download"
- }
- },
- {
- id: "vcRedist",
- execute: /* @__PURE__ */ __name(() => openUrl("https://aka.ms/vs/17/release/vc_redist.x64.exe"), "execute"),
- name: "Download VC++ Redist",
- shortDescription: "Download the latest VC++ Redistributable runtime.",
- description: "The Visual C++ runtime libraries are required to run ComfyUI. You will need to download and install this file.",
- button: {
- icon: PrimeIcons.EXTERNAL_LINK,
- text: "Download"
- }
- },
- {
- id: "reinstall",
- severity: "danger",
- requireConfirm: true,
- execute: /* @__PURE__ */ __name(async () => {
- await electron.reinstall();
- return true;
- }, "execute"),
- name: "Reinstall ComfyUI",
- shortDescription: "Deletes the desktop app config and load the welcome screen.",
- description: "Delete the desktop app config, restart the app, and load the installation screen.",
- confirmText: "Delete all saved config and reinstall?",
- button: {
- icon: PrimeIcons.EXCLAMATION_TRIANGLE,
- text: "Reinstall"
- }
- },
- {
- id: "pythonPackages",
- requireConfirm: true,
- execute: /* @__PURE__ */ __name(async () => {
- try {
- await electron.uv.installRequirements();
- return true;
- } catch (error) {
- return false;
- }
- }, "execute"),
- name: "Install python packages",
- shortDescription: "Installs the base python packages required to run ComfyUI.",
- errorDescription: "Python packages that are required to run ComfyUI are not installed.",
- description: "This will install the python packages required to run ComfyUI. This includes torch, torchvision, and other dependencies.",
- usesTerminal: true,
- isInstallationFix: true,
- button: {
- icon: PrimeIcons.DOWNLOAD,
- text: "Install"
- }
- },
- {
- id: "uv",
- execute: /* @__PURE__ */ __name(() => openUrl("https://docs.astral.sh/uv/getting-started/installation/"), "execute"),
- name: "uv executable",
- shortDescription: "uv installs and maintains the python environment.",
- description: "This will open the download page for Astral's uv tool. uv is used to install python and manage python packages.",
- button: {
- icon: "pi pi-asterisk",
- text: "Download"
- }
- },
- {
- id: "uvCache",
- severity: "danger",
- requireConfirm: true,
- execute: /* @__PURE__ */ __name(async () => await electron.uv.clearCache(), "execute"),
- name: "uv cache",
- shortDescription: "Remove the Astral uv cache of python packages.",
- description: "This will remove the uv cache directory and its contents. All downloaded python packages will need to be downloaded again.",
- confirmText: "Delete uv cache of python packages?",
- isInstallationFix: true,
- button: {
- icon: PrimeIcons.TRASH,
- text: "Clear cache"
- }
- },
- {
- id: "venvDirectory",
- severity: "danger",
- requireConfirm: true,
- execute: /* @__PURE__ */ __name(async () => await electron.uv.resetVenv(), "execute"),
- name: "Reset virtual environment",
- shortDescription: "Remove and recreate the .venv directory. This removes all python packages.",
- description: "The python environment is where ComfyUI installs python and python packages. It is used to run the ComfyUI server.",
- confirmText: "Delete the .venv directory?",
- usesTerminal: true,
- isInstallationFix: true,
- button: {
- icon: PrimeIcons.FOLDER,
- text: "Recreate"
- }
- }
-];
-class MaintenanceTaskRunner {
- static {
- __name(this, "MaintenanceTaskRunner");
- }
- constructor(task) {
- this.task = task;
- }
- _state;
- /** The current state of the task. Setter also controls {@link resolved} as a side-effect. */
- get state() {
- return this._state;
- }
- /** Updates the task state and {@link resolved} status. */
- setState(value2) {
- if (this._state === "error" && value2 === "OK") this.resolved = true;
- if (value2 === "error") this.resolved &&= false;
- this._state = value2;
- }
- /** `true` if the task has been resolved (was `error`, now `OK`). This is a side-effect of the {@link state} setter. */
- resolved;
- /** Whether the task state is currently being refreshed. */
- refreshing;
- /** Whether the task is currently running. */
- executing;
- /** The error message that occurred when the task failed. */
- error;
- update(update) {
- const state = update[this.task.id];
- this.refreshing = state === void 0;
- if (state) this.setState(state);
- }
- finaliseUpdate(update) {
- this.refreshing = false;
- this.setState(update[this.task.id] ?? "skipped");
- }
- /** Wraps the execution of a maintenance task, updating state and rethrowing errors. */
- async execute(task) {
- try {
- this.executing = true;
- const success = await task.execute();
- if (!success) return false;
- this.error = void 0;
- return true;
- } catch (error) {
- this.error = error?.message;
- throw error;
- } finally {
- this.executing = false;
- }
- }
-}
-const useMaintenanceTaskStore = defineStore("maintenanceTask", () => {
- const electron2 = electronAPI();
- const isRefreshing = ref(false);
- const isRunningTerminalCommand = computed(
- () => tasks.value.filter((task) => task.usesTerminal).some((task) => getRunner(task)?.executing)
- );
- const isRunningInstallationFix = computed(
- () => tasks.value.filter((task) => task.isInstallationFix).some((task) => getRunner(task)?.executing)
- );
- const tasks = ref(DESKTOP_MAINTENANCE_TASKS);
- const taskRunners = ref(
- new Map(
- DESKTOP_MAINTENANCE_TASKS.map((x) => [x.id, new MaintenanceTaskRunner(x)])
- )
- );
- const anyErrors = computed(
- () => tasks.value.some((task) => getRunner(task).state === "error")
- );
- const getRunner = /* @__PURE__ */ __name((task) => taskRunners.value.get(task.id), "getRunner");
- const processUpdate = /* @__PURE__ */ __name((validationUpdate) => {
- const update = validationUpdate;
- isRefreshing.value = true;
- for (const task of tasks.value) {
- getRunner(task).update(update);
- }
- if (!update.inProgress && isRefreshing.value) {
- isRefreshing.value = false;
- for (const task of tasks.value) {
- getRunner(task).finaliseUpdate(update);
- }
- }
- }, "processUpdate");
- const clearResolved = /* @__PURE__ */ __name(() => {
- for (const task of tasks.value) {
- getRunner(task).resolved &&= false;
- }
- }, "clearResolved");
- const refreshDesktopTasks = /* @__PURE__ */ __name(async () => {
- isRefreshing.value = true;
- console.log("Refreshing desktop tasks");
- await electron2.Validation.validateInstallation(processUpdate);
- }, "refreshDesktopTasks");
- const execute = /* @__PURE__ */ __name(async (task) => {
- return getRunner(task).execute(task);
- }, "execute");
- return {
- tasks,
- isRefreshing,
- isRunningTerminalCommand,
- isRunningInstallationFix,
- execute,
- getRunner,
- processUpdate,
- clearResolved,
- /** True if any tasks are in an error state. */
- anyErrors,
- refreshDesktopTasks
- };
-});
-function useMinLoadingDurationRef(value2, minDuration = 250) {
- const current = ref(value2.value);
- const { ready, start } = useTimeout(minDuration, {
- controls: true,
- immediate: false
- });
- watch(value2, (newValue) => {
- if (newValue && !current.value) start();
- current.value = newValue;
- });
- return computed(() => current.value || !ready.value);
-}
-__name(useMinLoadingDurationRef, "useMinLoadingDurationRef");
-const _hoisted_1$3 = {
- key: 0,
- class: "pi pi-exclamation-triangle text-red-500 absolute m-2 top-0 -right-14 opacity-15",
- style: { "font-size": "10rem" }
-};
-const _hoisted_2$3 = ["src"];
-const _hoisted_3$3 = { class: "flex gap-4 mt-1" };
-const _hoisted_4$3 = {
- key: 0,
- class: "task-card-ok pi pi-check"
-};
-const _sfc_main$4 = /* @__PURE__ */ defineComponent({
- __name: "TaskCard",
- props: {
- task: {}
- },
- emits: ["execute"],
- setup(__props) {
- const taskStore = useMaintenanceTaskStore();
- const runner = computed(() => taskStore.getRunner(props.task));
- const props = __props;
- const description = computed(
- () => runner.value.state === "error" ? props.task.errorDescription ?? props.task.shortDescription : props.task.shortDescription
- );
- const reactiveLoading = computed(() => runner.value.refreshing);
- const reactiveExecuting = computed(() => runner.value.executing);
- const isLoading = useMinLoadingDurationRef(reactiveLoading, 250);
- const isExecuting = useMinLoadingDurationRef(reactiveExecuting, 250);
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", {
- class: normalizeClass(["task-div max-w-48 min-h-52 grid relative", { "opacity-75": unref(isLoading) }])
- }, [
- createVNode(unref(script$1Y), mergeProps({
- class: ["max-w-48 relative h-full overflow-hidden", { "opacity-65": runner.value.state !== "error" }]
- }, (({ onClick: onClick11, ...rest }) => rest)(_ctx.$attrs)), {
- header: withCtx(() => [
- runner.value.state === "error" ? (openBlock(), createElementBlock("i", _hoisted_1$3)) : createCommentVNode("", true),
- _ctx.task.headerImg ? (openBlock(), createElementBlock("img", {
- key: 1,
- src: _ctx.task.headerImg,
- class: "object-contain w-full h-full opacity-25 pt-4 px-4"
- }, null, 8, _hoisted_2$3)) : createCommentVNode("", true)
- ]),
- title: withCtx(() => [
- createTextVNode(toDisplayString(_ctx.task.name), 1)
- ]),
- content: withCtx(() => [
- createTextVNode(toDisplayString(description.value), 1)
- ]),
- footer: withCtx(() => [
- createBaseVNode("div", _hoisted_3$3, [
- createVNode(unref(script$1d), {
- icon: _ctx.task.button?.icon,
- label: _ctx.task.button?.text,
- class: "w-full",
- raised: "",
- "icon-pos": "right",
- onClick: _cache[0] || (_cache[0] = (event2) => _ctx.$emit("execute", event2)),
- loading: unref(isExecuting)
- }, null, 8, ["icon", "label", "loading"])
- ])
- ]),
- _: 1
- }, 16, ["class"]),
- !unref(isLoading) && runner.value.state === "OK" ? (openBlock(), createElementBlock("i", _hoisted_4$3)) : createCommentVNode("", true)
- ], 2);
- };
- }
-});
-const TaskCard = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c3bd7658"]]);
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
- __name: "TaskListStatusIcon",
- props: {
- state: {},
- loading: {}
- },
- setup(__props) {
- const tooltip = computed(() => {
- if (props.state === "error") {
- return t("g.error");
- } else if (props.state === "OK") {
- return t("maintenance.OK");
- } else {
- return t("maintenance.Skipped");
- }
- });
- const cssClasses = computed(() => {
- let classes2;
- if (props.state === "error") {
- classes2 = `${PrimeIcons.EXCLAMATION_TRIANGLE} text-red-500`;
- } else if (props.state === "OK") {
- classes2 = `${PrimeIcons.CHECK} text-green-500`;
- } else {
- classes2 = PrimeIcons.MINUS;
- }
- return `text-3xl pi ${classes2}`;
- });
- const props = __props;
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return !_ctx.state || _ctx.loading ? (openBlock(), createBlock(unref(script$1c), {
- key: 0,
- class: "h-8 w-8"
- })) : withDirectives((openBlock(), createElementBlock("i", {
- key: 1,
- class: normalizeClass(cssClasses.value)
- }, null, 2)), [
- [
- _directive_tooltip,
- { value: tooltip.value, showDelay: 250 },
- void 0,
- { top: true }
- ]
- ]);
- };
- }
-});
-const _hoisted_1$2 = { class: "text-center w-16" };
-const _hoisted_2$2 = { class: "inline-block" };
-const _hoisted_3$2 = { class: "whitespace-pre-line" };
-const _hoisted_4$2 = { class: "text-right px-4" };
-const _sfc_main$2 = /* @__PURE__ */ defineComponent({
- __name: "TaskListItem",
- props: {
- task: {}
- },
- emits: ["execute"],
- setup(__props) {
- const taskStore = useMaintenanceTaskStore();
- const runner = computed(() => taskStore.getRunner(props.task));
- const props = __props;
- const severity = computed(
- () => runner.value.state === "error" || runner.value.state === "warning" ? "primary" : "secondary"
- );
- const reactiveLoading = computed(() => runner.value.refreshing);
- const reactiveExecuting = computed(() => runner.value.executing);
- const isLoading = useMinLoadingDurationRef(reactiveLoading, 250);
- const isExecuting = useMinLoadingDurationRef(reactiveExecuting, 250);
- const infoPopover = ref();
- const toggle6 = /* @__PURE__ */ __name((event2) => {
- infoPopover.value.toggle(event2);
- }, "toggle");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("tr", {
- class: normalizeClass(["border-neutral-700 border-solid border-y", {
- "opacity-50": runner.value.resolved,
- "opacity-75": unref(isLoading) && runner.value.resolved
- }])
- }, [
- createBaseVNode("td", _hoisted_1$2, [
- createVNode(_sfc_main$3, {
- state: runner.value.state,
- loading: unref(isLoading)
- }, null, 8, ["state", "loading"])
- ]),
- createBaseVNode("td", null, [
- createBaseVNode("p", _hoisted_2$2, toDisplayString(_ctx.task.name), 1),
- createVNode(unref(script$1d), {
- class: "inline-block mx-2",
- type: "button",
- icon: unref(PrimeIcons).INFO_CIRCLE,
- severity: "secondary",
- text: true,
- onClick: toggle6
- }, null, 8, ["icon"]),
- createVNode(unref(script$1P), {
- ref_key: "infoPopover",
- ref: infoPopover,
- class: "block m-1 max-w-64 min-w-32"
- }, {
- default: withCtx(() => [
- createBaseVNode("span", _hoisted_3$2, toDisplayString(_ctx.task.description), 1)
- ]),
- _: 1
- }, 512)
- ]),
- createBaseVNode("td", _hoisted_4$2, [
- createVNode(unref(script$1d), {
- icon: _ctx.task.button?.icon,
- label: _ctx.task.button?.text,
- severity: severity.value,
- "icon-pos": "right",
- onClick: _cache[0] || (_cache[0] = (event2) => _ctx.$emit("execute", event2)),
- loading: unref(isExecuting)
- }, null, 8, ["icon", "label", "severity", "loading"])
- ])
- ], 2);
- };
- }
-});
-const _hoisted_1$1 = { class: "my-4" };
-const _hoisted_2$1 = { class: "text-neutral-400 w-full text-center" };
-const _hoisted_3$1 = {
- key: 0,
- class: "w-full border-collapse border-hidden"
-};
-const _hoisted_4$1 = {
- key: 1,
- class: "flex flex-wrap justify-evenly gap-8 pad-y my-4"
-};
-const _sfc_main$1 = /* @__PURE__ */ defineComponent({
- __name: "TaskListPanel",
- props: {
- displayAsList: {},
- filter: {},
- isRefreshing: { type: Boolean }
- },
- setup(__props) {
- const toast = useToast();
- const confirm = useConfirm();
- const taskStore = useMaintenanceTaskStore();
- const props = __props;
- const executeTask = /* @__PURE__ */ __name(async (task) => {
- let message;
- try {
- if (await taskStore.execute(task) === true) return;
- message = t("maintenance.error.taskFailed");
- } catch (error) {
- message = error?.message;
- }
- toast.add({
- severity: "error",
- summary: t("maintenance.error.toastTitle"),
- detail: message ?? t("maintenance.error.defaultDescription"),
- life: 1e4
- });
- }, "executeTask");
- const confirmButton = /* @__PURE__ */ __name(async (event2, task) => {
- if (!task.requireConfirm) {
- await executeTask(task);
- return;
- }
- confirm.require({
- target: event2.currentTarget,
- message: task.confirmText ?? t("maintenance.confirmTitle"),
- icon: "pi pi-exclamation-circle",
- rejectProps: {
- label: t("g.cancel"),
- severity: "secondary",
- outlined: true
- },
- acceptProps: {
- label: task.button?.text ?? t("g.save"),
- severity: task.severity ?? "primary"
- },
- // TODO: Not awaited.
- accept: /* @__PURE__ */ __name(async () => {
- await executeTask(task);
- }, "accept")
- });
- }, "confirmButton");
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("section", _hoisted_1$1, [
- _ctx.filter.tasks.length === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
- createVNode(unref(script$1Z)),
- createBaseVNode("p", _hoisted_2$1, toDisplayString(_ctx.$t("maintenance.allOk")), 1)
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
- _ctx.displayAsList === unref(PrimeIcons).LIST ? (openBlock(), createElementBlock("table", _hoisted_3$1, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filter.tasks, (task) => {
- return openBlock(), createBlock(_sfc_main$2, {
- key: task.id,
- task,
- onExecute: /* @__PURE__ */ __name((event2) => confirmButton(event2, task), "onExecute")
- }, null, 8, ["task", "onExecute"]);
- }), 128))
- ])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filter.tasks, (task) => {
- return openBlock(), createBlock(TaskCard, {
- key: task.id,
- task,
- onExecute: /* @__PURE__ */ __name((event2) => confirmButton(event2, task), "onExecute")
- }, null, 8, ["task", "onExecute"]);
- }), 128))
- ]))
- ], 64)),
- createVNode(unref(script$1_))
- ]);
- };
- }
-});
-const _hoisted_1 = { class: "min-w-full min-h-full font-sans w-screen h-screen grid justify-around text-neutral-300 bg-neutral-900 dark-theme overflow-y-auto" };
-const _hoisted_2 = { class: "max-w-screen-sm w-screen m-8 relative" };
-const _hoisted_3 = { class: "backspan pi-wrench text-4xl font-bold" };
-const _hoisted_4 = { class: "w-full flex flex-wrap gap-4 items-center" };
-const _hoisted_5 = { class: "grow" };
-const _hoisted_6 = { class: "flex gap-4 items-center" };
-const _hoisted_7 = { class: "max-sm:hidden" };
-const _hoisted_8 = { class: "flex justify-between gap-4 flex-row" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "MaintenanceView",
- setup(__props) {
- const electron2 = electronAPI();
- const toast = useToast();
- const taskStore = useMaintenanceTaskStore();
- const { clearResolved, processUpdate, refreshDesktopTasks } = taskStore;
- const terminalVisible = ref(false);
- const reactiveIsRefreshing = computed(() => taskStore.isRefreshing);
- const isRefreshing = useMinLoadingDurationRef(reactiveIsRefreshing, 250);
- const anyErrors = computed(() => taskStore.anyErrors);
- const displayAsList = ref(PrimeIcons.TH_LARGE);
- const errorFilter = computed(
- () => taskStore.tasks.filter((x) => {
- const { state, resolved } = taskStore.getRunner(x);
- return state === "error" || resolved;
- })
- );
- const filterOptions = ref([
- { icon: PrimeIcons.FILTER_FILL, value: "All", tasks: taskStore.tasks },
- { icon: PrimeIcons.EXCLAMATION_TRIANGLE, value: "Errors", tasks: errorFilter }
- ]);
- const filter2 = ref(filterOptions.value[1]);
- const completeValidation = /* @__PURE__ */ __name(async (alertOnFail = true) => {
- const isValid = await electron2.Validation.complete();
- if (alertOnFail && !isValid) {
- toast.add({
- severity: "error",
- summary: t("g.error"),
- detail: t("maintenance.error.cannotContinue"),
- life: 5e3
- });
- }
- }, "completeValidation");
- const toggleConsoleDrawer = /* @__PURE__ */ __name(() => {
- terminalVisible.value = !terminalVisible.value;
- }, "toggleConsoleDrawer");
- watch(
- () => taskStore.isRunningTerminalCommand,
- (value2) => {
- terminalVisible.value = value2;
- }
- );
- watch(
- () => taskStore.isRunningInstallationFix,
- (value2, oldValue) => {
- if (!value2 && oldValue) completeValidation(false);
- }
- );
- onMounted(async () => {
- electron2.Validation.onUpdate(processUpdate);
- const update = await electron2.Validation.getStatus();
- processUpdate(update);
- });
- onUnmounted(() => electron2.Validation.dispose());
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$8, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("div", _hoisted_2, [
- createBaseVNode("h1", _hoisted_3, toDisplayString(unref(t)("maintenance.title")), 1),
- createBaseVNode("div", _hoisted_4, [
- createBaseVNode("span", _hoisted_5, [
- createTextVNode(toDisplayString(unref(t)("maintenance.status")) + ": ", 1),
- createVNode(_sfc_main$5, {
- refreshing: unref(isRefreshing),
- error: anyErrors.value
- }, null, 8, ["refreshing", "error"])
- ]),
- createBaseVNode("div", _hoisted_6, [
- createVNode(unref(script$1$), {
- modelValue: displayAsList.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => displayAsList.value = $event),
- options: [unref(PrimeIcons).LIST, unref(PrimeIcons).TH_LARGE],
- "allow-empty": false
- }, {
- option: withCtx((opts) => [
- createBaseVNode("i", {
- class: normalizeClass(opts.option)
- }, null, 2)
- ]),
- _: 1
- }, 8, ["modelValue", "options"]),
- createVNode(unref(script$1$), {
- modelValue: filter2.value,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter2.value = $event),
- options: filterOptions.value,
- "allow-empty": false,
- optionLabel: "value",
- dataKey: "value",
- "area-labelledby": "custom",
- onChange: unref(clearResolved)
- }, {
- option: withCtx((opts) => [
- createBaseVNode("i", {
- class: normalizeClass(opts.option.icon)
- }, null, 2),
- createBaseVNode("span", _hoisted_7, toDisplayString(opts.option.value), 1)
- ]),
- _: 1
- }, 8, ["modelValue", "options", "onChange"]),
- createVNode(_sfc_main$6, {
- modelValue: unref(isRefreshing),
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(isRefreshing) ? isRefreshing.value = $event : null),
- severity: "secondary",
- onRefresh: unref(refreshDesktopTasks)
- }, null, 8, ["modelValue", "onRefresh"])
- ])
- ]),
- createVNode(_sfc_main$1, {
- class: "border-neutral-700 border-solid border-x-0 border-y",
- filter: filter2.value,
- displayAsList: displayAsList.value,
- isRefreshing: unref(isRefreshing)
- }, null, 8, ["filter", "displayAsList", "isRefreshing"]),
- createBaseVNode("div", _hoisted_8, [
- createVNode(unref(script$1d), {
- label: unref(t)("maintenance.consoleLogs"),
- icon: "pi pi-desktop",
- "icon-pos": "left",
- severity: "secondary",
- onClick: toggleConsoleDrawer
- }, null, 8, ["label"]),
- createVNode(unref(script$1d), {
- label: unref(t)("g.continue"),
- icon: "pi pi-arrow-right",
- "icon-pos": "left",
- severity: anyErrors.value ? "secondary" : "primary",
- onClick: _cache[3] || (_cache[3] = () => completeValidation()),
- loading: unref(isRefreshing)
- }, null, 8, ["label", "severity", "loading"])
- ])
- ]),
- createVNode(_sfc_main$7, {
- modelValue: terminalVisible.value,
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => terminalVisible.value = $event),
- header: unref(t)("g.terminal"),
- "default-message": unref(t)("maintenance.terminalDefaultMessage")
- }, null, 8, ["modelValue", "header", "default-message"]),
- createVNode(unref(script$20))
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const MaintenanceView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dd50a7dd"]]);
-export {
- MaintenanceView as default
-};
-//# sourceMappingURL=MaintenanceView-Bh8OZpgl.js.map
diff --git a/web/assets/MaintenanceView-DEJCj8SR.css b/web/assets/MaintenanceView-DEJCj8SR.css
deleted file mode 100644
index c12b64c9..00000000
--- a/web/assets/MaintenanceView-DEJCj8SR.css
+++ /dev/null
@@ -1,87 +0,0 @@
-
-.task-card-ok[data-v-c3bd7658] {
-
- position: absolute;
-
- right: -1rem;
-
- bottom: -1rem;
-
- grid-column: 1 / -1;
-
- grid-row: 1 / -1;
-
- --tw-text-opacity: 1;
-
- color: rgb(150 206 76 / var(--tw-text-opacity));
-
- opacity: 1;
-
- transition-property: opacity;
-
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-
- transition-duration: 150ms;
-
- font-size: 4rem;
- text-shadow: 0.25rem 0 0.5rem black;
- z-index: 10;
-}
-.p-card {
-&[data-v-c3bd7658] {
-
- transition-property: opacity;
-
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-
- transition-duration: 150ms;
-
- --p-card-background: var(--p-button-secondary-background);
- opacity: 0.9;
- }
-&.opacity-65[data-v-c3bd7658] {
- opacity: 0.4;
-}
-&[data-v-c3bd7658]:hover {
- opacity: 1;
-}
-}
-[data-v-c3bd7658] .p-card-header {
- z-index: 0;
-}
-[data-v-c3bd7658] .p-card-body {
- z-index: 1;
- flex-grow: 1;
- justify-content: space-between;
-}
-.task-div {
-> i[data-v-c3bd7658] {
- pointer-events: none;
-}
-&:hover > i[data-v-c3bd7658] {
- opacity: 0.2;
-}
-}
-
-[data-v-dd50a7dd] .p-tag {
- --p-tag-gap: 0.375rem;
-}
-.backspan[data-v-dd50a7dd]::before {
- position: absolute;
- margin: 0px;
- color: var(--p-text-muted-color);
- font-family: 'primeicons';
- top: -2rem;
- right: -2rem;
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
- display: inline-block;
- -webkit-font-smoothing: antialiased;
- opacity: 0.02;
- font-size: min(14rem, 90vw);
- z-index: 0;
-}
diff --git a/web/assets/ManualConfigurationView-CsirlNfV.css b/web/assets/ManualConfigurationView-CsirlNfV.css
deleted file mode 100644
index dba81a0b..00000000
--- a/web/assets/ManualConfigurationView-CsirlNfV.css
+++ /dev/null
@@ -1,7 +0,0 @@
-
-.p-tag[data-v-dc169863] {
- --p-tag-gap: 0.5rem;
-}
-.comfy-installer[data-v-dc169863] {
- margin-top: max(1rem, max(0px, calc((100vh - 42rem) * 0.5)));
-}
diff --git a/web/assets/ManualConfigurationView-DTLyJ3VG.js b/web/assets/ManualConfigurationView-DTLyJ3VG.js
deleted file mode 100644
index 9f2a63ac..00000000
--- a/web/assets/ManualConfigurationView-DTLyJ3VG.js
+++ /dev/null
@@ -1,74 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, I as useI18n, T as ref, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, a5 as script, b3 as script$1, l as script$2, b9 as electronAPI, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = { class: "comfy-installer grow flex flex-col gap-4 text-neutral-300 max-w-110" };
-const _hoisted_2 = { class: "text-2xl font-semibold text-neutral-100" };
-const _hoisted_3 = { class: "m-1 text-neutral-300" };
-const _hoisted_4 = { class: "ml-2" };
-const _hoisted_5 = { class: "m-1 mb-4" };
-const _hoisted_6 = { class: "m-0" };
-const _hoisted_7 = { class: "m-1" };
-const _hoisted_8 = { class: "font-mono" };
-const _hoisted_9 = { class: "m-1" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "ManualConfigurationView",
- setup(__props) {
- const { t } = useI18n();
- const electron = electronAPI();
- const basePath = ref(null);
- const sep = ref("/");
- const restartApp = /* @__PURE__ */ __name((message) => electron.restartApp(message), "restartApp");
- onMounted(async () => {
- basePath.value = await electron.getBasePath();
- if (basePath.value.indexOf("/") === -1) sep.value = "\\";
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("h2", _hoisted_2, toDisplayString(_ctx.$t("install.manualConfiguration.title")), 1),
- createBaseVNode("p", _hoisted_3, [
- createVNode(unref(script), {
- icon: "pi pi-exclamation-triangle",
- severity: "warn",
- value: unref(t)("icon.exclamation-triangle")
- }, null, 8, ["value"]),
- createBaseVNode("strong", _hoisted_4, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1)
- ]),
- createBaseVNode("div", null, [
- createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("install.manualConfiguration.requirements")) + ": ", 1),
- createBaseVNode("ul", _hoisted_6, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1)
- ])
- ]),
- createBaseVNode("p", _hoisted_7, toDisplayString(_ctx.$t("install.manualConfiguration.createVenv")) + ":", 1),
- createVNode(unref(script$1), {
- header: unref(t)("install.manualConfiguration.virtualEnvironmentPath")
- }, {
- default: withCtx(() => [
- createBaseVNode("span", _hoisted_8, toDisplayString(`${basePath.value}${sep.value}.venv${sep.value}`), 1)
- ]),
- _: 1
- }, 8, ["header"]),
- createBaseVNode("p", _hoisted_9, toDisplayString(_ctx.$t("install.manualConfiguration.restartWhenFinished")), 1),
- createVNode(unref(script$2), {
- class: "place-self-end",
- label: unref(t)("menuLabels.Restart"),
- severity: "warn",
- icon: "pi pi-refresh",
- onClick: _cache[0] || (_cache[0] = ($event) => restartApp("Manual configuration complete"))
- }, null, 8, ["label"])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const ManualConfigurationView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc169863"]]);
-export {
- ManualConfigurationView as default
-};
-//# sourceMappingURL=ManualConfigurationView-DTLyJ3VG.js.map
diff --git a/web/assets/MetricsConsentView-C80fk2cl.js b/web/assets/MetricsConsentView-C80fk2cl.js
deleted file mode 100644
index f92e06b7..00000000
--- a/web/assets/MetricsConsentView-C80fk2cl.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-import { d as defineComponent, aV as useToast, I as useI18n, T as ref, bi as useRouter, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, a8 as createTextVNode, k as createVNode, j as unref, br as script, l as script$1, b9 as electronAPI } from "./index-Bv0b06LE.js";
-const _hoisted_1 = { class: "h-full p-8 2xl:p-16 flex flex-col items-center justify-center" };
-const _hoisted_2 = { class: "bg-neutral-800 rounded-lg shadow-lg p-6 w-full max-w-[600px] flex flex-col gap-6" };
-const _hoisted_3 = { class: "text-3xl font-semibold text-neutral-100" };
-const _hoisted_4 = { class: "text-neutral-400" };
-const _hoisted_5 = { class: "text-neutral-400" };
-const _hoisted_6 = {
- href: "https://comfy.org/privacy",
- target: "_blank",
- class: "text-blue-400 hover:text-blue-300 underline"
-};
-const _hoisted_7 = { class: "flex items-center gap-4" };
-const _hoisted_8 = {
- id: "metricsDescription",
- class: "text-neutral-100"
-};
-const _hoisted_9 = { class: "flex pt-6 justify-end" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "MetricsConsentView",
- setup(__props) {
- const toast = useToast();
- const { t } = useI18n();
- const allowMetrics = ref(true);
- const router = useRouter();
- const isUpdating = ref(false);
- const updateConsent = /* @__PURE__ */ __name(async () => {
- isUpdating.value = true;
- try {
- await electronAPI().setMetricsConsent(allowMetrics.value);
- } catch (error) {
- toast.add({
- severity: "error",
- summary: t("install.errorUpdatingConsent"),
- detail: t("install.errorUpdatingConsentDetail"),
- life: 3e3
- });
- } finally {
- isUpdating.value = false;
- }
- router.push("/");
- }, "updateConsent");
- return (_ctx, _cache) => {
- const _component_BaseViewTemplate = _sfc_main$1;
- return openBlock(), createBlock(_component_BaseViewTemplate, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("div", _hoisted_2, [
- createBaseVNode("h2", _hoisted_3, toDisplayString(_ctx.$t("install.helpImprove")), 1),
- createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("install.updateConsent")), 1),
- createBaseVNode("p", _hoisted_5, [
- createTextVNode(toDisplayString(_ctx.$t("install.moreInfo")) + " ", 1),
- createBaseVNode("a", _hoisted_6, toDisplayString(_ctx.$t("install.privacyPolicy")), 1),
- _cache[1] || (_cache[1] = createTextVNode(". "))
- ]),
- createBaseVNode("div", _hoisted_7, [
- createVNode(unref(script), {
- modelValue: allowMetrics.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => allowMetrics.value = $event),
- "aria-describedby": "metricsDescription"
- }, null, 8, ["modelValue"]),
- createBaseVNode("span", _hoisted_8, toDisplayString(allowMetrics.value ? _ctx.$t("install.metricsEnabled") : _ctx.$t("install.metricsDisabled")), 1)
- ]),
- createBaseVNode("div", _hoisted_9, [
- createVNode(unref(script$1), {
- label: _ctx.$t("g.ok"),
- icon: "pi pi-check",
- loading: isUpdating.value,
- iconPos: "right",
- onClick: updateConsent
- }, null, 8, ["label", "loading"])
- ])
- ])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=MetricsConsentView-C80fk2cl.js.map
diff --git a/web/assets/NotSupportedView-B78ZVR9Z.js b/web/assets/NotSupportedView-B78ZVR9Z.js
deleted file mode 100644
index f59e3d1a..00000000
--- a/web/assets/NotSupportedView-B78ZVR9Z.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, bi as useRouter, r as resolveDirective, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, i as withDirectives, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _imports_0 = "" + new URL("images/sad_girl.png", import.meta.url).href;
-const _hoisted_1 = { class: "sad-container" };
-const _hoisted_2 = { class: "no-drag sad-text flex items-center" };
-const _hoisted_3 = { class: "flex flex-col gap-8 p-8 min-w-110" };
-const _hoisted_4 = { class: "text-4xl font-bold text-red-500" };
-const _hoisted_5 = { class: "space-y-4" };
-const _hoisted_6 = { class: "text-xl" };
-const _hoisted_7 = { class: "list-disc list-inside space-y-1 text-neutral-800" };
-const _hoisted_8 = { class: "flex gap-4" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "NotSupportedView",
- setup(__props) {
- const openDocs = /* @__PURE__ */ __name(() => {
- window.open(
- "https://github.com/Comfy-Org/desktop#currently-supported-platforms",
- "_blank"
- );
- }, "openDocs");
- const reportIssue = /* @__PURE__ */ __name(() => {
- window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
- }, "reportIssue");
- const router = useRouter();
- const continueToInstall = /* @__PURE__ */ __name(() => {
- router.push("/install");
- }, "continueToInstall");
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createBlock(_sfc_main$1, null, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- _cache[0] || (_cache[0] = createBaseVNode("img", {
- class: "sad-girl",
- src: _imports_0,
- alt: "Sad girl illustration"
- }, null, -1)),
- createBaseVNode("div", _hoisted_2, [
- createBaseVNode("div", _hoisted_3, [
- createBaseVNode("h1", _hoisted_4, toDisplayString(_ctx.$t("notSupported.title")), 1),
- createBaseVNode("div", _hoisted_5, [
- createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("notSupported.message")), 1),
- createBaseVNode("ul", _hoisted_7, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.macos")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.windows")), 1)
- ])
- ]),
- createBaseVNode("div", _hoisted_8, [
- createVNode(unref(script), {
- label: _ctx.$t("notSupported.learnMore"),
- icon: "pi pi-github",
- onClick: openDocs,
- severity: "secondary"
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- label: _ctx.$t("notSupported.reportIssue"),
- icon: "pi pi-flag",
- onClick: reportIssue,
- severity: "secondary"
- }, null, 8, ["label"]),
- withDirectives(createVNode(unref(script), {
- label: _ctx.$t("notSupported.continue"),
- icon: "pi pi-arrow-right",
- iconPos: "right",
- onClick: continueToInstall,
- severity: "danger"
- }, null, 8, ["label"]), [
- [_directive_tooltip, _ctx.$t("notSupported.continueTooltip")]
- ])
- ])
- ])
- ])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const NotSupportedView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ebb20958"]]);
-export {
- NotSupportedView as default
-};
-//# sourceMappingURL=NotSupportedView-B78ZVR9Z.js.map
diff --git a/web/assets/NotSupportedView-RFx6eCkN.css b/web/assets/NotSupportedView-RFx6eCkN.css
deleted file mode 100644
index 59478381..00000000
--- a/web/assets/NotSupportedView-RFx6eCkN.css
+++ /dev/null
@@ -1,19 +0,0 @@
-
-.sad-container {
-&[data-v-ebb20958] {
- display: grid;
- align-items: center;
- justify-content: space-evenly;
- grid-template-columns: 25rem 1fr;
-}
-&[data-v-ebb20958] > * {
- grid-row: 1;
-}
-}
-.sad-text[data-v-ebb20958] {
- grid-column: 1/3;
-}
-.sad-girl[data-v-ebb20958] {
- grid-column: 2/3;
- width: min(75vw, 100vh);
-}
diff --git a/web/assets/ServerConfigPanel-BYrt6wyr.js b/web/assets/ServerConfigPanel-BYrt6wyr.js
deleted file mode 100644
index 494678ac..00000000
--- a/web/assets/ServerConfigPanel-BYrt6wyr.js
+++ /dev/null
@@ -1,156 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { o as openBlock, f as createElementBlock, m as createBaseVNode, H as markRaw, d as defineComponent, a as useSettingStore, af as storeToRefs, N as watch, dJ as useCopyToClipboard, I as useI18n, y as createBlock, z as withCtx, j as unref, bn as script, E as toDisplayString, D as renderList, F as Fragment, k as createVNode, l as script$1, B as createCommentVNode, bl as script$2, dK as FormItem, dz as _sfc_main$1, b9 as electronAPI } from "./index-Bv0b06LE.js";
-import { u as useServerConfigStore } from "./serverConfigStore-D2Vr0L0h.js";
-const _hoisted_1$1 = {
- viewBox: "0 0 24 24",
- width: "1.2em",
- height: "1.2em"
-};
-function render(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [
- createBaseVNode("path", {
- fill: "none",
- stroke: "currentColor",
- "stroke-linecap": "round",
- "stroke-linejoin": "round",
- "stroke-width": "2",
- d: "m4 17l6-6l-6-6m8 14h8"
- }, null, -1)
- ]));
-}
-__name(render, "render");
-const __unplugin_components_0 = markRaw({ name: "lucide-terminal", render });
-const _hoisted_1 = { class: "flex flex-col gap-2" };
-const _hoisted_2 = { class: "flex justify-end gap-2" };
-const _hoisted_3 = { class: "flex items-center justify-between" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "ServerConfigPanel",
- setup(__props) {
- const settingStore = useSettingStore();
- const serverConfigStore = useServerConfigStore();
- const {
- serverConfigsByCategory,
- serverConfigValues,
- launchArgs,
- commandLineArgs,
- modifiedConfigs
- } = storeToRefs(serverConfigStore);
- const revertChanges = /* @__PURE__ */ __name(() => {
- serverConfigStore.revertChanges();
- }, "revertChanges");
- const restartApp = /* @__PURE__ */ __name(() => {
- electronAPI().restartApp();
- }, "restartApp");
- watch(launchArgs, (newVal) => {
- settingStore.set("Comfy.Server.LaunchArgs", newVal);
- });
- watch(serverConfigValues, (newVal) => {
- settingStore.set("Comfy.Server.ServerConfigValues", newVal);
- });
- const { copyToClipboard } = useCopyToClipboard();
- const copyCommandLineArgs = /* @__PURE__ */ __name(async () => {
- await copyToClipboard(commandLineArgs.value);
- }, "copyCommandLineArgs");
- const { t } = useI18n();
- const translateItem = /* @__PURE__ */ __name((item) => {
- return {
- ...item,
- name: t(`serverConfigItems.${item.id}.name`, item.name),
- tooltip: item.tooltip ? t(`serverConfigItems.${item.id}.tooltip`, item.tooltip) : void 0
- };
- }, "translateItem");
- return (_ctx, _cache) => {
- const _component_i_lucide58terminal = __unplugin_components_0;
- return openBlock(), createBlock(_sfc_main$1, {
- value: "Server-Config",
- class: "server-config-panel"
- }, {
- header: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- unref(modifiedConfigs).length > 0 ? (openBlock(), createBlock(unref(script), {
- key: 0,
- severity: "info",
- "pt:text": "w-full"
- }, {
- default: withCtx(() => [
- createBaseVNode("p", null, toDisplayString(_ctx.$t("serverConfig.modifiedConfigs")), 1),
- createBaseVNode("ul", null, [
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(modifiedConfigs), (config) => {
- return openBlock(), createElementBlock("li", {
- key: config.id
- }, toDisplayString(config.name) + ": " + toDisplayString(config.initialValue) + " → " + toDisplayString(config.value), 1);
- }), 128))
- ]),
- createBaseVNode("div", _hoisted_2, [
- createVNode(unref(script$1), {
- label: _ctx.$t("serverConfig.revertChanges"),
- onClick: revertChanges,
- outlined: ""
- }, null, 8, ["label"]),
- createVNode(unref(script$1), {
- label: _ctx.$t("serverConfig.restart"),
- onClick: restartApp,
- outlined: "",
- severity: "danger"
- }, null, 8, ["label"])
- ])
- ]),
- _: 1
- })) : createCommentVNode("", true),
- unref(commandLineArgs) ? (openBlock(), createBlock(unref(script), {
- key: 1,
- severity: "secondary",
- "pt:text": "w-full"
- }, {
- icon: withCtx(() => [
- createVNode(_component_i_lucide58terminal, { class: "text-xl font-bold" })
- ]),
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_3, [
- createBaseVNode("p", null, toDisplayString(unref(commandLineArgs)), 1),
- createVNode(unref(script$1), {
- icon: "pi pi-clipboard",
- onClick: copyCommandLineArgs,
- severity: "secondary",
- text: ""
- })
- ])
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ])
- ]),
- default: withCtx(() => [
- (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(unref(serverConfigsByCategory)), ([label, items], i) => {
- return openBlock(), createElementBlock("div", { key: label }, [
- i > 0 ? (openBlock(), createBlock(unref(script$2), { key: 0 })) : createCommentVNode("", true),
- createBaseVNode("h3", null, toDisplayString(_ctx.$t(`serverConfigCategories.${label}`, label)), 1),
- (openBlock(true), createElementBlock(Fragment, null, renderList(items, (item) => {
- return openBlock(), createElementBlock("div", {
- key: item.name,
- class: "mb-4"
- }, [
- createVNode(FormItem, {
- item: translateItem(item),
- formValue: item.value,
- "onUpdate:formValue": /* @__PURE__ */ __name(($event) => item.value = $event, "onUpdate:formValue"),
- id: item.id,
- labelClass: {
- "text-highlight": item.initialValue !== item.value
- }
- }, null, 8, ["item", "formValue", "onUpdate:formValue", "id", "labelClass"])
- ]);
- }), 128))
- ]);
- }), 128))
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=ServerConfigPanel-BYrt6wyr.js.map
diff --git a/web/assets/ServerStartView-B7TlHxYo.js b/web/assets/ServerStartView-B7TlHxYo.js
deleted file mode 100644
index 80dfeb32..00000000
--- a/web/assets/ServerStartView-B7TlHxYo.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, I as useI18n, T as ref, bo as ProgressStatus, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, a8 as createTextVNode, E as toDisplayString, j as unref, f as createElementBlock, B as createCommentVNode, k as createVNode, l as script, i as withDirectives, v as vShow, bp as BaseTerminal, b9 as electronAPI, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = { class: "flex flex-col w-full h-full items-center" };
-const _hoisted_2 = { class: "text-2xl font-bold" };
-const _hoisted_3 = { key: 0 };
-const _hoisted_4 = {
- key: 0,
- class: "flex flex-col items-center gap-4"
-};
-const _hoisted_5 = { class: "flex items-center my-4 gap-2" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "ServerStartView",
- setup(__props) {
- const electron = electronAPI();
- const { t } = useI18n();
- const status = ref(ProgressStatus.INITIAL_STATE);
- const electronVersion = ref("");
- let xterm;
- const terminalVisible = ref(true);
- const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => {
- status.value = newStatus;
- if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false;
- else xterm?.clear();
- }, "updateProgress");
- const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => {
- xterm = terminal;
- useAutoSize({ root, autoRows: true, autoCols: true });
- electron.onLogMessage((message) => {
- terminal.write(message);
- });
- terminal.options.cursorBlink = false;
- terminal.options.disableStdin = true;
- terminal.options.cursorInactiveStyle = "block";
- }, "terminalCreated");
- const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall");
- const reportIssue = /* @__PURE__ */ __name(() => {
- window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
- }, "reportIssue");
- const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs");
- onMounted(async () => {
- electron.sendReady();
- electron.onProgressUpdate(updateProgress);
- electronVersion.value = await electron.getElectronVersion();
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, {
- dark: "",
- class: "flex-col"
- }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("h2", _hoisted_2, [
- createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1),
- status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_3, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true)
- ]),
- status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_4, [
- createBaseVNode("div", _hoisted_5, [
- createVNode(unref(script), {
- icon: "pi pi-flag",
- severity: "secondary",
- label: unref(t)("serverStart.reportIssue"),
- onClick: reportIssue
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- icon: "pi pi-file",
- severity: "secondary",
- label: unref(t)("serverStart.openLogs"),
- onClick: openLogs
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- icon: "pi pi-refresh",
- label: unref(t)("serverStart.reinstall"),
- onClick: reinstall
- }, null, 8, ["label"])
- ]),
- !terminalVisible.value ? (openBlock(), createBlock(unref(script), {
- key: 0,
- icon: "pi pi-search",
- severity: "secondary",
- label: unref(t)("serverStart.showTerminal"),
- onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true)
- }, null, 8, ["label"])) : createCommentVNode("", true)
- ])) : createCommentVNode("", true),
- withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
- [vShow, terminalVisible.value]
- ])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6ba9633"]]);
-export {
- ServerStartView as default
-};
-//# sourceMappingURL=ServerStartView-B7TlHxYo.js.map
diff --git a/web/assets/ServerStartView-BZ7uhZHv.css b/web/assets/ServerStartView-BZ7uhZHv.css
deleted file mode 100644
index 778134b7..00000000
--- a/web/assets/ServerStartView-BZ7uhZHv.css
+++ /dev/null
@@ -1,5 +0,0 @@
-
-[data-v-e6ba9633] .xterm-helper-textarea {
- /* Hide this as it moves all over when uv is running */
- display: none;
-}
diff --git a/web/assets/TerminalOutputDrawer-CKr7Br7O.js b/web/assets/TerminalOutputDrawer-CKr7Br7O.js
deleted file mode 100644
index 09062bab..00000000
--- a/web/assets/TerminalOutputDrawer-CKr7Br7O.js
+++ /dev/null
@@ -1,1061 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { bG as BaseStyle, bH as script$2, bZ as ZIndex, bU as addClass, bL as focus, cy as blockBodyScroll, cA as unblockBodyScroll, cB as FocusTrap, l as script$3, ca as script$4, cl as script$5, bR as resolveComponent, r as resolveDirective, o as openBlock, y as createBlock, z as withCtx, f as createElementBlock, at as mergeProps, k as createVNode, bI as Transition, i as withDirectives, A as renderSlot, F as Fragment, m as createBaseVNode, aj as normalizeClass, E as toDisplayString, B as createCommentVNode, C as resolveDynamicComponent, dd as commonjsGlobal, de as getDefaultExportFromCjs, H as markRaw, df as xtermExports, p as onMounted, d8 as onUnmounted, d as defineComponent, bw as mergeModels, bq as useModel, bp as BaseTerminal, j as unref, b9 as electronAPI } from "./index-Bv0b06LE.js";
-var theme = /* @__PURE__ */ __name(function theme2(_ref) {
- var dt = _ref.dt;
- return "\n.p-drawer {\n display: flex;\n flex-direction: column;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n background: ".concat(dt("drawer.background"), ";\n color: ").concat(dt("drawer.color"), ";\n border: 1px solid ").concat(dt("drawer.border.color"), ";\n box-shadow: ").concat(dt("drawer.shadow"), ";\n}\n\n.p-drawer-content {\n overflow-y: auto;\n flex-grow: 1;\n padding: ").concat(dt("drawer.content.padding"), ";\n}\n\n.p-drawer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n padding: ").concat(dt("drawer.header.padding"), ";\n}\n\n.p-drawer-footer {\n padding: ").concat(dt("drawer.footer.padding"), ";\n}\n\n.p-drawer-title {\n font-weight: ").concat(dt("drawer.title.font.weight"), ";\n font-size: ").concat(dt("drawer.title.font.size"), ";\n}\n\n.p-drawer-full .p-drawer {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n border-width: 1px;\n}\n\n.p-drawer-left .p-drawer-enter-from,\n.p-drawer-left .p-drawer-leave-to {\n transform: translateX(-100%);\n}\n\n.p-drawer-right .p-drawer-enter-from,\n.p-drawer-right .p-drawer-leave-to {\n transform: translateX(100%);\n}\n\n.p-drawer-top .p-drawer-enter-from,\n.p-drawer-top .p-drawer-leave-to {\n transform: translateY(-100%);\n}\n\n.p-drawer-bottom .p-drawer-enter-from,\n.p-drawer-bottom .p-drawer-leave-to {\n transform: translateY(100%);\n}\n\n.p-drawer-full .p-drawer-enter-from,\n.p-drawer-full .p-drawer-leave-to {\n opacity: 0;\n}\n\n.p-drawer-full .p-drawer-enter-active,\n.p-drawer-full .p-drawer-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n.p-drawer-left .p-drawer {\n width: 20rem;\n height: 100%;\n border-inline-end-width: 1px;\n}\n\n.p-drawer-right .p-drawer {\n width: 20rem;\n height: 100%;\n border-inline-start-width: 1px;\n}\n\n.p-drawer-top .p-drawer {\n height: 10rem;\n width: 100%;\n border-block-end-width: 1px;\n}\n\n.p-drawer-bottom .p-drawer {\n height: 10rem;\n width: 100%;\n border-block-start-width: 1px;\n}\n\n.p-drawer-left .p-drawer-content,\n.p-drawer-right .p-drawer-content,\n.p-drawer-top .p-drawer-content,\n.p-drawer-bottom .p-drawer-content {\n width: 100%;\n height: 100%;\n}\n\n.p-drawer-open {\n display: flex;\n}\n\n.p-drawer-mask:dir(rtl) {\n flex-direction: row-reverse;\n}\n");
-}, "theme");
-var inlineStyles = {
- mask: /* @__PURE__ */ __name(function mask(_ref2) {
- var position = _ref2.position, modal = _ref2.modal;
- return {
- position: "fixed",
- height: "100%",
- width: "100%",
- left: 0,
- top: 0,
- display: "flex",
- justifyContent: position === "left" ? "flex-start" : position === "right" ? "flex-end" : "center",
- alignItems: position === "top" ? "flex-start" : position === "bottom" ? "flex-end" : "center",
- pointerEvents: modal ? "auto" : "none"
- };
- }, "mask"),
- root: {
- pointerEvents: "auto"
- }
-};
-var classes = {
- mask: /* @__PURE__ */ __name(function mask2(_ref3) {
- var instance = _ref3.instance, props = _ref3.props;
- var positions = ["left", "right", "top", "bottom"];
- var pos = positions.find(function(item) {
- return item === props.position;
- });
- return ["p-drawer-mask", {
- "p-overlay-mask p-overlay-mask-enter": props.modal,
- "p-drawer-open": instance.containerVisible,
- "p-drawer-full": instance.fullScreen
- }, pos ? "p-drawer-".concat(pos) : ""];
- }, "mask"),
- root: /* @__PURE__ */ __name(function root(_ref4) {
- var instance = _ref4.instance;
- return ["p-drawer p-component", {
- "p-drawer-full": instance.fullScreen
- }];
- }, "root"),
- header: "p-drawer-header",
- title: "p-drawer-title",
- pcCloseButton: "p-drawer-close-button",
- content: "p-drawer-content",
- footer: "p-drawer-footer"
-};
-var DrawerStyle = BaseStyle.extend({
- name: "drawer",
- theme,
- classes,
- inlineStyles
-});
-var script$1 = {
- name: "BaseDrawer",
- "extends": script$2,
- props: {
- visible: {
- type: Boolean,
- "default": false
- },
- position: {
- type: String,
- "default": "left"
- },
- header: {
- type: null,
- "default": null
- },
- baseZIndex: {
- type: Number,
- "default": 0
- },
- autoZIndex: {
- type: Boolean,
- "default": true
- },
- dismissable: {
- type: Boolean,
- "default": true
- },
- showCloseIcon: {
- type: Boolean,
- "default": true
- },
- closeButtonProps: {
- type: Object,
- "default": /* @__PURE__ */ __name(function _default() {
- return {
- severity: "secondary",
- text: true,
- rounded: true
- };
- }, "_default")
- },
- closeIcon: {
- type: String,
- "default": void 0
- },
- modal: {
- type: Boolean,
- "default": true
- },
- blockScroll: {
- type: Boolean,
- "default": false
- }
- },
- style: DrawerStyle,
- provide: /* @__PURE__ */ __name(function provide() {
- return {
- $pcDrawer: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script = {
- name: "Drawer",
- "extends": script$1,
- inheritAttrs: false,
- emits: ["update:visible", "show", "after-show", "hide", "after-hide"],
- data: /* @__PURE__ */ __name(function data() {
- return {
- containerVisible: this.visible
- };
- }, "data"),
- container: null,
- mask: null,
- content: null,
- headerContainer: null,
- footerContainer: null,
- closeButton: null,
- outsideClickListener: null,
- documentKeydownListener: null,
- watch: {
- dismissable: /* @__PURE__ */ __name(function dismissable(newValue) {
- if (newValue) {
- this.enableDocumentSettings();
- } else {
- this.disableDocumentSettings();
- }
- }, "dismissable")
- },
- updated: /* @__PURE__ */ __name(function updated() {
- if (this.visible) {
- this.containerVisible = this.visible;
- }
- }, "updated"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() {
- this.disableDocumentSettings();
- if (this.mask && this.autoZIndex) {
- ZIndex.clear(this.mask);
- }
- this.container = null;
- this.mask = null;
- }, "beforeUnmount"),
- methods: {
- hide: /* @__PURE__ */ __name(function hide() {
- this.$emit("update:visible", false);
- }, "hide"),
- onEnter: /* @__PURE__ */ __name(function onEnter() {
- this.$emit("show");
- this.focus();
- this.bindDocumentKeyDownListener();
- if (this.autoZIndex) {
- ZIndex.set("modal", this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);
- }
- }, "onEnter"),
- onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter() {
- this.enableDocumentSettings();
- this.$emit("after-show");
- }, "onAfterEnter"),
- onBeforeLeave: /* @__PURE__ */ __name(function onBeforeLeave() {
- if (this.modal) {
- !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave");
- }
- }, "onBeforeLeave"),
- onLeave: /* @__PURE__ */ __name(function onLeave() {
- this.$emit("hide");
- }, "onLeave"),
- onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave() {
- if (this.autoZIndex) {
- ZIndex.clear(this.mask);
- }
- this.unbindDocumentKeyDownListener();
- this.containerVisible = false;
- this.disableDocumentSettings();
- this.$emit("after-hide");
- }, "onAfterLeave"),
- onMaskClick: /* @__PURE__ */ __name(function onMaskClick(event) {
- if (this.dismissable && this.modal && this.mask === event.target) {
- this.hide();
- }
- }, "onMaskClick"),
- focus: /* @__PURE__ */ __name(function focus$1() {
- var findFocusableElement = /* @__PURE__ */ __name(function findFocusableElement2(container) {
- return container && container.querySelector("[autofocus]");
- }, "findFocusableElement");
- var focusTarget = this.$slots.header && findFocusableElement(this.headerContainer);
- if (!focusTarget) {
- focusTarget = this.$slots["default"] && findFocusableElement(this.container);
- if (!focusTarget) {
- focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer);
- if (!focusTarget) {
- focusTarget = this.closeButton;
- }
- }
- }
- focusTarget && focus(focusTarget);
- }, "focus$1"),
- enableDocumentSettings: /* @__PURE__ */ __name(function enableDocumentSettings() {
- if (this.dismissable && !this.modal) {
- this.bindOutsideClickListener();
- }
- if (this.blockScroll) {
- blockBodyScroll();
- }
- }, "enableDocumentSettings"),
- disableDocumentSettings: /* @__PURE__ */ __name(function disableDocumentSettings() {
- this.unbindOutsideClickListener();
- if (this.blockScroll) {
- unblockBodyScroll();
- }
- }, "disableDocumentSettings"),
- onKeydown: /* @__PURE__ */ __name(function onKeydown(event) {
- if (event.code === "Escape") {
- this.hide();
- }
- }, "onKeydown"),
- containerRef: /* @__PURE__ */ __name(function containerRef(el) {
- this.container = el;
- }, "containerRef"),
- maskRef: /* @__PURE__ */ __name(function maskRef(el) {
- this.mask = el;
- }, "maskRef"),
- contentRef: /* @__PURE__ */ __name(function contentRef(el) {
- this.content = el;
- }, "contentRef"),
- headerContainerRef: /* @__PURE__ */ __name(function headerContainerRef(el) {
- this.headerContainer = el;
- }, "headerContainerRef"),
- footerContainerRef: /* @__PURE__ */ __name(function footerContainerRef(el) {
- this.footerContainer = el;
- }, "footerContainerRef"),
- closeButtonRef: /* @__PURE__ */ __name(function closeButtonRef(el) {
- this.closeButton = el ? el.$el : void 0;
- }, "closeButtonRef"),
- bindDocumentKeyDownListener: /* @__PURE__ */ __name(function bindDocumentKeyDownListener() {
- if (!this.documentKeydownListener) {
- this.documentKeydownListener = this.onKeydown;
- document.addEventListener("keydown", this.documentKeydownListener);
- }
- }, "bindDocumentKeyDownListener"),
- unbindDocumentKeyDownListener: /* @__PURE__ */ __name(function unbindDocumentKeyDownListener() {
- if (this.documentKeydownListener) {
- document.removeEventListener("keydown", this.documentKeydownListener);
- this.documentKeydownListener = null;
- }
- }, "unbindDocumentKeyDownListener"),
- bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() {
- var _this = this;
- if (!this.outsideClickListener) {
- this.outsideClickListener = function(event) {
- if (_this.isOutsideClicked(event)) {
- _this.hide();
- }
- };
- document.addEventListener("click", this.outsideClickListener);
- }
- }, "bindOutsideClickListener"),
- unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() {
- if (this.outsideClickListener) {
- document.removeEventListener("click", this.outsideClickListener);
- this.outsideClickListener = null;
- }
- }, "unbindOutsideClickListener"),
- isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(event) {
- return this.container && !this.container.contains(event.target);
- }, "isOutsideClicked")
- },
- computed: {
- fullScreen: /* @__PURE__ */ __name(function fullScreen() {
- return this.position === "full";
- }, "fullScreen"),
- closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
- }, "closeAriaLabel")
- },
- directives: {
- focustrap: FocusTrap
- },
- components: {
- Button: script$3,
- Portal: script$4,
- TimesIcon: script$5
- }
-};
-var _hoisted_1 = ["aria-modal"];
-function render(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_Button = resolveComponent("Button");
- var _component_Portal = resolveComponent("Portal");
- var _directive_focustrap = resolveDirective("focustrap");
- return openBlock(), createBlock(_component_Portal, null, {
- "default": withCtx(function() {
- return [$data.containerVisible ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.maskRef,
- onMousedown: _cache[0] || (_cache[0] = function() {
- return $options.onMaskClick && $options.onMaskClick.apply($options, arguments);
- }),
- "class": _ctx.cx("mask"),
- style: _ctx.sx("mask", true, {
- position: _ctx.position,
- modal: _ctx.modal
- })
- }, _ctx.ptm("mask")), [createVNode(Transition, mergeProps({
- name: "p-drawer",
- onEnter: $options.onEnter,
- onAfterEnter: $options.onAfterEnter,
- onBeforeLeave: $options.onBeforeLeave,
- onLeave: $options.onLeave,
- onAfterLeave: $options.onAfterLeave,
- appear: ""
- }, _ctx.ptm("transition")), {
- "default": withCtx(function() {
- return [_ctx.visible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.containerRef,
- "class": _ctx.cx("root"),
- style: _ctx.sx("root"),
- role: "complementary",
- "aria-modal": _ctx.modal
- }, _ctx.ptmi("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", {
- key: 0,
- closeCallback: $options.hide
- }) : (openBlock(), createElementBlock(Fragment, {
- key: 1
- }, [createBaseVNode("div", mergeProps({
- ref: $options.headerContainerRef,
- "class": _ctx.cx("header")
- }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", {
- "class": normalizeClass(_ctx.cx("title"))
- }, function() {
- return [_ctx.header ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- "class": _ctx.cx("title")
- }, _ctx.ptm("title")), toDisplayString(_ctx.header), 17)) : createCommentVNode("", true)];
- }), _ctx.showCloseIcon ? (openBlock(), createBlock(_component_Button, mergeProps({
- key: 0,
- ref: $options.closeButtonRef,
- type: "button",
- "class": _ctx.cx("pcCloseButton"),
- "aria-label": $options.closeAriaLabel,
- unstyled: _ctx.unstyled,
- onClick: $options.hide
- }, _ctx.closeButtonProps, {
- pt: _ctx.ptm("pcCloseButton"),
- "data-pc-group-section": "iconcontainer"
- }), {
- icon: withCtx(function(slotProps) {
- return [renderSlot(_ctx.$slots, "closeicon", {}, function() {
- return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon ? "span" : "TimesIcon"), mergeProps({
- "class": [_ctx.closeIcon, slotProps["class"]]
- }, _ctx.ptm("pcCloseButton")["icon"]), null, 16, ["class"]))];
- })];
- }),
- _: 3
- }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true)], 16), createBaseVNode("div", mergeProps({
- ref: $options.contentRef,
- "class": _ctx.cx("content")
- }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
- key: 0,
- ref: $options.footerContainerRef,
- "class": _ctx.cx("footer")
- }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 64))], 16, _hoisted_1)), [[_directive_focustrap]]) : createCommentVNode("", true)];
- }),
- _: 3
- }, 16, ["onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])], 16)) : createCommentVNode("", true)];
- }),
- _: 3
- });
-}
-__name(render, "render");
-script.render = render;
-var addonSerialize$2 = { exports: {} };
-var addonSerialize = addonSerialize$2.exports;
-(function(module, exports) {
- !function(e, t) {
- true ? module.exports = t() : false ? (void 0)([], t) : true ? exports.SerializeAddon = t() : e.SerializeAddon = t();
- }(commonjsGlobal, () => (() => {
- "use strict";
- var e = { 930: (e2, t2, s2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.ColorContrastCache = void 0;
- const r2 = s2(485);
- t2.ColorContrastCache = class {
- constructor() {
- this._color = new r2.TwoKeyMap(), this._css = new r2.TwoKeyMap();
- }
- setCss(e3, t3, s3) {
- this._css.set(e3, t3, s3);
- }
- getCss(e3, t3) {
- return this._css.get(e3, t3);
- }
- setColor(e3, t3, s3) {
- this._color.set(e3, t3, s3);
- }
- getColor(e3, t3) {
- return this._color.get(e3, t3);
- }
- clear() {
- this._color.clear(), this._css.clear();
- }
- };
- }, 997: function(e2, t2, s2) {
- var r2 = this && this.__decorate || function(e3, t3, s3, r3) {
- var o2, i2 = arguments.length, n2 = i2 < 3 ? t3 : null === r3 ? r3 = Object.getOwnPropertyDescriptor(t3, s3) : r3;
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n2 = Reflect.decorate(e3, t3, s3, r3);
- else for (var l2 = e3.length - 1; l2 >= 0; l2--) (o2 = e3[l2]) && (n2 = (i2 < 3 ? o2(n2) : i2 > 3 ? o2(t3, s3, n2) : o2(t3, s3)) || n2);
- return i2 > 3 && n2 && Object.defineProperty(t3, s3, n2), n2;
- }, o = this && this.__param || function(e3, t3) {
- return function(s3, r3) {
- t3(s3, r3, e3);
- };
- };
- Object.defineProperty(t2, "__esModule", { value: true }), t2.ThemeService = t2.DEFAULT_ANSI_COLORS = void 0;
- const i = s2(930), n = s2(160), l = s2(345), a = s2(859), c = s2(97), h = n.css.toColor("#ffffff"), u = n.css.toColor("#000000"), _ = n.css.toColor("#ffffff"), d = n.css.toColor("#000000"), C = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 };
- t2.DEFAULT_ANSI_COLORS = Object.freeze((() => {
- const e3 = [n.css.toColor("#2e3436"), n.css.toColor("#cc0000"), n.css.toColor("#4e9a06"), n.css.toColor("#c4a000"), n.css.toColor("#3465a4"), n.css.toColor("#75507b"), n.css.toColor("#06989a"), n.css.toColor("#d3d7cf"), n.css.toColor("#555753"), n.css.toColor("#ef2929"), n.css.toColor("#8ae234"), n.css.toColor("#fce94f"), n.css.toColor("#729fcf"), n.css.toColor("#ad7fa8"), n.css.toColor("#34e2e2"), n.css.toColor("#eeeeec")], t3 = [0, 95, 135, 175, 215, 255];
- for (let s3 = 0; s3 < 216; s3++) {
- const r3 = t3[s3 / 36 % 6 | 0], o2 = t3[s3 / 6 % 6 | 0], i2 = t3[s3 % 6];
- e3.push({ css: n.channels.toCss(r3, o2, i2), rgba: n.channels.toRgba(r3, o2, i2) });
- }
- for (let t4 = 0; t4 < 24; t4++) {
- const s3 = 8 + 10 * t4;
- e3.push({ css: n.channels.toCss(s3, s3, s3), rgba: n.channels.toRgba(s3, s3, s3) });
- }
- return e3;
- })());
- let f = t2.ThemeService = class extends a.Disposable {
- get colors() {
- return this._colors;
- }
- constructor(e3) {
- super(), this._optionsService = e3, this._contrastCache = new i.ColorContrastCache(), this._halfContrastCache = new i.ColorContrastCache(), this._onChangeColors = this.register(new l.EventEmitter()), this.onChangeColors = this._onChangeColors.event, this._colors = { foreground: h, background: u, cursor: _, cursorAccent: d, selectionForeground: void 0, selectionBackgroundTransparent: C, selectionBackgroundOpaque: n.color.blend(u, C), selectionInactiveBackgroundTransparent: C, selectionInactiveBackgroundOpaque: n.color.blend(u, C), ansi: t2.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache, halfContrastCache: this._halfContrastCache }, this._updateRestoreColors(), this._setTheme(this._optionsService.rawOptions.theme), this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio", () => this._contrastCache.clear())), this.register(this._optionsService.onSpecificOptionChange("theme", () => this._setTheme(this._optionsService.rawOptions.theme)));
- }
- _setTheme(e3 = {}) {
- const s3 = this._colors;
- if (s3.foreground = g(e3.foreground, h), s3.background = g(e3.background, u), s3.cursor = g(e3.cursor, _), s3.cursorAccent = g(e3.cursorAccent, d), s3.selectionBackgroundTransparent = g(e3.selectionBackground, C), s3.selectionBackgroundOpaque = n.color.blend(s3.background, s3.selectionBackgroundTransparent), s3.selectionInactiveBackgroundTransparent = g(e3.selectionInactiveBackground, s3.selectionBackgroundTransparent), s3.selectionInactiveBackgroundOpaque = n.color.blend(s3.background, s3.selectionInactiveBackgroundTransparent), s3.selectionForeground = e3.selectionForeground ? g(e3.selectionForeground, n.NULL_COLOR) : void 0, s3.selectionForeground === n.NULL_COLOR && (s3.selectionForeground = void 0), n.color.isOpaque(s3.selectionBackgroundTransparent)) {
- const e4 = 0.3;
- s3.selectionBackgroundTransparent = n.color.opacity(s3.selectionBackgroundTransparent, e4);
- }
- if (n.color.isOpaque(s3.selectionInactiveBackgroundTransparent)) {
- const e4 = 0.3;
- s3.selectionInactiveBackgroundTransparent = n.color.opacity(s3.selectionInactiveBackgroundTransparent, e4);
- }
- if (s3.ansi = t2.DEFAULT_ANSI_COLORS.slice(), s3.ansi[0] = g(e3.black, t2.DEFAULT_ANSI_COLORS[0]), s3.ansi[1] = g(e3.red, t2.DEFAULT_ANSI_COLORS[1]), s3.ansi[2] = g(e3.green, t2.DEFAULT_ANSI_COLORS[2]), s3.ansi[3] = g(e3.yellow, t2.DEFAULT_ANSI_COLORS[3]), s3.ansi[4] = g(e3.blue, t2.DEFAULT_ANSI_COLORS[4]), s3.ansi[5] = g(e3.magenta, t2.DEFAULT_ANSI_COLORS[5]), s3.ansi[6] = g(e3.cyan, t2.DEFAULT_ANSI_COLORS[6]), s3.ansi[7] = g(e3.white, t2.DEFAULT_ANSI_COLORS[7]), s3.ansi[8] = g(e3.brightBlack, t2.DEFAULT_ANSI_COLORS[8]), s3.ansi[9] = g(e3.brightRed, t2.DEFAULT_ANSI_COLORS[9]), s3.ansi[10] = g(e3.brightGreen, t2.DEFAULT_ANSI_COLORS[10]), s3.ansi[11] = g(e3.brightYellow, t2.DEFAULT_ANSI_COLORS[11]), s3.ansi[12] = g(e3.brightBlue, t2.DEFAULT_ANSI_COLORS[12]), s3.ansi[13] = g(e3.brightMagenta, t2.DEFAULT_ANSI_COLORS[13]), s3.ansi[14] = g(e3.brightCyan, t2.DEFAULT_ANSI_COLORS[14]), s3.ansi[15] = g(e3.brightWhite, t2.DEFAULT_ANSI_COLORS[15]), e3.extendedAnsi) {
- const r3 = Math.min(s3.ansi.length - 16, e3.extendedAnsi.length);
- for (let o2 = 0; o2 < r3; o2++) s3.ansi[o2 + 16] = g(e3.extendedAnsi[o2], t2.DEFAULT_ANSI_COLORS[o2 + 16]);
- }
- this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors);
- }
- restoreColor(e3) {
- this._restoreColor(e3), this._onChangeColors.fire(this.colors);
- }
- _restoreColor(e3) {
- if (void 0 !== e3) switch (e3) {
- case 256:
- this._colors.foreground = this._restoreColors.foreground;
- break;
- case 257:
- this._colors.background = this._restoreColors.background;
- break;
- case 258:
- this._colors.cursor = this._restoreColors.cursor;
- break;
- default:
- this._colors.ansi[e3] = this._restoreColors.ansi[e3];
- }
- else for (let e4 = 0; e4 < this._restoreColors.ansi.length; ++e4) this._colors.ansi[e4] = this._restoreColors.ansi[e4];
- }
- modifyColors(e3) {
- e3(this._colors), this._onChangeColors.fire(this.colors);
- }
- _updateRestoreColors() {
- this._restoreColors = { foreground: this._colors.foreground, background: this._colors.background, cursor: this._colors.cursor, ansi: this._colors.ansi.slice() };
- }
- };
- function g(e3, t3) {
- if (void 0 !== e3) try {
- return n.css.toColor(e3);
- } catch {
- }
- return t3;
- }
- __name(g, "g");
- t2.ThemeService = f = r2([o(0, c.IOptionsService)], f);
- }, 160: (e2, t2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.contrastRatio = t2.toPaddedHex = t2.rgba = t2.rgb = t2.css = t2.color = t2.channels = t2.NULL_COLOR = void 0;
- let s2 = 0, r2 = 0, o = 0, i = 0;
- var n, l, a, c, h;
- function u(e3) {
- const t3 = e3.toString(16);
- return t3.length < 2 ? "0" + t3 : t3;
- }
- __name(u, "u");
- function _(e3, t3) {
- return e3 < t3 ? (t3 + 0.05) / (e3 + 0.05) : (e3 + 0.05) / (t3 + 0.05);
- }
- __name(_, "_");
- t2.NULL_COLOR = { css: "#00000000", rgba: 0 }, function(e3) {
- e3.toCss = function(e4, t3, s3, r3) {
- return void 0 !== r3 ? `#${u(e4)}${u(t3)}${u(s3)}${u(r3)}` : `#${u(e4)}${u(t3)}${u(s3)}`;
- }, e3.toRgba = function(e4, t3, s3, r3 = 255) {
- return (e4 << 24 | t3 << 16 | s3 << 8 | r3) >>> 0;
- }, e3.toColor = function(t3, s3, r3, o2) {
- return { css: e3.toCss(t3, s3, r3, o2), rgba: e3.toRgba(t3, s3, r3, o2) };
- };
- }(n || (t2.channels = n = {})), function(e3) {
- function t3(e4, t4) {
- return i = Math.round(255 * t4), [s2, r2, o] = h.toChannels(e4.rgba), { css: n.toCss(s2, r2, o, i), rgba: n.toRgba(s2, r2, o, i) };
- }
- __name(t3, "t");
- e3.blend = function(e4, t4) {
- if (i = (255 & t4.rgba) / 255, 1 === i) return { css: t4.css, rgba: t4.rgba };
- const l2 = t4.rgba >> 24 & 255, a2 = t4.rgba >> 16 & 255, c2 = t4.rgba >> 8 & 255, h2 = e4.rgba >> 24 & 255, u2 = e4.rgba >> 16 & 255, _2 = e4.rgba >> 8 & 255;
- return s2 = h2 + Math.round((l2 - h2) * i), r2 = u2 + Math.round((a2 - u2) * i), o = _2 + Math.round((c2 - _2) * i), { css: n.toCss(s2, r2, o), rgba: n.toRgba(s2, r2, o) };
- }, e3.isOpaque = function(e4) {
- return 255 == (255 & e4.rgba);
- }, e3.ensureContrastRatio = function(e4, t4, s3) {
- const r3 = h.ensureContrastRatio(e4.rgba, t4.rgba, s3);
- if (r3) return n.toColor(r3 >> 24 & 255, r3 >> 16 & 255, r3 >> 8 & 255);
- }, e3.opaque = function(e4) {
- const t4 = (255 | e4.rgba) >>> 0;
- return [s2, r2, o] = h.toChannels(t4), { css: n.toCss(s2, r2, o), rgba: t4 };
- }, e3.opacity = t3, e3.multiplyOpacity = function(e4, s3) {
- return i = 255 & e4.rgba, t3(e4, i * s3 / 255);
- }, e3.toColorRGB = function(e4) {
- return [e4.rgba >> 24 & 255, e4.rgba >> 16 & 255, e4.rgba >> 8 & 255];
- };
- }(l || (t2.color = l = {})), function(e3) {
- let t3, l2;
- try {
- const e4 = document.createElement("canvas");
- e4.width = 1, e4.height = 1;
- const s3 = e4.getContext("2d", { willReadFrequently: true });
- s3 && (t3 = s3, t3.globalCompositeOperation = "copy", l2 = t3.createLinearGradient(0, 0, 1, 1));
- } catch {
- }
- e3.toColor = function(e4) {
- if (e4.match(/#[\da-f]{3,8}/i)) switch (e4.length) {
- case 4:
- return s2 = parseInt(e4.slice(1, 2).repeat(2), 16), r2 = parseInt(e4.slice(2, 3).repeat(2), 16), o = parseInt(e4.slice(3, 4).repeat(2), 16), n.toColor(s2, r2, o);
- case 5:
- return s2 = parseInt(e4.slice(1, 2).repeat(2), 16), r2 = parseInt(e4.slice(2, 3).repeat(2), 16), o = parseInt(e4.slice(3, 4).repeat(2), 16), i = parseInt(e4.slice(4, 5).repeat(2), 16), n.toColor(s2, r2, o, i);
- case 7:
- return { css: e4, rgba: (parseInt(e4.slice(1), 16) << 8 | 255) >>> 0 };
- case 9:
- return { css: e4, rgba: parseInt(e4.slice(1), 16) >>> 0 };
- }
- const a2 = e4.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
- if (a2) return s2 = parseInt(a2[1]), r2 = parseInt(a2[2]), o = parseInt(a2[3]), i = Math.round(255 * (void 0 === a2[5] ? 1 : parseFloat(a2[5]))), n.toColor(s2, r2, o, i);
- if (!t3 || !l2) throw new Error("css.toColor: Unsupported css format");
- if (t3.fillStyle = l2, t3.fillStyle = e4, "string" != typeof t3.fillStyle) throw new Error("css.toColor: Unsupported css format");
- if (t3.fillRect(0, 0, 1, 1), [s2, r2, o, i] = t3.getImageData(0, 0, 1, 1).data, 255 !== i) throw new Error("css.toColor: Unsupported css format");
- return { rgba: n.toRgba(s2, r2, o, i), css: e4 };
- };
- }(a || (t2.css = a = {})), function(e3) {
- function t3(e4, t4, s3) {
- const r3 = e4 / 255, o2 = t4 / 255, i2 = s3 / 255;
- return 0.2126 * (r3 <= 0.03928 ? r3 / 12.92 : Math.pow((r3 + 0.055) / 1.055, 2.4)) + 0.7152 * (o2 <= 0.03928 ? o2 / 12.92 : Math.pow((o2 + 0.055) / 1.055, 2.4)) + 0.0722 * (i2 <= 0.03928 ? i2 / 12.92 : Math.pow((i2 + 0.055) / 1.055, 2.4));
- }
- __name(t3, "t");
- e3.relativeLuminance = function(e4) {
- return t3(e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4);
- }, e3.relativeLuminance2 = t3;
- }(c || (t2.rgb = c = {})), function(e3) {
- function t3(e4, t4, s3) {
- const r3 = e4 >> 24 & 255, o2 = e4 >> 16 & 255, i2 = e4 >> 8 & 255;
- let n2 = t4 >> 24 & 255, l3 = t4 >> 16 & 255, a2 = t4 >> 8 & 255, h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2));
- for (; h2 < s3 && (n2 > 0 || l3 > 0 || a2 > 0); ) n2 -= Math.max(0, Math.ceil(0.1 * n2)), l3 -= Math.max(0, Math.ceil(0.1 * l3)), a2 -= Math.max(0, Math.ceil(0.1 * a2)), h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2));
- return (n2 << 24 | l3 << 16 | a2 << 8 | 255) >>> 0;
- }
- __name(t3, "t");
- function l2(e4, t4, s3) {
- const r3 = e4 >> 24 & 255, o2 = e4 >> 16 & 255, i2 = e4 >> 8 & 255;
- let n2 = t4 >> 24 & 255, l3 = t4 >> 16 & 255, a2 = t4 >> 8 & 255, h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2));
- for (; h2 < s3 && (n2 < 255 || l3 < 255 || a2 < 255); ) n2 = Math.min(255, n2 + Math.ceil(0.1 * (255 - n2))), l3 = Math.min(255, l3 + Math.ceil(0.1 * (255 - l3))), a2 = Math.min(255, a2 + Math.ceil(0.1 * (255 - a2))), h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2));
- return (n2 << 24 | l3 << 16 | a2 << 8 | 255) >>> 0;
- }
- __name(l2, "l");
- e3.blend = function(e4, t4) {
- if (i = (255 & t4) / 255, 1 === i) return t4;
- const l3 = t4 >> 24 & 255, a2 = t4 >> 16 & 255, c2 = t4 >> 8 & 255, h2 = e4 >> 24 & 255, u2 = e4 >> 16 & 255, _2 = e4 >> 8 & 255;
- return s2 = h2 + Math.round((l3 - h2) * i), r2 = u2 + Math.round((a2 - u2) * i), o = _2 + Math.round((c2 - _2) * i), n.toRgba(s2, r2, o);
- }, e3.ensureContrastRatio = function(e4, s3, r3) {
- const o2 = c.relativeLuminance(e4 >> 8), i2 = c.relativeLuminance(s3 >> 8);
- if (_(o2, i2) < r3) {
- if (i2 < o2) {
- const i3 = t3(e4, s3, r3), n3 = _(o2, c.relativeLuminance(i3 >> 8));
- if (n3 < r3) {
- const t4 = l2(e4, s3, r3);
- return n3 > _(o2, c.relativeLuminance(t4 >> 8)) ? i3 : t4;
- }
- return i3;
- }
- const n2 = l2(e4, s3, r3), a2 = _(o2, c.relativeLuminance(n2 >> 8));
- if (a2 < r3) {
- const i3 = t3(e4, s3, r3);
- return a2 > _(o2, c.relativeLuminance(i3 >> 8)) ? n2 : i3;
- }
- return n2;
- }
- }, e3.reduceLuminance = t3, e3.increaseLuminance = l2, e3.toChannels = function(e4) {
- return [e4 >> 24 & 255, e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4];
- };
- }(h || (t2.rgba = h = {})), t2.toPaddedHex = u, t2.contrastRatio = _;
- }, 345: (e2, t2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class {
- constructor() {
- this._listeners = [], this._disposed = false;
- }
- get event() {
- return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: /* @__PURE__ */ __name(() => {
- if (!this._disposed) {
- for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1);
- }
- }, "dispose") })), this._event;
- }
- fire(e3, t3) {
- const s2 = [];
- for (let e4 = 0; e4 < this._listeners.length; e4++) s2.push(this._listeners[e4]);
- for (let r2 = 0; r2 < s2.length; r2++) s2[r2].call(void 0, e3, t3);
- }
- dispose() {
- this.clearListeners(), this._disposed = true;
- }
- clearListeners() {
- this._listeners && (this._listeners.length = 0);
- }
- }, t2.forwardEvent = function(e3, t3) {
- return e3((e4) => t3.fire(e4));
- }, t2.runAndSubscribe = function(e3, t3) {
- return t3(void 0), e3((e4) => t3(e4));
- };
- }, 859: (e2, t2) => {
- function s2(e3) {
- for (const t3 of e3) t3.dispose();
- e3.length = 0;
- }
- __name(s2, "s");
- Object.defineProperty(t2, "__esModule", { value: true }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class {
- constructor() {
- this._disposables = [], this._isDisposed = false;
- }
- dispose() {
- this._isDisposed = true;
- for (const e3 of this._disposables) e3.dispose();
- this._disposables.length = 0;
- }
- register(e3) {
- return this._disposables.push(e3), e3;
- }
- unregister(e3) {
- const t3 = this._disposables.indexOf(e3);
- -1 !== t3 && this._disposables.splice(t3, 1);
- }
- }, t2.MutableDisposable = class {
- constructor() {
- this._isDisposed = false;
- }
- get value() {
- return this._isDisposed ? void 0 : this._value;
- }
- set value(e3) {
- this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3);
- }
- clear() {
- this.value = void 0;
- }
- dispose() {
- this._isDisposed = true, this._value?.dispose(), this._value = void 0;
- }
- }, t2.toDisposable = function(e3) {
- return { dispose: e3 };
- }, t2.disposeArray = s2, t2.getDisposeArrayDisposable = function(e3) {
- return { dispose: /* @__PURE__ */ __name(() => s2(e3), "dispose") };
- };
- }, 485: (e2, t2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.FourKeyMap = t2.TwoKeyMap = void 0;
- class s2 {
- static {
- __name(this, "s");
- }
- constructor() {
- this._data = {};
- }
- set(e3, t3, s3) {
- this._data[e3] || (this._data[e3] = {}), this._data[e3][t3] = s3;
- }
- get(e3, t3) {
- return this._data[e3] ? this._data[e3][t3] : void 0;
- }
- clear() {
- this._data = {};
- }
- }
- t2.TwoKeyMap = s2, t2.FourKeyMap = class {
- constructor() {
- this._data = new s2();
- }
- set(e3, t3, r2, o, i) {
- this._data.get(e3, t3) || this._data.set(e3, t3, new s2()), this._data.get(e3, t3).set(r2, o, i);
- }
- get(e3, t3, s3, r2) {
- return this._data.get(e3, t3)?.get(s3, r2);
- }
- clear() {
- this._data.clear();
- }
- };
- }, 726: (e2, t2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0;
- const s2 = "di$target", r2 = "di$dependencies";
- t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) {
- return e3[r2] || [];
- }, t2.createDecorator = function(e3) {
- if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3);
- const o = /* @__PURE__ */ __name(function(e4, t3, i) {
- if (3 !== arguments.length) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
- !function(e5, t4, o2) {
- t4[s2] === t4 ? t4[r2].push({ id: e5, index: o2 }) : (t4[r2] = [{ id: e5, index: o2 }], t4[s2] = t4);
- }(o, e4, i);
- }, "o");
- return o.toString = () => e3, t2.serviceRegistry.set(e3, o), o;
- };
- }, 97: (e2, t2, s2) => {
- Object.defineProperty(t2, "__esModule", { value: true }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0;
- const r2 = s2(726);
- var o;
- t2.IBufferService = (0, r2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, r2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, r2.createDecorator)("CoreService"), t2.ICharsetService = (0, r2.createDecorator)("CharsetService"), t2.IInstantiationService = (0, r2.createDecorator)("InstantiationService"), function(e3) {
- e3[e3.TRACE = 0] = "TRACE", e3[e3.DEBUG = 1] = "DEBUG", e3[e3.INFO = 2] = "INFO", e3[e3.WARN = 3] = "WARN", e3[e3.ERROR = 4] = "ERROR", e3[e3.OFF = 5] = "OFF";
- }(o || (t2.LogLevelEnum = o = {})), t2.ILogService = (0, r2.createDecorator)("LogService"), t2.IOptionsService = (0, r2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, r2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, r2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, r2.createDecorator)("DecorationService");
- } }, t = {};
- function s(r2) {
- var o = t[r2];
- if (void 0 !== o) return o.exports;
- var i = t[r2] = { exports: {} };
- return e[r2].call(i.exports, i, i.exports, s), i.exports;
- }
- __name(s, "s");
- var r = {};
- return (() => {
- var e2 = r;
- Object.defineProperty(e2, "__esModule", { value: true }), e2.HTMLSerializeHandler = e2.SerializeAddon = void 0;
- const t2 = s(997);
- function o(e3, t3, s2) {
- return Math.max(t3, Math.min(e3, s2));
- }
- __name(o, "o");
- class i {
- static {
- __name(this, "i");
- }
- constructor(e3) {
- this._buffer = e3;
- }
- serialize(e3, t3) {
- const s2 = this._buffer.getNullCell(), r2 = this._buffer.getNullCell();
- let o2 = s2;
- const i2 = e3.start.y, n2 = e3.end.y, l2 = e3.start.x, a2 = e3.end.x;
- this._beforeSerialize(n2 - i2, i2, n2);
- for (let t4 = i2; t4 <= n2; t4++) {
- const i3 = this._buffer.getLine(t4);
- if (i3) {
- const n3 = t4 === e3.start.y ? l2 : 0, c2 = t4 === e3.end.y ? a2 : i3.length;
- for (let e4 = n3; e4 < c2; e4++) {
- const n4 = i3.getCell(e4, o2 === s2 ? r2 : s2);
- n4 ? (this._nextCell(n4, o2, t4, e4), o2 = n4) : console.warn(`Can't get cell at row=${t4}, col=${e4}`);
- }
- }
- this._rowEnd(t4, t4 === n2);
- }
- return this._afterSerialize(), this._serializeString(t3);
- }
- _nextCell(e3, t3, s2, r2) {
- }
- _rowEnd(e3, t3) {
- }
- _beforeSerialize(e3, t3, s2) {
- }
- _afterSerialize() {
- }
- _serializeString(e3) {
- return "";
- }
- }
- function n(e3, t3) {
- return e3.getFgColorMode() === t3.getFgColorMode() && e3.getFgColor() === t3.getFgColor();
- }
- __name(n, "n");
- function l(e3, t3) {
- return e3.getBgColorMode() === t3.getBgColorMode() && e3.getBgColor() === t3.getBgColor();
- }
- __name(l, "l");
- function a(e3, t3) {
- return e3.isInverse() === t3.isInverse() && e3.isBold() === t3.isBold() && e3.isUnderline() === t3.isUnderline() && e3.isOverline() === t3.isOverline() && e3.isBlink() === t3.isBlink() && e3.isInvisible() === t3.isInvisible() && e3.isItalic() === t3.isItalic() && e3.isDim() === t3.isDim() && e3.isStrikethrough() === t3.isStrikethrough();
- }
- __name(a, "a");
- class c extends i {
- static {
- __name(this, "c");
- }
- constructor(e3, t3) {
- super(e3), this._terminal = t3, this._rowIndex = 0, this._allRows = new Array(), this._allRowSeparators = new Array(), this._currentRow = "", this._nullCellCount = 0, this._cursorStyle = this._buffer.getNullCell(), this._cursorStyleRow = 0, this._cursorStyleCol = 0, this._backgroundCell = this._buffer.getNullCell(), this._firstRow = 0, this._lastCursorRow = 0, this._lastCursorCol = 0, this._lastContentCursorRow = 0, this._lastContentCursorCol = 0, this._thisRowLastChar = this._buffer.getNullCell(), this._thisRowLastSecondChar = this._buffer.getNullCell(), this._nextRowFirstChar = this._buffer.getNullCell();
- }
- _beforeSerialize(e3, t3, s2) {
- this._allRows = new Array(e3), this._lastContentCursorRow = t3, this._lastCursorRow = t3, this._firstRow = t3;
- }
- _rowEnd(e3, t3) {
- this._nullCellCount > 0 && !l(this._cursorStyle, this._backgroundCell) && (this._currentRow += `\x1B[${this._nullCellCount}X`);
- let s2 = "";
- if (!t3) {
- e3 - this._firstRow >= this._terminal.rows && this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell);
- const t4 = this._buffer.getLine(e3), r2 = this._buffer.getLine(e3 + 1);
- if (r2.isWrapped) {
- s2 = "";
- const o2 = t4.getCell(t4.length - 1, this._thisRowLastChar), i2 = t4.getCell(t4.length - 2, this._thisRowLastSecondChar), n2 = r2.getCell(0, this._nextRowFirstChar), a2 = n2.getWidth() > 1;
- let c2 = false;
- (n2.getChars() && a2 ? this._nullCellCount <= 1 : this._nullCellCount <= 0) && ((o2.getChars() || 0 === o2.getWidth()) && l(o2, n2) && (c2 = true), a2 && (i2.getChars() || 0 === i2.getWidth()) && l(o2, n2) && l(i2, n2) && (c2 = true)), c2 || (s2 = "-".repeat(this._nullCellCount + 1), s2 += "\x1B[1D\x1B[1X", this._nullCellCount > 0 && (s2 += "\x1B[A", s2 += `\x1B[${t4.length - this._nullCellCount}C`, s2 += `\x1B[${this._nullCellCount}X`, s2 += `\x1B[${t4.length - this._nullCellCount}D`, s2 += "\x1B[B"), this._lastContentCursorRow = e3 + 1, this._lastContentCursorCol = 0, this._lastCursorRow = e3 + 1, this._lastCursorCol = 0);
- } else s2 = "\r\n", this._lastCursorRow = e3 + 1, this._lastCursorCol = 0;
- }
- this._allRows[this._rowIndex] = this._currentRow, this._allRowSeparators[this._rowIndex++] = s2, this._currentRow = "", this._nullCellCount = 0;
- }
- _diffStyle(e3, t3) {
- const s2 = [], r2 = !n(e3, t3), o2 = !l(e3, t3), i2 = !a(e3, t3);
- if (r2 || o2 || i2) if (e3.isAttributeDefault()) t3.isAttributeDefault() || s2.push(0);
- else {
- if (r2) {
- const t4 = e3.getFgColor();
- e3.isFgRGB() ? s2.push(38, 2, t4 >>> 16 & 255, t4 >>> 8 & 255, 255 & t4) : e3.isFgPalette() ? t4 >= 16 ? s2.push(38, 5, t4) : s2.push(8 & t4 ? 90 + (7 & t4) : 30 + (7 & t4)) : s2.push(39);
- }
- if (o2) {
- const t4 = e3.getBgColor();
- e3.isBgRGB() ? s2.push(48, 2, t4 >>> 16 & 255, t4 >>> 8 & 255, 255 & t4) : e3.isBgPalette() ? t4 >= 16 ? s2.push(48, 5, t4) : s2.push(8 & t4 ? 100 + (7 & t4) : 40 + (7 & t4)) : s2.push(49);
- }
- i2 && (e3.isInverse() !== t3.isInverse() && s2.push(e3.isInverse() ? 7 : 27), e3.isBold() !== t3.isBold() && s2.push(e3.isBold() ? 1 : 22), e3.isUnderline() !== t3.isUnderline() && s2.push(e3.isUnderline() ? 4 : 24), e3.isOverline() !== t3.isOverline() && s2.push(e3.isOverline() ? 53 : 55), e3.isBlink() !== t3.isBlink() && s2.push(e3.isBlink() ? 5 : 25), e3.isInvisible() !== t3.isInvisible() && s2.push(e3.isInvisible() ? 8 : 28), e3.isItalic() !== t3.isItalic() && s2.push(e3.isItalic() ? 3 : 23), e3.isDim() !== t3.isDim() && s2.push(e3.isDim() ? 2 : 22), e3.isStrikethrough() !== t3.isStrikethrough() && s2.push(e3.isStrikethrough() ? 9 : 29));
- }
- return s2;
- }
- _nextCell(e3, t3, s2, r2) {
- if (0 === e3.getWidth()) return;
- const o2 = "" === e3.getChars(), i2 = this._diffStyle(e3, this._cursorStyle);
- if (o2 ? !l(this._cursorStyle, e3) : i2.length > 0) {
- this._nullCellCount > 0 && (l(this._cursorStyle, this._backgroundCell) || (this._currentRow += `\x1B[${this._nullCellCount}X`), this._currentRow += `\x1B[${this._nullCellCount}C`, this._nullCellCount = 0), this._lastContentCursorRow = this._lastCursorRow = s2, this._lastContentCursorCol = this._lastCursorCol = r2, this._currentRow += `\x1B[${i2.join(";")}m`;
- const e4 = this._buffer.getLine(s2);
- void 0 !== e4 && (e4.getCell(r2, this._cursorStyle), this._cursorStyleRow = s2, this._cursorStyleCol = r2);
- }
- o2 ? this._nullCellCount += e3.getWidth() : (this._nullCellCount > 0 && (l(this._cursorStyle, this._backgroundCell) || (this._currentRow += `\x1B[${this._nullCellCount}X`), this._currentRow += `\x1B[${this._nullCellCount}C`, this._nullCellCount = 0), this._currentRow += e3.getChars(), this._lastContentCursorRow = this._lastCursorRow = s2, this._lastContentCursorCol = this._lastCursorCol = r2 + e3.getWidth());
- }
- _serializeString(e3) {
- let t3 = this._allRows.length;
- this._buffer.length - this._firstRow <= this._terminal.rows && (t3 = this._lastContentCursorRow + 1 - this._firstRow, this._lastCursorCol = this._lastContentCursorCol, this._lastCursorRow = this._lastContentCursorRow);
- let s2 = "";
- for (let e4 = 0; e4 < t3; e4++) s2 += this._allRows[e4], e4 + 1 < t3 && (s2 += this._allRowSeparators[e4]);
- if (!e3) {
- const e4 = this._buffer.baseY + this._buffer.cursorY, t4 = this._buffer.cursorX, o3 = /* @__PURE__ */ __name((e5) => {
- e5 > 0 ? s2 += `\x1B[${e5}C` : e5 < 0 && (s2 += `\x1B[${-e5}D`);
- }, "o");
- (e4 !== this._lastCursorRow || t4 !== this._lastCursorCol) && ((r2 = e4 - this._lastCursorRow) > 0 ? s2 += `\x1B[${r2}B` : r2 < 0 && (s2 += `\x1B[${-r2}A`), o3(t4 - this._lastCursorCol));
- }
- var r2;
- const o2 = this._terminal._core._inputHandler._curAttrData, i2 = this._diffStyle(o2, this._cursorStyle);
- return i2.length > 0 && (s2 += `\x1B[${i2.join(";")}m`), s2;
- }
- }
- e2.SerializeAddon = class {
- activate(e3) {
- this._terminal = e3;
- }
- _serializeBufferByScrollback(e3, t3, s2) {
- const r2 = t3.length, i2 = void 0 === s2 ? r2 : o(s2 + e3.rows, 0, r2);
- return this._serializeBufferByRange(e3, t3, { start: r2 - i2, end: r2 - 1 }, false);
- }
- _serializeBufferByRange(e3, t3, s2, r2) {
- return new c(t3, e3).serialize({ start: { x: 0, y: "number" == typeof s2.start ? s2.start : s2.start.line }, end: { x: e3.cols, y: "number" == typeof s2.end ? s2.end : s2.end.line } }, r2);
- }
- _serializeBufferAsHTML(e3, t3) {
- const s2 = e3.buffer.active, r2 = new h(s2, e3, t3);
- if (!t3.onlySelection) {
- const i3 = s2.length, n2 = t3.scrollback, l2 = void 0 === n2 ? i3 : o(n2 + e3.rows, 0, i3);
- return r2.serialize({ start: { x: 0, y: i3 - l2 }, end: { x: e3.cols, y: i3 - 1 } });
- }
- const i2 = this._terminal?.getSelectionPosition();
- return void 0 !== i2 ? r2.serialize({ start: { x: i2.start.x, y: i2.start.y }, end: { x: i2.end.x, y: i2.end.y } }) : "";
- }
- _serializeModes(e3) {
- let t3 = "";
- const s2 = e3.modes;
- if (s2.applicationCursorKeysMode && (t3 += "\x1B[?1h"), s2.applicationKeypadMode && (t3 += "\x1B[?66h"), s2.bracketedPasteMode && (t3 += "\x1B[?2004h"), s2.insertMode && (t3 += "\x1B[4h"), s2.originMode && (t3 += "\x1B[?6h"), s2.reverseWraparoundMode && (t3 += "\x1B[?45h"), s2.sendFocusMode && (t3 += "\x1B[?1004h"), false === s2.wraparoundMode && (t3 += "\x1B[?7l"), "none" !== s2.mouseTrackingMode) switch (s2.mouseTrackingMode) {
- case "x10":
- t3 += "\x1B[?9h";
- break;
- case "vt200":
- t3 += "\x1B[?1000h";
- break;
- case "drag":
- t3 += "\x1B[?1002h";
- break;
- case "any":
- t3 += "\x1B[?1003h";
- }
- return t3;
- }
- serialize(e3) {
- if (!this._terminal) throw new Error("Cannot use addon until it has been loaded");
- let t3 = e3?.range ? this._serializeBufferByRange(this._terminal, this._terminal.buffer.normal, e3.range, true) : this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.normal, e3?.scrollback);
- return e3?.excludeAltBuffer || "alternate" !== this._terminal.buffer.active.type || (t3 += `\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.alternate, void 0)}`), e3?.excludeModes || (t3 += this._serializeModes(this._terminal)), t3;
- }
- serializeAsHTML(e3) {
- if (!this._terminal) throw new Error("Cannot use addon until it has been loaded");
- return this._serializeBufferAsHTML(this._terminal, e3 || {});
- }
- dispose() {
- }
- };
- class h extends i {
- static {
- __name(this, "h");
- }
- constructor(e3, s2, r2) {
- super(e3), this._terminal = s2, this._options = r2, this._currentRow = "", this._htmlContent = "", s2._core._themeService ? this._ansiColors = s2._core._themeService.colors.ansi : this._ansiColors = t2.DEFAULT_ANSI_COLORS;
- }
- _padStart(e3, t3, s2) {
- return t3 >>= 0, s2 = s2 ?? " ", e3.length > t3 ? e3 : ((t3 -= e3.length) > s2.length && (s2 += s2.repeat(t3 / s2.length)), s2.slice(0, t3) + e3);
- }
- _beforeSerialize(e3, t3, s2) {
- this._htmlContent += "
";
- let r2 = "#000000", o2 = "#ffffff";
- this._options.includeGlobalBackground && (r2 = this._terminal.options.theme?.foreground ?? "#ffffff", o2 = this._terminal.options.theme?.background ?? "#000000");
- const i2 = [];
- i2.push("color: " + r2 + ";"), i2.push("background-color: " + o2 + ";"), i2.push("font-family: " + this._terminal.options.fontFamily + ";"), i2.push("font-size: " + this._terminal.options.fontSize + "px;"), this._htmlContent += "";
- }
- _afterSerialize() {
- this._htmlContent += "
", this._htmlContent += "
";
- }
- _rowEnd(e3, t3) {
- this._htmlContent += "
" + this._currentRow + "
", this._currentRow = "";
- }
- _getHexColor(e3, t3) {
- const s2 = t3 ? e3.getFgColor() : e3.getBgColor();
- return (t3 ? e3.isFgRGB() : e3.isBgRGB()) ? "#" + [s2 >> 16 & 255, s2 >> 8 & 255, 255 & s2].map((e4) => this._padStart(e4.toString(16), 2, "0")).join("") : (t3 ? e3.isFgPalette() : e3.isBgPalette()) ? this._ansiColors[s2].css : void 0;
- }
- _diffStyle(e3, t3) {
- const s2 = [], r2 = !n(e3, t3), o2 = !l(e3, t3), i2 = !a(e3, t3);
- if (r2 || o2 || i2) {
- const t4 = this._getHexColor(e3, true);
- t4 && s2.push("color: " + t4 + ";");
- const r3 = this._getHexColor(e3, false);
- return r3 && s2.push("background-color: " + r3 + ";"), e3.isInverse() && s2.push("color: #000000; background-color: #BFBFBF;"), e3.isBold() && s2.push("font-weight: bold;"), e3.isUnderline() && e3.isOverline() ? s2.push("text-decoration: overline underline;") : e3.isUnderline() ? s2.push("text-decoration: underline;") : e3.isOverline() && s2.push("text-decoration: overline;"), e3.isBlink() && s2.push("text-decoration: blink;"), e3.isInvisible() && s2.push("visibility: hidden;"), e3.isItalic() && s2.push("font-style: italic;"), e3.isDim() && s2.push("opacity: 0.5;"), e3.isStrikethrough() && s2.push("text-decoration: line-through;"), s2;
- }
- }
- _nextCell(e3, t3, s2, r2) {
- if (0 === e3.getWidth()) return;
- const o2 = "" === e3.getChars(), i2 = this._diffStyle(e3, t3);
- i2 && (this._currentRow += 0 === i2.length ? "
" : ""), this._currentRow += o2 ? " " : e3.getChars();
- }
- _serializeString() {
- return this._htmlContent;
- }
- }
- e2.HTMLSerializeHandler = h;
- })(), r;
- })());
-})(addonSerialize$2, addonSerialize$2.exports);
-var addonSerializeExports = addonSerialize$2.exports;
-const addonSerialize$1 = /* @__PURE__ */ getDefaultExportFromCjs(addonSerializeExports);
-function useTerminalBuffer() {
- const serializeAddon = new addonSerializeExports.SerializeAddon();
- const terminal = markRaw(new xtermExports.Terminal({ convertEol: true }));
- const copyTo = /* @__PURE__ */ __name((destinationTerminal) => {
- destinationTerminal.write(serializeAddon.serialize());
- }, "copyTo");
- const write = /* @__PURE__ */ __name((message) => terminal.write(message), "write");
- const serialize = /* @__PURE__ */ __name(() => serializeAddon.serialize(), "serialize");
- onMounted(() => {
- terminal.loadAddon(serializeAddon);
- });
- onUnmounted(() => {
- terminal.dispose();
- });
- return {
- copyTo,
- serialize,
- write
- };
-}
-__name(useTerminalBuffer, "useTerminalBuffer");
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "TerminalOutputDrawer",
- props: /* @__PURE__ */ mergeModels({
- header: {},
- defaultMessage: {}
- }, {
- "modelValue": { type: Boolean, ...{ required: true } },
- "modelModifiers": {}
- }),
- emits: ["update:modelValue"],
- setup(__props) {
- const terminalVisible = useModel(__props, "modelValue");
- const props = __props;
- const electron = electronAPI();
- const buffer = useTerminalBuffer();
- let xterm = null;
- const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root2) => {
- xterm = terminal;
- useAutoSize({ root: root2, autoRows: true, autoCols: true });
- terminal.write(props.defaultMessage);
- buffer.copyTo(terminal);
- terminal.options.cursorBlink = false;
- terminal.options.cursorStyle = "bar";
- terminal.options.cursorInactiveStyle = "bar";
- terminal.options.disableStdin = true;
- }, "terminalCreated");
- const terminalUnmounted = /* @__PURE__ */ __name(() => {
- xterm = null;
- }, "terminalUnmounted");
- onMounted(async () => {
- electron.onLogMessage((message) => {
- buffer.write(message);
- xterm?.write(message);
- });
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script), {
- visible: terminalVisible.value,
- "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => terminalVisible.value = $event),
- header: _ctx.header,
- position: "bottom",
- style: { "height": "max(50vh, 34rem)" }
- }, {
- default: withCtx(() => [
- createVNode(BaseTerminal, {
- onCreated: terminalCreated,
- onUnmounted: terminalUnmounted
- })
- ]),
- _: 1
- }, 8, ["visible", "header"]);
- };
- }
-});
-export {
- _sfc_main as _,
- script as s
-};
-//# sourceMappingURL=TerminalOutputDrawer-CKr7Br7O.js.map
diff --git a/web/assets/UserSelectView-C703HOyO.js b/web/assets/UserSelectView-C703HOyO.js
deleted file mode 100644
index 6ada5034..00000000
--- a/web/assets/UserSelectView-C703HOyO.js
+++ /dev/null
@@ -1,101 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, ak as useUserStore, bi as useRouter, T as ref, c as computed, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, bj as withKeys, j as unref, bk as script, bl as script$1, bm as script$2, bn as script$3, a8 as createTextVNode, B as createCommentVNode, l as script$4 } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = {
- id: "comfy-user-selection",
- class: "min-w-84 relative rounded-lg bg-[var(--comfy-menu-bg)] p-5 px-10 shadow-lg"
-};
-const _hoisted_2 = { class: "flex w-full flex-col items-center" };
-const _hoisted_3 = { class: "flex w-full flex-col gap-2" };
-const _hoisted_4 = { for: "new-user-input" };
-const _hoisted_5 = { class: "flex w-full flex-col gap-2" };
-const _hoisted_6 = { for: "existing-user-select" };
-const _hoisted_7 = { class: "mt-5" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "UserSelectView",
- setup(__props) {
- const userStore = useUserStore();
- const router = useRouter();
- const selectedUser = ref(null);
- const newUsername = ref("");
- const loginError = ref("");
- const createNewUser = computed(() => newUsername.value.trim() !== "");
- const newUserExistsError = computed(() => {
- return userStore.users.find((user) => user.username === newUsername.value) ? `User "${newUsername.value}" already exists` : "";
- });
- const error = computed(() => newUserExistsError.value || loginError.value);
- const login = /* @__PURE__ */ __name(async () => {
- try {
- const user = createNewUser.value ? await userStore.createUser(newUsername.value) : selectedUser.value;
- if (!user) {
- throw new Error("No user selected");
- }
- userStore.login(user);
- router.push("/");
- } catch (err) {
- loginError.value = err.message ?? JSON.stringify(err);
- }
- }, "login");
- onMounted(async () => {
- if (!userStore.initialized) {
- await userStore.initialize();
- }
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("main", _hoisted_1, [
- _cache[2] || (_cache[2] = createBaseVNode("h1", { class: "my-2.5 mb-7 font-normal" }, "ComfyUI", -1)),
- createBaseVNode("div", _hoisted_2, [
- createBaseVNode("div", _hoisted_3, [
- createBaseVNode("label", _hoisted_4, toDisplayString(_ctx.$t("userSelect.newUser")) + ":", 1),
- createVNode(unref(script), {
- id: "new-user-input",
- modelValue: newUsername.value,
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newUsername.value = $event),
- placeholder: _ctx.$t("userSelect.enterUsername"),
- onKeyup: withKeys(login, ["enter"])
- }, null, 8, ["modelValue", "placeholder"])
- ]),
- createVNode(unref(script$1)),
- createBaseVNode("div", _hoisted_5, [
- createBaseVNode("label", _hoisted_6, toDisplayString(_ctx.$t("userSelect.existingUser")) + ":", 1),
- createVNode(unref(script$2), {
- modelValue: selectedUser.value,
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedUser.value = $event),
- class: "w-full",
- inputId: "existing-user-select",
- options: unref(userStore).users,
- "option-label": "username",
- placeholder: _ctx.$t("userSelect.selectUser"),
- disabled: createNewUser.value
- }, null, 8, ["modelValue", "options", "placeholder", "disabled"]),
- error.value ? (openBlock(), createBlock(unref(script$3), {
- key: 0,
- severity: "error"
- }, {
- default: withCtx(() => [
- createTextVNode(toDisplayString(error.value), 1)
- ]),
- _: 1
- })) : createCommentVNode("", true)
- ]),
- createBaseVNode("footer", _hoisted_7, [
- createVNode(unref(script$4), {
- label: _ctx.$t("userSelect.next"),
- onClick: login
- }, null, 8, ["label"])
- ])
- ])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-export {
- _sfc_main as default
-};
-//# sourceMappingURL=UserSelectView-C703HOyO.js.map
diff --git a/web/assets/WelcomeView-Brz3-luE.css b/web/assets/WelcomeView-Brz3-luE.css
deleted file mode 100644
index 522f3438..00000000
--- a/web/assets/WelcomeView-Brz3-luE.css
+++ /dev/null
@@ -1,36 +0,0 @@
-
-.animated-gradient-text[data-v-7dfaf74c] {
- font-weight: 700;
- font-size: clamp(2rem, 8vw, 4rem);
- background: linear-gradient(to right, #12c2e9, #c471ed, #f64f59, #12c2e9);
- background-size: 300% auto;
- background-clip: text;
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- animation: gradient-7dfaf74c 8s linear infinite;
-}
-.text-glow[data-v-7dfaf74c] {
- filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
-}
-@keyframes gradient-7dfaf74c {
-0% {
- background-position: 0% center;
-}
-100% {
- background-position: 300% center;
-}
-}
-.fade-in-up[data-v-7dfaf74c] {
- animation: fadeInUp-7dfaf74c 1.5s ease-out;
- animation-fill-mode: both;
-}
-@keyframes fadeInUp-7dfaf74c {
-0% {
- opacity: 0;
- transform: translateY(20px);
-}
-100% {
- opacity: 1;
- transform: translateY(0);
-}
-}
diff --git a/web/assets/WelcomeView-DIFvbWc2.js b/web/assets/WelcomeView-DIFvbWc2.js
deleted file mode 100644
index 93c67019..00000000
--- a/web/assets/WelcomeView-DIFvbWc2.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, bi as useRouter, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, _ as _export_sfc } from "./index-Bv0b06LE.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BTbuZf5t.js";
-const _hoisted_1 = { class: "flex flex-col items-center justify-center gap-8 p-8" };
-const _hoisted_2 = { class: "animated-gradient-text text-glow select-none" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "WelcomeView",
- setup(__props) {
- const router = useRouter();
- const navigateTo = /* @__PURE__ */ __name((path) => {
- router.push(path);
- }, "navigateTo");
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
- default: withCtx(() => [
- createBaseVNode("div", _hoisted_1, [
- createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("welcome.title")), 1),
- createVNode(unref(script), {
- label: _ctx.$t("welcome.getStarted"),
- icon: "pi pi-arrow-right",
- iconPos: "right",
- size: "large",
- rounded: "",
- onClick: _cache[0] || (_cache[0] = ($event) => navigateTo("/install")),
- class: "p-4 text-lg fade-in-up"
- }, null, 8, ["label"])
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const WelcomeView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7dfaf74c"]]);
-export {
- WelcomeView as default
-};
-//# sourceMappingURL=WelcomeView-DIFvbWc2.js.map
diff --git a/web/assets/images/Git-Logo-White.svg b/web/assets/images/Git-Logo-White.svg
deleted file mode 100644
index f2961b94..00000000
--- a/web/assets/images/Git-Logo-White.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/web/assets/images/apple-mps-logo.png b/web/assets/images/apple-mps-logo.png
deleted file mode 100644
index 261edbfd..00000000
Binary files a/web/assets/images/apple-mps-logo.png and /dev/null differ
diff --git a/web/assets/images/manual-configuration.svg b/web/assets/images/manual-configuration.svg
deleted file mode 100644
index bc90c647..00000000
--- a/web/assets/images/manual-configuration.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/web/assets/images/nvidia-logo.svg b/web/assets/images/nvidia-logo.svg
deleted file mode 100644
index 71f15b53..00000000
--- a/web/assets/images/nvidia-logo.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
\ No newline at end of file
diff --git a/web/assets/images/sad_girl.png b/web/assets/images/sad_girl.png
deleted file mode 100644
index 2b0925a6..00000000
Binary files a/web/assets/images/sad_girl.png and /dev/null differ
diff --git a/web/assets/index-A_bXPJCN.js b/web/assets/index-A_bXPJCN.js
deleted file mode 100644
index 8753d0e8..00000000
--- a/web/assets/index-A_bXPJCN.js
+++ /dev/null
@@ -1,618 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { bG as BaseStyle, bX as script$5, o as openBlock, f as createElementBlock, at as mergeProps, m as createBaseVNode, bH as script$6, cF as script$7, cG as script$8, cl as script$9, bO as Ripple, r as resolveDirective, y as createBlock, C as resolveDynamicComponent, F as Fragment, E as toDisplayString, cx as normalizeProps, i as withDirectives, B as createCommentVNode, dg as ToastEventBus, bZ as ZIndex, ci as isEmpty, c8 as setAttribute, ca as script$a, bR as resolveComponent, z as withCtx, k as createVNode, dh as TransitionGroup, D as renderList } from "./index-Bv0b06LE.js";
-function _typeof$2(o) {
- "@babel/helpers - typeof";
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$2(o);
-}
-__name(_typeof$2, "_typeof$2");
-function _defineProperty$2(e, r, t) {
- return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
-}
-__name(_defineProperty$2, "_defineProperty$2");
-function _toPropertyKey$2(t) {
- var i = _toPrimitive$2(t, "string");
- return "symbol" == _typeof$2(i) ? i : i + "";
-}
-__name(_toPropertyKey$2, "_toPropertyKey$2");
-function _toPrimitive$2(t, r) {
- if ("object" != _typeof$2(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof$2(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
-}
-__name(_toPrimitive$2, "_toPrimitive$2");
-var theme = /* @__PURE__ */ __name(function theme2(_ref) {
- var dt = _ref.dt;
- return "\n.p-toast {\n width: ".concat(dt("toast.width"), ";\n white-space: pre-line;\n word-break: break-word;\n}\n\n.p-toast-message {\n margin: 0 0 1rem 0;\n}\n\n.p-toast-message-icon {\n flex-shrink: 0;\n font-size: ").concat(dt("toast.icon.size"), ";\n width: ").concat(dt("toast.icon.size"), ";\n height: ").concat(dt("toast.icon.size"), ";\n}\n\n.p-toast-message-content {\n display: flex;\n align-items: flex-start;\n padding: ").concat(dt("toast.content.padding"), ";\n gap: ").concat(dt("toast.content.gap"), ";\n}\n\n.p-toast-message-text {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("toast.text.gap"), ";\n}\n\n.p-toast-summary {\n font-weight: ").concat(dt("toast.summary.font.weight"), ";\n font-size: ").concat(dt("toast.summary.font.size"), ";\n}\n\n.p-toast-detail {\n font-weight: ").concat(dt("toast.detail.font.weight"), ";\n font-size: ").concat(dt("toast.detail.font.size"), ";\n}\n\n.p-toast-close-button {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n background: transparent;\n transition: background ").concat(dt("toast.transition.duration"), ", color ").concat(dt("toast.transition.duration"), ", outline-color ").concat(dt("toast.transition.duration"), ", box-shadow ").concat(dt("toast.transition.duration"), ";\n outline-color: transparent;\n color: inherit;\n width: ").concat(dt("toast.close.button.width"), ";\n height: ").concat(dt("toast.close.button.height"), ";\n border-radius: ").concat(dt("toast.close.button.border.radius"), ";\n margin: -25% 0 0 0;\n right: -25%;\n padding: 0;\n border: none;\n user-select: none;\n}\n\n.p-toast-close-button:dir(rtl) {\n margin: -25% 0 0 auto;\n left: -25%;\n right: auto;\n}\n\n.p-toast-message-info,\n.p-toast-message-success,\n.p-toast-message-warn,\n.p-toast-message-error,\n.p-toast-message-secondary,\n.p-toast-message-contrast {\n border-width: ").concat(dt("toast.border.width"), ";\n border-style: solid;\n backdrop-filter: blur(").concat(dt("toast.blur"), ");\n border-radius: ").concat(dt("toast.border.radius"), ";\n}\n\n.p-toast-close-icon {\n font-size: ").concat(dt("toast.close.icon.size"), ";\n width: ").concat(dt("toast.close.icon.size"), ";\n height: ").concat(dt("toast.close.icon.size"), ";\n}\n\n.p-toast-close-button:focus-visible {\n outline-width: ").concat(dt("focus.ring.width"), ";\n outline-style: ").concat(dt("focus.ring.style"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-toast-message-info {\n background: ").concat(dt("toast.info.background"), ";\n border-color: ").concat(dt("toast.info.border.color"), ";\n color: ").concat(dt("toast.info.color"), ";\n box-shadow: ").concat(dt("toast.info.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-detail {\n color: ").concat(dt("toast.info.detail.color"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.info.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.info.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:hover {\n background: ").concat(dt("toast.info.close.button.hover.background"), ";\n}\n\n.p-toast-message-success {\n background: ").concat(dt("toast.success.background"), ";\n border-color: ").concat(dt("toast.success.border.color"), ";\n color: ").concat(dt("toast.success.color"), ";\n box-shadow: ").concat(dt("toast.success.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-detail {\n color: ").concat(dt("toast.success.detail.color"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.success.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.success.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:hover {\n background: ").concat(dt("toast.success.close.button.hover.background"), ";\n}\n\n.p-toast-message-warn {\n background: ").concat(dt("toast.warn.background"), ";\n border-color: ").concat(dt("toast.warn.border.color"), ";\n color: ").concat(dt("toast.warn.color"), ";\n box-shadow: ").concat(dt("toast.warn.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-detail {\n color: ").concat(dt("toast.warn.detail.color"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.warn.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.warn.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:hover {\n background: ").concat(dt("toast.warn.close.button.hover.background"), ";\n}\n\n.p-toast-message-error {\n background: ").concat(dt("toast.error.background"), ";\n border-color: ").concat(dt("toast.error.border.color"), ";\n color: ").concat(dt("toast.error.color"), ";\n box-shadow: ").concat(dt("toast.error.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-detail {\n color: ").concat(dt("toast.error.detail.color"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.error.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.error.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:hover {\n background: ").concat(dt("toast.error.close.button.hover.background"), ";\n}\n\n.p-toast-message-secondary {\n background: ").concat(dt("toast.secondary.background"), ";\n border-color: ").concat(dt("toast.secondary.border.color"), ";\n color: ").concat(dt("toast.secondary.color"), ";\n box-shadow: ").concat(dt("toast.secondary.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-detail {\n color: ").concat(dt("toast.secondary.detail.color"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.secondary.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.secondary.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:hover {\n background: ").concat(dt("toast.secondary.close.button.hover.background"), ";\n}\n\n.p-toast-message-contrast {\n background: ").concat(dt("toast.contrast.background"), ";\n border-color: ").concat(dt("toast.contrast.border.color"), ";\n color: ").concat(dt("toast.contrast.color"), ";\n box-shadow: ").concat(dt("toast.contrast.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-detail {\n color: ").concat(dt("toast.contrast.detail.color"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.contrast.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.contrast.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:hover {\n background: ").concat(dt("toast.contrast.close.button.hover.background"), ";\n}\n\n.p-toast-top-center {\n transform: translateX(-50%);\n}\n\n.p-toast-bottom-center {\n transform: translateX(-50%);\n}\n\n.p-toast-center {\n min-width: 20vw;\n transform: translate(-50%, -50%);\n}\n\n.p-toast-message-enter-from {\n opacity: 0;\n transform: translateY(50%);\n}\n\n.p-toast-message-leave-from {\n max-height: 1000px;\n}\n\n.p-toast .p-toast-message.p-toast-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin-bottom: 0;\n overflow: hidden;\n}\n\n.p-toast-message-enter-active {\n transition: transform 0.3s, opacity 0.3s;\n}\n\n.p-toast-message-leave-active {\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\n}\n");
-}, "theme");
-var inlineStyles = {
- root: /* @__PURE__ */ __name(function root(_ref2) {
- var position = _ref2.position;
- return {
- position: "fixed",
- top: position === "top-right" || position === "top-left" || position === "top-center" ? "20px" : position === "center" ? "50%" : null,
- right: (position === "top-right" || position === "bottom-right") && "20px",
- bottom: (position === "bottom-left" || position === "bottom-right" || position === "bottom-center") && "20px",
- left: position === "top-left" || position === "bottom-left" ? "20px" : position === "center" || position === "top-center" || position === "bottom-center" ? "50%" : null
- };
- }, "root")
-};
-var classes = {
- root: /* @__PURE__ */ __name(function root2(_ref3) {
- var props = _ref3.props;
- return ["p-toast p-component p-toast-" + props.position];
- }, "root"),
- message: /* @__PURE__ */ __name(function message(_ref4) {
- var props = _ref4.props;
- return ["p-toast-message", {
- "p-toast-message-info": props.message.severity === "info" || props.message.severity === void 0,
- "p-toast-message-warn": props.message.severity === "warn",
- "p-toast-message-error": props.message.severity === "error",
- "p-toast-message-success": props.message.severity === "success",
- "p-toast-message-secondary": props.message.severity === "secondary",
- "p-toast-message-contrast": props.message.severity === "contrast"
- }];
- }, "message"),
- messageContent: "p-toast-message-content",
- messageIcon: /* @__PURE__ */ __name(function messageIcon(_ref5) {
- var props = _ref5.props;
- return ["p-toast-message-icon", _defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({}, props.infoIcon, props.message.severity === "info"), props.warnIcon, props.message.severity === "warn"), props.errorIcon, props.message.severity === "error"), props.successIcon, props.message.severity === "success")];
- }, "messageIcon"),
- messageText: "p-toast-message-text",
- summary: "p-toast-summary",
- detail: "p-toast-detail",
- closeButton: "p-toast-close-button",
- closeIcon: "p-toast-close-icon"
-};
-var ToastStyle = BaseStyle.extend({
- name: "toast",
- theme,
- classes,
- inlineStyles
-});
-var script$4 = {
- name: "ExclamationTriangleIcon",
- "extends": script$5
-};
-function render$3(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- d: "M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",
- fill: "currentColor"
- }, null, -1), createBaseVNode("path", {
- d: "M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",
- fill: "currentColor"
- }, null, -1), createBaseVNode("path", {
- d: "M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$3, "render$3");
-script$4.render = render$3;
-var script$3 = {
- name: "InfoCircleIcon",
- "extends": script$5
-};
-function render$2(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- d: "M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",
- fill: "currentColor"
- }, null, -1)]), 16);
-}
-__name(render$2, "render$2");
-script$3.render = render$2;
-var script$2 = {
- name: "BaseToast",
- "extends": script$6,
- props: {
- group: {
- type: String,
- "default": null
- },
- position: {
- type: String,
- "default": "top-right"
- },
- autoZIndex: {
- type: Boolean,
- "default": true
- },
- baseZIndex: {
- type: Number,
- "default": 0
- },
- breakpoints: {
- type: Object,
- "default": null
- },
- closeIcon: {
- type: String,
- "default": void 0
- },
- infoIcon: {
- type: String,
- "default": void 0
- },
- warnIcon: {
- type: String,
- "default": void 0
- },
- errorIcon: {
- type: String,
- "default": void 0
- },
- successIcon: {
- type: String,
- "default": void 0
- },
- closeButtonProps: {
- type: null,
- "default": null
- }
- },
- style: ToastStyle,
- provide: /* @__PURE__ */ __name(function provide() {
- return {
- $pcToast: this,
- $parentInstance: this
- };
- }, "provide")
-};
-var script$1 = {
- name: "ToastMessage",
- hostName: "Toast",
- "extends": script$6,
- emits: ["close"],
- closeTimeout: null,
- props: {
- message: {
- type: null,
- "default": null
- },
- templates: {
- type: Object,
- "default": null
- },
- closeIcon: {
- type: String,
- "default": null
- },
- infoIcon: {
- type: String,
- "default": null
- },
- warnIcon: {
- type: String,
- "default": null
- },
- errorIcon: {
- type: String,
- "default": null
- },
- successIcon: {
- type: String,
- "default": null
- },
- closeButtonProps: {
- type: null,
- "default": null
- }
- },
- mounted: /* @__PURE__ */ __name(function mounted() {
- var _this = this;
- if (this.message.life) {
- this.closeTimeout = setTimeout(function() {
- _this.close({
- message: _this.message,
- type: "life-end"
- });
- }, this.message.life);
- }
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() {
- this.clearCloseTimeout();
- }, "beforeUnmount"),
- methods: {
- close: /* @__PURE__ */ __name(function close(params) {
- this.$emit("close", params);
- }, "close"),
- onCloseClick: /* @__PURE__ */ __name(function onCloseClick() {
- this.clearCloseTimeout();
- this.close({
- message: this.message,
- type: "close"
- });
- }, "onCloseClick"),
- clearCloseTimeout: /* @__PURE__ */ __name(function clearCloseTimeout() {
- if (this.closeTimeout) {
- clearTimeout(this.closeTimeout);
- this.closeTimeout = null;
- }
- }, "clearCloseTimeout")
- },
- computed: {
- iconComponent: /* @__PURE__ */ __name(function iconComponent() {
- return {
- info: !this.infoIcon && script$3,
- success: !this.successIcon && script$7,
- warn: !this.warnIcon && script$4,
- error: !this.errorIcon && script$8
- }[this.message.severity];
- }, "iconComponent"),
- closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() {
- return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0;
- }, "closeAriaLabel")
- },
- components: {
- TimesIcon: script$9,
- InfoCircleIcon: script$3,
- CheckIcon: script$7,
- ExclamationTriangleIcon: script$4,
- TimesCircleIcon: script$8
- },
- directives: {
- ripple: Ripple
- }
-};
-function _typeof$1(o) {
- "@babel/helpers - typeof";
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof$1(o);
-}
-__name(_typeof$1, "_typeof$1");
-function ownKeys$1(e, r) {
- var t = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t.push.apply(t, o);
- }
- return t;
-}
-__name(ownKeys$1, "ownKeys$1");
-function _objectSpread$1(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
- _defineProperty$1(e, r2, t[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
- });
- }
- return e;
-}
-__name(_objectSpread$1, "_objectSpread$1");
-function _defineProperty$1(e, r, t) {
- return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
-}
-__name(_defineProperty$1, "_defineProperty$1");
-function _toPropertyKey$1(t) {
- var i = _toPrimitive$1(t, "string");
- return "symbol" == _typeof$1(i) ? i : i + "";
-}
-__name(_toPropertyKey$1, "_toPropertyKey$1");
-function _toPrimitive$1(t, r) {
- if ("object" != _typeof$1(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof$1(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
-}
-__name(_toPrimitive$1, "_toPrimitive$1");
-var _hoisted_1 = ["aria-label"];
-function render$1(_ctx, _cache, $props, $setup, $data, $options) {
- var _directive_ripple = resolveDirective("ripple");
- return openBlock(), createElementBlock("div", mergeProps({
- "class": [_ctx.cx("message"), $props.message.styleClass],
- role: "alert",
- "aria-live": "assertive",
- "aria-atomic": "true"
- }, _ctx.ptm("message")), [$props.templates.container ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.container), {
- key: 0,
- message: $props.message,
- closeCallback: $options.onCloseClick
- }, null, 8, ["message", "closeCallback"])) : (openBlock(), createElementBlock("div", mergeProps({
- key: 1,
- "class": [_ctx.cx("messageContent"), $props.message.contentStyleClass]
- }, _ctx.ptm("messageContent")), [!$props.templates.message ? (openBlock(), createElementBlock(Fragment, {
- key: 0
- }, [(openBlock(), createBlock(resolveDynamicComponent($props.templates.messageicon ? $props.templates.messageicon : $props.templates.icon ? $props.templates.icon : $options.iconComponent && $options.iconComponent.name ? $options.iconComponent : "span"), mergeProps({
- "class": _ctx.cx("messageIcon")
- }, _ctx.ptm("messageIcon")), null, 16, ["class"])), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("messageText")
- }, _ctx.ptm("messageText")), [createBaseVNode("span", mergeProps({
- "class": _ctx.cx("summary")
- }, _ctx.ptm("summary")), toDisplayString($props.message.summary), 17), createBaseVNode("div", mergeProps({
- "class": _ctx.cx("detail")
- }, _ctx.ptm("detail")), toDisplayString($props.message.detail), 17)], 16)], 64)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.message), {
- key: 1,
- message: $props.message
- }, null, 8, ["message"])), $props.message.closable !== false ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({
- key: 2
- }, _ctx.ptm("buttonContainer"))), [withDirectives((openBlock(), createElementBlock("button", mergeProps({
- "class": _ctx.cx("closeButton"),
- type: "button",
- "aria-label": $options.closeAriaLabel,
- onClick: _cache[0] || (_cache[0] = function() {
- return $options.onCloseClick && $options.onCloseClick.apply($options, arguments);
- }),
- autofocus: ""
- }, _objectSpread$1(_objectSpread$1({}, $props.closeButtonProps), _ctx.ptm("closeButton"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.closeicon || "TimesIcon"), mergeProps({
- "class": [_ctx.cx("closeIcon"), $props.closeIcon]
- }, _ctx.ptm("closeIcon")), null, 16, ["class"]))], 16, _hoisted_1)), [[_directive_ripple]])], 16)) : createCommentVNode("", true)], 16))], 16);
-}
-__name(render$1, "render$1");
-script$1.render = render$1;
-function _toConsumableArray(r) {
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
-}
-__name(_toConsumableArray, "_toConsumableArray");
-function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-__name(_nonIterableSpread, "_nonIterableSpread");
-function _unsupportedIterableToArray(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
- }
-}
-__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
-function _iterableToArray(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
-}
-__name(_iterableToArray, "_iterableToArray");
-function _arrayWithoutHoles(r) {
- if (Array.isArray(r)) return _arrayLikeToArray(r);
-}
-__name(_arrayWithoutHoles, "_arrayWithoutHoles");
-function _arrayLikeToArray(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
-}
-__name(_arrayLikeToArray, "_arrayLikeToArray");
-var messageIdx = 0;
-var script = {
- name: "Toast",
- "extends": script$2,
- inheritAttrs: false,
- emits: ["close", "life-end"],
- data: /* @__PURE__ */ __name(function data() {
- return {
- messages: []
- };
- }, "data"),
- styleElement: null,
- mounted: /* @__PURE__ */ __name(function mounted2() {
- ToastEventBus.on("add", this.onAdd);
- ToastEventBus.on("remove", this.onRemove);
- ToastEventBus.on("remove-group", this.onRemoveGroup);
- ToastEventBus.on("remove-all-groups", this.onRemoveAllGroups);
- if (this.breakpoints) {
- this.createStyle();
- }
- }, "mounted"),
- beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() {
- this.destroyStyle();
- if (this.$refs.container && this.autoZIndex) {
- ZIndex.clear(this.$refs.container);
- }
- ToastEventBus.off("add", this.onAdd);
- ToastEventBus.off("remove", this.onRemove);
- ToastEventBus.off("remove-group", this.onRemoveGroup);
- ToastEventBus.off("remove-all-groups", this.onRemoveAllGroups);
- }, "beforeUnmount"),
- methods: {
- add: /* @__PURE__ */ __name(function add(message2) {
- if (message2.id == null) {
- message2.id = messageIdx++;
- }
- this.messages = [].concat(_toConsumableArray(this.messages), [message2]);
- }, "add"),
- remove: /* @__PURE__ */ __name(function remove(params) {
- var index = this.messages.findIndex(function(m) {
- return m.id === params.message.id;
- });
- if (index !== -1) {
- this.messages.splice(index, 1);
- this.$emit(params.type, {
- message: params.message
- });
- }
- }, "remove"),
- onAdd: /* @__PURE__ */ __name(function onAdd(message2) {
- if (this.group == message2.group) {
- this.add(message2);
- }
- }, "onAdd"),
- onRemove: /* @__PURE__ */ __name(function onRemove(message2) {
- this.remove({
- message: message2,
- type: "close"
- });
- }, "onRemove"),
- onRemoveGroup: /* @__PURE__ */ __name(function onRemoveGroup(group) {
- if (this.group === group) {
- this.messages = [];
- }
- }, "onRemoveGroup"),
- onRemoveAllGroups: /* @__PURE__ */ __name(function onRemoveAllGroups() {
- this.messages = [];
- }, "onRemoveAllGroups"),
- onEnter: /* @__PURE__ */ __name(function onEnter() {
- if (this.autoZIndex) {
- ZIndex.set("modal", this.$refs.container, this.baseZIndex || this.$primevue.config.zIndex.modal);
- }
- }, "onEnter"),
- onLeave: /* @__PURE__ */ __name(function onLeave() {
- var _this = this;
- if (this.$refs.container && this.autoZIndex && isEmpty(this.messages)) {
- setTimeout(function() {
- ZIndex.clear(_this.$refs.container);
- }, 200);
- }
- }, "onLeave"),
- createStyle: /* @__PURE__ */ __name(function createStyle() {
- if (!this.styleElement && !this.isUnstyled) {
- var _this$$primevue;
- this.styleElement = document.createElement("style");
- this.styleElement.type = "text/css";
- setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);
- document.head.appendChild(this.styleElement);
- var innerHTML = "";
- for (var breakpoint in this.breakpoints) {
- var breakpointStyle = "";
- for (var styleProp in this.breakpoints[breakpoint]) {
- breakpointStyle += styleProp + ":" + this.breakpoints[breakpoint][styleProp] + "!important;";
- }
- innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n .p-toast[").concat(this.$attrSelector, "] {\n ").concat(breakpointStyle, "\n }\n }\n ");
- }
- this.styleElement.innerHTML = innerHTML;
- }
- }, "createStyle"),
- destroyStyle: /* @__PURE__ */ __name(function destroyStyle() {
- if (this.styleElement) {
- document.head.removeChild(this.styleElement);
- this.styleElement = null;
- }
- }, "destroyStyle")
- },
- components: {
- ToastMessage: script$1,
- Portal: script$a
- }
-};
-function _typeof(o) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
- return typeof o2;
- } : function(o2) {
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
- }, _typeof(o);
-}
-__name(_typeof, "_typeof");
-function ownKeys(e, r) {
- var t = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function(r2) {
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
- })), t.push.apply(t, o);
- }
- return t;
-}
-__name(ownKeys, "ownKeys");
-function _objectSpread(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
- _defineProperty(e, r2, t[r2]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
- });
- }
- return e;
-}
-__name(_objectSpread, "_objectSpread");
-function _defineProperty(e, r, t) {
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
-}
-__name(_defineProperty, "_defineProperty");
-function _toPropertyKey(t) {
- var i = _toPrimitive(t, "string");
- return "symbol" == _typeof(i) ? i : i + "";
-}
-__name(_toPropertyKey, "_toPropertyKey");
-function _toPrimitive(t, r) {
- if ("object" != _typeof(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
-}
-__name(_toPrimitive, "_toPrimitive");
-function render(_ctx, _cache, $props, $setup, $data, $options) {
- var _component_ToastMessage = resolveComponent("ToastMessage");
- var _component_Portal = resolveComponent("Portal");
- return openBlock(), createBlock(_component_Portal, null, {
- "default": withCtx(function() {
- return [createBaseVNode("div", mergeProps({
- ref: "container",
- "class": _ctx.cx("root"),
- style: _ctx.sx("root", true, {
- position: _ctx.position
- })
- }, _ctx.ptmi("root")), [createVNode(TransitionGroup, mergeProps({
- name: "p-toast-message",
- tag: "div",
- onEnter: $options.onEnter,
- onLeave: $options.onLeave
- }, _objectSpread({}, _ctx.ptm("transition"))), {
- "default": withCtx(function() {
- return [(openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function(msg) {
- return openBlock(), createBlock(_component_ToastMessage, {
- key: msg.id,
- message: msg,
- templates: _ctx.$slots,
- closeIcon: _ctx.closeIcon,
- infoIcon: _ctx.infoIcon,
- warnIcon: _ctx.warnIcon,
- errorIcon: _ctx.errorIcon,
- successIcon: _ctx.successIcon,
- closeButtonProps: _ctx.closeButtonProps,
- unstyled: _ctx.unstyled,
- onClose: _cache[0] || (_cache[0] = function($event) {
- return $options.remove($event);
- }),
- pt: _ctx.pt
- }, null, 8, ["message", "templates", "closeIcon", "infoIcon", "warnIcon", "errorIcon", "successIcon", "closeButtonProps", "unstyled", "pt"]);
- }), 128))];
- }),
- _: 1
- }, 16, ["onEnter", "onLeave"])], 16)];
- }),
- _: 1
- });
-}
-__name(render, "render");
-script.render = render;
-export {
- script$3 as a,
- script$4 as b,
- script as s
-};
-//# sourceMappingURL=index-A_bXPJCN.js.map
diff --git a/web/assets/index-B36GcHVN.js b/web/assets/index-B36GcHVN.js
deleted file mode 100644
index 3aed3257..00000000
--- a/web/assets/index-B36GcHVN.js
+++ /dev/null
@@ -1,54182 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { di as ComfyDialog, dj as $el, dk as ComfyApp, h as app, L as LiteGraph, aD as LGraphCanvas, dl as useExtensionService, dm as processDynamicPrompt, b8 as isElectron, b9 as electronAPI, b as useWorkflowStore, by as checkMirrorReachable, bb as useDialogService, bg as t, dn as DraggableList, aW as useToastStore, $ as LGraphNode, dp as applyTextReplacements, dq as ComfyWidgets, dr as addValueControlWidgets, O as useNodeDefStore, a as useSettingStore, ds as serialise, dt as deserialiseAndCreate, aL as api, Z as LGraphGroup, d as defineComponent, T as ref, p as onMounted, d8 as onUnmounted, r as resolveDirective, o as openBlock, f as createElementBlock, k as createVNode, j as unref, l as script, z as withCtx, i as withDirectives, m as createBaseVNode, y as createBlock, aj as normalizeClass, du as script$1, v as vShow, B as createCommentVNode, dv as createApp, cs as Tooltip, N as watch, bm as script$2, dw as PrimeVue, V as nextTick, b4 as lodashExports, aO as setStorageValue, aM as getStorageValue } from "./index-Bv0b06LE.js";
-import { P as PYTHON_MIRROR } from "./uvMirrors-B-HKMf6X.js";
-class ClipspaceDialog extends ComfyDialog {
- static {
- __name(this, "ClipspaceDialog");
- }
- static items = [];
- static instance = null;
- static registerButton(name, contextPredicate, callback) {
- const item = $el("button", {
- type: "button",
- textContent: name,
- contextPredicate,
- onclick: callback
- });
- ClipspaceDialog.items.push(item);
- }
- static invalidatePreview() {
- if (ComfyApp.clipspace && ComfyApp.clipspace.imgs && ComfyApp.clipspace.imgs.length > 0) {
- const img_preview = document.getElementById(
- "clipspace_preview"
- );
- if (img_preview) {
- img_preview.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src;
- img_preview.style.maxHeight = "100%";
- img_preview.style.maxWidth = "100%";
- }
- }
- }
- static invalidate() {
- if (ClipspaceDialog.instance) {
- const self2 = ClipspaceDialog.instance;
- const children = $el("div.comfy-modal-content", [
- self2.createImgSettings(),
- ...self2.createButtons()
- ]);
- if (self2.element) {
- if (self2.element.firstChild) {
- self2.element.removeChild(self2.element.firstChild);
- }
- self2.element.appendChild(children);
- } else {
- self2.element = $el("div.comfy-modal", { parent: document.body }, [
- children
- ]);
- }
- if (self2.element.children[0].children.length <= 1) {
- self2.element.children[0].appendChild(
- $el("p", {}, [
- "Unable to find the features to edit content of a format stored in the current Clipspace."
- ])
- );
- }
- ClipspaceDialog.invalidatePreview();
- }
- }
- constructor() {
- super();
- }
- createButtons() {
- const buttons = [];
- for (let idx in ClipspaceDialog.items) {
- const item = ClipspaceDialog.items[idx];
- if (!item.contextPredicate || item.contextPredicate())
- buttons.push(ClipspaceDialog.items[idx]);
- }
- buttons.push(
- $el("button", {
- type: "button",
- textContent: "Close",
- onclick: /* @__PURE__ */ __name(() => {
- this.close();
- }, "onclick")
- })
- );
- return buttons;
- }
- createImgSettings() {
- if (ComfyApp.clipspace?.imgs) {
- const combo_items = [];
- const imgs = ComfyApp.clipspace.imgs;
- for (let i = 0; i < imgs.length; i++) {
- combo_items.push($el("option", { value: i }, [`${i}`]));
- }
- const combo1 = $el(
- "select",
- {
- id: "clipspace_img_selector",
- onchange: /* @__PURE__ */ __name((event) => {
- if (event.target && ComfyApp.clipspace) {
- ComfyApp.clipspace["selectedIndex"] = event.target.selectedIndex;
- ClipspaceDialog.invalidatePreview();
- }
- }, "onchange")
- },
- combo_items
- );
- const row1 = $el("tr", {}, [
- $el("td", {}, [$el("font", { color: "white" }, ["Select Image"])]),
- $el("td", {}, [combo1])
- ]);
- const combo2 = $el(
- "select",
- {
- id: "clipspace_img_paste_mode",
- onchange: /* @__PURE__ */ __name((event) => {
- if (event.target && ComfyApp.clipspace) {
- ComfyApp.clipspace["img_paste_mode"] = event.target.value;
- }
- }, "onchange")
- },
- [
- $el("option", { value: "selected" }, "selected"),
- $el("option", { value: "all" }, "all")
- ]
- );
- combo2.value = ComfyApp.clipspace["img_paste_mode"];
- const row2 = $el("tr", {}, [
- $el("td", {}, [$el("font", { color: "white" }, ["Paste Mode"])]),
- $el("td", {}, [combo2])
- ]);
- const td2 = $el(
- "td",
- { align: "center", width: "100px", height: "100px", colSpan: "2" },
- [$el("img", { id: "clipspace_preview", ondragstart: /* @__PURE__ */ __name(() => false, "ondragstart") }, [])]
- );
- const row3 = $el("tr", {}, [td2]);
- return $el("table", {}, [row1, row2, row3]);
- } else {
- return [];
- }
- }
- createImgPreview() {
- if (ComfyApp.clipspace?.imgs) {
- return $el("img", { id: "clipspace_preview", ondragstart: /* @__PURE__ */ __name(() => false, "ondragstart") });
- } else return [];
- }
- show() {
- const img_preview = document.getElementById("clipspace_preview");
- ClipspaceDialog.invalidate();
- this.element.style.display = "block";
- }
-}
-app.registerExtension({
- name: "Comfy.Clipspace",
- init(app2) {
- app2.openClipspace = function() {
- if (!ClipspaceDialog.instance) {
- ClipspaceDialog.instance = new ClipspaceDialog();
- ComfyApp.clipspace_invalidate_handler = ClipspaceDialog.invalidate;
- }
- if (ComfyApp.clipspace) {
- ClipspaceDialog.instance.show();
- } else app2.ui.dialog.show("Clipspace is Empty!");
- };
- }
-});
-window.comfyAPI = window.comfyAPI || {};
-window.comfyAPI.clipspace = window.comfyAPI.clipspace || {};
-window.comfyAPI.clipspace.ClipspaceDialog = ClipspaceDialog;
-const ext$1 = {
- name: "Comfy.ContextMenuFilter",
- init() {
- const ctxMenu = LiteGraph.ContextMenu;
- LiteGraph.ContextMenu = function(values, options) {
- const ctx = new ctxMenu(values, options);
- if (options?.className === "dark" && values?.length > 4) {
- const filter = document.createElement("input");
- filter.classList.add("comfy-context-menu-filter");
- filter.placeholder = "Filter list";
- ctx.root.prepend(filter);
- const items = Array.from(
- ctx.root.querySelectorAll(".litemenu-entry")
- );
- let displayedItems = [...items];
- let itemCount = displayedItems.length;
- requestAnimationFrame(() => {
- const currentNode = LGraphCanvas.active_canvas.current_node;
- const clickedComboValue = currentNode?.widgets?.filter(
- (w) => w.type === "combo" && w.options.values?.length === values.length
- ).find(
- (w) => w.options.values?.every((v, i) => v === values[i])
- )?.value;
- let selectedIndex = clickedComboValue ? values.findIndex((v) => v === clickedComboValue) : 0;
- if (selectedIndex < 0) {
- selectedIndex = 0;
- }
- let selectedItem = displayedItems[selectedIndex];
- updateSelected();
- function updateSelected() {
- selectedItem?.style.setProperty("background-color", "");
- selectedItem?.style.setProperty("color", "");
- selectedItem = displayedItems[selectedIndex];
- selectedItem?.style.setProperty(
- "background-color",
- "#ccc",
- "important"
- );
- selectedItem?.style.setProperty("color", "#000", "important");
- }
- __name(updateSelected, "updateSelected");
- const positionList = /* @__PURE__ */ __name(() => {
- const rect = ctx.root.getBoundingClientRect();
- if (rect.top < 0) {
- const scale = 1 - ctx.root.getBoundingClientRect().height / ctx.root.clientHeight;
- const shift = ctx.root.clientHeight * scale / 2;
- ctx.root.style.top = -shift + "px";
- }
- }, "positionList");
- filter.addEventListener("keydown", (event) => {
- switch (event.key) {
- case "ArrowUp":
- event.preventDefault();
- if (selectedIndex === 0) {
- selectedIndex = itemCount - 1;
- } else {
- selectedIndex--;
- }
- updateSelected();
- break;
- case "ArrowRight":
- event.preventDefault();
- selectedIndex = itemCount - 1;
- updateSelected();
- break;
- case "ArrowDown":
- event.preventDefault();
- if (selectedIndex === itemCount - 1) {
- selectedIndex = 0;
- } else {
- selectedIndex++;
- }
- updateSelected();
- break;
- case "ArrowLeft":
- event.preventDefault();
- selectedIndex = 0;
- updateSelected();
- break;
- case "Enter":
- selectedItem?.click();
- break;
- case "Escape":
- ctx.close();
- break;
- }
- });
- filter.addEventListener("input", () => {
- const term = filter.value.toLocaleLowerCase();
- displayedItems = items.filter((item) => {
- const isVisible = !term || item.textContent?.toLocaleLowerCase().includes(term);
- item.style.display = isVisible ? "block" : "none";
- return isVisible;
- });
- selectedIndex = 0;
- if (displayedItems.includes(selectedItem)) {
- selectedIndex = displayedItems.findIndex(
- (d) => d === selectedItem
- );
- }
- itemCount = displayedItems.length;
- updateSelected();
- if (options.event) {
- let top = options.event.clientY - 10;
- const bodyRect = document.body.getBoundingClientRect();
- const rootRect = ctx.root.getBoundingClientRect();
- if (bodyRect.height && top > bodyRect.height - rootRect.height - 10) {
- top = Math.max(0, bodyRect.height - rootRect.height - 10);
- }
- ctx.root.style.top = top + "px";
- positionList();
- }
- });
- requestAnimationFrame(() => {
- filter.focus();
- positionList();
- });
- });
- }
- return ctx;
- };
- LiteGraph.ContextMenu.prototype = ctxMenu.prototype;
- }
-};
-app.registerExtension(ext$1);
-useExtensionService().registerExtension({
- name: "Comfy.DynamicPrompts",
- nodeCreated(node) {
- if (node.widgets) {
- const widgets = node.widgets.filter((w) => w.dynamicPrompts);
- for (const widget of widgets) {
- widget.serializeValue = (workflowNode, widgetIndex) => {
- if (typeof widget.value !== "string") return widget.value;
- const prompt = processDynamicPrompt(widget.value);
- if (workflowNode?.widgets_values)
- workflowNode.widgets_values[widgetIndex] = prompt;
- return prompt;
- };
- }
- }
- }
-});
-app.registerExtension({
- name: "Comfy.EditAttention",
- init() {
- const editAttentionDelta = app.ui.settings.addSetting({
- id: "Comfy.EditAttention.Delta",
- category: ["Comfy", "EditTokenWeight", "Delta"],
- name: "Ctrl+up/down precision",
- type: "slider",
- attrs: {
- min: 0.01,
- max: 0.5,
- step: 0.01
- },
- defaultValue: 0.05
- });
- function incrementWeight(weight, delta) {
- const floatWeight = parseFloat(weight);
- if (isNaN(floatWeight)) return weight;
- const newWeight = floatWeight + delta;
- return String(Number(newWeight.toFixed(10)));
- }
- __name(incrementWeight, "incrementWeight");
- function findNearestEnclosure(text, cursorPos) {
- let start = cursorPos, end = cursorPos;
- let openCount = 0, closeCount = 0;
- while (start >= 0) {
- start--;
- if (text[start] === "(" && openCount === closeCount) break;
- if (text[start] === "(") openCount++;
- if (text[start] === ")") closeCount++;
- }
- if (start < 0) return null;
- openCount = 0;
- closeCount = 0;
- while (end < text.length) {
- if (text[end] === ")" && openCount === closeCount) break;
- if (text[end] === "(") openCount++;
- if (text[end] === ")") closeCount++;
- end++;
- }
- if (end === text.length) return null;
- return { start: start + 1, end };
- }
- __name(findNearestEnclosure, "findNearestEnclosure");
- function addWeightToParentheses(text) {
- const parenRegex = /^\((.*)\)$/;
- const parenMatch = text.match(parenRegex);
- const floatRegex = /:([+-]?(\d*\.)?\d+([eE][+-]?\d+)?)/;
- const floatMatch = text.match(floatRegex);
- if (parenMatch && !floatMatch) {
- return `(${parenMatch[1]}:1.0)`;
- } else {
- return text;
- }
- }
- __name(addWeightToParentheses, "addWeightToParentheses");
- function editAttention(event) {
- const inputField = event.composedPath()[0];
- const delta = parseFloat(editAttentionDelta.value);
- if (inputField.tagName !== "TEXTAREA") return;
- if (!(event.key === "ArrowUp" || event.key === "ArrowDown")) return;
- if (!event.ctrlKey && !event.metaKey) return;
- event.preventDefault();
- let start = inputField.selectionStart;
- let end = inputField.selectionEnd;
- let selectedText = inputField.value.substring(start, end);
- if (!selectedText) {
- const nearestEnclosure = findNearestEnclosure(inputField.value, start);
- if (nearestEnclosure) {
- start = nearestEnclosure.start;
- end = nearestEnclosure.end;
- selectedText = inputField.value.substring(start, end);
- } else {
- const delimiters = " .,\\/!?%^*;:{}=-_`~()\r\n ";
- while (!delimiters.includes(inputField.value[start - 1]) && start > 0) {
- start--;
- }
- while (!delimiters.includes(inputField.value[end]) && end < inputField.value.length) {
- end++;
- }
- selectedText = inputField.value.substring(start, end);
- if (!selectedText) return;
- }
- }
- if (selectedText[selectedText.length - 1] === " ") {
- selectedText = selectedText.substring(0, selectedText.length - 1);
- end -= 1;
- }
- if (inputField.value[start - 1] === "(" && inputField.value[end] === ")") {
- start -= 1;
- end += 1;
- selectedText = inputField.value.substring(start, end);
- }
- if (selectedText[0] !== "(" || selectedText[selectedText.length - 1] !== ")") {
- selectedText = `(${selectedText})`;
- }
- selectedText = addWeightToParentheses(selectedText);
- const weightDelta = event.key === "ArrowUp" ? delta : -delta;
- const updatedText = selectedText.replace(
- /\((.*):([+-]?\d+(?:\.\d+)?)\)/,
- (match, text, weight) => {
- weight = incrementWeight(weight, weightDelta);
- if (weight == 1) {
- return text;
- } else {
- return `(${text}:${weight})`;
- }
- }
- );
- inputField.setSelectionRange(start, end);
- document.execCommand("insertText", false, updatedText);
- inputField.setSelectionRange(start, start + updatedText.length);
- }
- __name(editAttention, "editAttention");
- window.addEventListener("keydown", editAttention);
- }
-});
-(async () => {
- if (!isElectron()) return;
- const electronAPI$1 = electronAPI();
- const desktopAppVersion = await electronAPI$1.getElectronVersion();
- const workflowStore = useWorkflowStore();
- const onChangeRestartApp = /* @__PURE__ */ __name((newValue, oldValue) => {
- if (oldValue !== void 0 && newValue !== oldValue) {
- electronAPI$1.restartApp("Restart ComfyUI to apply changes.", 1500);
- }
- }, "onChangeRestartApp");
- app.registerExtension({
- name: "Comfy.ElectronAdapter",
- settings: [
- {
- id: "Comfy-Desktop.AutoUpdate",
- category: ["Comfy-Desktop", "General", "AutoUpdate"],
- name: "Automatically check for updates",
- type: "boolean",
- defaultValue: true,
- onChange: onChangeRestartApp
- },
- {
- id: "Comfy-Desktop.SendStatistics",
- category: ["Comfy-Desktop", "General", "Send Statistics"],
- name: "Send anonymous usage metrics",
- type: "boolean",
- defaultValue: true,
- onChange: onChangeRestartApp
- },
- {
- id: "Comfy-Desktop.WindowStyle",
- category: ["Comfy-Desktop", "General", "Window Style"],
- name: "Window Style",
- tooltip: "Custom: Replace the system title bar with ComfyUI's Top menu",
- type: "combo",
- experimental: true,
- defaultValue: "default",
- options: ["default", "custom"],
- onChange: /* @__PURE__ */ __name((newValue, oldValue) => {
- if (!oldValue) return;
- electronAPI$1.Config.setWindowStyle(newValue);
- }, "onChange")
- },
- {
- id: "Comfy-Desktop.UV.PythonInstallMirror",
- name: "Python Install Mirror",
- tooltip: `Managed Python installations are downloaded from the Astral python-build-standalone project. This variable can be set to a mirror URL to use a different source for Python installations. The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Distributions can be read from a local directory by using the file:// URL scheme.`,
- type: "url",
- defaultValue: "",
- attrs: {
- validateUrlFn(mirror) {
- return checkMirrorReachable(
- mirror + PYTHON_MIRROR.validationPathSuffix
- );
- }
- }
- },
- {
- id: "Comfy-Desktop.UV.PypiInstallMirror",
- name: "Pypi Install Mirror",
- tooltip: `Default pip install mirror`,
- type: "url",
- defaultValue: "",
- attrs: {
- validateUrlFn: checkMirrorReachable
- }
- },
- {
- id: "Comfy-Desktop.UV.TorchInstallMirror",
- name: "Torch Install Mirror",
- tooltip: `Pip install mirror for pytorch`,
- type: "url",
- defaultValue: "",
- attrs: {
- validateUrlFn: checkMirrorReachable
- }
- }
- ],
- commands: [
- {
- id: "Comfy-Desktop.Folders.OpenLogsFolder",
- label: "Open Logs Folder",
- icon: "pi pi-folder-open",
- function() {
- electronAPI$1.openLogsFolder();
- }
- },
- {
- id: "Comfy-Desktop.Folders.OpenModelsFolder",
- label: "Open Models Folder",
- icon: "pi pi-folder-open",
- function() {
- electronAPI$1.openModelsFolder();
- }
- },
- {
- id: "Comfy-Desktop.Folders.OpenOutputsFolder",
- label: "Open Outputs Folder",
- icon: "pi pi-folder-open",
- function() {
- electronAPI$1.openOutputsFolder();
- }
- },
- {
- id: "Comfy-Desktop.Folders.OpenInputsFolder",
- label: "Open Inputs Folder",
- icon: "pi pi-folder-open",
- function() {
- electronAPI$1.openInputsFolder();
- }
- },
- {
- id: "Comfy-Desktop.Folders.OpenCustomNodesFolder",
- label: "Open Custom Nodes Folder",
- icon: "pi pi-folder-open",
- function() {
- electronAPI$1.openCustomNodesFolder();
- }
- },
- {
- id: "Comfy-Desktop.Folders.OpenModelConfig",
- label: "Open extra_model_paths.yaml",
- icon: "pi pi-file",
- function() {
- electronAPI$1.openModelConfig();
- }
- },
- {
- id: "Comfy-Desktop.OpenDevTools",
- label: "Open DevTools",
- icon: "pi pi-code",
- function() {
- electronAPI$1.openDevTools();
- }
- },
- {
- id: "Comfy-Desktop.OpenUserGuide",
- label: "Desktop User Guide",
- icon: "pi pi-book",
- function() {
- window.open("https://comfyorg.notion.site/", "_blank");
- }
- },
- {
- id: "Comfy-Desktop.Reinstall",
- label: "Reinstall",
- icon: "pi pi-refresh",
- async function() {
- const proceed = await useDialogService().confirm({
- message: t("desktopMenu.confirmReinstall"),
- title: t("desktopMenu.reinstall"),
- type: "reinstall"
- });
- if (proceed) electronAPI$1.reinstall();
- }
- },
- {
- id: "Comfy-Desktop.Restart",
- label: "Restart",
- icon: "pi pi-refresh",
- function() {
- electronAPI$1.restartApp();
- }
- },
- {
- id: "Comfy-Desktop.Quit",
- label: "Quit",
- icon: "pi pi-sign-out",
- async function() {
- if (workflowStore.modifiedWorkflows.length > 0) {
- const confirmed = await useDialogService().confirm({
- message: t("desktopMenu.confirmQuit"),
- title: t("desktopMenu.quit"),
- type: "default"
- });
- if (!confirmed) return;
- }
- electronAPI$1.quit();
- }
- }
- ],
- menuCommands: [
- {
- path: ["Help"],
- commands: ["Comfy-Desktop.OpenUserGuide"]
- },
- {
- path: ["Help"],
- commands: ["Comfy-Desktop.OpenDevTools"]
- },
- {
- path: ["Help", "Open Folder"],
- commands: [
- "Comfy-Desktop.Folders.OpenLogsFolder",
- "Comfy-Desktop.Folders.OpenModelsFolder",
- "Comfy-Desktop.Folders.OpenOutputsFolder",
- "Comfy-Desktop.Folders.OpenInputsFolder",
- "Comfy-Desktop.Folders.OpenCustomNodesFolder",
- "Comfy-Desktop.Folders.OpenModelConfig"
- ]
- },
- {
- path: ["Help"],
- commands: ["Comfy-Desktop.Reinstall"]
- }
- ],
- keybindings: [
- {
- commandId: "Workspace.CloseWorkflow",
- combo: {
- key: "w",
- ctrl: true
- }
- }
- ],
- aboutPageBadges: [
- {
- label: "ComfyUI_desktop v" + desktopAppVersion,
- url: "https://github.com/Comfy-Org/electron",
- icon: "pi pi-github"
- }
- ]
- });
-})();
-const ORDER = Symbol();
-const PREFIX$1 = "workflow";
-const SEPARATOR$1 = ">";
-function merge(target, source) {
- if (typeof target === "object" && typeof source === "object") {
- for (const key in source) {
- const sv = source[key];
- if (typeof sv === "object") {
- let tv = target[key];
- if (!tv) tv = target[key] = {};
- merge(tv, source[key]);
- } else {
- target[key] = sv;
- }
- }
- }
- return target;
-}
-__name(merge, "merge");
-class ManageGroupDialog extends ComfyDialog {
- static {
- __name(this, "ManageGroupDialog");
- }
- tabs;
- selectedNodeIndex;
- selectedTab = "Inputs";
- selectedGroup;
- modifications = {};
- nodeItems;
- app;
- groupNodeType;
- groupNodeDef;
- groupData;
- innerNodesList;
- widgetsPage;
- inputsPage;
- outputsPage;
- draggable;
- get selectedNodeInnerIndex() {
- return +this.nodeItems[this.selectedNodeIndex].dataset.nodeindex;
- }
- constructor(app2) {
- super();
- this.app = app2;
- this.element = $el("dialog.comfy-group-manage", {
- parent: document.body
- });
- }
- changeTab(tab) {
- this.tabs[this.selectedTab].tab.classList.remove("active");
- this.tabs[this.selectedTab].page.classList.remove("active");
- this.tabs[tab].tab.classList.add("active");
- this.tabs[tab].page.classList.add("active");
- this.selectedTab = tab;
- }
- changeNode(index, force) {
- if (!force && this.selectedNodeIndex === index) return;
- if (this.selectedNodeIndex != null) {
- this.nodeItems[this.selectedNodeIndex].classList.remove("selected");
- }
- this.nodeItems[index].classList.add("selected");
- this.selectedNodeIndex = index;
- if (!this.buildInputsPage() && this.selectedTab === "Inputs") {
- this.changeTab("Widgets");
- }
- if (!this.buildWidgetsPage() && this.selectedTab === "Widgets") {
- this.changeTab("Outputs");
- }
- if (!this.buildOutputsPage() && this.selectedTab === "Outputs") {
- this.changeTab("Inputs");
- }
- this.changeTab(this.selectedTab);
- }
- getGroupData() {
- this.groupNodeType = LiteGraph.registered_node_types[`${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup];
- this.groupNodeDef = this.groupNodeType.nodeData;
- this.groupData = GroupNodeHandler.getGroupData(this.groupNodeType);
- }
- changeGroup(group, reset = true) {
- this.selectedGroup = group;
- this.getGroupData();
- const nodes = this.groupData.nodeData.nodes;
- this.nodeItems = nodes.map(
- (n, i) => $el(
- "li.draggable-item",
- {
- dataset: {
- nodeindex: n.index + ""
- },
- onclick: /* @__PURE__ */ __name(() => {
- this.changeNode(i);
- }, "onclick")
- },
- [
- $el("span.drag-handle"),
- $el(
- "div",
- {
- textContent: n.title ?? n.type
- },
- n.title ? $el("span", {
- textContent: n.type
- }) : []
- )
- ]
- )
- );
- this.innerNodesList.replaceChildren(...this.nodeItems);
- if (reset) {
- this.selectedNodeIndex = null;
- this.changeNode(0);
- } else {
- const items = this.draggable.getAllItems();
- let index = items.findIndex((item) => item.classList.contains("selected"));
- if (index === -1) index = this.selectedNodeIndex;
- this.changeNode(index, true);
- }
- const ordered = [...nodes];
- this.draggable?.dispose();
- this.draggable = new DraggableList(this.innerNodesList, "li");
- this.draggable.addEventListener(
- "dragend",
- ({ detail: { oldPosition, newPosition } }) => {
- if (oldPosition === newPosition) return;
- ordered.splice(newPosition, 0, ordered.splice(oldPosition, 1)[0]);
- for (let i = 0; i < ordered.length; i++) {
- this.storeModification({
- nodeIndex: ordered[i].index,
- section: ORDER,
- prop: "order",
- value: i
- });
- }
- }
- );
- }
- storeModification(props) {
- const { nodeIndex, section, prop, value } = props;
- const groupMod = this.modifications[this.selectedGroup] ??= {};
- const nodesMod = groupMod.nodes ??= {};
- const nodeMod = nodesMod[nodeIndex ?? this.selectedNodeInnerIndex] ??= {};
- const typeMod = nodeMod[section] ??= {};
- if (typeof value === "object") {
- const objMod = typeMod[prop] ??= {};
- Object.assign(objMod, value);
- } else {
- typeMod[prop] = value;
- }
- }
- getEditElement(section, prop, value, placeholder, checked, checkable = true) {
- if (value === placeholder) value = "";
- const mods = this.modifications[this.selectedGroup]?.nodes?.[this.selectedNodeInnerIndex]?.[section]?.[prop];
- if (mods) {
- if (mods.name != null) {
- value = mods.name;
- }
- if (mods.visible != null) {
- checked = mods.visible;
- }
- }
- return $el("div", [
- $el("input", {
- value,
- placeholder,
- type: "text",
- onchange: /* @__PURE__ */ __name((e) => {
- this.storeModification({
- section,
- prop,
- value: { name: e.target.value }
- });
- }, "onchange")
- }),
- $el("label", { textContent: "Visible" }, [
- $el("input", {
- type: "checkbox",
- checked,
- disabled: !checkable,
- onchange: /* @__PURE__ */ __name((e) => {
- this.storeModification({
- section,
- prop,
- value: { visible: !!e.target.checked }
- });
- }, "onchange")
- })
- ])
- ]);
- }
- buildWidgetsPage() {
- const widgets = this.groupData.oldToNewWidgetMap[this.selectedNodeInnerIndex];
- const items = Object.keys(widgets ?? {});
- const type = app.graph.extra.groupNodes[this.selectedGroup];
- const config = type.config?.[this.selectedNodeInnerIndex]?.input;
- this.widgetsPage.replaceChildren(
- ...items.map((oldName) => {
- return this.getEditElement(
- "input",
- oldName,
- widgets[oldName],
- oldName,
- config?.[oldName]?.visible !== false
- );
- })
- );
- return !!items.length;
- }
- buildInputsPage() {
- const inputs = this.groupData.nodeInputs[this.selectedNodeInnerIndex];
- const items = Object.keys(inputs ?? {});
- const type = app.graph.extra.groupNodes[this.selectedGroup];
- const config = type.config?.[this.selectedNodeInnerIndex]?.input;
- this.inputsPage.replaceChildren(
- ...items.map((oldName) => {
- let value = inputs[oldName];
- if (!value) {
- return;
- }
- return this.getEditElement(
- "input",
- oldName,
- value,
- oldName,
- config?.[oldName]?.visible !== false
- );
- }).filter(Boolean)
- );
- return !!items.length;
- }
- buildOutputsPage() {
- const nodes = this.groupData.nodeData.nodes;
- const innerNodeDef = this.groupData.getNodeDef(
- nodes[this.selectedNodeInnerIndex]
- );
- const outputs = innerNodeDef?.output ?? [];
- const groupOutputs = this.groupData.oldToNewOutputMap[this.selectedNodeInnerIndex];
- const type = app.graph.extra.groupNodes[this.selectedGroup];
- const config = type.config?.[this.selectedNodeInnerIndex]?.output;
- const node = this.groupData.nodeData.nodes[this.selectedNodeInnerIndex];
- const checkable = node.type !== "PrimitiveNode";
- this.outputsPage.replaceChildren(
- ...outputs.map((type2, slot) => {
- const groupOutputIndex = groupOutputs?.[slot];
- const oldName = innerNodeDef.output_name?.[slot] ?? type2;
- let value = config?.[slot]?.name;
- const visible = config?.[slot]?.visible || groupOutputIndex != null;
- if (!value || value === oldName) {
- value = "";
- }
- return this.getEditElement(
- "output",
- slot,
- value,
- oldName,
- visible,
- checkable
- );
- }).filter(Boolean)
- );
- return !!outputs.length;
- }
- show(type) {
- const groupNodes = Object.keys(app.graph.extra?.groupNodes ?? {}).sort(
- (a, b) => a.localeCompare(b)
- );
- this.innerNodesList = $el(
- "ul.comfy-group-manage-list-items"
- );
- this.widgetsPage = $el("section.comfy-group-manage-node-page");
- this.inputsPage = $el("section.comfy-group-manage-node-page");
- this.outputsPage = $el("section.comfy-group-manage-node-page");
- const pages = $el("div", [
- this.widgetsPage,
- this.inputsPage,
- this.outputsPage
- ]);
- this.tabs = [
- ["Inputs", this.inputsPage],
- ["Widgets", this.widgetsPage],
- ["Outputs", this.outputsPage]
- ].reduce((p, [name, page]) => {
- p[name] = {
- tab: $el("a", {
- onclick: /* @__PURE__ */ __name(() => {
- this.changeTab(name);
- }, "onclick"),
- textContent: name
- }),
- page
- };
- return p;
- }, {});
- const outer = $el("div.comfy-group-manage-outer", [
- $el("header", [
- $el("h2", "Group Nodes"),
- $el(
- "select",
- {
- onchange: /* @__PURE__ */ __name((e) => {
- this.changeGroup(e.target.value);
- }, "onchange")
- },
- groupNodes.map(
- (g) => $el("option", {
- textContent: g,
- selected: `${PREFIX$1}${SEPARATOR$1}${g}` === type,
- value: g
- })
- )
- )
- ]),
- $el("main", [
- $el("section.comfy-group-manage-list", this.innerNodesList),
- $el("section.comfy-group-manage-node", [
- $el(
- "header",
- Object.values(this.tabs).map((t2) => t2.tab)
- ),
- pages
- ])
- ]),
- $el("footer", [
- $el(
- "button.comfy-btn",
- {
- onclick: /* @__PURE__ */ __name((e) => {
- const node = app.graph.nodes.find(
- (n) => n.type === `${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup
- );
- if (node) {
- useToastStore().addAlert(
- "This group node is in use in the current workflow, please first remove these."
- );
- return;
- }
- if (confirm(
- `Are you sure you want to remove the node: "${this.selectedGroup}"`
- )) {
- delete app.graph.extra.groupNodes[this.selectedGroup];
- LiteGraph.unregisterNodeType(
- `${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup
- );
- }
- this.show();
- }, "onclick")
- },
- "Delete Group Node"
- ),
- $el(
- "button.comfy-btn",
- {
- onclick: /* @__PURE__ */ __name(async () => {
- let nodesByType;
- let recreateNodes = [];
- const types = {};
- for (const g in this.modifications) {
- const type2 = app.graph.extra.groupNodes[g];
- let config = type2.config ??= {};
- let nodeMods = this.modifications[g]?.nodes;
- if (nodeMods) {
- const keys = Object.keys(nodeMods);
- if (nodeMods[keys[0]][ORDER]) {
- const orderedNodes = [];
- const orderedMods = {};
- const orderedConfig = {};
- for (const n of keys) {
- const order = nodeMods[n][ORDER].order;
- orderedNodes[order] = type2.nodes[+n];
- orderedMods[order] = nodeMods[n];
- orderedNodes[order].index = order;
- }
- for (const l of type2.links) {
- if (l[0] != null) l[0] = type2.nodes[l[0]].index;
- if (l[2] != null) l[2] = type2.nodes[l[2]].index;
- }
- if (type2.external) {
- for (const ext2 of type2.external) {
- ext2[0] = type2.nodes[ext2[0]];
- }
- }
- for (const id2 of keys) {
- if (config[id2]) {
- orderedConfig[type2.nodes[id2].index] = config[id2];
- }
- delete config[id2];
- }
- type2.nodes = orderedNodes;
- nodeMods = orderedMods;
- type2.config = config = orderedConfig;
- }
- merge(config, nodeMods);
- }
- types[g] = type2;
- if (!nodesByType) {
- nodesByType = app.graph.nodes.reduce((p, n) => {
- p[n.type] ??= [];
- p[n.type].push(n);
- return p;
- }, {});
- }
- const nodes = nodesByType[`${PREFIX$1}${SEPARATOR$1}` + g];
- if (nodes) recreateNodes.push(...nodes);
- }
- await GroupNodeConfig.registerFromWorkflow(types, {});
- for (const node of recreateNodes) {
- node.recreate();
- }
- this.modifications = {};
- this.app.graph.setDirtyCanvas(true, true);
- this.changeGroup(this.selectedGroup, false);
- }, "onclick")
- },
- "Save"
- ),
- $el(
- "button.comfy-btn",
- { onclick: /* @__PURE__ */ __name(() => this.element.close(), "onclick") },
- "Close"
- )
- ])
- ]);
- this.element.replaceChildren(outer);
- this.changeGroup(
- type ? groupNodes.find((g) => `${PREFIX$1}${SEPARATOR$1}${g}` === type) ?? groupNodes[0] : groupNodes[0]
- );
- this.element.showModal();
- this.element.addEventListener("close", () => {
- this.draggable?.dispose();
- this.element.remove();
- });
- }
-}
-window.comfyAPI = window.comfyAPI || {};
-window.comfyAPI.groupNodeManage = window.comfyAPI.groupNodeManage || {};
-window.comfyAPI.groupNodeManage.ManageGroupDialog = ManageGroupDialog;
-const CONVERTED_TYPE = "converted-widget";
-const VALID_TYPES = [
- "STRING",
- "combo",
- "number",
- "toggle",
- "BOOLEAN",
- "text",
- "string"
-];
-const CONFIG = Symbol();
-const GET_CONFIG = Symbol();
-const TARGET = Symbol();
-const replacePropertyName = "Run widget replace on values";
-class PrimitiveNode extends LGraphNode {
- static {
- __name(this, "PrimitiveNode");
- }
- controlValues;
- lastType;
- static category;
- constructor(title) {
- super(title);
- this.addOutput("connect to widget input", "*");
- this.serialize_widgets = true;
- this.isVirtualNode = true;
- if (!this.properties || !(replacePropertyName in this.properties)) {
- this.addProperty(replacePropertyName, false, "boolean");
- }
- }
- applyToGraph(extraLinks = []) {
- if (!this.outputs[0].links?.length) return;
- function get_links(node) {
- let links2 = [];
- for (const l of node.outputs[0].links) {
- const linkInfo = app.graph.links[l];
- const n = node.graph.getNodeById(linkInfo.target_id);
- if (n.type == "Reroute") {
- links2 = links2.concat(get_links(n));
- } else {
- links2.push(l);
- }
- }
- return links2;
- }
- __name(get_links, "get_links");
- let links = [
- ...get_links(this).map((l) => app.graph.links[l]),
- ...extraLinks
- ];
- let v = this.widgets?.[0].value;
- if (v && this.properties[replacePropertyName]) {
- v = applyTextReplacements(app, v);
- }
- for (const linkInfo of links) {
- const node = this.graph.getNodeById(linkInfo.target_id);
- const input = node.inputs[linkInfo.target_slot];
- let widget;
- if (input.widget[TARGET]) {
- widget = input.widget[TARGET];
- } else {
- const widgetName = input.widget.name;
- if (widgetName) {
- widget = node.widgets.find((w) => w.name === widgetName);
- }
- }
- if (widget) {
- widget.value = v;
- if (widget.callback) {
- widget.callback(
- widget.value,
- app.canvas,
- node,
- app.canvas.graph_mouse,
- {}
- );
- }
- }
- }
- }
- refreshComboInNode() {
- const widget = this.widgets?.[0];
- if (widget?.type === "combo") {
- widget.options.values = this.outputs[0].widget[GET_CONFIG]()[0];
- if (!widget.options.values.includes(widget.value)) {
- widget.value = widget.options.values[0];
- widget.callback(widget.value);
- }
- }
- }
- onAfterGraphConfigured() {
- if (this.outputs[0].links?.length && !this.widgets?.length) {
- if (!this.#onFirstConnection()) return;
- if (this.widgets) {
- for (let i = 0; i < this.widgets_values.length; i++) {
- const w = this.widgets[i];
- if (w) {
- w.value = this.widgets_values[i];
- }
- }
- }
- this.#mergeWidgetConfig();
- }
- }
- onConnectionsChange(_, index, connected) {
- if (app.configuringGraph) {
- return;
- }
- const links = this.outputs[0].links;
- if (connected) {
- if (links?.length && !this.widgets?.length) {
- this.#onFirstConnection();
- }
- } else {
- this.#mergeWidgetConfig();
- if (!links?.length) {
- this.onLastDisconnect();
- }
- }
- }
- onConnectOutput(slot, type, input, target_node, target_slot) {
- if (!input.widget) {
- if (!(input.type in ComfyWidgets)) return false;
- }
- if (this.outputs[slot].links?.length) {
- const valid = this.#isValidConnection(input);
- if (valid) {
- this.applyToGraph([{ target_id: target_node.id, target_slot }]);
- }
- return valid;
- }
- }
- #onFirstConnection(recreating) {
- if (!this.outputs[0].links) {
- this.onLastDisconnect();
- return;
- }
- const linkId = this.outputs[0].links[0];
- const link = this.graph.links[linkId];
- if (!link) return;
- const theirNode = this.graph.getNodeById(link.target_id);
- if (!theirNode || !theirNode.inputs) return;
- const input = theirNode.inputs[link.target_slot];
- if (!input) return;
- let widget;
- if (!input.widget) {
- if (!(input.type in ComfyWidgets)) return;
- widget = { name: input.name, [GET_CONFIG]: () => [input.type, {}] };
- } else {
- widget = input.widget;
- }
- const config = widget[GET_CONFIG]?.();
- if (!config) return;
- const { type } = getWidgetType(config);
- this.outputs[0].type = type;
- this.outputs[0].name = type;
- this.outputs[0].widget = widget;
- this.#createWidget(
- widget[CONFIG] ?? config,
- theirNode,
- widget.name,
- recreating,
- widget[TARGET]
- );
- }
- #createWidget(inputData, node, widgetName, recreating, targetWidget) {
- let type = inputData[0];
- if (type instanceof Array) {
- type = "COMBO";
- }
- const [oldWidth, oldHeight] = this.size;
- let widget;
- if (type in ComfyWidgets) {
- widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget;
- } else {
- widget = this.addWidget(type, "value", null, () => {
- }, {});
- }
- if (targetWidget) {
- widget.value = targetWidget.value;
- } else if (node?.widgets && widget) {
- const theirWidget = node.widgets.find((w) => w.name === widgetName);
- if (theirWidget) {
- widget.value = theirWidget.value;
- }
- }
- if (!inputData?.[1]?.control_after_generate && (widget.type === "number" || widget.type === "combo")) {
- let control_value = this.widgets_values?.[1];
- if (!control_value) {
- control_value = "fixed";
- }
- addValueControlWidgets(
- this,
- widget,
- control_value,
- void 0,
- inputData
- );
- let filter = this.widgets_values?.[2];
- if (filter && this.widgets.length === 3) {
- this.widgets[2].value = filter;
- }
- }
- const controlValues = this.controlValues;
- if (this.lastType === this.widgets[0].type && controlValues?.length === this.widgets.length - 1) {
- for (let i = 0; i < controlValues.length; i++) {
- this.widgets[i + 1].value = controlValues[i];
- }
- }
- const callback = widget.callback;
- const self2 = this;
- widget.callback = function() {
- const r = callback ? callback.apply(this, arguments) : void 0;
- self2.applyToGraph();
- return r;
- };
- this.size = [
- Math.max(this.size[0], oldWidth),
- Math.max(this.size[1], oldHeight)
- ];
- if (!recreating) {
- const sz = this.computeSize();
- if (this.size[0] < sz[0]) {
- this.size[0] = sz[0];
- }
- if (this.size[1] < sz[1]) {
- this.size[1] = sz[1];
- }
- requestAnimationFrame(() => {
- if (this.onResize) {
- this.onResize(this.size);
- }
- });
- }
- }
- recreateWidget() {
- const values = this.widgets?.map((w) => w.value);
- this.#removeWidgets();
- this.#onFirstConnection(true);
- if (values?.length) {
- for (let i = 0; i < this.widgets?.length; i++)
- this.widgets[i].value = values[i];
- }
- return this.widgets?.[0];
- }
- #mergeWidgetConfig() {
- const output = this.outputs[0];
- const links = output.links;
- const hasConfig = !!output.widget[CONFIG];
- if (hasConfig) {
- delete output.widget[CONFIG];
- }
- if (links?.length < 2 && hasConfig) {
- if (links.length) {
- this.recreateWidget();
- }
- return;
- }
- const config1 = output.widget[GET_CONFIG]();
- const isNumber = config1[0] === "INT" || config1[0] === "FLOAT";
- if (!isNumber) return;
- for (const linkId of links) {
- const link = app.graph.links[linkId];
- if (!link) continue;
- const theirNode = app.graph.getNodeById(link.target_id);
- const theirInput = theirNode.inputs[link.target_slot];
- this.#isValidConnection(theirInput, hasConfig);
- }
- }
- isValidWidgetLink(originSlot, targetNode, targetWidget) {
- const config2 = getConfig.call(targetNode, targetWidget.name) ?? [
- targetWidget.type,
- targetWidget.options || {}
- ];
- if (!isConvertibleWidget(targetWidget, config2)) return false;
- const output = this.outputs[originSlot];
- if (!(output.widget?.[CONFIG] ?? output.widget?.[GET_CONFIG]())) {
- return true;
- }
- return !!mergeIfValid.call(this, output, config2);
- }
- #isValidConnection(input, forceUpdate) {
- const output = this.outputs[0];
- const config2 = input.widget[GET_CONFIG]();
- return !!mergeIfValid.call(
- this,
- output,
- config2,
- forceUpdate,
- this.recreateWidget
- );
- }
- #removeWidgets() {
- if (this.widgets) {
- for (const w of this.widgets) {
- if (w.onRemove) {
- w.onRemove();
- }
- }
- this.controlValues = [];
- this.lastType = this.widgets[0]?.type;
- for (let i = 1; i < this.widgets.length; i++) {
- this.controlValues.push(this.widgets[i].value);
- }
- setTimeout(() => {
- delete this.lastType;
- delete this.controlValues;
- }, 15);
- this.widgets.length = 0;
- }
- }
- onLastDisconnect() {
- this.outputs[0].type = "*";
- this.outputs[0].name = "connect to widget input";
- delete this.outputs[0].widget;
- this.#removeWidgets();
- }
-}
-function getWidgetConfig(slot) {
- return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]?.() ?? ["*", {}];
-}
-__name(getWidgetConfig, "getWidgetConfig");
-function getConfig(widgetName) {
- const { nodeData } = this.constructor;
- return nodeData?.input?.required?.[widgetName] ?? nodeData?.input?.optional?.[widgetName];
-}
-__name(getConfig, "getConfig");
-function isConvertibleWidget(widget, config) {
- return (VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])) && !widget.options?.forceInput;
-}
-__name(isConvertibleWidget, "isConvertibleWidget");
-function hideWidget(node, widget, suffix = "") {
- if (widget.type?.startsWith(CONVERTED_TYPE)) return;
- widget.origType = widget.type;
- widget.origComputeSize = widget.computeSize;
- widget.origSerializeValue = widget.serializeValue;
- widget.computeSize = () => [0, -4];
- widget.type = CONVERTED_TYPE + suffix;
- widget.serializeValue = () => {
- if (!node.inputs) {
- return void 0;
- }
- let node_input = node.inputs.find((i) => i.widget?.name === widget.name);
- if (!node_input || !node_input.link) {
- return void 0;
- }
- return widget.origSerializeValue ? widget.origSerializeValue() : widget.value;
- };
- if (widget.linkedWidgets) {
- for (const w of widget.linkedWidgets) {
- hideWidget(node, w, ":" + widget.name);
- }
- }
-}
-__name(hideWidget, "hideWidget");
-function showWidget(widget) {
- widget.type = widget.origType;
- widget.computeSize = widget.origComputeSize;
- widget.serializeValue = widget.origSerializeValue;
- delete widget.origType;
- delete widget.origComputeSize;
- delete widget.origSerializeValue;
- if (widget.linkedWidgets) {
- for (const w of widget.linkedWidgets) {
- showWidget(w);
- }
- }
-}
-__name(showWidget, "showWidget");
-function convertToInput(node, widget, config) {
- hideWidget(node, widget);
- const { type } = getWidgetType(config);
- const [oldWidth, oldHeight] = node.size;
- const inputIsOptional = !!widget.options?.inputIsOptional;
- const input = node.addInput(widget.name, type, {
- widget: { name: widget.name, [GET_CONFIG]: () => config },
- ...inputIsOptional ? { shape: LiteGraph.SlotShape.HollowCircle } : {}
- });
- for (const widget2 of node.widgets) {
- widget2.last_y += LiteGraph.NODE_SLOT_HEIGHT;
- }
- node.setSize([
- Math.max(oldWidth, node.size[0]),
- Math.max(oldHeight, node.size[1])
- ]);
- return input;
-}
-__name(convertToInput, "convertToInput");
-function convertToWidget(node, widget) {
- showWidget(widget);
- const [oldWidth, oldHeight] = node.size;
- node.removeInput(node.inputs.findIndex((i) => i.widget?.name === widget.name));
- for (const widget2 of node.widgets) {
- widget2.last_y -= LiteGraph.NODE_SLOT_HEIGHT;
- }
- node.setSize([
- Math.max(oldWidth, node.size[0]),
- Math.max(oldHeight, node.size[1])
- ]);
-}
-__name(convertToWidget, "convertToWidget");
-function getWidgetType(config) {
- let type = config[0];
- if (type instanceof Array) {
- type = "COMBO";
- }
- return { type };
-}
-__name(getWidgetType, "getWidgetType");
-function isValidCombo(combo, obj) {
- if (!(obj instanceof Array)) {
- console.log(`connection rejected: tried to connect combo to ${obj}`);
- return false;
- }
- if (combo.length !== obj.length) {
- console.log(`connection rejected: combo lists dont match`);
- return false;
- }
- if (combo.find((v, i) => obj[i] !== v)) {
- console.log(`connection rejected: combo lists dont match`);
- return false;
- }
- return true;
-}
-__name(isValidCombo, "isValidCombo");
-function isPrimitiveNode(node) {
- return node.type === "PrimitiveNode";
-}
-__name(isPrimitiveNode, "isPrimitiveNode");
-function setWidgetConfig(slot, config, target) {
- if (!slot.widget) return;
- if (config) {
- slot.widget[GET_CONFIG] = () => config;
- slot.widget[TARGET] = target;
- } else {
- delete slot.widget;
- }
- if (slot.link) {
- const link = app.graph.links[slot.link];
- if (link) {
- const originNode = app.graph.getNodeById(link.origin_id);
- if (isPrimitiveNode(originNode)) {
- if (config) {
- originNode.recreateWidget();
- } else if (!app.configuringGraph) {
- originNode.disconnectOutput(0);
- originNode.onLastDisconnect();
- }
- }
- }
- }
-}
-__name(setWidgetConfig, "setWidgetConfig");
-function mergeIfValid(output, config2, forceUpdate, recreateWidget, config1) {
- if (!config1) {
- config1 = getWidgetConfig(output);
- }
- if (config1[0] instanceof Array) {
- if (!isValidCombo(config1[0], config2[0])) return;
- } else if (config1[0] !== config2[0]) {
- console.log(`connection rejected: types dont match`, config1[0], config2[0]);
- return;
- }
- const keys = /* @__PURE__ */ new Set([
- ...Object.keys(config1[1] ?? {}),
- ...Object.keys(config2[1] ?? {})
- ]);
- let customConfig;
- const getCustomConfig = /* @__PURE__ */ __name(() => {
- if (!customConfig) {
- if (typeof structuredClone === "undefined") {
- customConfig = JSON.parse(JSON.stringify(config1[1] ?? {}));
- } else {
- customConfig = structuredClone(config1[1] ?? {});
- }
- }
- return customConfig;
- }, "getCustomConfig");
- const isNumber = config1[0] === "INT" || config1[0] === "FLOAT";
- for (const k of keys.values()) {
- if (k !== "default" && k !== "forceInput" && k !== "defaultInput" && k !== "control_after_generate" && k !== "multiline" && k !== "tooltip" && k !== "dynamicPrompts") {
- let v1 = config1[1][k];
- let v2 = config2[1]?.[k];
- if (v1 === v2 || !v1 && !v2) continue;
- if (isNumber) {
- if (k === "min") {
- const theirMax = config2[1]?.["max"];
- if (theirMax != null && v1 > theirMax) {
- console.log("connection rejected: min > max", v1, theirMax);
- return;
- }
- getCustomConfig()[k] = v1 == null ? v2 : v2 == null ? v1 : Math.max(v1, v2);
- continue;
- } else if (k === "max") {
- const theirMin = config2[1]?.["min"];
- if (theirMin != null && v1 < theirMin) {
- console.log("connection rejected: max < min", v1, theirMin);
- return;
- }
- getCustomConfig()[k] = v1 == null ? v2 : v2 == null ? v1 : Math.min(v1, v2);
- continue;
- } else if (k === "step") {
- let step;
- if (v1 == null) {
- step = v2;
- } else if (v2 == null) {
- step = v1;
- } else {
- if (v1 < v2) {
- const a = v2;
- v2 = v1;
- v1 = a;
- }
- if (v1 % v2) {
- console.log(
- "connection rejected: steps not divisible",
- "current:",
- v1,
- "new:",
- v2
- );
- return;
- }
- step = v1;
- }
- getCustomConfig()[k] = step;
- continue;
- }
- }
- console.log(`connection rejected: config ${k} values dont match`, v1, v2);
- return;
- }
- }
- if (customConfig || forceUpdate) {
- if (customConfig) {
- output.widget[CONFIG] = [config1[0], customConfig];
- }
- const widget = recreateWidget?.call(this);
- if (widget) {
- const min = widget.options.min;
- const max2 = widget.options.max;
- if (min != null && widget.value < min) widget.value = min;
- if (max2 != null && widget.value > max2) widget.value = max2;
- widget.callback(widget.value);
- }
- }
- return { customConfig };
-}
-__name(mergeIfValid, "mergeIfValid");
-app.registerExtension({
- name: "Comfy.WidgetInputs",
- settings: [
- {
- id: "Comfy.NodeInputConversionSubmenus",
- name: "In the node context menu, place the entries that convert between input/widget in sub-menus.",
- type: "boolean",
- defaultValue: true
- }
- ],
- setup() {
- app.canvas.getWidgetLinkType = function(widget, node) {
- const nodeDefStore = useNodeDefStore();
- const nodeDef = nodeDefStore.nodeDefsByName[node.type];
- const input = nodeDef.inputs.getInput(widget.name);
- return input?.type;
- };
- document.addEventListener(
- "litegraph:canvas",
- async (e) => {
- if (e.detail.subType === "connectingWidgetLink") {
- const { node, link, widget } = e.detail;
- if (!node || !link || !widget) return;
- const nodeData = node.constructor.nodeData;
- if (!nodeData) return;
- const all = {
- ...nodeData?.input?.required,
- ...nodeData?.input?.optional
- };
- const inputSpec = all[widget.name];
- if (!inputSpec) return;
- const input = convertToInput(node, widget, inputSpec);
- if (!input) return;
- const originNode = link.node;
- originNode.connect(link.slot, node, node.inputs.lastIndexOf(input));
- }
- }
- );
- },
- async beforeRegisterNodeDef(nodeType, nodeData, app2) {
- const origGetExtraMenuOptions = nodeType.prototype.getExtraMenuOptions;
- nodeType.prototype.convertWidgetToInput = function(widget) {
- const config = getConfig.call(this, widget.name) ?? [
- widget.type,
- widget.options || {}
- ];
- if (!isConvertibleWidget(widget, config)) return false;
- if (widget.type?.startsWith(CONVERTED_TYPE)) return false;
- convertToInput(this, widget, config);
- return true;
- };
- nodeType.prototype.getExtraSlotMenuOptions = function(slot) {
- if (!slot.input || !slot.input.widget) return [];
- const widget = this.widgets.find((w) => w.name === slot.input.widget.name);
- if (!widget) return [];
- return [
- {
- content: `Convert to widget`,
- callback: /* @__PURE__ */ __name(() => convertToWidget(this, widget), "callback")
- }
- ];
- };
- nodeType.prototype.getExtraMenuOptions = function(_, options) {
- const r = origGetExtraMenuOptions ? origGetExtraMenuOptions.apply(this, arguments) : void 0;
- const getPointerCanvasPos = /* @__PURE__ */ __name(() => {
- const pos = this.graph?.list_of_graphcanvas?.at(0)?.graph_mouse;
- return pos ? { canvasX: pos[0], canvasY: pos[1] } : void 0;
- }, "getPointerCanvasPos");
- if (this.widgets) {
- const { canvasX, canvasY } = getPointerCanvasPos();
- const widget = this.getWidgetOnPos(canvasX, canvasY);
- if (widget && widget.type !== CONVERTED_TYPE) {
- const config = getConfig.call(this, widget.name) ?? [
- widget.type,
- widget.options || {}
- ];
- if (isConvertibleWidget(widget, config)) {
- options.push({
- content: `Convert ${widget.name} to input`,
- callback: /* @__PURE__ */ __name(() => convertToInput(this, widget, config) && false, "callback")
- });
- }
- }
- let toInput = [];
- let toWidget = [];
- for (const w of this.widgets) {
- if (w.options?.forceInput) {
- continue;
- }
- if (w.type === CONVERTED_TYPE) {
- toWidget.push({
- // @ts-expect-error never
- content: `Convert ${w.name} to widget`,
- callback: /* @__PURE__ */ __name(() => convertToWidget(this, w), "callback")
- });
- } else {
- const config = getConfig.call(this, w.name) ?? [
- w.type,
- w.options || {}
- ];
- if (isConvertibleWidget(w, config)) {
- toInput.push({
- content: `Convert ${w.name} to input`,
- callback: /* @__PURE__ */ __name(() => convertToInput(this, w, config), "callback")
- });
- }
- }
- }
- if (toInput.length) {
- if (useSettingStore().get("Comfy.NodeInputConversionSubmenus")) {
- options.push({
- content: "Convert Widget to Input",
- submenu: {
- options: toInput
- }
- });
- } else {
- options.push(...toInput, null);
- }
- }
- if (toWidget.length) {
- if (useSettingStore().get("Comfy.NodeInputConversionSubmenus")) {
- options.push({
- content: "Convert Input to Widget",
- submenu: {
- options: toWidget
- }
- });
- } else {
- options.push(...toWidget, null);
- }
- }
- }
- return r;
- };
- nodeType.prototype.onGraphConfigured = function() {
- if (!this.inputs) return;
- this.widgets ??= [];
- for (const input of this.inputs) {
- if (input.widget) {
- if (!input.widget[GET_CONFIG]) {
- input.widget[GET_CONFIG] = () => getConfig.call(this, input.widget.name);
- }
- if (input.widget.config) {
- if (input.widget.config[0] instanceof Array) {
- input.type = "COMBO";
- const link = app2.graph.links[input.link];
- if (link) {
- link.type = input.type;
- }
- }
- delete input.widget.config;
- }
- const w = this.widgets.find((w2) => w2.name === input.widget.name);
- if (w) {
- hideWidget(this, w);
- } else {
- convertToWidget(this, input);
- }
- }
- }
- };
- const origOnNodeCreated = nodeType.prototype.onNodeCreated;
- nodeType.prototype.onNodeCreated = function() {
- const r = origOnNodeCreated ? origOnNodeCreated.apply(this) : void 0;
- if (!app2.configuringGraph && this.widgets) {
- for (const w of this.widgets) {
- if (w?.options?.forceInput || w?.options?.defaultInput) {
- const config = getConfig.call(this, w.name) ?? [
- w.type,
- w.options || {}
- ];
- convertToInput(this, w, config);
- }
- }
- }
- return r;
- };
- const origOnConfigure = nodeType.prototype.onConfigure;
- nodeType.prototype.onConfigure = function() {
- const r = origOnConfigure ? origOnConfigure.apply(this, arguments) : void 0;
- if (!app2.configuringGraph && this.inputs) {
- for (const input of this.inputs) {
- if (input.widget && !input.widget[GET_CONFIG]) {
- input.widget[GET_CONFIG] = () => getConfig.call(this, input.widget.name);
- const w = this.widgets.find((w2) => w2.name === input.widget.name);
- if (w) {
- hideWidget(this, w);
- }
- }
- }
- }
- return r;
- };
- function isNodeAtPos(pos) {
- for (const n of app2.graph.nodes) {
- if (n.pos[0] === pos[0] && n.pos[1] === pos[1]) {
- return true;
- }
- }
- return false;
- }
- __name(isNodeAtPos, "isNodeAtPos");
- const origOnInputDblClick = nodeType.prototype.onInputDblClick;
- const ignoreDblClick = Symbol();
- nodeType.prototype.onInputDblClick = function(slot) {
- const r = origOnInputDblClick ? origOnInputDblClick.apply(this, arguments) : void 0;
- const input = this.inputs[slot];
- if (!input.widget || !input[ignoreDblClick]) {
- if (!(input.type in ComfyWidgets) && !(input.widget?.[GET_CONFIG]?.()?.[0] instanceof Array)) {
- return r;
- }
- }
- const node = LiteGraph.createNode("PrimitiveNode");
- app2.graph.add(node);
- const pos = [
- this.pos[0] - node.size[0] - 30,
- this.pos[1]
- ];
- while (isNodeAtPos(pos)) {
- pos[1] += LiteGraph.NODE_TITLE_HEIGHT;
- }
- node.pos = pos;
- node.connect(0, this, slot);
- node.title = input.name;
- input[ignoreDblClick] = true;
- setTimeout(() => {
- delete input[ignoreDblClick];
- }, 300);
- return r;
- };
- const onConnectInput = nodeType.prototype.onConnectInput;
- nodeType.prototype.onConnectInput = function(targetSlot, type, output, originNode, originSlot) {
- const v = onConnectInput?.(this, arguments);
- if (type !== "COMBO") return v;
- if (originNode.outputs[originSlot].widget) return v;
- const targetCombo = this.inputs[targetSlot].widget?.[GET_CONFIG]?.()?.[0];
- if (!targetCombo || !(targetCombo instanceof Array)) return v;
- const originConfig = originNode.constructor?.nodeData?.output?.[originSlot];
- if (!originConfig || !isValidCombo(targetCombo, originConfig)) {
- return false;
- }
- return v;
- };
- },
- registerCustomNodes() {
- LiteGraph.registerNodeType(
- "PrimitiveNode",
- Object.assign(PrimitiveNode, {
- title: "Primitive"
- })
- );
- PrimitiveNode.category = "utils";
- }
-});
-window.comfyAPI = window.comfyAPI || {};
-window.comfyAPI.widgetInputs = window.comfyAPI.widgetInputs || {};
-window.comfyAPI.widgetInputs.getWidgetConfig = getWidgetConfig;
-window.comfyAPI.widgetInputs.convertToInput = convertToInput;
-window.comfyAPI.widgetInputs.setWidgetConfig = setWidgetConfig;
-window.comfyAPI.widgetInputs.mergeIfValid = mergeIfValid;
-const GROUP = Symbol();
-const PREFIX = "workflow";
-const SEPARATOR = ">";
-const Workflow = {
- InUse: {
- Free: 0,
- Registered: 1,
- InWorkflow: 2
- },
- isInUseGroupNode(name) {
- const id2 = `${PREFIX}${SEPARATOR}${name}`;
- if (app.graph.extra?.groupNodes?.[name]) {
- if (app.graph.nodes.find((n) => n.type === id2)) {
- return Workflow.InUse.InWorkflow;
- } else {
- return Workflow.InUse.Registered;
- }
- }
- return Workflow.InUse.Free;
- },
- storeGroupNode(name, data) {
- let extra = app.graph.extra;
- if (!extra) app.graph.extra = extra = {};
- let groupNodes = extra.groupNodes;
- if (!groupNodes) extra.groupNodes = groupNodes = {};
- groupNodes[name] = data;
- }
-};
-class GroupNodeBuilder {
- static {
- __name(this, "GroupNodeBuilder");
- }
- nodes;
- nodeData;
- constructor(nodes) {
- this.nodes = nodes;
- }
- async build() {
- const name = await this.getName();
- if (!name) return;
- this.sortNodes();
- this.nodeData = this.getNodeData();
- Workflow.storeGroupNode(name, this.nodeData);
- return { name, nodeData: this.nodeData };
- }
- async getName() {
- const name = await useDialogService().prompt({
- title: t("groupNode.create"),
- message: t("groupNode.enterName"),
- defaultValue: ""
- });
- if (!name) return;
- const used = Workflow.isInUseGroupNode(name);
- switch (used) {
- case Workflow.InUse.InWorkflow:
- useToastStore().addAlert(
- "An in use group node with this name already exists embedded in this workflow, please remove any instances or use a new name."
- );
- return;
- case Workflow.InUse.Registered:
- if (!confirm(
- "A group node with this name already exists embedded in this workflow, are you sure you want to overwrite it?"
- )) {
- return;
- }
- break;
- }
- return name;
- }
- sortNodes() {
- const nodesInOrder = app.graph.computeExecutionOrder(false);
- this.nodes = this.nodes.map((node) => ({ index: nodesInOrder.indexOf(node), node })).sort((a, b) => a.index - b.index || a.node.id - b.node.id).map(({ node }) => node);
- }
- getNodeData() {
- const storeLinkTypes = /* @__PURE__ */ __name((config) => {
- for (const link of config.links) {
- const origin = app.graph.getNodeById(link[4]);
- const type = origin.outputs[link[1]].type;
- link.push(type);
- }
- }, "storeLinkTypes");
- const storeExternalLinks = /* @__PURE__ */ __name((config) => {
- config.external = [];
- for (let i = 0; i < this.nodes.length; i++) {
- const node = this.nodes[i];
- if (!node.outputs?.length) continue;
- for (let slot = 0; slot < node.outputs.length; slot++) {
- let hasExternal = false;
- const output = node.outputs[slot];
- let type = output.type;
- if (!output.links?.length) continue;
- for (const l of output.links) {
- const link = app.graph.links[l];
- if (!link) continue;
- if (type === "*") type = link.type;
- if (!app.canvas.selected_nodes[link.target_id]) {
- hasExternal = true;
- break;
- }
- }
- if (hasExternal) {
- config.external.push([i, slot, type]);
- }
- }
- }
- }, "storeExternalLinks");
- try {
- const serialised = serialise(this.nodes, app.canvas.graph);
- const config = JSON.parse(serialised);
- storeLinkTypes(config);
- storeExternalLinks(config);
- return config;
- } finally {
- }
- }
-}
-class GroupNodeConfig {
- static {
- __name(this, "GroupNodeConfig");
- }
- name;
- nodeData;
- inputCount;
- oldToNewOutputMap;
- newToOldOutputMap;
- oldToNewInputMap;
- oldToNewWidgetMap;
- newToOldWidgetMap;
- primitiveDefs;
- widgetToPrimitive;
- primitiveToWidget;
- nodeInputs;
- outputVisibility;
- nodeDef;
- inputs;
- linksFrom;
- linksTo;
- externalFrom;
- constructor(name, nodeData) {
- this.name = name;
- this.nodeData = nodeData;
- this.getLinks();
- this.inputCount = 0;
- this.oldToNewOutputMap = {};
- this.newToOldOutputMap = {};
- this.oldToNewInputMap = {};
- this.oldToNewWidgetMap = {};
- this.newToOldWidgetMap = {};
- this.primitiveDefs = {};
- this.widgetToPrimitive = {};
- this.primitiveToWidget = {};
- this.nodeInputs = {};
- this.outputVisibility = [];
- }
- async registerType(source = PREFIX) {
- this.nodeDef = {
- output: [],
- output_name: [],
- output_is_list: [],
- // @ts-expect-error Unused, doesn't exist
- output_is_hidden: [],
- name: source + SEPARATOR + this.name,
- display_name: this.name,
- category: "group nodes" + (SEPARATOR + source),
- input: { required: {} },
- description: `Group node combining ${this.nodeData.nodes.map((n) => n.type).join(", ")}`,
- python_module: "custom_nodes." + this.name,
- [GROUP]: this
- };
- this.inputs = [];
- const seenInputs = {};
- const seenOutputs = {};
- for (let i = 0; i < this.nodeData.nodes.length; i++) {
- const node = this.nodeData.nodes[i];
- node.index = i;
- this.processNode(node, seenInputs, seenOutputs);
- }
- for (const p of this.#convertedToProcess) {
- p();
- }
- this.#convertedToProcess = null;
- await app.registerNodeDef(`${PREFIX}${SEPARATOR}` + this.name, this.nodeDef);
- useNodeDefStore().addNodeDef(this.nodeDef);
- }
- getLinks() {
- this.linksFrom = {};
- this.linksTo = {};
- this.externalFrom = {};
- for (const l of this.nodeData.links) {
- const [sourceNodeId, sourceNodeSlot, targetNodeId, targetNodeSlot] = l;
- if (sourceNodeId == null) continue;
- if (!this.linksFrom[sourceNodeId]) {
- this.linksFrom[sourceNodeId] = {};
- }
- if (!this.linksFrom[sourceNodeId][sourceNodeSlot]) {
- this.linksFrom[sourceNodeId][sourceNodeSlot] = [];
- }
- this.linksFrom[sourceNodeId][sourceNodeSlot].push(l);
- if (!this.linksTo[targetNodeId]) {
- this.linksTo[targetNodeId] = {};
- }
- this.linksTo[targetNodeId][targetNodeSlot] = l;
- }
- if (this.nodeData.external) {
- for (const ext2 of this.nodeData.external) {
- if (!this.externalFrom[ext2[0]]) {
- this.externalFrom[ext2[0]] = { [ext2[1]]: ext2[2] };
- } else {
- this.externalFrom[ext2[0]][ext2[1]] = ext2[2];
- }
- }
- }
- }
- processNode(node, seenInputs, seenOutputs) {
- const def = this.getNodeDef(node);
- if (!def) return;
- const inputs = { ...def.input?.required, ...def.input?.optional };
- this.inputs.push(this.processNodeInputs(node, seenInputs, inputs));
- if (def.output?.length) this.processNodeOutputs(node, seenOutputs, def);
- }
- getNodeDef(node) {
- const def = globalDefs[node.type];
- if (def) return def;
- const linksFrom = this.linksFrom[node.index];
- if (node.type === "PrimitiveNode") {
- if (!linksFrom) return;
- let type = linksFrom["0"][0][5];
- if (type === "COMBO") {
- const source = node.outputs[0].widget.name;
- const fromTypeName = this.nodeData.nodes[linksFrom["0"][0][2]].type;
- const fromType = globalDefs[fromTypeName];
- const input = fromType.input.required[source] ?? fromType.input.optional[source];
- type = input[0];
- }
- const def2 = this.primitiveDefs[node.index] = {
- input: {
- required: {
- value: [type, {}]
- }
- },
- output: [type],
- output_name: [],
- output_is_list: []
- };
- return def2;
- } else if (node.type === "Reroute") {
- const linksTo = this.linksTo[node.index];
- if (linksTo && linksFrom && !this.externalFrom[node.index]?.[0]) {
- return null;
- }
- let config = {};
- let rerouteType = "*";
- if (linksFrom) {
- for (const [, , id2, slot] of linksFrom["0"]) {
- const node2 = this.nodeData.nodes[id2];
- const input = node2.inputs[slot];
- if (rerouteType === "*") {
- rerouteType = input.type;
- }
- if (input.widget) {
- const targetDef = globalDefs[node2.type];
- const targetWidget = targetDef.input.required[input.widget.name] ?? targetDef.input.optional[input.widget.name];
- const widget = [targetWidget[0], config];
- const res = mergeIfValid(
- {
- widget
- },
- targetWidget,
- false,
- null,
- widget
- );
- config = res?.customConfig ?? config;
- }
- }
- } else if (linksTo) {
- const [id2, slot] = linksTo["0"];
- rerouteType = this.nodeData.nodes[id2].outputs[slot].type;
- } else {
- for (const l of this.nodeData.links) {
- if (l[2] === node.index) {
- rerouteType = l[5];
- break;
- }
- }
- if (rerouteType === "*") {
- const t2 = this.externalFrom[node.index]?.[0];
- if (t2) {
- rerouteType = t2;
- }
- }
- }
- config.forceInput = true;
- return {
- input: {
- required: {
- [rerouteType]: [rerouteType, config]
- }
- },
- output: [rerouteType],
- output_name: [],
- output_is_list: []
- };
- }
- console.warn(
- "Skipping virtual node " + node.type + " when building group node " + this.name
- );
- }
- getInputConfig(node, inputName, seenInputs, config, extra) {
- const customConfig = this.nodeData.config?.[node.index]?.input?.[inputName];
- let name = customConfig?.name ?? node.inputs?.find((inp) => inp.name === inputName)?.label ?? inputName;
- let key = name;
- let prefix = "";
- if (node.type === "PrimitiveNode" && node.title || name in seenInputs) {
- prefix = `${node.title ?? node.type} `;
- key = name = `${prefix}${inputName}`;
- if (name in seenInputs) {
- name = `${prefix}${seenInputs[name]} ${inputName}`;
- }
- }
- seenInputs[key] = (seenInputs[key] ?? 1) + 1;
- if (inputName === "seed" || inputName === "noise_seed") {
- if (!extra) extra = {};
- extra.control_after_generate = `${prefix}control_after_generate`;
- }
- if (config[0] === "IMAGEUPLOAD") {
- if (!extra) extra = {};
- extra.widget = this.oldToNewWidgetMap[node.index]?.[config[1]?.widget ?? "image"] ?? "image";
- }
- if (extra) {
- config = [config[0], { ...config[1], ...extra }];
- }
- return { name, config, customConfig };
- }
- processWidgetInputs(inputs, node, inputNames, seenInputs) {
- const slots = [];
- const converted = /* @__PURE__ */ new Map();
- const widgetMap = this.oldToNewWidgetMap[node.index] = {};
- for (const inputName of inputNames) {
- let widgetType = app.getWidgetType(inputs[inputName], inputName);
- if (widgetType) {
- const convertedIndex = node.inputs?.findIndex(
- (inp) => inp.name === inputName && inp.widget?.name === inputName
- );
- if (convertedIndex > -1) {
- converted.set(convertedIndex, inputName);
- widgetMap[inputName] = null;
- } else {
- const { name, config } = this.getInputConfig(
- node,
- inputName,
- seenInputs,
- inputs[inputName]
- );
- this.nodeDef.input.required[name] = config;
- widgetMap[inputName] = name;
- this.newToOldWidgetMap[name] = { node, inputName };
- }
- } else {
- slots.push(inputName);
- }
- }
- return { converted, slots };
- }
- checkPrimitiveConnection(link, inputName, inputs) {
- const sourceNode = this.nodeData.nodes[link[0]];
- if (sourceNode.type === "PrimitiveNode") {
- const [sourceNodeId, _, targetNodeId, __] = link;
- const primitiveDef = this.primitiveDefs[sourceNodeId];
- const targetWidget = inputs[inputName];
- const primitiveConfig = primitiveDef.input.required.value;
- const output = { widget: primitiveConfig };
- const config = mergeIfValid(
- output,
- targetWidget,
- false,
- null,
- primitiveConfig
- );
- primitiveConfig[1] = config?.customConfig ?? inputs[inputName][1] ? { ...inputs[inputName][1] } : {};
- let name = this.oldToNewWidgetMap[sourceNodeId]["value"];
- name = name.substr(0, name.length - 6);
- primitiveConfig[1].control_after_generate = true;
- primitiveConfig[1].control_prefix = name;
- let toPrimitive = this.widgetToPrimitive[targetNodeId];
- if (!toPrimitive) {
- toPrimitive = this.widgetToPrimitive[targetNodeId] = {};
- }
- if (toPrimitive[inputName]) {
- toPrimitive[inputName].push(sourceNodeId);
- }
- toPrimitive[inputName] = sourceNodeId;
- let toWidget = this.primitiveToWidget[sourceNodeId];
- if (!toWidget) {
- toWidget = this.primitiveToWidget[sourceNodeId] = [];
- }
- toWidget.push({ nodeId: targetNodeId, inputName });
- }
- }
- processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs) {
- this.nodeInputs[node.index] = {};
- for (let i = 0; i < slots.length; i++) {
- const inputName = slots[i];
- if (linksTo[i]) {
- this.checkPrimitiveConnection(linksTo[i], inputName, inputs);
- continue;
- }
- const { name, config, customConfig } = this.getInputConfig(
- node,
- inputName,
- seenInputs,
- inputs[inputName]
- );
- this.nodeInputs[node.index][inputName] = name;
- if (customConfig?.visible === false) continue;
- this.nodeDef.input.required[name] = config;
- inputMap[i] = this.inputCount++;
- }
- }
- processConvertedWidgets(inputs, node, slots, converted, linksTo, inputMap, seenInputs) {
- const convertedSlots = [...converted.keys()].sort().map((k) => converted.get(k));
- for (let i = 0; i < convertedSlots.length; i++) {
- const inputName = convertedSlots[i];
- if (linksTo[slots.length + i]) {
- this.checkPrimitiveConnection(
- linksTo[slots.length + i],
- inputName,
- inputs
- );
- continue;
- }
- const { name, config } = this.getInputConfig(
- node,
- inputName,
- seenInputs,
- inputs[inputName],
- {
- defaultInput: true
- }
- );
- this.nodeDef.input.required[name] = config;
- this.newToOldWidgetMap[name] = { node, inputName };
- if (!this.oldToNewWidgetMap[node.index]) {
- this.oldToNewWidgetMap[node.index] = {};
- }
- this.oldToNewWidgetMap[node.index][inputName] = name;
- inputMap[slots.length + i] = this.inputCount++;
- }
- }
- #convertedToProcess = [];
- processNodeInputs(node, seenInputs, inputs) {
- const inputMapping = [];
- const inputNames = Object.keys(inputs);
- if (!inputNames.length) return;
- const { converted, slots } = this.processWidgetInputs(
- inputs,
- node,
- inputNames,
- seenInputs
- );
- const linksTo = this.linksTo[node.index] ?? {};
- const inputMap = this.oldToNewInputMap[node.index] = {};
- this.processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs);
- this.#convertedToProcess.push(
- () => this.processConvertedWidgets(
- inputs,
- node,
- slots,
- converted,
- linksTo,
- inputMap,
- seenInputs
- )
- );
- return inputMapping;
- }
- processNodeOutputs(node, seenOutputs, def) {
- const oldToNew = this.oldToNewOutputMap[node.index] = {};
- for (let outputId = 0; outputId < def.output.length; outputId++) {
- const linksFrom = this.linksFrom[node.index];
- const hasLink = linksFrom?.[outputId] && !this.externalFrom[node.index]?.[outputId];
- const customConfig = this.nodeData.config?.[node.index]?.output?.[outputId];
- const visible = customConfig?.visible ?? !hasLink;
- this.outputVisibility.push(visible);
- if (!visible) {
- continue;
- }
- oldToNew[outputId] = this.nodeDef.output.length;
- this.newToOldOutputMap[this.nodeDef.output.length] = {
- node,
- slot: outputId
- };
- this.nodeDef.output.push(def.output[outputId]);
- this.nodeDef.output_is_list.push(def.output_is_list[outputId]);
- let label = customConfig?.name;
- if (!label) {
- label = def.output_name?.[outputId] ?? def.output[outputId];
- const output = node.outputs.find((o) => o.name === label);
- if (output?.label) {
- label = output.label;
- }
- }
- let name = label;
- if (name in seenOutputs) {
- const prefix = `${node.title ?? node.type} `;
- name = `${prefix}${label}`;
- if (name in seenOutputs) {
- name = `${prefix}${node.index} ${label}`;
- }
- }
- seenOutputs[name] = 1;
- this.nodeDef.output_name.push(name);
- }
- }
- static async registerFromWorkflow(groupNodes, missingNodeTypes) {
- for (const g in groupNodes) {
- const groupData = groupNodes[g];
- let hasMissing = false;
- for (const n of groupData.nodes) {
- if (!(n.type in LiteGraph.registered_node_types)) {
- missingNodeTypes.push({
- type: n.type,
- hint: ` (In group node '${PREFIX}${SEPARATOR}${g}')`
- });
- missingNodeTypes.push({
- type: `${PREFIX}${SEPARATOR}` + g,
- action: {
- text: "Remove from workflow",
- callback: /* @__PURE__ */ __name((e) => {
- delete groupNodes[g];
- e.target.textContent = "Removed";
- e.target.style.pointerEvents = "none";
- e.target.style.opacity = 0.7;
- }, "callback")
- }
- });
- hasMissing = true;
- }
- }
- if (hasMissing) continue;
- const config = new GroupNodeConfig(g, groupData);
- await config.registerType();
- }
- }
-}
-class GroupNodeHandler {
- static {
- __name(this, "GroupNodeHandler");
- }
- node;
- groupData;
- innerNodes;
- constructor(node) {
- this.node = node;
- this.groupData = node.constructor?.nodeData?.[GROUP];
- this.node.setInnerNodes = (innerNodes) => {
- this.innerNodes = innerNodes;
- for (let innerNodeIndex = 0; innerNodeIndex < this.innerNodes.length; innerNodeIndex++) {
- const innerNode = this.innerNodes[innerNodeIndex];
- for (const w of innerNode.widgets ?? []) {
- if (w.type === "converted-widget") {
- w.serializeValue = w.origSerializeValue;
- }
- }
- innerNode.index = innerNodeIndex;
- innerNode.getInputNode = (slot) => {
- const externalSlot = this.groupData.oldToNewInputMap[innerNode.index]?.[slot];
- if (externalSlot != null) {
- return this.node.getInputNode(externalSlot);
- }
- const innerLink = this.groupData.linksTo[innerNode.index]?.[slot];
- if (!innerLink) return null;
- const inputNode = innerNodes[innerLink[0]];
- if (inputNode.type === "PrimitiveNode") return null;
- return inputNode;
- };
- innerNode.getInputLink = (slot) => {
- const externalSlot = this.groupData.oldToNewInputMap[innerNode.index]?.[slot];
- if (externalSlot != null) {
- const linkId = this.node.inputs[externalSlot].link;
- let link2 = app.graph.links[linkId];
- link2 = {
- ...link2,
- target_id: innerNode.id,
- target_slot: +slot
- };
- return link2;
- }
- let link = this.groupData.linksTo[innerNode.index]?.[slot];
- if (!link) return null;
- link = {
- origin_id: innerNodes[link[0]].id,
- origin_slot: link[1],
- target_id: innerNode.id,
- target_slot: +slot
- };
- return link;
- };
- }
- };
- this.node.updateLink = (link) => {
- link = { ...link };
- const output = this.groupData.newToOldOutputMap[link.origin_slot];
- let innerNode = this.innerNodes[output.node.index];
- let l;
- while (innerNode?.type === "Reroute") {
- l = innerNode.getInputLink(0);
- innerNode = innerNode.getInputNode(0);
- }
- if (!innerNode) {
- return null;
- }
- if (l && GroupNodeHandler.isGroupNode(innerNode)) {
- return innerNode.updateLink(l);
- }
- link.origin_id = innerNode.id;
- link.origin_slot = l?.origin_slot ?? output.slot;
- return link;
- };
- this.node.getInnerNodes = () => {
- if (!this.innerNodes) {
- this.node.setInnerNodes(
- this.groupData.nodeData.nodes.map((n, i) => {
- const innerNode = LiteGraph.createNode(n.type);
- innerNode.configure(n);
- innerNode.id = `${this.node.id}:${i}`;
- return innerNode;
- })
- );
- }
- this.updateInnerWidgets();
- return this.innerNodes;
- };
- this.node.recreate = async () => {
- const id2 = this.node.id;
- const sz = this.node.size;
- const nodes = this.node.convertToNodes();
- const groupNode = LiteGraph.createNode(this.node.type);
- groupNode.id = id2;
- groupNode.setInnerNodes(nodes);
- groupNode[GROUP].populateWidgets();
- app.graph.add(groupNode);
- groupNode.size = [
- Math.max(groupNode.size[0], sz[0]),
- Math.max(groupNode.size[1], sz[1])
- ];
- const builder = new GroupNodeBuilder(nodes);
- const nodeData = builder.getNodeData();
- groupNode[GROUP].groupData.nodeData.links = nodeData.links;
- groupNode[GROUP].replaceNodes(nodes);
- return groupNode;
- };
- this.node.convertToNodes = () => {
- const addInnerNodes = /* @__PURE__ */ __name(() => {
- const c = { ...this.groupData.nodeData };
- c.nodes = [...c.nodes];
- const innerNodes = this.node.getInnerNodes();
- let ids = [];
- for (let i = 0; i < c.nodes.length; i++) {
- let id2 = innerNodes?.[i]?.id;
- if (id2 == null || isNaN(id2)) {
- id2 = void 0;
- } else {
- ids.push(id2);
- }
- c.nodes[i] = { ...c.nodes[i], id: id2 };
- }
- deserialiseAndCreate(JSON.stringify(c), app.canvas);
- const [x, y] = this.node.pos;
- let top;
- let left;
- const selectedIds = ids.length ? ids : Object.keys(app.canvas.selected_nodes);
- const newNodes = [];
- for (let i = 0; i < selectedIds.length; i++) {
- const id2 = selectedIds[i];
- const newNode = app.graph.getNodeById(id2);
- const innerNode = innerNodes[i];
- newNodes.push(newNode);
- if (left == null || newNode.pos[0] < left) {
- left = newNode.pos[0];
- }
- if (top == null || newNode.pos[1] < top) {
- top = newNode.pos[1];
- }
- if (!newNode.widgets) continue;
- const map = this.groupData.oldToNewWidgetMap[innerNode.index];
- if (map) {
- const widgets = Object.keys(map);
- for (const oldName of widgets) {
- const newName = map[oldName];
- if (!newName) continue;
- const widgetIndex = this.node.widgets.findIndex(
- (w) => w.name === newName
- );
- if (widgetIndex === -1) continue;
- if (innerNode.type === "PrimitiveNode") {
- for (let i2 = 0; i2 < newNode.widgets.length; i2++) {
- newNode.widgets[i2].value = this.node.widgets[widgetIndex + i2].value;
- }
- } else {
- const outerWidget = this.node.widgets[widgetIndex];
- const newWidget = newNode.widgets.find(
- (w) => w.name === oldName
- );
- if (!newWidget) continue;
- newWidget.value = outerWidget.value;
- for (let w = 0; w < outerWidget.linkedWidgets?.length; w++) {
- newWidget.linkedWidgets[w].value = outerWidget.linkedWidgets[w].value;
- }
- }
- }
- }
- }
- for (const newNode of newNodes) {
- newNode.pos[0] -= left - x;
- newNode.pos[1] -= top - y;
- }
- return { newNodes, selectedIds };
- }, "addInnerNodes");
- const reconnectInputs = /* @__PURE__ */ __name((selectedIds) => {
- for (const innerNodeIndex in this.groupData.oldToNewInputMap) {
- const id2 = selectedIds[innerNodeIndex];
- const newNode = app.graph.getNodeById(id2);
- const map = this.groupData.oldToNewInputMap[innerNodeIndex];
- for (const innerInputId in map) {
- const groupSlotId = map[innerInputId];
- if (groupSlotId == null) continue;
- const slot = node.inputs[groupSlotId];
- if (slot.link == null) continue;
- const link = app.graph.links[slot.link];
- if (!link) continue;
- const originNode = app.graph.getNodeById(link.origin_id);
- originNode.connect(link.origin_slot, newNode, +innerInputId);
- }
- }
- }, "reconnectInputs");
- const reconnectOutputs = /* @__PURE__ */ __name((selectedIds) => {
- for (let groupOutputId = 0; groupOutputId < node.outputs?.length; groupOutputId++) {
- const output = node.outputs[groupOutputId];
- if (!output.links) continue;
- const links = [...output.links];
- for (const l of links) {
- const slot = this.groupData.newToOldOutputMap[groupOutputId];
- const link = app.graph.links[l];
- const targetNode = app.graph.getNodeById(link.target_id);
- const newNode = app.graph.getNodeById(selectedIds[slot.node.index]);
- newNode.connect(slot.slot, targetNode, link.target_slot);
- }
- }
- }, "reconnectOutputs");
- app.canvas.emitBeforeChange();
- try {
- const { newNodes, selectedIds } = addInnerNodes();
- reconnectInputs(selectedIds);
- reconnectOutputs(selectedIds);
- app.graph.remove(this.node);
- return newNodes;
- } finally {
- app.canvas.emitAfterChange();
- }
- };
- const getExtraMenuOptions = this.node.getExtraMenuOptions;
- this.node.getExtraMenuOptions = function(_, options) {
- getExtraMenuOptions?.apply(this, arguments);
- let optionIndex = options.findIndex((o) => o.content === "Outputs");
- if (optionIndex === -1) optionIndex = options.length;
- else optionIndex++;
- options.splice(
- optionIndex,
- 0,
- null,
- {
- content: "Convert to nodes",
- // @ts-expect-error
- callback: /* @__PURE__ */ __name(() => {
- return this.convertToNodes();
- }, "callback")
- },
- {
- content: "Manage Group Node",
- callback: /* @__PURE__ */ __name(() => manageGroupNodes(this.type), "callback")
- }
- );
- };
- const onDrawTitleBox = this.node.onDrawTitleBox;
- this.node.onDrawTitleBox = function(ctx, height, size, scale) {
- onDrawTitleBox?.apply(this, arguments);
- const fill2 = ctx.fillStyle;
- ctx.beginPath();
- ctx.rect(11, -height + 11, 2, 2);
- ctx.rect(14, -height + 11, 2, 2);
- ctx.rect(17, -height + 11, 2, 2);
- ctx.rect(11, -height + 14, 2, 2);
- ctx.rect(14, -height + 14, 2, 2);
- ctx.rect(17, -height + 14, 2, 2);
- ctx.rect(11, -height + 17, 2, 2);
- ctx.rect(14, -height + 17, 2, 2);
- ctx.rect(17, -height + 17, 2, 2);
- ctx.fillStyle = this.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;
- ctx.fill();
- ctx.fillStyle = fill2;
- };
- const onDrawForeground = node.onDrawForeground;
- const groupData = this.groupData.nodeData;
- node.onDrawForeground = function(ctx) {
- const r = onDrawForeground?.apply?.(this, arguments);
- if (+app.runningNodeId === this.id && this.runningInternalNodeId !== null) {
- const n = groupData.nodes[this.runningInternalNodeId];
- if (!n) return;
- const message = `Running ${n.title || n.type} (${this.runningInternalNodeId}/${groupData.nodes.length})`;
- ctx.save();
- ctx.font = "12px sans-serif";
- const sz = ctx.measureText(message);
- ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;
- ctx.beginPath();
- ctx.roundRect(
- 0,
- -LiteGraph.NODE_TITLE_HEIGHT - 20,
- sz.width + 12,
- 20,
- 5
- );
- ctx.fill();
- ctx.fillStyle = "#fff";
- ctx.fillText(message, 6, -LiteGraph.NODE_TITLE_HEIGHT - 6);
- ctx.restore();
- }
- };
- const onExecutionStart = this.node.onExecutionStart;
- this.node.onExecutionStart = function() {
- this.resetExecution = true;
- return onExecutionStart?.apply(this, arguments);
- };
- const self2 = this;
- const onNodeCreated = this.node.onNodeCreated;
- this.node.onNodeCreated = function() {
- if (!this.widgets) {
- return;
- }
- const config = self2.groupData.nodeData.config;
- if (config) {
- for (const n in config) {
- const inputs = config[n]?.input;
- for (const w in inputs) {
- if (inputs[w].visible !== false) continue;
- const widgetName = self2.groupData.oldToNewWidgetMap[n][w];
- const widget = this.widgets.find((w2) => w2.name === widgetName);
- if (widget) {
- widget.type = "hidden";
- widget.computeSize = () => [0, -4];
- }
- }
- }
- }
- return onNodeCreated?.apply(this, arguments);
- };
- function handleEvent(type, getId, getEvent) {
- const handler = /* @__PURE__ */ __name(({ detail }) => {
- const id2 = getId(detail);
- if (!id2) return;
- const node2 = app.graph.getNodeById(id2);
- if (node2) return;
- const innerNodeIndex = this.innerNodes?.findIndex((n) => n.id == id2);
- if (innerNodeIndex > -1) {
- this.node.runningInternalNodeId = innerNodeIndex;
- api.dispatchCustomEvent(
- type,
- getEvent(detail, `${this.node.id}`, this.node)
- );
- }
- }, "handler");
- api.addEventListener(type, handler);
- return handler;
- }
- __name(handleEvent, "handleEvent");
- const executing = handleEvent.call(
- this,
- "executing",
- (d) => d,
- (d, id2, node2) => id2
- );
- const executed = handleEvent.call(
- this,
- "executed",
- (d) => d?.display_node || d?.node,
- (d, id2, node2) => ({
- ...d,
- node: id2,
- display_node: id2,
- merge: !node2.resetExecution
- })
- );
- const onRemoved = node.onRemoved;
- this.node.onRemoved = function() {
- onRemoved?.apply(this, arguments);
- api.removeEventListener("executing", executing);
- api.removeEventListener("executed", executed);
- };
- this.node.refreshComboInNode = (defs) => {
- for (const widgetName in this.groupData.newToOldWidgetMap) {
- const widget = this.node.widgets.find((w) => w.name === widgetName);
- if (widget?.type === "combo") {
- const old = this.groupData.newToOldWidgetMap[widgetName];
- const def = defs[old.node.type];
- const input = def?.input?.required?.[old.inputName] ?? def?.input?.optional?.[old.inputName];
- if (!input) continue;
- widget.options.values = input[0];
- if (old.inputName !== "image" && // @ts-expect-error Widget values
- !widget.options.values.includes(widget.value)) {
- widget.value = widget.options.values[0];
- widget.callback(widget.value);
- }
- }
- }
- };
- }
- updateInnerWidgets() {
- for (const newWidgetName in this.groupData.newToOldWidgetMap) {
- const newWidget = this.node.widgets.find((w) => w.name === newWidgetName);
- if (!newWidget) continue;
- const newValue = newWidget.value;
- const old = this.groupData.newToOldWidgetMap[newWidgetName];
- let innerNode = this.innerNodes[old.node.index];
- if (innerNode.type === "PrimitiveNode") {
- innerNode.primitiveValue = newValue;
- const primitiveLinked = this.groupData.primitiveToWidget[old.node.index];
- for (const linked of primitiveLinked ?? []) {
- const node = this.innerNodes[linked.nodeId];
- const widget2 = node.widgets.find((w) => w.name === linked.inputName);
- if (widget2) {
- widget2.value = newValue;
- }
- }
- continue;
- } else if (innerNode.type === "Reroute") {
- const rerouteLinks = this.groupData.linksFrom[old.node.index];
- if (rerouteLinks) {
- for (const [_, , targetNodeId, targetSlot] of rerouteLinks["0"]) {
- const node = this.innerNodes[targetNodeId];
- const input = node.inputs[targetSlot];
- if (input.widget) {
- const widget2 = node.widgets?.find(
- (w) => w.name === input.widget.name
- );
- if (widget2) {
- widget2.value = newValue;
- }
- }
- }
- }
- }
- const widget = innerNode.widgets?.find((w) => w.name === old.inputName);
- if (widget) {
- widget.value = newValue;
- }
- }
- }
- populatePrimitive(node, nodeId, oldName, i, linkedShift) {
- const primitiveId = this.groupData.widgetToPrimitive[nodeId]?.[oldName];
- if (primitiveId == null) return;
- const targetWidgetName = this.groupData.oldToNewWidgetMap[primitiveId]["value"];
- const targetWidgetIndex = this.node.widgets.findIndex(
- (w) => w.name === targetWidgetName
- );
- if (targetWidgetIndex > -1) {
- const primitiveNode = this.innerNodes[primitiveId];
- let len = primitiveNode.widgets.length;
- if (len - 1 !== this.node.widgets[targetWidgetIndex].linkedWidgets?.length) {
- len = 1;
- }
- for (let i2 = 0; i2 < len; i2++) {
- this.node.widgets[targetWidgetIndex + i2].value = primitiveNode.widgets[i2].value;
- }
- }
- return true;
- }
- populateReroute(node, nodeId, map) {
- if (node.type !== "Reroute") return;
- const link = this.groupData.linksFrom[nodeId]?.[0]?.[0];
- if (!link) return;
- const [, , targetNodeId, targetNodeSlot] = link;
- const targetNode = this.groupData.nodeData.nodes[targetNodeId];
- const inputs = targetNode.inputs;
- const targetWidget = inputs?.[targetNodeSlot]?.widget;
- if (!targetWidget) return;
- const offset = inputs.length - (targetNode.widgets_values?.length ?? 0);
- const v = targetNode.widgets_values?.[targetNodeSlot - offset];
- if (v == null) return;
- const widgetName = Object.values(map)[0];
- const widget = this.node.widgets.find((w) => w.name === widgetName);
- if (widget) {
- widget.value = v;
- }
- }
- populateWidgets() {
- if (!this.node.widgets) return;
- for (let nodeId = 0; nodeId < this.groupData.nodeData.nodes.length; nodeId++) {
- const node = this.groupData.nodeData.nodes[nodeId];
- const map = this.groupData.oldToNewWidgetMap[nodeId] ?? {};
- const widgets = Object.keys(map);
- if (!node.widgets_values?.length) {
- this.populateReroute(node, nodeId, map);
- continue;
- }
- let linkedShift = 0;
- for (let i = 0; i < widgets.length; i++) {
- const oldName = widgets[i];
- const newName = map[oldName];
- const widgetIndex = this.node.widgets.findIndex(
- (w) => w.name === newName
- );
- const mainWidget = this.node.widgets[widgetIndex];
- if (this.populatePrimitive(node, nodeId, oldName, i, linkedShift) || widgetIndex === -1) {
- const innerWidget = this.innerNodes[nodeId].widgets?.find(
- (w) => w.name === oldName
- );
- linkedShift += innerWidget?.linkedWidgets?.length ?? 0;
- }
- if (widgetIndex === -1) {
- continue;
- }
- mainWidget.value = node.widgets_values[i + linkedShift];
- for (let w = 0; w < mainWidget.linkedWidgets?.length; w++) {
- this.node.widgets[widgetIndex + w + 1].value = node.widgets_values[i + ++linkedShift];
- }
- }
- }
- }
- replaceNodes(nodes) {
- let top;
- let left;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (left == null || node.pos[0] < left) {
- left = node.pos[0];
- }
- if (top == null || node.pos[1] < top) {
- top = node.pos[1];
- }
- this.linkOutputs(node, i);
- app.graph.remove(node);
- }
- this.linkInputs();
- this.node.pos = [left, top];
- }
- linkOutputs(originalNode, nodeId) {
- if (!originalNode.outputs) return;
- for (const output of originalNode.outputs) {
- if (!output.links) continue;
- const links = [...output.links];
- for (const l of links) {
- const link = app.graph.links[l];
- if (!link) continue;
- const targetNode = app.graph.getNodeById(link.target_id);
- const newSlot = this.groupData.oldToNewOutputMap[nodeId]?.[link.origin_slot];
- if (newSlot != null) {
- this.node.connect(newSlot, targetNode, link.target_slot);
- }
- }
- }
- }
- linkInputs() {
- for (const link of this.groupData.nodeData.links ?? []) {
- const [, originSlot, targetId, targetSlot, actualOriginId] = link;
- const originNode = app.graph.getNodeById(actualOriginId);
- if (!originNode) continue;
- originNode.connect(
- originSlot,
- // @ts-expect-error Valid - uses deprecated interface. Required check: if (graph.getNodeById(this.node.id) !== this.node) report()
- this.node.id,
- this.groupData.oldToNewInputMap[targetId][targetSlot]
- );
- }
- }
- static getGroupData(node) {
- return (node.nodeData ?? node.constructor?.nodeData)?.[GROUP];
- }
- static isGroupNode(node) {
- return !!node.constructor?.nodeData?.[GROUP];
- }
- static async fromNodes(nodes) {
- const builder = new GroupNodeBuilder(nodes);
- const res = await builder.build();
- if (!res) return;
- const { name, nodeData } = res;
- const config = new GroupNodeConfig(name, nodeData);
- await config.registerType();
- const groupNode = LiteGraph.createNode(`${PREFIX}${SEPARATOR}${name}`);
- groupNode.setInnerNodes(builder.nodes);
- groupNode[GROUP].populateWidgets();
- app.graph.add(groupNode);
- groupNode[GROUP].replaceNodes(builder.nodes);
- return groupNode;
- }
-}
-function addConvertToGroupOptions() {
- function addConvertOption(options, index) {
- const selected = Object.values(app.canvas.selected_nodes ?? {});
- const disabled = selected.length < 2 || selected.find((n) => GroupNodeHandler.isGroupNode(n));
- options.splice(index + 1, null, {
- content: `Convert to Group Node`,
- disabled,
- callback: convertSelectedNodesToGroupNode
- });
- }
- __name(addConvertOption, "addConvertOption");
- function addManageOption(options, index) {
- const groups = app.graph.extra?.groupNodes;
- const disabled = !groups || !Object.keys(groups).length;
- options.splice(index + 1, null, {
- content: `Manage Group Nodes`,
- disabled,
- callback: /* @__PURE__ */ __name(() => manageGroupNodes(), "callback")
- });
- }
- __name(addManageOption, "addManageOption");
- const getCanvasMenuOptions = LGraphCanvas.prototype.getCanvasMenuOptions;
- LGraphCanvas.prototype.getCanvasMenuOptions = function() {
- const options = getCanvasMenuOptions.apply(this, arguments);
- const index = options.findIndex((o) => o?.content === "Add Group") + 1 || options.length;
- addConvertOption(options, index);
- addManageOption(options, index + 1);
- return options;
- };
- const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions;
- LGraphCanvas.prototype.getNodeMenuOptions = function(node) {
- const options = getNodeMenuOptions.apply(this, arguments);
- if (!GroupNodeHandler.isGroupNode(node)) {
- const index = options.findIndex((o) => o?.content === "Outputs") + 1 || options.length - 1;
- addConvertOption(options, index);
- }
- return options;
- };
-}
-__name(addConvertToGroupOptions, "addConvertToGroupOptions");
-const replaceLegacySeparators = /* @__PURE__ */ __name((nodes) => {
- for (const node of nodes) {
- if (typeof node.type === "string" && node.type.startsWith("workflow/")) {
- node.type = node.type.replace(/^workflow\//, `${PREFIX}${SEPARATOR}`);
- }
- }
-}, "replaceLegacySeparators");
-async function convertSelectedNodesToGroupNode() {
- const nodes = Object.values(app.canvas.selected_nodes ?? {});
- if (nodes.length === 0) {
- throw new Error("No nodes selected");
- }
- if (nodes.length === 1) {
- throw new Error("Please select multiple nodes to convert to group node");
- }
- if (nodes.some((n) => GroupNodeHandler.isGroupNode(n))) {
- throw new Error("Selected nodes contain a group node");
- }
- return await GroupNodeHandler.fromNodes(nodes);
-}
-__name(convertSelectedNodesToGroupNode, "convertSelectedNodesToGroupNode");
-function ungroupSelectedGroupNodes() {
- const nodes = Object.values(app.canvas.selected_nodes ?? {});
- for (const node of nodes) {
- if (GroupNodeHandler.isGroupNode(node)) {
- node.convertToNodes?.();
- }
- }
-}
-__name(ungroupSelectedGroupNodes, "ungroupSelectedGroupNodes");
-function manageGroupNodes(type) {
- new ManageGroupDialog(app).show(type);
-}
-__name(manageGroupNodes, "manageGroupNodes");
-const id$1 = "Comfy.GroupNode";
-let globalDefs;
-const ext = {
- name: id$1,
- commands: [
- {
- id: "Comfy.GroupNode.ConvertSelectedNodesToGroupNode",
- label: "Convert selected nodes to group node",
- icon: "pi pi-sitemap",
- versionAdded: "1.3.17",
- function: convertSelectedNodesToGroupNode
- },
- {
- id: "Comfy.GroupNode.UngroupSelectedGroupNodes",
- label: "Ungroup selected group nodes",
- icon: "pi pi-sitemap",
- versionAdded: "1.3.17",
- function: ungroupSelectedGroupNodes
- },
- {
- id: "Comfy.GroupNode.ManageGroupNodes",
- label: "Manage group nodes",
- icon: "pi pi-cog",
- versionAdded: "1.3.17",
- function: manageGroupNodes
- }
- ],
- keybindings: [
- {
- commandId: "Comfy.GroupNode.ConvertSelectedNodesToGroupNode",
- combo: {
- alt: true,
- key: "g"
- }
- },
- {
- commandId: "Comfy.GroupNode.UngroupSelectedGroupNodes",
- combo: {
- alt: true,
- shift: true,
- key: "G"
- }
- }
- ],
- setup() {
- addConvertToGroupOptions();
- },
- async beforeConfigureGraph(graphData, missingNodeTypes) {
- const nodes = graphData?.extra?.groupNodes;
- if (nodes) {
- replaceLegacySeparators(graphData.nodes);
- await GroupNodeConfig.registerFromWorkflow(nodes, missingNodeTypes);
- }
- },
- addCustomNodeDefs(defs) {
- globalDefs = defs;
- },
- nodeCreated(node) {
- if (GroupNodeHandler.isGroupNode(node)) {
- node[GROUP] = new GroupNodeHandler(node);
- if (node.title && node[GROUP]?.groupData?.nodeData) {
- Workflow.storeGroupNode(node.title, node[GROUP].groupData.nodeData);
- }
- }
- },
- async refreshComboInNodes(defs) {
- Object.assign(globalDefs, defs);
- const nodes = app.graph.extra?.groupNodes;
- if (nodes) {
- await GroupNodeConfig.registerFromWorkflow(nodes, {});
- }
- }
-};
-app.registerExtension(ext);
-window.comfyAPI = window.comfyAPI || {};
-window.comfyAPI.groupNode = window.comfyAPI.groupNode || {};
-window.comfyAPI.groupNode.GroupNodeConfig = GroupNodeConfig;
-window.comfyAPI.groupNode.GroupNodeHandler = GroupNodeHandler;
-function setNodeMode(node, mode) {
- node.mode = mode;
- node.graph?.change();
-}
-__name(setNodeMode, "setNodeMode");
-function addNodesToGroup(group, items) {
- const padding = useSettingStore().get("Comfy.GroupSelectedNodes.Padding");
- group.resizeTo([...group.children, ...items], padding);
-}
-__name(addNodesToGroup, "addNodesToGroup");
-app.registerExtension({
- name: "Comfy.GroupOptions",
- setup() {
- const orig = LGraphCanvas.prototype.getCanvasMenuOptions;
- LGraphCanvas.prototype.getCanvasMenuOptions = function() {
- const options = orig.apply(this, arguments);
- const group = this.graph.getGroupOnPos(
- this.graph_mouse[0],
- this.graph_mouse[1]
- );
- if (!group) {
- options.push({
- content: "Add Group For Selected Nodes",
- disabled: !this.selectedItems?.size,
- callback: /* @__PURE__ */ __name(() => {
- const group2 = new LGraphGroup();
- addNodesToGroup(group2, this.selectedItems);
- this.graph.add(group2);
- this.graph.change();
- }, "callback")
- });
- return options;
- }
- group.recomputeInsideNodes();
- const nodesInGroup = group.nodes;
- options.push({
- content: "Add Selected Nodes To Group",
- disabled: !this.selectedItems?.size,
- callback: /* @__PURE__ */ __name(() => {
- addNodesToGroup(group, this.selectedItems);
- this.graph.change();
- }, "callback")
- });
- if (nodesInGroup.length === 0) {
- return options;
- } else {
- options.push(null);
- }
- let allNodesAreSameMode = true;
- for (let i = 1; i < nodesInGroup.length; i++) {
- if (nodesInGroup[i].mode !== nodesInGroup[0].mode) {
- allNodesAreSameMode = false;
- break;
- }
- }
- options.push({
- content: "Fit Group To Nodes",
- callback: /* @__PURE__ */ __name(() => {
- group.recomputeInsideNodes();
- const padding = useSettingStore().get(
- "Comfy.GroupSelectedNodes.Padding"
- );
- group.resizeTo(group.children, padding);
- this.graph.change();
- }, "callback")
- });
- options.push({
- content: "Select Nodes",
- callback: /* @__PURE__ */ __name(() => {
- this.selectNodes(nodesInGroup);
- this.graph.change();
- this.canvas.focus();
- }, "callback")
- });
- if (allNodesAreSameMode) {
- const mode = nodesInGroup[0].mode;
- switch (mode) {
- case 0:
- options.push({
- content: "Set Group Nodes to Never",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 2);
- }
- }, "callback")
- });
- options.push({
- content: "Bypass Group Nodes",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 4);
- }
- }, "callback")
- });
- break;
- case 2:
- options.push({
- content: "Set Group Nodes to Always",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 0);
- }
- }, "callback")
- });
- options.push({
- content: "Bypass Group Nodes",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 4);
- }
- }, "callback")
- });
- break;
- case 4:
- options.push({
- content: "Set Group Nodes to Always",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 0);
- }
- }, "callback")
- });
- options.push({
- content: "Set Group Nodes to Never",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 2);
- }
- }, "callback")
- });
- break;
- default:
- options.push({
- content: "Set Group Nodes to Always",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 0);
- }
- }, "callback")
- });
- options.push({
- content: "Set Group Nodes to Never",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 2);
- }
- }, "callback")
- });
- options.push({
- content: "Bypass Group Nodes",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 4);
- }
- }, "callback")
- });
- break;
- }
- } else {
- options.push({
- content: "Set Group Nodes to Always",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 0);
- }
- }, "callback")
- });
- options.push({
- content: "Set Group Nodes to Never",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 2);
- }
- }, "callback")
- });
- options.push({
- content: "Bypass Group Nodes",
- callback: /* @__PURE__ */ __name(() => {
- for (const node of nodesInGroup) {
- setNodeMode(node, 4);
- }
- }, "callback")
- });
- }
- return options;
- };
- }
-});
-class Load3dUtils {
- static {
- __name(this, "Load3dUtils");
- }
- static async uploadTempImage(imageData, prefix) {
- const blob = await fetch(imageData).then((r) => r.blob());
- const name = `${prefix}_${Date.now()}.png`;
- const file2 = new File([blob], name);
- const body = new FormData();
- body.append("image", file2);
- body.append("subfolder", "threed");
- body.append("type", "temp");
- const resp = await api.fetchApi("/upload/image", {
- method: "POST",
- body
- });
- if (resp.status !== 200) {
- const err2 = `Error uploading temp image: ${resp.status} - ${resp.statusText}`;
- useToastStore().addAlert(err2);
- throw new Error(err2);
- }
- return await resp.json();
- }
- static async uploadFile(load3d, file2, fileInput) {
- let uploadPath;
- try {
- const body = new FormData();
- body.append("image", file2);
- body.append("subfolder", "3d");
- const resp = await api.fetchApi("/upload/image", {
- method: "POST",
- body
- });
- if (resp.status === 200) {
- const data = await resp.json();
- let path = data.name;
- if (data.subfolder) path = data.subfolder + "/" + path;
- uploadPath = path;
- const modelUrl = api.apiURL(
- this.getResourceURL(...this.splitFilePath(path), "input")
- );
- await load3d.loadModel(modelUrl, file2.name);
- const fileExt = file2.name.split(".").pop()?.toLowerCase();
- if (fileExt === "obj" && fileInput?.files) {
- try {
- const mtlFile = Array.from(fileInput.files).find(
- (f) => f.name.toLowerCase().endsWith(".mtl")
- );
- if (mtlFile) {
- const mtlFormData = new FormData();
- mtlFormData.append("image", mtlFile);
- mtlFormData.append("subfolder", "3d");
- await api.fetchApi("/upload/image", {
- method: "POST",
- body: mtlFormData
- });
- }
- } catch (mtlError) {
- console.warn("Failed to upload MTL file:", mtlError);
- }
- }
- } else {
- useToastStore().addAlert(resp.status + " - " + resp.statusText);
- }
- } catch (error) {
- console.error("Upload error:", error);
- useToastStore().addAlert(
- error instanceof Error ? error.message : "Upload failed"
- );
- }
- return uploadPath;
- }
- static splitFilePath(path) {
- const folder_separator = path.lastIndexOf("/");
- if (folder_separator === -1) {
- return ["", path];
- }
- return [
- path.substring(0, folder_separator),
- path.substring(folder_separator + 1)
- ];
- }
- static getResourceURL(subfolder, filename, type = "input") {
- const params = [
- "filename=" + encodeURIComponent(filename),
- "type=" + type,
- "subfolder=" + subfolder,
- app.getRandParam().substring(1)
- ].join("&");
- return `/view?${params}`;
- }
-}
-class Load3DConfiguration {
- static {
- __name(this, "Load3DConfiguration");
- }
- constructor(load3d) {
- this.load3d = load3d;
- }
- configure(loadFolder, modelWidget, material, upDirection, cameraState, width = null, height = null, postModelUpdateFunc) {
- this.setupModelHandling(
- modelWidget,
- loadFolder,
- cameraState,
- postModelUpdateFunc
- );
- this.setupMaterial(material);
- this.setupDirection(upDirection);
- this.setupTargetSize(width, height);
- this.setupDefaultProperties();
- }
- setupTargetSize(width, height) {
- if (width && height) {
- this.load3d.setTargetSize(width.value, height.value);
- width.callback = (value) => {
- this.load3d.setTargetSize(value, height.value);
- };
- height.callback = (value) => {
- this.load3d.setTargetSize(width.value, value);
- };
- }
- }
- setupModelHandling(modelWidget, loadFolder, cameraState, postModelUpdateFunc) {
- const onModelWidgetUpdate = this.createModelUpdateHandler(
- loadFolder,
- cameraState,
- postModelUpdateFunc
- );
- if (modelWidget.value) {
- onModelWidgetUpdate(modelWidget.value);
- }
- modelWidget.callback = onModelWidgetUpdate;
- }
- setupMaterial(material) {
- material.callback = (value) => {
- this.load3d.setMaterialMode(value);
- };
- this.load3d.setMaterialMode(
- material.value
- );
- }
- setupDirection(upDirection) {
- upDirection.callback = (value) => {
- this.load3d.setUpDirection(value);
- };
- this.load3d.setUpDirection(
- upDirection.value
- );
- }
- setupDefaultProperties() {
- const cameraType = this.load3d.loadNodeProperty(
- "Camera Type",
- "perspective"
- );
- this.load3d.toggleCamera(cameraType);
- const showGrid = this.load3d.loadNodeProperty("Show Grid", true);
- this.load3d.toggleGrid(showGrid);
- const bgColor = this.load3d.loadNodeProperty("Background Color", "#282828");
- this.load3d.setBackgroundColor(bgColor);
- const lightIntensity = this.load3d.loadNodeProperty("Light Intensity", "5");
- this.load3d.setLightIntensity(lightIntensity);
- const fov2 = this.load3d.loadNodeProperty("FOV", "75");
- this.load3d.setFOV(fov2);
- }
- createModelUpdateHandler(loadFolder, cameraState, postModelUpdateFunc) {
- let isFirstLoad = true;
- return async (value) => {
- if (!value) return;
- const filename = value;
- const modelUrl = api.apiURL(
- Load3dUtils.getResourceURL(
- ...Load3dUtils.splitFilePath(filename),
- loadFolder
- )
- );
- await this.load3d.loadModel(modelUrl, filename);
- if (postModelUpdateFunc) {
- postModelUpdateFunc(this.load3d);
- }
- if (isFirstLoad && cameraState && typeof cameraState === "object") {
- try {
- this.load3d.setCameraState(cameraState);
- } catch (error) {
- console.warn("Failed to restore camera state:", error);
- }
- isFirstLoad = false;
- }
- };
- }
-}
-/**
- * @license
- * Copyright 2010-2024 Three.js Authors
- * SPDX-License-Identifier: MIT
- */
-const REVISION = "170";
-const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
-const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
-const CullFaceNone = 0;
-const CullFaceBack = 1;
-const CullFaceFront = 2;
-const CullFaceFrontBack = 3;
-const BasicShadowMap = 0;
-const PCFShadowMap = 1;
-const PCFSoftShadowMap = 2;
-const VSMShadowMap = 3;
-const FrontSide = 0;
-const BackSide = 1;
-const DoubleSide = 2;
-const NoBlending = 0;
-const NormalBlending = 1;
-const AdditiveBlending = 2;
-const SubtractiveBlending = 3;
-const MultiplyBlending = 4;
-const CustomBlending = 5;
-const AddEquation = 100;
-const SubtractEquation = 101;
-const ReverseSubtractEquation = 102;
-const MinEquation = 103;
-const MaxEquation = 104;
-const ZeroFactor = 200;
-const OneFactor = 201;
-const SrcColorFactor = 202;
-const OneMinusSrcColorFactor = 203;
-const SrcAlphaFactor = 204;
-const OneMinusSrcAlphaFactor = 205;
-const DstAlphaFactor = 206;
-const OneMinusDstAlphaFactor = 207;
-const DstColorFactor = 208;
-const OneMinusDstColorFactor = 209;
-const SrcAlphaSaturateFactor = 210;
-const ConstantColorFactor = 211;
-const OneMinusConstantColorFactor = 212;
-const ConstantAlphaFactor = 213;
-const OneMinusConstantAlphaFactor = 214;
-const NeverDepth = 0;
-const AlwaysDepth = 1;
-const LessDepth = 2;
-const LessEqualDepth = 3;
-const EqualDepth = 4;
-const GreaterEqualDepth = 5;
-const GreaterDepth = 6;
-const NotEqualDepth = 7;
-const MultiplyOperation = 0;
-const MixOperation = 1;
-const AddOperation = 2;
-const NoToneMapping = 0;
-const LinearToneMapping = 1;
-const ReinhardToneMapping = 2;
-const CineonToneMapping = 3;
-const ACESFilmicToneMapping = 4;
-const CustomToneMapping = 5;
-const AgXToneMapping = 6;
-const NeutralToneMapping = 7;
-const AttachedBindMode = "attached";
-const DetachedBindMode = "detached";
-const UVMapping = 300;
-const CubeReflectionMapping = 301;
-const CubeRefractionMapping = 302;
-const EquirectangularReflectionMapping = 303;
-const EquirectangularRefractionMapping = 304;
-const CubeUVReflectionMapping = 306;
-const RepeatWrapping = 1e3;
-const ClampToEdgeWrapping = 1001;
-const MirroredRepeatWrapping = 1002;
-const NearestFilter = 1003;
-const NearestMipmapNearestFilter = 1004;
-const NearestMipMapNearestFilter = 1004;
-const NearestMipmapLinearFilter = 1005;
-const NearestMipMapLinearFilter = 1005;
-const LinearFilter = 1006;
-const LinearMipmapNearestFilter = 1007;
-const LinearMipMapNearestFilter = 1007;
-const LinearMipmapLinearFilter = 1008;
-const LinearMipMapLinearFilter = 1008;
-const UnsignedByteType = 1009;
-const ByteType = 1010;
-const ShortType = 1011;
-const UnsignedShortType = 1012;
-const IntType = 1013;
-const UnsignedIntType = 1014;
-const FloatType = 1015;
-const HalfFloatType = 1016;
-const UnsignedShort4444Type = 1017;
-const UnsignedShort5551Type = 1018;
-const UnsignedInt248Type = 1020;
-const UnsignedInt5999Type = 35902;
-const AlphaFormat = 1021;
-const RGBFormat = 1022;
-const RGBAFormat = 1023;
-const LuminanceFormat = 1024;
-const LuminanceAlphaFormat = 1025;
-const DepthFormat = 1026;
-const DepthStencilFormat = 1027;
-const RedFormat = 1028;
-const RedIntegerFormat = 1029;
-const RGFormat = 1030;
-const RGIntegerFormat = 1031;
-const RGBIntegerFormat = 1032;
-const RGBAIntegerFormat = 1033;
-const RGB_S3TC_DXT1_Format = 33776;
-const RGBA_S3TC_DXT1_Format = 33777;
-const RGBA_S3TC_DXT3_Format = 33778;
-const RGBA_S3TC_DXT5_Format = 33779;
-const RGB_PVRTC_4BPPV1_Format = 35840;
-const RGB_PVRTC_2BPPV1_Format = 35841;
-const RGBA_PVRTC_4BPPV1_Format = 35842;
-const RGBA_PVRTC_2BPPV1_Format = 35843;
-const RGB_ETC1_Format = 36196;
-const RGB_ETC2_Format = 37492;
-const RGBA_ETC2_EAC_Format = 37496;
-const RGBA_ASTC_4x4_Format = 37808;
-const RGBA_ASTC_5x4_Format = 37809;
-const RGBA_ASTC_5x5_Format = 37810;
-const RGBA_ASTC_6x5_Format = 37811;
-const RGBA_ASTC_6x6_Format = 37812;
-const RGBA_ASTC_8x5_Format = 37813;
-const RGBA_ASTC_8x6_Format = 37814;
-const RGBA_ASTC_8x8_Format = 37815;
-const RGBA_ASTC_10x5_Format = 37816;
-const RGBA_ASTC_10x6_Format = 37817;
-const RGBA_ASTC_10x8_Format = 37818;
-const RGBA_ASTC_10x10_Format = 37819;
-const RGBA_ASTC_12x10_Format = 37820;
-const RGBA_ASTC_12x12_Format = 37821;
-const RGBA_BPTC_Format = 36492;
-const RGB_BPTC_SIGNED_Format = 36494;
-const RGB_BPTC_UNSIGNED_Format = 36495;
-const RED_RGTC1_Format = 36283;
-const SIGNED_RED_RGTC1_Format = 36284;
-const RED_GREEN_RGTC2_Format = 36285;
-const SIGNED_RED_GREEN_RGTC2_Format = 36286;
-const LoopOnce = 2200;
-const LoopRepeat = 2201;
-const LoopPingPong = 2202;
-const InterpolateDiscrete = 2300;
-const InterpolateLinear = 2301;
-const InterpolateSmooth = 2302;
-const ZeroCurvatureEnding = 2400;
-const ZeroSlopeEnding = 2401;
-const WrapAroundEnding = 2402;
-const NormalAnimationBlendMode = 2500;
-const AdditiveAnimationBlendMode = 2501;
-const TrianglesDrawMode = 0;
-const TriangleStripDrawMode = 1;
-const TriangleFanDrawMode = 2;
-const BasicDepthPacking = 3200;
-const RGBADepthPacking = 3201;
-const RGBDepthPacking = 3202;
-const RGDepthPacking = 3203;
-const TangentSpaceNormalMap = 0;
-const ObjectSpaceNormalMap = 1;
-const NoColorSpace = "";
-const SRGBColorSpace = "srgb";
-const LinearSRGBColorSpace = "srgb-linear";
-const LinearTransfer = "linear";
-const SRGBTransfer = "srgb";
-const ZeroStencilOp = 0;
-const KeepStencilOp = 7680;
-const ReplaceStencilOp = 7681;
-const IncrementStencilOp = 7682;
-const DecrementStencilOp = 7683;
-const IncrementWrapStencilOp = 34055;
-const DecrementWrapStencilOp = 34056;
-const InvertStencilOp = 5386;
-const NeverStencilFunc = 512;
-const LessStencilFunc = 513;
-const EqualStencilFunc = 514;
-const LessEqualStencilFunc = 515;
-const GreaterStencilFunc = 516;
-const NotEqualStencilFunc = 517;
-const GreaterEqualStencilFunc = 518;
-const AlwaysStencilFunc = 519;
-const NeverCompare = 512;
-const LessCompare = 513;
-const EqualCompare = 514;
-const LessEqualCompare = 515;
-const GreaterCompare = 516;
-const NotEqualCompare = 517;
-const GreaterEqualCompare = 518;
-const AlwaysCompare = 519;
-const StaticDrawUsage = 35044;
-const DynamicDrawUsage = 35048;
-const StreamDrawUsage = 35040;
-const StaticReadUsage = 35045;
-const DynamicReadUsage = 35049;
-const StreamReadUsage = 35041;
-const StaticCopyUsage = 35046;
-const DynamicCopyUsage = 35050;
-const StreamCopyUsage = 35042;
-const GLSL1 = "100";
-const GLSL3 = "300 es";
-const WebGLCoordinateSystem = 2e3;
-const WebGPUCoordinateSystem = 2001;
-class EventDispatcher {
- static {
- __name(this, "EventDispatcher");
- }
- addEventListener(type, listener) {
- if (this._listeners === void 0) this._listeners = {};
- const listeners = this._listeners;
- if (listeners[type] === void 0) {
- listeners[type] = [];
- }
- if (listeners[type].indexOf(listener) === -1) {
- listeners[type].push(listener);
- }
- }
- hasEventListener(type, listener) {
- if (this._listeners === void 0) return false;
- const listeners = this._listeners;
- return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1;
- }
- removeEventListener(type, listener) {
- if (this._listeners === void 0) return;
- const listeners = this._listeners;
- const listenerArray = listeners[type];
- if (listenerArray !== void 0) {
- const index = listenerArray.indexOf(listener);
- if (index !== -1) {
- listenerArray.splice(index, 1);
- }
- }
- }
- dispatchEvent(event) {
- if (this._listeners === void 0) return;
- const listeners = this._listeners;
- const listenerArray = listeners[event.type];
- if (listenerArray !== void 0) {
- event.target = this;
- const array = listenerArray.slice(0);
- for (let i = 0, l = array.length; i < l; i++) {
- array[i].call(this, event);
- }
- event.target = null;
- }
- }
-}
-const _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
-let _seed = 1234567;
-const DEG2RAD = Math.PI / 180;
-const RAD2DEG = 180 / Math.PI;
-function generateUUID() {
- const d0 = Math.random() * 4294967295 | 0;
- const d1 = Math.random() * 4294967295 | 0;
- const d2 = Math.random() * 4294967295 | 0;
- const d3 = Math.random() * 4294967295 | 0;
- const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
- return uuid.toLowerCase();
-}
-__name(generateUUID, "generateUUID");
-function clamp(value, min, max2) {
- return Math.max(min, Math.min(max2, value));
-}
-__name(clamp, "clamp");
-function euclideanModulo(n, m) {
- return (n % m + m) % m;
-}
-__name(euclideanModulo, "euclideanModulo");
-function mapLinear(x, a1, a2, b1, b22) {
- return b1 + (x - a1) * (b22 - b1) / (a2 - a1);
-}
-__name(mapLinear, "mapLinear");
-function inverseLerp(x, y, value) {
- if (x !== y) {
- return (value - x) / (y - x);
- } else {
- return 0;
- }
-}
-__name(inverseLerp, "inverseLerp");
-function lerp(x, y, t2) {
- return (1 - t2) * x + t2 * y;
-}
-__name(lerp, "lerp");
-function damp(x, y, lambda, dt) {
- return lerp(x, y, 1 - Math.exp(-lambda * dt));
-}
-__name(damp, "damp");
-function pingpong(x, length = 1) {
- return length - Math.abs(euclideanModulo(x, length * 2) - length);
-}
-__name(pingpong, "pingpong");
-function smoothstep(x, min, max2) {
- if (x <= min) return 0;
- if (x >= max2) return 1;
- x = (x - min) / (max2 - min);
- return x * x * (3 - 2 * x);
-}
-__name(smoothstep, "smoothstep");
-function smootherstep(x, min, max2) {
- if (x <= min) return 0;
- if (x >= max2) return 1;
- x = (x - min) / (max2 - min);
- return x * x * x * (x * (x * 6 - 15) + 10);
-}
-__name(smootherstep, "smootherstep");
-function randInt(low, high) {
- return low + Math.floor(Math.random() * (high - low + 1));
-}
-__name(randInt, "randInt");
-function randFloat(low, high) {
- return low + Math.random() * (high - low);
-}
-__name(randFloat, "randFloat");
-function randFloatSpread(range) {
- return range * (0.5 - Math.random());
-}
-__name(randFloatSpread, "randFloatSpread");
-function seededRandom(s) {
- if (s !== void 0) _seed = s;
- let t2 = _seed += 1831565813;
- t2 = Math.imul(t2 ^ t2 >>> 15, t2 | 1);
- t2 ^= t2 + Math.imul(t2 ^ t2 >>> 7, t2 | 61);
- return ((t2 ^ t2 >>> 14) >>> 0) / 4294967296;
-}
-__name(seededRandom, "seededRandom");
-function degToRad(degrees) {
- return degrees * DEG2RAD;
-}
-__name(degToRad, "degToRad");
-function radToDeg(radians) {
- return radians * RAD2DEG;
-}
-__name(radToDeg, "radToDeg");
-function isPowerOfTwo(value) {
- return (value & value - 1) === 0 && value !== 0;
-}
-__name(isPowerOfTwo, "isPowerOfTwo");
-function ceilPowerOfTwo(value) {
- return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));
-}
-__name(ceilPowerOfTwo, "ceilPowerOfTwo");
-function floorPowerOfTwo(value) {
- return Math.pow(2, Math.floor(Math.log(value) / Math.LN2));
-}
-__name(floorPowerOfTwo, "floorPowerOfTwo");
-function setQuaternionFromProperEuler(q, a, b, c, order) {
- const cos = Math.cos;
- const sin = Math.sin;
- const c2 = cos(b / 2);
- const s2 = sin(b / 2);
- const c13 = cos((a + c) / 2);
- const s13 = sin((a + c) / 2);
- const c1_3 = cos((a - c) / 2);
- const s1_3 = sin((a - c) / 2);
- const c3_1 = cos((c - a) / 2);
- const s3_1 = sin((c - a) / 2);
- switch (order) {
- case "XYX":
- q.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);
- break;
- case "YZY":
- q.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);
- break;
- case "ZXZ":
- q.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);
- break;
- case "XZX":
- q.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);
- break;
- case "YXY":
- q.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);
- break;
- case "ZYZ":
- q.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);
- break;
- default:
- console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + order);
- }
-}
-__name(setQuaternionFromProperEuler, "setQuaternionFromProperEuler");
-function denormalize(value, array) {
- switch (array.constructor) {
- case Float32Array:
- return value;
- case Uint32Array:
- return value / 4294967295;
- case Uint16Array:
- return value / 65535;
- case Uint8Array:
- return value / 255;
- case Int32Array:
- return Math.max(value / 2147483647, -1);
- case Int16Array:
- return Math.max(value / 32767, -1);
- case Int8Array:
- return Math.max(value / 127, -1);
- default:
- throw new Error("Invalid component type.");
- }
-}
-__name(denormalize, "denormalize");
-function normalize(value, array) {
- switch (array.constructor) {
- case Float32Array:
- return value;
- case Uint32Array:
- return Math.round(value * 4294967295);
- case Uint16Array:
- return Math.round(value * 65535);
- case Uint8Array:
- return Math.round(value * 255);
- case Int32Array:
- return Math.round(value * 2147483647);
- case Int16Array:
- return Math.round(value * 32767);
- case Int8Array:
- return Math.round(value * 127);
- default:
- throw new Error("Invalid component type.");
- }
-}
-__name(normalize, "normalize");
-const MathUtils = {
- DEG2RAD,
- RAD2DEG,
- generateUUID,
- clamp,
- euclideanModulo,
- mapLinear,
- inverseLerp,
- lerp,
- damp,
- pingpong,
- smoothstep,
- smootherstep,
- randInt,
- randFloat,
- randFloatSpread,
- seededRandom,
- degToRad,
- radToDeg,
- isPowerOfTwo,
- ceilPowerOfTwo,
- floorPowerOfTwo,
- setQuaternionFromProperEuler,
- normalize,
- denormalize
-};
-class Vector2 {
- static {
- __name(this, "Vector2");
- }
- constructor(x = 0, y = 0) {
- Vector2.prototype.isVector2 = true;
- this.x = x;
- this.y = y;
- }
- get width() {
- return this.x;
- }
- set width(value) {
- this.x = value;
- }
- get height() {
- return this.y;
- }
- set height(value) {
- this.y = value;
- }
- set(x, y) {
- this.x = x;
- this.y = y;
- return this;
- }
- setScalar(scalar) {
- this.x = scalar;
- this.y = scalar;
- return this;
- }
- setX(x) {
- this.x = x;
- return this;
- }
- setY(y) {
- this.y = y;
- return this;
- }
- setComponent(index, value) {
- switch (index) {
- case 0:
- this.x = value;
- break;
- case 1:
- this.y = value;
- break;
- default:
- throw new Error("index is out of range: " + index);
- }
- return this;
- }
- getComponent(index) {
- switch (index) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- default:
- throw new Error("index is out of range: " + index);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y);
- }
- copy(v) {
- this.x = v.x;
- this.y = v.y;
- return this;
- }
- add(v) {
- this.x += v.x;
- this.y += v.y;
- return this;
- }
- addScalar(s) {
- this.x += s;
- this.y += s;
- return this;
- }
- addVectors(a, b) {
- this.x = a.x + b.x;
- this.y = a.y + b.y;
- return this;
- }
- addScaledVector(v, s) {
- this.x += v.x * s;
- this.y += v.y * s;
- return this;
- }
- sub(v) {
- this.x -= v.x;
- this.y -= v.y;
- return this;
- }
- subScalar(s) {
- this.x -= s;
- this.y -= s;
- return this;
- }
- subVectors(a, b) {
- this.x = a.x - b.x;
- this.y = a.y - b.y;
- return this;
- }
- multiply(v) {
- this.x *= v.x;
- this.y *= v.y;
- return this;
- }
- multiplyScalar(scalar) {
- this.x *= scalar;
- this.y *= scalar;
- return this;
- }
- divide(v) {
- this.x /= v.x;
- this.y /= v.y;
- return this;
- }
- divideScalar(scalar) {
- return this.multiplyScalar(1 / scalar);
- }
- applyMatrix3(m) {
- const x = this.x, y = this.y;
- const e = m.elements;
- this.x = e[0] * x + e[3] * y + e[6];
- this.y = e[1] * x + e[4] * y + e[7];
- return this;
- }
- min(v) {
- this.x = Math.min(this.x, v.x);
- this.y = Math.min(this.y, v.y);
- return this;
- }
- max(v) {
- this.x = Math.max(this.x, v.x);
- this.y = Math.max(this.y, v.y);
- return this;
- }
- clamp(min, max2) {
- this.x = Math.max(min.x, Math.min(max2.x, this.x));
- this.y = Math.max(min.y, Math.min(max2.y, this.y));
- return this;
- }
- clampScalar(minVal, maxVal) {
- this.x = Math.max(minVal, Math.min(maxVal, this.x));
- this.y = Math.max(minVal, Math.min(maxVal, this.y));
- return this;
- }
- clampLength(min, max2) {
- const length = this.length();
- return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
- }
- floor() {
- this.x = Math.floor(this.x);
- this.y = Math.floor(this.y);
- return this;
- }
- ceil() {
- this.x = Math.ceil(this.x);
- this.y = Math.ceil(this.y);
- return this;
- }
- round() {
- this.x = Math.round(this.x);
- this.y = Math.round(this.y);
- return this;
- }
- roundToZero() {
- this.x = Math.trunc(this.x);
- this.y = Math.trunc(this.y);
- return this;
- }
- negate() {
- this.x = -this.x;
- this.y = -this.y;
- return this;
- }
- dot(v) {
- return this.x * v.x + this.y * v.y;
- }
- cross(v) {
- return this.x * v.y - this.y * v.x;
- }
- lengthSq() {
- return this.x * this.x + this.y * this.y;
- }
- length() {
- return Math.sqrt(this.x * this.x + this.y * this.y);
- }
- manhattanLength() {
- return Math.abs(this.x) + Math.abs(this.y);
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- angle() {
- const angle = Math.atan2(-this.y, -this.x) + Math.PI;
- return angle;
- }
- angleTo(v) {
- const denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
- if (denominator === 0) return Math.PI / 2;
- const theta = this.dot(v) / denominator;
- return Math.acos(clamp(theta, -1, 1));
- }
- distanceTo(v) {
- return Math.sqrt(this.distanceToSquared(v));
- }
- distanceToSquared(v) {
- const dx = this.x - v.x, dy = this.y - v.y;
- return dx * dx + dy * dy;
- }
- manhattanDistanceTo(v) {
- return Math.abs(this.x - v.x) + Math.abs(this.y - v.y);
- }
- setLength(length) {
- return this.normalize().multiplyScalar(length);
- }
- lerp(v, alpha) {
- this.x += (v.x - this.x) * alpha;
- this.y += (v.y - this.y) * alpha;
- return this;
- }
- lerpVectors(v1, v2, alpha) {
- this.x = v1.x + (v2.x - v1.x) * alpha;
- this.y = v1.y + (v2.y - v1.y) * alpha;
- return this;
- }
- equals(v) {
- return v.x === this.x && v.y === this.y;
- }
- fromArray(array, offset = 0) {
- this.x = array[offset];
- this.y = array[offset + 1];
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this.x;
- array[offset + 1] = this.y;
- return array;
- }
- fromBufferAttribute(attribute, index) {
- this.x = attribute.getX(index);
- this.y = attribute.getY(index);
- return this;
- }
- rotateAround(center, angle) {
- const c = Math.cos(angle), s = Math.sin(angle);
- const x = this.x - center.x;
- const y = this.y - center.y;
- this.x = x * c - y * s + center.x;
- this.y = x * s + y * c + center.y;
- return this;
- }
- random() {
- this.x = Math.random();
- this.y = Math.random();
- return this;
- }
- *[Symbol.iterator]() {
- yield this.x;
- yield this.y;
- }
-}
-class Matrix3 {
- static {
- __name(this, "Matrix3");
- }
- constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
- Matrix3.prototype.isMatrix3 = true;
- this.elements = [
- 1,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 1
- ];
- if (n11 !== void 0) {
- this.set(n11, n12, n13, n21, n22, n23, n31, n32, n33);
- }
- }
- set(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
- const te2 = this.elements;
- te2[0] = n11;
- te2[1] = n21;
- te2[2] = n31;
- te2[3] = n12;
- te2[4] = n22;
- te2[5] = n32;
- te2[6] = n13;
- te2[7] = n23;
- te2[8] = n33;
- return this;
- }
- identity() {
- this.set(
- 1,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- copy(m) {
- const te2 = this.elements;
- const me = m.elements;
- te2[0] = me[0];
- te2[1] = me[1];
- te2[2] = me[2];
- te2[3] = me[3];
- te2[4] = me[4];
- te2[5] = me[5];
- te2[6] = me[6];
- te2[7] = me[7];
- te2[8] = me[8];
- return this;
- }
- extractBasis(xAxis, yAxis, zAxis) {
- xAxis.setFromMatrix3Column(this, 0);
- yAxis.setFromMatrix3Column(this, 1);
- zAxis.setFromMatrix3Column(this, 2);
- return this;
- }
- setFromMatrix4(m) {
- const me = m.elements;
- this.set(
- me[0],
- me[4],
- me[8],
- me[1],
- me[5],
- me[9],
- me[2],
- me[6],
- me[10]
- );
- return this;
- }
- multiply(m) {
- return this.multiplyMatrices(this, m);
- }
- premultiply(m) {
- return this.multiplyMatrices(m, this);
- }
- multiplyMatrices(a, b) {
- const ae = a.elements;
- const be = b.elements;
- const te2 = this.elements;
- const a11 = ae[0], a12 = ae[3], a13 = ae[6];
- const a21 = ae[1], a22 = ae[4], a23 = ae[7];
- const a31 = ae[2], a32 = ae[5], a33 = ae[8];
- const b11 = be[0], b12 = be[3], b13 = be[6];
- const b21 = be[1], b22 = be[4], b23 = be[7];
- const b31 = be[2], b32 = be[5], b33 = be[8];
- te2[0] = a11 * b11 + a12 * b21 + a13 * b31;
- te2[3] = a11 * b12 + a12 * b22 + a13 * b32;
- te2[6] = a11 * b13 + a12 * b23 + a13 * b33;
- te2[1] = a21 * b11 + a22 * b21 + a23 * b31;
- te2[4] = a21 * b12 + a22 * b22 + a23 * b32;
- te2[7] = a21 * b13 + a22 * b23 + a23 * b33;
- te2[2] = a31 * b11 + a32 * b21 + a33 * b31;
- te2[5] = a31 * b12 + a32 * b22 + a33 * b32;
- te2[8] = a31 * b13 + a32 * b23 + a33 * b33;
- return this;
- }
- multiplyScalar(s) {
- const te2 = this.elements;
- te2[0] *= s;
- te2[3] *= s;
- te2[6] *= s;
- te2[1] *= s;
- te2[4] *= s;
- te2[7] *= s;
- te2[2] *= s;
- te2[5] *= s;
- te2[8] *= s;
- return this;
- }
- determinant() {
- const te2 = this.elements;
- const a = te2[0], b = te2[1], c = te2[2], d = te2[3], e = te2[4], f = te2[5], g = te2[6], h = te2[7], i = te2[8];
- return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;
- }
- invert() {
- const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n12 = te2[3], n22 = te2[4], n32 = te2[5], n13 = te2[6], n23 = te2[7], n33 = te2[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13;
- if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
- const detInv = 1 / det;
- te2[0] = t11 * detInv;
- te2[1] = (n31 * n23 - n33 * n21) * detInv;
- te2[2] = (n32 * n21 - n31 * n22) * detInv;
- te2[3] = t12 * detInv;
- te2[4] = (n33 * n11 - n31 * n13) * detInv;
- te2[5] = (n31 * n12 - n32 * n11) * detInv;
- te2[6] = t13 * detInv;
- te2[7] = (n21 * n13 - n23 * n11) * detInv;
- te2[8] = (n22 * n11 - n21 * n12) * detInv;
- return this;
- }
- transpose() {
- let tmp2;
- const m = this.elements;
- tmp2 = m[1];
- m[1] = m[3];
- m[3] = tmp2;
- tmp2 = m[2];
- m[2] = m[6];
- m[6] = tmp2;
- tmp2 = m[5];
- m[5] = m[7];
- m[7] = tmp2;
- return this;
- }
- getNormalMatrix(matrix4) {
- return this.setFromMatrix4(matrix4).invert().transpose();
- }
- transposeIntoArray(r) {
- const m = this.elements;
- r[0] = m[0];
- r[1] = m[3];
- r[2] = m[6];
- r[3] = m[1];
- r[4] = m[4];
- r[5] = m[7];
- r[6] = m[2];
- r[7] = m[5];
- r[8] = m[8];
- return this;
- }
- setUvTransform(tx, ty, sx, sy, rotation, cx, cy) {
- const c = Math.cos(rotation);
- const s = Math.sin(rotation);
- this.set(
- sx * c,
- sx * s,
- -sx * (c * cx + s * cy) + cx + tx,
- -sy * s,
- sy * c,
- -sy * (-s * cx + c * cy) + cy + ty,
- 0,
- 0,
- 1
- );
- return this;
- }
- //
- scale(sx, sy) {
- this.premultiply(_m3.makeScale(sx, sy));
- return this;
- }
- rotate(theta) {
- this.premultiply(_m3.makeRotation(-theta));
- return this;
- }
- translate(tx, ty) {
- this.premultiply(_m3.makeTranslation(tx, ty));
- return this;
- }
- // for 2D Transforms
- makeTranslation(x, y) {
- if (x.isVector2) {
- this.set(
- 1,
- 0,
- x.x,
- 0,
- 1,
- x.y,
- 0,
- 0,
- 1
- );
- } else {
- this.set(
- 1,
- 0,
- x,
- 0,
- 1,
- y,
- 0,
- 0,
- 1
- );
- }
- return this;
- }
- makeRotation(theta) {
- const c = Math.cos(theta);
- const s = Math.sin(theta);
- this.set(
- c,
- -s,
- 0,
- s,
- c,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeScale(x, y) {
- this.set(
- x,
- 0,
- 0,
- 0,
- y,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- //
- equals(matrix) {
- const te2 = this.elements;
- const me = matrix.elements;
- for (let i = 0; i < 9; i++) {
- if (te2[i] !== me[i]) return false;
- }
- return true;
- }
- fromArray(array, offset = 0) {
- for (let i = 0; i < 9; i++) {
- this.elements[i] = array[i + offset];
- }
- return this;
- }
- toArray(array = [], offset = 0) {
- const te2 = this.elements;
- array[offset] = te2[0];
- array[offset + 1] = te2[1];
- array[offset + 2] = te2[2];
- array[offset + 3] = te2[3];
- array[offset + 4] = te2[4];
- array[offset + 5] = te2[5];
- array[offset + 6] = te2[6];
- array[offset + 7] = te2[7];
- array[offset + 8] = te2[8];
- return array;
- }
- clone() {
- return new this.constructor().fromArray(this.elements);
- }
-}
-const _m3 = /* @__PURE__ */ new Matrix3();
-function arrayNeedsUint32(array) {
- for (let i = array.length - 1; i >= 0; --i) {
- if (array[i] >= 65535) return true;
- }
- return false;
-}
-__name(arrayNeedsUint32, "arrayNeedsUint32");
-const TYPED_ARRAYS = {
- Int8Array,
- Uint8Array,
- Uint8ClampedArray,
- Int16Array,
- Uint16Array,
- Int32Array,
- Uint32Array,
- Float32Array,
- Float64Array
-};
-function getTypedArray(type, buffer) {
- return new TYPED_ARRAYS[type](buffer);
-}
-__name(getTypedArray, "getTypedArray");
-function createElementNS(name) {
- return document.createElementNS("http://www.w3.org/1999/xhtml", name);
-}
-__name(createElementNS, "createElementNS");
-function createCanvasElement() {
- const canvas = createElementNS("canvas");
- canvas.style.display = "block";
- return canvas;
-}
-__name(createCanvasElement, "createCanvasElement");
-const _cache = {};
-function warnOnce(message) {
- if (message in _cache) return;
- _cache[message] = true;
- console.warn(message);
-}
-__name(warnOnce, "warnOnce");
-function probeAsync(gl, sync, interval) {
- return new Promise(function(resolve, reject) {
- function probe() {
- switch (gl.clientWaitSync(sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0)) {
- case gl.WAIT_FAILED:
- reject();
- break;
- case gl.TIMEOUT_EXPIRED:
- setTimeout(probe, interval);
- break;
- default:
- resolve();
- }
- }
- __name(probe, "probe");
- setTimeout(probe, interval);
- });
-}
-__name(probeAsync, "probeAsync");
-function toNormalizedProjectionMatrix(projectionMatrix) {
- const m = projectionMatrix.elements;
- m[2] = 0.5 * m[2] + 0.5 * m[3];
- m[6] = 0.5 * m[6] + 0.5 * m[7];
- m[10] = 0.5 * m[10] + 0.5 * m[11];
- m[14] = 0.5 * m[14] + 0.5 * m[15];
-}
-__name(toNormalizedProjectionMatrix, "toNormalizedProjectionMatrix");
-function toReversedProjectionMatrix(projectionMatrix) {
- const m = projectionMatrix.elements;
- const isPerspectiveMatrix = m[11] === -1;
- if (isPerspectiveMatrix) {
- m[10] = -m[10] - 1;
- m[14] = -m[14];
- } else {
- m[10] = -m[10];
- m[14] = -m[14] + 1;
- }
-}
-__name(toReversedProjectionMatrix, "toReversedProjectionMatrix");
-const ColorManagement = {
- enabled: true,
- workingColorSpace: LinearSRGBColorSpace,
- /**
- * Implementations of supported color spaces.
- *
- * Required:
- * - primaries: chromaticity coordinates [ rx ry gx gy bx by ]
- * - whitePoint: reference white [ x y ]
- * - transfer: transfer function (pre-defined)
- * - toXYZ: Matrix3 RGB to XYZ transform
- * - fromXYZ: Matrix3 XYZ to RGB transform
- * - luminanceCoefficients: RGB luminance coefficients
- *
- * Optional:
- * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }
- * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
- *
- * Reference:
- * - https://www.russellcottrell.com/photo/matrixCalculator.htm
- */
- spaces: {},
- convert: /* @__PURE__ */ __name(function(color, sourceColorSpace, targetColorSpace) {
- if (this.enabled === false || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {
- return color;
- }
- if (this.spaces[sourceColorSpace].transfer === SRGBTransfer) {
- color.r = SRGBToLinear(color.r);
- color.g = SRGBToLinear(color.g);
- color.b = SRGBToLinear(color.b);
- }
- if (this.spaces[sourceColorSpace].primaries !== this.spaces[targetColorSpace].primaries) {
- color.applyMatrix3(this.spaces[sourceColorSpace].toXYZ);
- color.applyMatrix3(this.spaces[targetColorSpace].fromXYZ);
- }
- if (this.spaces[targetColorSpace].transfer === SRGBTransfer) {
- color.r = LinearToSRGB(color.r);
- color.g = LinearToSRGB(color.g);
- color.b = LinearToSRGB(color.b);
- }
- return color;
- }, "convert"),
- fromWorkingColorSpace: /* @__PURE__ */ __name(function(color, targetColorSpace) {
- return this.convert(color, this.workingColorSpace, targetColorSpace);
- }, "fromWorkingColorSpace"),
- toWorkingColorSpace: /* @__PURE__ */ __name(function(color, sourceColorSpace) {
- return this.convert(color, sourceColorSpace, this.workingColorSpace);
- }, "toWorkingColorSpace"),
- getPrimaries: /* @__PURE__ */ __name(function(colorSpace) {
- return this.spaces[colorSpace].primaries;
- }, "getPrimaries"),
- getTransfer: /* @__PURE__ */ __name(function(colorSpace) {
- if (colorSpace === NoColorSpace) return LinearTransfer;
- return this.spaces[colorSpace].transfer;
- }, "getTransfer"),
- getLuminanceCoefficients: /* @__PURE__ */ __name(function(target, colorSpace = this.workingColorSpace) {
- return target.fromArray(this.spaces[colorSpace].luminanceCoefficients);
- }, "getLuminanceCoefficients"),
- define: /* @__PURE__ */ __name(function(colorSpaces) {
- Object.assign(this.spaces, colorSpaces);
- }, "define"),
- // Internal APIs
- _getMatrix: /* @__PURE__ */ __name(function(targetMatrix, sourceColorSpace, targetColorSpace) {
- return targetMatrix.copy(this.spaces[sourceColorSpace].toXYZ).multiply(this.spaces[targetColorSpace].fromXYZ);
- }, "_getMatrix"),
- _getDrawingBufferColorSpace: /* @__PURE__ */ __name(function(colorSpace) {
- return this.spaces[colorSpace].outputColorSpaceConfig.drawingBufferColorSpace;
- }, "_getDrawingBufferColorSpace"),
- _getUnpackColorSpace: /* @__PURE__ */ __name(function(colorSpace = this.workingColorSpace) {
- return this.spaces[colorSpace].workingColorSpaceConfig.unpackColorSpace;
- }, "_getUnpackColorSpace")
-};
-function SRGBToLinear(c) {
- return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
-}
-__name(SRGBToLinear, "SRGBToLinear");
-function LinearToSRGB(c) {
- return c < 31308e-7 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;
-}
-__name(LinearToSRGB, "LinearToSRGB");
-const REC709_PRIMARIES = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06];
-const REC709_LUMINANCE_COEFFICIENTS = [0.2126, 0.7152, 0.0722];
-const D65 = [0.3127, 0.329];
-const LINEAR_REC709_TO_XYZ = /* @__PURE__ */ new Matrix3().set(
- 0.4123908,
- 0.3575843,
- 0.1804808,
- 0.212639,
- 0.7151687,
- 0.0721923,
- 0.0193308,
- 0.1191948,
- 0.9505322
-);
-const XYZ_TO_LINEAR_REC709 = /* @__PURE__ */ new Matrix3().set(
- 3.2409699,
- -1.5373832,
- -0.4986108,
- -0.9692436,
- 1.8759675,
- 0.0415551,
- 0.0556301,
- -0.203977,
- 1.0569715
-);
-ColorManagement.define({
- [LinearSRGBColorSpace]: {
- primaries: REC709_PRIMARIES,
- whitePoint: D65,
- transfer: LinearTransfer,
- toXYZ: LINEAR_REC709_TO_XYZ,
- fromXYZ: XYZ_TO_LINEAR_REC709,
- luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,
- workingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },
- outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }
- },
- [SRGBColorSpace]: {
- primaries: REC709_PRIMARIES,
- whitePoint: D65,
- transfer: SRGBTransfer,
- toXYZ: LINEAR_REC709_TO_XYZ,
- fromXYZ: XYZ_TO_LINEAR_REC709,
- luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,
- outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }
- }
-});
-let _canvas;
-class ImageUtils {
- static {
- __name(this, "ImageUtils");
- }
- static getDataURL(image) {
- if (/^data:/i.test(image.src)) {
- return image.src;
- }
- if (typeof HTMLCanvasElement === "undefined") {
- return image.src;
- }
- let canvas;
- if (image instanceof HTMLCanvasElement) {
- canvas = image;
- } else {
- if (_canvas === void 0) _canvas = createElementNS("canvas");
- _canvas.width = image.width;
- _canvas.height = image.height;
- const context = _canvas.getContext("2d");
- if (image instanceof ImageData) {
- context.putImageData(image, 0, 0);
- } else {
- context.drawImage(image, 0, 0, image.width, image.height);
- }
- canvas = _canvas;
- }
- if (canvas.width > 2048 || canvas.height > 2048) {
- console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", image);
- return canvas.toDataURL("image/jpeg", 0.6);
- } else {
- return canvas.toDataURL("image/png");
- }
- }
- static sRGBToLinear(image) {
- if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
- const canvas = createElementNS("canvas");
- canvas.width = image.width;
- canvas.height = image.height;
- const context = canvas.getContext("2d");
- context.drawImage(image, 0, 0, image.width, image.height);
- const imageData = context.getImageData(0, 0, image.width, image.height);
- const data = imageData.data;
- for (let i = 0; i < data.length; i++) {
- data[i] = SRGBToLinear(data[i] / 255) * 255;
- }
- context.putImageData(imageData, 0, 0);
- return canvas;
- } else if (image.data) {
- const data = image.data.slice(0);
- for (let i = 0; i < data.length; i++) {
- if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) {
- data[i] = Math.floor(SRGBToLinear(data[i] / 255) * 255);
- } else {
- data[i] = SRGBToLinear(data[i]);
- }
- }
- return {
- data,
- width: image.width,
- height: image.height
- };
- } else {
- console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");
- return image;
- }
- }
-}
-let _sourceId = 0;
-class Source {
- static {
- __name(this, "Source");
- }
- constructor(data = null) {
- this.isSource = true;
- Object.defineProperty(this, "id", { value: _sourceId++ });
- this.uuid = generateUUID();
- this.data = data;
- this.dataReady = true;
- this.version = 0;
- }
- set needsUpdate(value) {
- if (value === true) this.version++;
- }
- toJSON(meta) {
- const isRootObject = meta === void 0 || typeof meta === "string";
- if (!isRootObject && meta.images[this.uuid] !== void 0) {
- return meta.images[this.uuid];
- }
- const output = {
- uuid: this.uuid,
- url: ""
- };
- const data = this.data;
- if (data !== null) {
- let url;
- if (Array.isArray(data)) {
- url = [];
- for (let i = 0, l = data.length; i < l; i++) {
- if (data[i].isDataTexture) {
- url.push(serializeImage(data[i].image));
- } else {
- url.push(serializeImage(data[i]));
- }
- }
- } else {
- url = serializeImage(data);
- }
- output.url = url;
- }
- if (!isRootObject) {
- meta.images[this.uuid] = output;
- }
- return output;
- }
-}
-function serializeImage(image) {
- if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
- return ImageUtils.getDataURL(image);
- } else {
- if (image.data) {
- return {
- data: Array.from(image.data),
- width: image.width,
- height: image.height,
- type: image.data.constructor.name
- };
- } else {
- console.warn("THREE.Texture: Unable to serialize Texture.");
- return {};
- }
- }
-}
-__name(serializeImage, "serializeImage");
-let _textureId = 0;
-class Texture extends EventDispatcher {
- static {
- __name(this, "Texture");
- }
- constructor(image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace) {
- super();
- this.isTexture = true;
- Object.defineProperty(this, "id", { value: _textureId++ });
- this.uuid = generateUUID();
- this.name = "";
- this.source = new Source(image);
- this.mipmaps = [];
- this.mapping = mapping;
- this.channel = 0;
- this.wrapS = wrapS;
- this.wrapT = wrapT;
- this.magFilter = magFilter;
- this.minFilter = minFilter;
- this.anisotropy = anisotropy;
- this.format = format;
- this.internalFormat = null;
- this.type = type;
- this.offset = new Vector2(0, 0);
- this.repeat = new Vector2(1, 1);
- this.center = new Vector2(0, 0);
- this.rotation = 0;
- this.matrixAutoUpdate = true;
- this.matrix = new Matrix3();
- this.generateMipmaps = true;
- this.premultiplyAlpha = false;
- this.flipY = true;
- this.unpackAlignment = 4;
- this.colorSpace = colorSpace;
- this.userData = {};
- this.version = 0;
- this.onUpdate = null;
- this.isRenderTargetTexture = false;
- this.pmremVersion = 0;
- }
- get image() {
- return this.source.data;
- }
- set image(value = null) {
- this.source.data = value;
- }
- updateMatrix() {
- this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(source) {
- this.name = source.name;
- this.source = source.source;
- this.mipmaps = source.mipmaps.slice(0);
- this.mapping = source.mapping;
- this.channel = source.channel;
- this.wrapS = source.wrapS;
- this.wrapT = source.wrapT;
- this.magFilter = source.magFilter;
- this.minFilter = source.minFilter;
- this.anisotropy = source.anisotropy;
- this.format = source.format;
- this.internalFormat = source.internalFormat;
- this.type = source.type;
- this.offset.copy(source.offset);
- this.repeat.copy(source.repeat);
- this.center.copy(source.center);
- this.rotation = source.rotation;
- this.matrixAutoUpdate = source.matrixAutoUpdate;
- this.matrix.copy(source.matrix);
- this.generateMipmaps = source.generateMipmaps;
- this.premultiplyAlpha = source.premultiplyAlpha;
- this.flipY = source.flipY;
- this.unpackAlignment = source.unpackAlignment;
- this.colorSpace = source.colorSpace;
- this.userData = JSON.parse(JSON.stringify(source.userData));
- this.needsUpdate = true;
- return this;
- }
- toJSON(meta) {
- const isRootObject = meta === void 0 || typeof meta === "string";
- if (!isRootObject && meta.textures[this.uuid] !== void 0) {
- return meta.textures[this.uuid];
- }
- const output = {
- metadata: {
- version: 4.6,
- type: "Texture",
- generator: "Texture.toJSON"
- },
- uuid: this.uuid,
- name: this.name,
- image: this.source.toJSON(meta).uuid,
- mapping: this.mapping,
- channel: this.channel,
- repeat: [this.repeat.x, this.repeat.y],
- offset: [this.offset.x, this.offset.y],
- center: [this.center.x, this.center.y],
- rotation: this.rotation,
- wrap: [this.wrapS, this.wrapT],
- format: this.format,
- internalFormat: this.internalFormat,
- type: this.type,
- colorSpace: this.colorSpace,
- minFilter: this.minFilter,
- magFilter: this.magFilter,
- anisotropy: this.anisotropy,
- flipY: this.flipY,
- generateMipmaps: this.generateMipmaps,
- premultiplyAlpha: this.premultiplyAlpha,
- unpackAlignment: this.unpackAlignment
- };
- if (Object.keys(this.userData).length > 0) output.userData = this.userData;
- if (!isRootObject) {
- meta.textures[this.uuid] = output;
- }
- return output;
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- transformUv(uv) {
- if (this.mapping !== UVMapping) return uv;
- uv.applyMatrix3(this.matrix);
- if (uv.x < 0 || uv.x > 1) {
- switch (this.wrapS) {
- case RepeatWrapping:
- uv.x = uv.x - Math.floor(uv.x);
- break;
- case ClampToEdgeWrapping:
- uv.x = uv.x < 0 ? 0 : 1;
- break;
- case MirroredRepeatWrapping:
- if (Math.abs(Math.floor(uv.x) % 2) === 1) {
- uv.x = Math.ceil(uv.x) - uv.x;
- } else {
- uv.x = uv.x - Math.floor(uv.x);
- }
- break;
- }
- }
- if (uv.y < 0 || uv.y > 1) {
- switch (this.wrapT) {
- case RepeatWrapping:
- uv.y = uv.y - Math.floor(uv.y);
- break;
- case ClampToEdgeWrapping:
- uv.y = uv.y < 0 ? 0 : 1;
- break;
- case MirroredRepeatWrapping:
- if (Math.abs(Math.floor(uv.y) % 2) === 1) {
- uv.y = Math.ceil(uv.y) - uv.y;
- } else {
- uv.y = uv.y - Math.floor(uv.y);
- }
- break;
- }
- }
- if (this.flipY) {
- uv.y = 1 - uv.y;
- }
- return uv;
- }
- set needsUpdate(value) {
- if (value === true) {
- this.version++;
- this.source.needsUpdate = true;
- }
- }
- set needsPMREMUpdate(value) {
- if (value === true) {
- this.pmremVersion++;
- }
- }
-}
-Texture.DEFAULT_IMAGE = null;
-Texture.DEFAULT_MAPPING = UVMapping;
-Texture.DEFAULT_ANISOTROPY = 1;
-class Vector4 {
- static {
- __name(this, "Vector4");
- }
- constructor(x = 0, y = 0, z = 0, w = 1) {
- Vector4.prototype.isVector4 = true;
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
- get width() {
- return this.z;
- }
- set width(value) {
- this.z = value;
- }
- get height() {
- return this.w;
- }
- set height(value) {
- this.w = value;
- }
- set(x, y, z, w) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- return this;
- }
- setScalar(scalar) {
- this.x = scalar;
- this.y = scalar;
- this.z = scalar;
- this.w = scalar;
- return this;
- }
- setX(x) {
- this.x = x;
- return this;
- }
- setY(y) {
- this.y = y;
- return this;
- }
- setZ(z) {
- this.z = z;
- return this;
- }
- setW(w) {
- this.w = w;
- return this;
- }
- setComponent(index, value) {
- switch (index) {
- case 0:
- this.x = value;
- break;
- case 1:
- this.y = value;
- break;
- case 2:
- this.z = value;
- break;
- case 3:
- this.w = value;
- break;
- default:
- throw new Error("index is out of range: " + index);
- }
- return this;
- }
- getComponent(index) {
- switch (index) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- case 3:
- return this.w;
- default:
- throw new Error("index is out of range: " + index);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y, this.z, this.w);
- }
- copy(v) {
- this.x = v.x;
- this.y = v.y;
- this.z = v.z;
- this.w = v.w !== void 0 ? v.w : 1;
- return this;
- }
- add(v) {
- this.x += v.x;
- this.y += v.y;
- this.z += v.z;
- this.w += v.w;
- return this;
- }
- addScalar(s) {
- this.x += s;
- this.y += s;
- this.z += s;
- this.w += s;
- return this;
- }
- addVectors(a, b) {
- this.x = a.x + b.x;
- this.y = a.y + b.y;
- this.z = a.z + b.z;
- this.w = a.w + b.w;
- return this;
- }
- addScaledVector(v, s) {
- this.x += v.x * s;
- this.y += v.y * s;
- this.z += v.z * s;
- this.w += v.w * s;
- return this;
- }
- sub(v) {
- this.x -= v.x;
- this.y -= v.y;
- this.z -= v.z;
- this.w -= v.w;
- return this;
- }
- subScalar(s) {
- this.x -= s;
- this.y -= s;
- this.z -= s;
- this.w -= s;
- return this;
- }
- subVectors(a, b) {
- this.x = a.x - b.x;
- this.y = a.y - b.y;
- this.z = a.z - b.z;
- this.w = a.w - b.w;
- return this;
- }
- multiply(v) {
- this.x *= v.x;
- this.y *= v.y;
- this.z *= v.z;
- this.w *= v.w;
- return this;
- }
- multiplyScalar(scalar) {
- this.x *= scalar;
- this.y *= scalar;
- this.z *= scalar;
- this.w *= scalar;
- return this;
- }
- applyMatrix4(m) {
- const x = this.x, y = this.y, z = this.z, w = this.w;
- const e = m.elements;
- this.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;
- this.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;
- this.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;
- this.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;
- return this;
- }
- divide(v) {
- this.x /= v.x;
- this.y /= v.y;
- this.z /= v.z;
- this.w /= v.w;
- return this;
- }
- divideScalar(scalar) {
- return this.multiplyScalar(1 / scalar);
- }
- setAxisAngleFromQuaternion(q) {
- this.w = 2 * Math.acos(q.w);
- const s = Math.sqrt(1 - q.w * q.w);
- if (s < 1e-4) {
- this.x = 1;
- this.y = 0;
- this.z = 0;
- } else {
- this.x = q.x / s;
- this.y = q.y / s;
- this.z = q.z / s;
- }
- return this;
- }
- setAxisAngleFromRotationMatrix(m) {
- let angle, x, y, z;
- const epsilon = 0.01, epsilon2 = 0.1, te2 = m.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10];
- if (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {
- if (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {
- this.set(1, 0, 0, 0);
- return this;
- }
- angle = Math.PI;
- const xx = (m11 + 1) / 2;
- const yy = (m22 + 1) / 2;
- const zz = (m33 + 1) / 2;
- const xy = (m12 + m21) / 4;
- const xz = (m13 + m31) / 4;
- const yz = (m23 + m32) / 4;
- if (xx > yy && xx > zz) {
- if (xx < epsilon) {
- x = 0;
- y = 0.707106781;
- z = 0.707106781;
- } else {
- x = Math.sqrt(xx);
- y = xy / x;
- z = xz / x;
- }
- } else if (yy > zz) {
- if (yy < epsilon) {
- x = 0.707106781;
- y = 0;
- z = 0.707106781;
- } else {
- y = Math.sqrt(yy);
- x = xy / y;
- z = yz / y;
- }
- } else {
- if (zz < epsilon) {
- x = 0.707106781;
- y = 0.707106781;
- z = 0;
- } else {
- z = Math.sqrt(zz);
- x = xz / z;
- y = yz / z;
- }
- }
- this.set(x, y, z, angle);
- return this;
- }
- let s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12));
- if (Math.abs(s) < 1e-3) s = 1;
- this.x = (m32 - m23) / s;
- this.y = (m13 - m31) / s;
- this.z = (m21 - m12) / s;
- this.w = Math.acos((m11 + m22 + m33 - 1) / 2);
- return this;
- }
- setFromMatrixPosition(m) {
- const e = m.elements;
- this.x = e[12];
- this.y = e[13];
- this.z = e[14];
- this.w = e[15];
- return this;
- }
- min(v) {
- this.x = Math.min(this.x, v.x);
- this.y = Math.min(this.y, v.y);
- this.z = Math.min(this.z, v.z);
- this.w = Math.min(this.w, v.w);
- return this;
- }
- max(v) {
- this.x = Math.max(this.x, v.x);
- this.y = Math.max(this.y, v.y);
- this.z = Math.max(this.z, v.z);
- this.w = Math.max(this.w, v.w);
- return this;
- }
- clamp(min, max2) {
- this.x = Math.max(min.x, Math.min(max2.x, this.x));
- this.y = Math.max(min.y, Math.min(max2.y, this.y));
- this.z = Math.max(min.z, Math.min(max2.z, this.z));
- this.w = Math.max(min.w, Math.min(max2.w, this.w));
- return this;
- }
- clampScalar(minVal, maxVal) {
- this.x = Math.max(minVal, Math.min(maxVal, this.x));
- this.y = Math.max(minVal, Math.min(maxVal, this.y));
- this.z = Math.max(minVal, Math.min(maxVal, this.z));
- this.w = Math.max(minVal, Math.min(maxVal, this.w));
- return this;
- }
- clampLength(min, max2) {
- const length = this.length();
- return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
- }
- floor() {
- this.x = Math.floor(this.x);
- this.y = Math.floor(this.y);
- this.z = Math.floor(this.z);
- this.w = Math.floor(this.w);
- return this;
- }
- ceil() {
- this.x = Math.ceil(this.x);
- this.y = Math.ceil(this.y);
- this.z = Math.ceil(this.z);
- this.w = Math.ceil(this.w);
- return this;
- }
- round() {
- this.x = Math.round(this.x);
- this.y = Math.round(this.y);
- this.z = Math.round(this.z);
- this.w = Math.round(this.w);
- return this;
- }
- roundToZero() {
- this.x = Math.trunc(this.x);
- this.y = Math.trunc(this.y);
- this.z = Math.trunc(this.z);
- this.w = Math.trunc(this.w);
- return this;
- }
- negate() {
- this.x = -this.x;
- this.y = -this.y;
- this.z = -this.z;
- this.w = -this.w;
- return this;
- }
- dot(v) {
- return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;
- }
- lengthSq() {
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
- }
- length() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
- }
- manhattanLength() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- setLength(length) {
- return this.normalize().multiplyScalar(length);
- }
- lerp(v, alpha) {
- this.x += (v.x - this.x) * alpha;
- this.y += (v.y - this.y) * alpha;
- this.z += (v.z - this.z) * alpha;
- this.w += (v.w - this.w) * alpha;
- return this;
- }
- lerpVectors(v1, v2, alpha) {
- this.x = v1.x + (v2.x - v1.x) * alpha;
- this.y = v1.y + (v2.y - v1.y) * alpha;
- this.z = v1.z + (v2.z - v1.z) * alpha;
- this.w = v1.w + (v2.w - v1.w) * alpha;
- return this;
- }
- equals(v) {
- return v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;
- }
- fromArray(array, offset = 0) {
- this.x = array[offset];
- this.y = array[offset + 1];
- this.z = array[offset + 2];
- this.w = array[offset + 3];
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this.x;
- array[offset + 1] = this.y;
- array[offset + 2] = this.z;
- array[offset + 3] = this.w;
- return array;
- }
- fromBufferAttribute(attribute, index) {
- this.x = attribute.getX(index);
- this.y = attribute.getY(index);
- this.z = attribute.getZ(index);
- this.w = attribute.getW(index);
- return this;
- }
- random() {
- this.x = Math.random();
- this.y = Math.random();
- this.z = Math.random();
- this.w = Math.random();
- return this;
- }
- *[Symbol.iterator]() {
- yield this.x;
- yield this.y;
- yield this.z;
- yield this.w;
- }
-}
-class RenderTarget extends EventDispatcher {
- static {
- __name(this, "RenderTarget");
- }
- constructor(width = 1, height = 1, options = {}) {
- super();
- this.isRenderTarget = true;
- this.width = width;
- this.height = height;
- this.depth = 1;
- this.scissor = new Vector4(0, 0, width, height);
- this.scissorTest = false;
- this.viewport = new Vector4(0, 0, width, height);
- const image = { width, height, depth: 1 };
- options = Object.assign({
- generateMipmaps: false,
- internalFormat: null,
- minFilter: LinearFilter,
- depthBuffer: true,
- stencilBuffer: false,
- resolveDepthBuffer: true,
- resolveStencilBuffer: true,
- depthTexture: null,
- samples: 0,
- count: 1
- }, options);
- const texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace);
- texture.flipY = false;
- texture.generateMipmaps = options.generateMipmaps;
- texture.internalFormat = options.internalFormat;
- this.textures = [];
- const count = options.count;
- for (let i = 0; i < count; i++) {
- this.textures[i] = texture.clone();
- this.textures[i].isRenderTargetTexture = true;
- }
- this.depthBuffer = options.depthBuffer;
- this.stencilBuffer = options.stencilBuffer;
- this.resolveDepthBuffer = options.resolveDepthBuffer;
- this.resolveStencilBuffer = options.resolveStencilBuffer;
- this.depthTexture = options.depthTexture;
- this.samples = options.samples;
- }
- get texture() {
- return this.textures[0];
- }
- set texture(value) {
- this.textures[0] = value;
- }
- setSize(width, height, depth = 1) {
- if (this.width !== width || this.height !== height || this.depth !== depth) {
- this.width = width;
- this.height = height;
- this.depth = depth;
- for (let i = 0, il = this.textures.length; i < il; i++) {
- this.textures[i].image.width = width;
- this.textures[i].image.height = height;
- this.textures[i].image.depth = depth;
- }
- this.dispose();
- }
- this.viewport.set(0, 0, width, height);
- this.scissor.set(0, 0, width, height);
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(source) {
- this.width = source.width;
- this.height = source.height;
- this.depth = source.depth;
- this.scissor.copy(source.scissor);
- this.scissorTest = source.scissorTest;
- this.viewport.copy(source.viewport);
- this.textures.length = 0;
- for (let i = 0, il = source.textures.length; i < il; i++) {
- this.textures[i] = source.textures[i].clone();
- this.textures[i].isRenderTargetTexture = true;
- }
- const image = Object.assign({}, source.texture.image);
- this.texture.source = new Source(image);
- this.depthBuffer = source.depthBuffer;
- this.stencilBuffer = source.stencilBuffer;
- this.resolveDepthBuffer = source.resolveDepthBuffer;
- this.resolveStencilBuffer = source.resolveStencilBuffer;
- if (source.depthTexture !== null) this.depthTexture = source.depthTexture.clone();
- this.samples = source.samples;
- return this;
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
-}
-class WebGLRenderTarget extends RenderTarget {
- static {
- __name(this, "WebGLRenderTarget");
- }
- constructor(width = 1, height = 1, options = {}) {
- super(width, height, options);
- this.isWebGLRenderTarget = true;
- }
-}
-class DataArrayTexture extends Texture {
- static {
- __name(this, "DataArrayTexture");
- }
- constructor(data = null, width = 1, height = 1, depth = 1) {
- super(null);
- this.isDataArrayTexture = true;
- this.image = { data, width, height, depth };
- this.magFilter = NearestFilter;
- this.minFilter = NearestFilter;
- this.wrapR = ClampToEdgeWrapping;
- this.generateMipmaps = false;
- this.flipY = false;
- this.unpackAlignment = 1;
- this.layerUpdates = /* @__PURE__ */ new Set();
- }
- addLayerUpdate(layerIndex) {
- this.layerUpdates.add(layerIndex);
- }
- clearLayerUpdates() {
- this.layerUpdates.clear();
- }
-}
-class WebGLArrayRenderTarget extends WebGLRenderTarget {
- static {
- __name(this, "WebGLArrayRenderTarget");
- }
- constructor(width = 1, height = 1, depth = 1, options = {}) {
- super(width, height, options);
- this.isWebGLArrayRenderTarget = true;
- this.depth = depth;
- this.texture = new DataArrayTexture(null, width, height, depth);
- this.texture.isRenderTargetTexture = true;
- }
-}
-class Data3DTexture extends Texture {
- static {
- __name(this, "Data3DTexture");
- }
- constructor(data = null, width = 1, height = 1, depth = 1) {
- super(null);
- this.isData3DTexture = true;
- this.image = { data, width, height, depth };
- this.magFilter = NearestFilter;
- this.minFilter = NearestFilter;
- this.wrapR = ClampToEdgeWrapping;
- this.generateMipmaps = false;
- this.flipY = false;
- this.unpackAlignment = 1;
- }
-}
-class WebGL3DRenderTarget extends WebGLRenderTarget {
- static {
- __name(this, "WebGL3DRenderTarget");
- }
- constructor(width = 1, height = 1, depth = 1, options = {}) {
- super(width, height, options);
- this.isWebGL3DRenderTarget = true;
- this.depth = depth;
- this.texture = new Data3DTexture(null, width, height, depth);
- this.texture.isRenderTargetTexture = true;
- }
-}
-class Quaternion {
- static {
- __name(this, "Quaternion");
- }
- constructor(x = 0, y = 0, z = 0, w = 1) {
- this.isQuaternion = true;
- this._x = x;
- this._y = y;
- this._z = z;
- this._w = w;
- }
- static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t2) {
- let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3];
- const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3];
- if (t2 === 0) {
- dst[dstOffset + 0] = x0;
- dst[dstOffset + 1] = y0;
- dst[dstOffset + 2] = z0;
- dst[dstOffset + 3] = w0;
- return;
- }
- if (t2 === 1) {
- dst[dstOffset + 0] = x1;
- dst[dstOffset + 1] = y1;
- dst[dstOffset + 2] = z1;
- dst[dstOffset + 3] = w1;
- return;
- }
- if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {
- let s = 1 - t2;
- const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos;
- if (sqrSin > Number.EPSILON) {
- const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir);
- s = Math.sin(s * len) / sin;
- t2 = Math.sin(t2 * len) / sin;
- }
- const tDir = t2 * dir;
- x0 = x0 * s + x1 * tDir;
- y0 = y0 * s + y1 * tDir;
- z0 = z0 * s + z1 * tDir;
- w0 = w0 * s + w1 * tDir;
- if (s === 1 - t2) {
- const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);
- x0 *= f;
- y0 *= f;
- z0 *= f;
- w0 *= f;
- }
- }
- dst[dstOffset] = x0;
- dst[dstOffset + 1] = y0;
- dst[dstOffset + 2] = z0;
- dst[dstOffset + 3] = w0;
- }
- static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {
- const x0 = src0[srcOffset0];
- const y0 = src0[srcOffset0 + 1];
- const z0 = src0[srcOffset0 + 2];
- const w0 = src0[srcOffset0 + 3];
- const x1 = src1[srcOffset1];
- const y1 = src1[srcOffset1 + 1];
- const z1 = src1[srcOffset1 + 2];
- const w1 = src1[srcOffset1 + 3];
- dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;
- dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;
- dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;
- dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;
- return dst;
- }
- get x() {
- return this._x;
- }
- set x(value) {
- this._x = value;
- this._onChangeCallback();
- }
- get y() {
- return this._y;
- }
- set y(value) {
- this._y = value;
- this._onChangeCallback();
- }
- get z() {
- return this._z;
- }
- set z(value) {
- this._z = value;
- this._onChangeCallback();
- }
- get w() {
- return this._w;
- }
- set w(value) {
- this._w = value;
- this._onChangeCallback();
- }
- set(x, y, z, w) {
- this._x = x;
- this._y = y;
- this._z = z;
- this._w = w;
- this._onChangeCallback();
- return this;
- }
- clone() {
- return new this.constructor(this._x, this._y, this._z, this._w);
- }
- copy(quaternion) {
- this._x = quaternion.x;
- this._y = quaternion.y;
- this._z = quaternion.z;
- this._w = quaternion.w;
- this._onChangeCallback();
- return this;
- }
- setFromEuler(euler, update = true) {
- const x = euler._x, y = euler._y, z = euler._z, order = euler._order;
- const cos = Math.cos;
- const sin = Math.sin;
- const c1 = cos(x / 2);
- const c2 = cos(y / 2);
- const c3 = cos(z / 2);
- const s1 = sin(x / 2);
- const s2 = sin(y / 2);
- const s3 = sin(z / 2);
- switch (order) {
- case "XYZ":
- this._x = s1 * c2 * c3 + c1 * s2 * s3;
- this._y = c1 * s2 * c3 - s1 * c2 * s3;
- this._z = c1 * c2 * s3 + s1 * s2 * c3;
- this._w = c1 * c2 * c3 - s1 * s2 * s3;
- break;
- case "YXZ":
- this._x = s1 * c2 * c3 + c1 * s2 * s3;
- this._y = c1 * s2 * c3 - s1 * c2 * s3;
- this._z = c1 * c2 * s3 - s1 * s2 * c3;
- this._w = c1 * c2 * c3 + s1 * s2 * s3;
- break;
- case "ZXY":
- this._x = s1 * c2 * c3 - c1 * s2 * s3;
- this._y = c1 * s2 * c3 + s1 * c2 * s3;
- this._z = c1 * c2 * s3 + s1 * s2 * c3;
- this._w = c1 * c2 * c3 - s1 * s2 * s3;
- break;
- case "ZYX":
- this._x = s1 * c2 * c3 - c1 * s2 * s3;
- this._y = c1 * s2 * c3 + s1 * c2 * s3;
- this._z = c1 * c2 * s3 - s1 * s2 * c3;
- this._w = c1 * c2 * c3 + s1 * s2 * s3;
- break;
- case "YZX":
- this._x = s1 * c2 * c3 + c1 * s2 * s3;
- this._y = c1 * s2 * c3 + s1 * c2 * s3;
- this._z = c1 * c2 * s3 - s1 * s2 * c3;
- this._w = c1 * c2 * c3 - s1 * s2 * s3;
- break;
- case "XZY":
- this._x = s1 * c2 * c3 - c1 * s2 * s3;
- this._y = c1 * s2 * c3 - s1 * c2 * s3;
- this._z = c1 * c2 * s3 + s1 * s2 * c3;
- this._w = c1 * c2 * c3 + s1 * s2 * s3;
- break;
- default:
- console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order);
- }
- if (update === true) this._onChangeCallback();
- return this;
- }
- setFromAxisAngle(axis, angle) {
- const halfAngle = angle / 2, s = Math.sin(halfAngle);
- this._x = axis.x * s;
- this._y = axis.y * s;
- this._z = axis.z * s;
- this._w = Math.cos(halfAngle);
- this._onChangeCallback();
- return this;
- }
- setFromRotationMatrix(m) {
- const te2 = m.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10], trace = m11 + m22 + m33;
- if (trace > 0) {
- const s = 0.5 / Math.sqrt(trace + 1);
- this._w = 0.25 / s;
- this._x = (m32 - m23) * s;
- this._y = (m13 - m31) * s;
- this._z = (m21 - m12) * s;
- } else if (m11 > m22 && m11 > m33) {
- const s = 2 * Math.sqrt(1 + m11 - m22 - m33);
- this._w = (m32 - m23) / s;
- this._x = 0.25 * s;
- this._y = (m12 + m21) / s;
- this._z = (m13 + m31) / s;
- } else if (m22 > m33) {
- const s = 2 * Math.sqrt(1 + m22 - m11 - m33);
- this._w = (m13 - m31) / s;
- this._x = (m12 + m21) / s;
- this._y = 0.25 * s;
- this._z = (m23 + m32) / s;
- } else {
- const s = 2 * Math.sqrt(1 + m33 - m11 - m22);
- this._w = (m21 - m12) / s;
- this._x = (m13 + m31) / s;
- this._y = (m23 + m32) / s;
- this._z = 0.25 * s;
- }
- this._onChangeCallback();
- return this;
- }
- setFromUnitVectors(vFrom, vTo) {
- let r = vFrom.dot(vTo) + 1;
- if (r < Number.EPSILON) {
- r = 0;
- if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {
- this._x = -vFrom.y;
- this._y = vFrom.x;
- this._z = 0;
- this._w = r;
- } else {
- this._x = 0;
- this._y = -vFrom.z;
- this._z = vFrom.y;
- this._w = r;
- }
- } else {
- this._x = vFrom.y * vTo.z - vFrom.z * vTo.y;
- this._y = vFrom.z * vTo.x - vFrom.x * vTo.z;
- this._z = vFrom.x * vTo.y - vFrom.y * vTo.x;
- this._w = r;
- }
- return this.normalize();
- }
- angleTo(q) {
- return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));
- }
- rotateTowards(q, step) {
- const angle = this.angleTo(q);
- if (angle === 0) return this;
- const t2 = Math.min(1, step / angle);
- this.slerp(q, t2);
- return this;
- }
- identity() {
- return this.set(0, 0, 0, 1);
- }
- invert() {
- return this.conjugate();
- }
- conjugate() {
- this._x *= -1;
- this._y *= -1;
- this._z *= -1;
- this._onChangeCallback();
- return this;
- }
- dot(v) {
- return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;
- }
- lengthSq() {
- return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
- }
- length() {
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
- }
- normalize() {
- let l = this.length();
- if (l === 0) {
- this._x = 0;
- this._y = 0;
- this._z = 0;
- this._w = 1;
- } else {
- l = 1 / l;
- this._x = this._x * l;
- this._y = this._y * l;
- this._z = this._z * l;
- this._w = this._w * l;
- }
- this._onChangeCallback();
- return this;
- }
- multiply(q) {
- return this.multiplyQuaternions(this, q);
- }
- premultiply(q) {
- return this.multiplyQuaternions(q, this);
- }
- multiplyQuaternions(a, b) {
- const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;
- const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;
- this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
- this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
- this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
- this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
- this._onChangeCallback();
- return this;
- }
- slerp(qb, t2) {
- if (t2 === 0) return this;
- if (t2 === 1) return this.copy(qb);
- const x = this._x, y = this._y, z = this._z, w = this._w;
- let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;
- if (cosHalfTheta < 0) {
- this._w = -qb._w;
- this._x = -qb._x;
- this._y = -qb._y;
- this._z = -qb._z;
- cosHalfTheta = -cosHalfTheta;
- } else {
- this.copy(qb);
- }
- if (cosHalfTheta >= 1) {
- this._w = w;
- this._x = x;
- this._y = y;
- this._z = z;
- return this;
- }
- const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta;
- if (sqrSinHalfTheta <= Number.EPSILON) {
- const s = 1 - t2;
- this._w = s * w + t2 * this._w;
- this._x = s * x + t2 * this._x;
- this._y = s * y + t2 * this._y;
- this._z = s * z + t2 * this._z;
- this.normalize();
- return this;
- }
- const sinHalfTheta = Math.sqrt(sqrSinHalfTheta);
- const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);
- const ratioA = Math.sin((1 - t2) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t2 * halfTheta) / sinHalfTheta;
- this._w = w * ratioA + this._w * ratioB;
- this._x = x * ratioA + this._x * ratioB;
- this._y = y * ratioA + this._y * ratioB;
- this._z = z * ratioA + this._z * ratioB;
- this._onChangeCallback();
- return this;
- }
- slerpQuaternions(qa, qb, t2) {
- return this.copy(qa).slerp(qb, t2);
- }
- random() {
- const theta1 = 2 * Math.PI * Math.random();
- const theta2 = 2 * Math.PI * Math.random();
- const x0 = Math.random();
- const r1 = Math.sqrt(1 - x0);
- const r2 = Math.sqrt(x0);
- return this.set(
- r1 * Math.sin(theta1),
- r1 * Math.cos(theta1),
- r2 * Math.sin(theta2),
- r2 * Math.cos(theta2)
- );
- }
- equals(quaternion) {
- return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;
- }
- fromArray(array, offset = 0) {
- this._x = array[offset];
- this._y = array[offset + 1];
- this._z = array[offset + 2];
- this._w = array[offset + 3];
- this._onChangeCallback();
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this._x;
- array[offset + 1] = this._y;
- array[offset + 2] = this._z;
- array[offset + 3] = this._w;
- return array;
- }
- fromBufferAttribute(attribute, index) {
- this._x = attribute.getX(index);
- this._y = attribute.getY(index);
- this._z = attribute.getZ(index);
- this._w = attribute.getW(index);
- this._onChangeCallback();
- return this;
- }
- toJSON() {
- return this.toArray();
- }
- _onChange(callback) {
- this._onChangeCallback = callback;
- return this;
- }
- _onChangeCallback() {
- }
- *[Symbol.iterator]() {
- yield this._x;
- yield this._y;
- yield this._z;
- yield this._w;
- }
-}
-class Vector3 {
- static {
- __name(this, "Vector3");
- }
- constructor(x = 0, y = 0, z = 0) {
- Vector3.prototype.isVector3 = true;
- this.x = x;
- this.y = y;
- this.z = z;
- }
- set(x, y, z) {
- if (z === void 0) z = this.z;
- this.x = x;
- this.y = y;
- this.z = z;
- return this;
- }
- setScalar(scalar) {
- this.x = scalar;
- this.y = scalar;
- this.z = scalar;
- return this;
- }
- setX(x) {
- this.x = x;
- return this;
- }
- setY(y) {
- this.y = y;
- return this;
- }
- setZ(z) {
- this.z = z;
- return this;
- }
- setComponent(index, value) {
- switch (index) {
- case 0:
- this.x = value;
- break;
- case 1:
- this.y = value;
- break;
- case 2:
- this.z = value;
- break;
- default:
- throw new Error("index is out of range: " + index);
- }
- return this;
- }
- getComponent(index) {
- switch (index) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- default:
- throw new Error("index is out of range: " + index);
- }
- }
- clone() {
- return new this.constructor(this.x, this.y, this.z);
- }
- copy(v) {
- this.x = v.x;
- this.y = v.y;
- this.z = v.z;
- return this;
- }
- add(v) {
- this.x += v.x;
- this.y += v.y;
- this.z += v.z;
- return this;
- }
- addScalar(s) {
- this.x += s;
- this.y += s;
- this.z += s;
- return this;
- }
- addVectors(a, b) {
- this.x = a.x + b.x;
- this.y = a.y + b.y;
- this.z = a.z + b.z;
- return this;
- }
- addScaledVector(v, s) {
- this.x += v.x * s;
- this.y += v.y * s;
- this.z += v.z * s;
- return this;
- }
- sub(v) {
- this.x -= v.x;
- this.y -= v.y;
- this.z -= v.z;
- return this;
- }
- subScalar(s) {
- this.x -= s;
- this.y -= s;
- this.z -= s;
- return this;
- }
- subVectors(a, b) {
- this.x = a.x - b.x;
- this.y = a.y - b.y;
- this.z = a.z - b.z;
- return this;
- }
- multiply(v) {
- this.x *= v.x;
- this.y *= v.y;
- this.z *= v.z;
- return this;
- }
- multiplyScalar(scalar) {
- this.x *= scalar;
- this.y *= scalar;
- this.z *= scalar;
- return this;
- }
- multiplyVectors(a, b) {
- this.x = a.x * b.x;
- this.y = a.y * b.y;
- this.z = a.z * b.z;
- return this;
- }
- applyEuler(euler) {
- return this.applyQuaternion(_quaternion$4.setFromEuler(euler));
- }
- applyAxisAngle(axis, angle) {
- return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle));
- }
- applyMatrix3(m) {
- const x = this.x, y = this.y, z = this.z;
- const e = m.elements;
- this.x = e[0] * x + e[3] * y + e[6] * z;
- this.y = e[1] * x + e[4] * y + e[7] * z;
- this.z = e[2] * x + e[5] * y + e[8] * z;
- return this;
- }
- applyNormalMatrix(m) {
- return this.applyMatrix3(m).normalize();
- }
- applyMatrix4(m) {
- const x = this.x, y = this.y, z = this.z;
- const e = m.elements;
- const w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);
- this.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;
- this.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;
- this.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;
- return this;
- }
- applyQuaternion(q) {
- const vx = this.x, vy = this.y, vz = this.z;
- const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
- const tx = 2 * (qy * vz - qz * vy);
- const ty = 2 * (qz * vx - qx * vz);
- const tz = 2 * (qx * vy - qy * vx);
- this.x = vx + qw * tx + qy * tz - qz * ty;
- this.y = vy + qw * ty + qz * tx - qx * tz;
- this.z = vz + qw * tz + qx * ty - qy * tx;
- return this;
- }
- project(camera) {
- return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);
- }
- unproject(camera) {
- return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);
- }
- transformDirection(m) {
- const x = this.x, y = this.y, z = this.z;
- const e = m.elements;
- this.x = e[0] * x + e[4] * y + e[8] * z;
- this.y = e[1] * x + e[5] * y + e[9] * z;
- this.z = e[2] * x + e[6] * y + e[10] * z;
- return this.normalize();
- }
- divide(v) {
- this.x /= v.x;
- this.y /= v.y;
- this.z /= v.z;
- return this;
- }
- divideScalar(scalar) {
- return this.multiplyScalar(1 / scalar);
- }
- min(v) {
- this.x = Math.min(this.x, v.x);
- this.y = Math.min(this.y, v.y);
- this.z = Math.min(this.z, v.z);
- return this;
- }
- max(v) {
- this.x = Math.max(this.x, v.x);
- this.y = Math.max(this.y, v.y);
- this.z = Math.max(this.z, v.z);
- return this;
- }
- clamp(min, max2) {
- this.x = Math.max(min.x, Math.min(max2.x, this.x));
- this.y = Math.max(min.y, Math.min(max2.y, this.y));
- this.z = Math.max(min.z, Math.min(max2.z, this.z));
- return this;
- }
- clampScalar(minVal, maxVal) {
- this.x = Math.max(minVal, Math.min(maxVal, this.x));
- this.y = Math.max(minVal, Math.min(maxVal, this.y));
- this.z = Math.max(minVal, Math.min(maxVal, this.z));
- return this;
- }
- clampLength(min, max2) {
- const length = this.length();
- return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length)));
- }
- floor() {
- this.x = Math.floor(this.x);
- this.y = Math.floor(this.y);
- this.z = Math.floor(this.z);
- return this;
- }
- ceil() {
- this.x = Math.ceil(this.x);
- this.y = Math.ceil(this.y);
- this.z = Math.ceil(this.z);
- return this;
- }
- round() {
- this.x = Math.round(this.x);
- this.y = Math.round(this.y);
- this.z = Math.round(this.z);
- return this;
- }
- roundToZero() {
- this.x = Math.trunc(this.x);
- this.y = Math.trunc(this.y);
- this.z = Math.trunc(this.z);
- return this;
- }
- negate() {
- this.x = -this.x;
- this.y = -this.y;
- this.z = -this.z;
- return this;
- }
- dot(v) {
- return this.x * v.x + this.y * v.y + this.z * v.z;
- }
- // TODO lengthSquared?
- lengthSq() {
- return this.x * this.x + this.y * this.y + this.z * this.z;
- }
- length() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
- }
- manhattanLength() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
- }
- normalize() {
- return this.divideScalar(this.length() || 1);
- }
- setLength(length) {
- return this.normalize().multiplyScalar(length);
- }
- lerp(v, alpha) {
- this.x += (v.x - this.x) * alpha;
- this.y += (v.y - this.y) * alpha;
- this.z += (v.z - this.z) * alpha;
- return this;
- }
- lerpVectors(v1, v2, alpha) {
- this.x = v1.x + (v2.x - v1.x) * alpha;
- this.y = v1.y + (v2.y - v1.y) * alpha;
- this.z = v1.z + (v2.z - v1.z) * alpha;
- return this;
- }
- cross(v) {
- return this.crossVectors(this, v);
- }
- crossVectors(a, b) {
- const ax = a.x, ay = a.y, az = a.z;
- const bx = b.x, by = b.y, bz = b.z;
- this.x = ay * bz - az * by;
- this.y = az * bx - ax * bz;
- this.z = ax * by - ay * bx;
- return this;
- }
- projectOnVector(v) {
- const denominator = v.lengthSq();
- if (denominator === 0) return this.set(0, 0, 0);
- const scalar = v.dot(this) / denominator;
- return this.copy(v).multiplyScalar(scalar);
- }
- projectOnPlane(planeNormal) {
- _vector$c.copy(this).projectOnVector(planeNormal);
- return this.sub(_vector$c);
- }
- reflect(normal) {
- return this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal)));
- }
- angleTo(v) {
- const denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
- if (denominator === 0) return Math.PI / 2;
- const theta = this.dot(v) / denominator;
- return Math.acos(clamp(theta, -1, 1));
- }
- distanceTo(v) {
- return Math.sqrt(this.distanceToSquared(v));
- }
- distanceToSquared(v) {
- const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
- return dx * dx + dy * dy + dz * dz;
- }
- manhattanDistanceTo(v) {
- return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);
- }
- setFromSpherical(s) {
- return this.setFromSphericalCoords(s.radius, s.phi, s.theta);
- }
- setFromSphericalCoords(radius, phi, theta) {
- const sinPhiRadius = Math.sin(phi) * radius;
- this.x = sinPhiRadius * Math.sin(theta);
- this.y = Math.cos(phi) * radius;
- this.z = sinPhiRadius * Math.cos(theta);
- return this;
- }
- setFromCylindrical(c) {
- return this.setFromCylindricalCoords(c.radius, c.theta, c.y);
- }
- setFromCylindricalCoords(radius, theta, y) {
- this.x = radius * Math.sin(theta);
- this.y = y;
- this.z = radius * Math.cos(theta);
- return this;
- }
- setFromMatrixPosition(m) {
- const e = m.elements;
- this.x = e[12];
- this.y = e[13];
- this.z = e[14];
- return this;
- }
- setFromMatrixScale(m) {
- const sx = this.setFromMatrixColumn(m, 0).length();
- const sy = this.setFromMatrixColumn(m, 1).length();
- const sz = this.setFromMatrixColumn(m, 2).length();
- this.x = sx;
- this.y = sy;
- this.z = sz;
- return this;
- }
- setFromMatrixColumn(m, index) {
- return this.fromArray(m.elements, index * 4);
- }
- setFromMatrix3Column(m, index) {
- return this.fromArray(m.elements, index * 3);
- }
- setFromEuler(e) {
- this.x = e._x;
- this.y = e._y;
- this.z = e._z;
- return this;
- }
- setFromColor(c) {
- this.x = c.r;
- this.y = c.g;
- this.z = c.b;
- return this;
- }
- equals(v) {
- return v.x === this.x && v.y === this.y && v.z === this.z;
- }
- fromArray(array, offset = 0) {
- this.x = array[offset];
- this.y = array[offset + 1];
- this.z = array[offset + 2];
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this.x;
- array[offset + 1] = this.y;
- array[offset + 2] = this.z;
- return array;
- }
- fromBufferAttribute(attribute, index) {
- this.x = attribute.getX(index);
- this.y = attribute.getY(index);
- this.z = attribute.getZ(index);
- return this;
- }
- random() {
- this.x = Math.random();
- this.y = Math.random();
- this.z = Math.random();
- return this;
- }
- randomDirection() {
- const theta = Math.random() * Math.PI * 2;
- const u = Math.random() * 2 - 1;
- const c = Math.sqrt(1 - u * u);
- this.x = c * Math.cos(theta);
- this.y = u;
- this.z = c * Math.sin(theta);
- return this;
- }
- *[Symbol.iterator]() {
- yield this.x;
- yield this.y;
- yield this.z;
- }
-}
-const _vector$c = /* @__PURE__ */ new Vector3();
-const _quaternion$4 = /* @__PURE__ */ new Quaternion();
-class Box3 {
- static {
- __name(this, "Box3");
- }
- constructor(min = new Vector3(Infinity, Infinity, Infinity), max2 = new Vector3(-Infinity, -Infinity, -Infinity)) {
- this.isBox3 = true;
- this.min = min;
- this.max = max2;
- }
- set(min, max2) {
- this.min.copy(min);
- this.max.copy(max2);
- return this;
- }
- setFromArray(array) {
- this.makeEmpty();
- for (let i = 0, il = array.length; i < il; i += 3) {
- this.expandByPoint(_vector$b.fromArray(array, i));
- }
- return this;
- }
- setFromBufferAttribute(attribute) {
- this.makeEmpty();
- for (let i = 0, il = attribute.count; i < il; i++) {
- this.expandByPoint(_vector$b.fromBufferAttribute(attribute, i));
- }
- return this;
- }
- setFromPoints(points) {
- this.makeEmpty();
- for (let i = 0, il = points.length; i < il; i++) {
- this.expandByPoint(points[i]);
- }
- return this;
- }
- setFromCenterAndSize(center, size) {
- const halfSize = _vector$b.copy(size).multiplyScalar(0.5);
- this.min.copy(center).sub(halfSize);
- this.max.copy(center).add(halfSize);
- return this;
- }
- setFromObject(object, precise = false) {
- this.makeEmpty();
- return this.expandByObject(object, precise);
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(box) {
- this.min.copy(box.min);
- this.max.copy(box.max);
- return this;
- }
- makeEmpty() {
- this.min.x = this.min.y = this.min.z = Infinity;
- this.max.x = this.max.y = this.max.z = -Infinity;
- return this;
- }
- isEmpty() {
- return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
- }
- getCenter(target) {
- return this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
- }
- getSize(target) {
- return this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);
- }
- expandByPoint(point) {
- this.min.min(point);
- this.max.max(point);
- return this;
- }
- expandByVector(vector) {
- this.min.sub(vector);
- this.max.add(vector);
- return this;
- }
- expandByScalar(scalar) {
- this.min.addScalar(-scalar);
- this.max.addScalar(scalar);
- return this;
- }
- expandByObject(object, precise = false) {
- object.updateWorldMatrix(false, false);
- const geometry = object.geometry;
- if (geometry !== void 0) {
- const positionAttribute = geometry.getAttribute("position");
- if (precise === true && positionAttribute !== void 0 && object.isInstancedMesh !== true) {
- for (let i = 0, l = positionAttribute.count; i < l; i++) {
- if (object.isMesh === true) {
- object.getVertexPosition(i, _vector$b);
- } else {
- _vector$b.fromBufferAttribute(positionAttribute, i);
- }
- _vector$b.applyMatrix4(object.matrixWorld);
- this.expandByPoint(_vector$b);
- }
- } else {
- if (object.boundingBox !== void 0) {
- if (object.boundingBox === null) {
- object.computeBoundingBox();
- }
- _box$4.copy(object.boundingBox);
- } else {
- if (geometry.boundingBox === null) {
- geometry.computeBoundingBox();
- }
- _box$4.copy(geometry.boundingBox);
- }
- _box$4.applyMatrix4(object.matrixWorld);
- this.union(_box$4);
- }
- }
- const children = object.children;
- for (let i = 0, l = children.length; i < l; i++) {
- this.expandByObject(children[i], precise);
- }
- return this;
- }
- containsPoint(point) {
- return point.x >= this.min.x && point.x <= this.max.x && point.y >= this.min.y && point.y <= this.max.y && point.z >= this.min.z && point.z <= this.max.z;
- }
- containsBox(box) {
- return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;
- }
- getParameter(point, target) {
- return target.set(
- (point.x - this.min.x) / (this.max.x - this.min.x),
- (point.y - this.min.y) / (this.max.y - this.min.y),
- (point.z - this.min.z) / (this.max.z - this.min.z)
- );
- }
- intersectsBox(box) {
- return box.max.x >= this.min.x && box.min.x <= this.max.x && box.max.y >= this.min.y && box.min.y <= this.max.y && box.max.z >= this.min.z && box.min.z <= this.max.z;
- }
- intersectsSphere(sphere) {
- this.clampPoint(sphere.center, _vector$b);
- return _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;
- }
- intersectsPlane(plane) {
- let min, max2;
- if (plane.normal.x > 0) {
- min = plane.normal.x * this.min.x;
- max2 = plane.normal.x * this.max.x;
- } else {
- min = plane.normal.x * this.max.x;
- max2 = plane.normal.x * this.min.x;
- }
- if (plane.normal.y > 0) {
- min += plane.normal.y * this.min.y;
- max2 += plane.normal.y * this.max.y;
- } else {
- min += plane.normal.y * this.max.y;
- max2 += plane.normal.y * this.min.y;
- }
- if (plane.normal.z > 0) {
- min += plane.normal.z * this.min.z;
- max2 += plane.normal.z * this.max.z;
- } else {
- min += plane.normal.z * this.max.z;
- max2 += plane.normal.z * this.min.z;
- }
- return min <= -plane.constant && max2 >= -plane.constant;
- }
- intersectsTriangle(triangle) {
- if (this.isEmpty()) {
- return false;
- }
- this.getCenter(_center);
- _extents.subVectors(this.max, _center);
- _v0$3.subVectors(triangle.a, _center);
- _v1$7.subVectors(triangle.b, _center);
- _v2$4.subVectors(triangle.c, _center);
- _f0.subVectors(_v1$7, _v0$3);
- _f1.subVectors(_v2$4, _v1$7);
- _f2.subVectors(_v0$3, _v2$4);
- let axes = [
- 0,
- -_f0.z,
- _f0.y,
- 0,
- -_f1.z,
- _f1.y,
- 0,
- -_f2.z,
- _f2.y,
- _f0.z,
- 0,
- -_f0.x,
- _f1.z,
- 0,
- -_f1.x,
- _f2.z,
- 0,
- -_f2.x,
- -_f0.y,
- _f0.x,
- 0,
- -_f1.y,
- _f1.x,
- 0,
- -_f2.y,
- _f2.x,
- 0
- ];
- if (!satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents)) {
- return false;
- }
- axes = [1, 0, 0, 0, 1, 0, 0, 0, 1];
- if (!satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents)) {
- return false;
- }
- _triangleNormal.crossVectors(_f0, _f1);
- axes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];
- return satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents);
- }
- clampPoint(point, target) {
- return target.copy(point).clamp(this.min, this.max);
- }
- distanceToPoint(point) {
- return this.clampPoint(point, _vector$b).distanceTo(point);
- }
- getBoundingSphere(target) {
- if (this.isEmpty()) {
- target.makeEmpty();
- } else {
- this.getCenter(target.center);
- target.radius = this.getSize(_vector$b).length() * 0.5;
- }
- return target;
- }
- intersect(box) {
- this.min.max(box.min);
- this.max.min(box.max);
- if (this.isEmpty()) this.makeEmpty();
- return this;
- }
- union(box) {
- this.min.min(box.min);
- this.max.max(box.max);
- return this;
- }
- applyMatrix4(matrix) {
- if (this.isEmpty()) return this;
- _points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix);
- _points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix);
- _points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix);
- _points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix);
- _points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix);
- _points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix);
- _points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix);
- _points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix);
- this.setFromPoints(_points);
- return this;
- }
- translate(offset) {
- this.min.add(offset);
- this.max.add(offset);
- return this;
- }
- equals(box) {
- return box.min.equals(this.min) && box.max.equals(this.max);
- }
-}
-const _points = [
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3(),
- /* @__PURE__ */ new Vector3()
-];
-const _vector$b = /* @__PURE__ */ new Vector3();
-const _box$4 = /* @__PURE__ */ new Box3();
-const _v0$3 = /* @__PURE__ */ new Vector3();
-const _v1$7 = /* @__PURE__ */ new Vector3();
-const _v2$4 = /* @__PURE__ */ new Vector3();
-const _f0 = /* @__PURE__ */ new Vector3();
-const _f1 = /* @__PURE__ */ new Vector3();
-const _f2 = /* @__PURE__ */ new Vector3();
-const _center = /* @__PURE__ */ new Vector3();
-const _extents = /* @__PURE__ */ new Vector3();
-const _triangleNormal = /* @__PURE__ */ new Vector3();
-const _testAxis = /* @__PURE__ */ new Vector3();
-function satForAxes(axes, v0, v1, v2, extents) {
- for (let i = 0, j = axes.length - 3; i <= j; i += 3) {
- _testAxis.fromArray(axes, i);
- const r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z);
- const p0 = v0.dot(_testAxis);
- const p1 = v1.dot(_testAxis);
- const p2 = v2.dot(_testAxis);
- if (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {
- return false;
- }
- }
- return true;
-}
-__name(satForAxes, "satForAxes");
-const _box$3 = /* @__PURE__ */ new Box3();
-const _v1$6 = /* @__PURE__ */ new Vector3();
-const _v2$3 = /* @__PURE__ */ new Vector3();
-class Sphere {
- static {
- __name(this, "Sphere");
- }
- constructor(center = new Vector3(), radius = -1) {
- this.isSphere = true;
- this.center = center;
- this.radius = radius;
- }
- set(center, radius) {
- this.center.copy(center);
- this.radius = radius;
- return this;
- }
- setFromPoints(points, optionalCenter) {
- const center = this.center;
- if (optionalCenter !== void 0) {
- center.copy(optionalCenter);
- } else {
- _box$3.setFromPoints(points).getCenter(center);
- }
- let maxRadiusSq = 0;
- for (let i = 0, il = points.length; i < il; i++) {
- maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));
- }
- this.radius = Math.sqrt(maxRadiusSq);
- return this;
- }
- copy(sphere) {
- this.center.copy(sphere.center);
- this.radius = sphere.radius;
- return this;
- }
- isEmpty() {
- return this.radius < 0;
- }
- makeEmpty() {
- this.center.set(0, 0, 0);
- this.radius = -1;
- return this;
- }
- containsPoint(point) {
- return point.distanceToSquared(this.center) <= this.radius * this.radius;
- }
- distanceToPoint(point) {
- return point.distanceTo(this.center) - this.radius;
- }
- intersectsSphere(sphere) {
- const radiusSum = this.radius + sphere.radius;
- return sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;
- }
- intersectsBox(box) {
- return box.intersectsSphere(this);
- }
- intersectsPlane(plane) {
- return Math.abs(plane.distanceToPoint(this.center)) <= this.radius;
- }
- clampPoint(point, target) {
- const deltaLengthSq = this.center.distanceToSquared(point);
- target.copy(point);
- if (deltaLengthSq > this.radius * this.radius) {
- target.sub(this.center).normalize();
- target.multiplyScalar(this.radius).add(this.center);
- }
- return target;
- }
- getBoundingBox(target) {
- if (this.isEmpty()) {
- target.makeEmpty();
- return target;
- }
- target.set(this.center, this.center);
- target.expandByScalar(this.radius);
- return target;
- }
- applyMatrix4(matrix) {
- this.center.applyMatrix4(matrix);
- this.radius = this.radius * matrix.getMaxScaleOnAxis();
- return this;
- }
- translate(offset) {
- this.center.add(offset);
- return this;
- }
- expandByPoint(point) {
- if (this.isEmpty()) {
- this.center.copy(point);
- this.radius = 0;
- return this;
- }
- _v1$6.subVectors(point, this.center);
- const lengthSq = _v1$6.lengthSq();
- if (lengthSq > this.radius * this.radius) {
- const length = Math.sqrt(lengthSq);
- const delta = (length - this.radius) * 0.5;
- this.center.addScaledVector(_v1$6, delta / length);
- this.radius += delta;
- }
- return this;
- }
- union(sphere) {
- if (sphere.isEmpty()) {
- return this;
- }
- if (this.isEmpty()) {
- this.copy(sphere);
- return this;
- }
- if (this.center.equals(sphere.center) === true) {
- this.radius = Math.max(this.radius, sphere.radius);
- } else {
- _v2$3.subVectors(sphere.center, this.center).setLength(sphere.radius);
- this.expandByPoint(_v1$6.copy(sphere.center).add(_v2$3));
- this.expandByPoint(_v1$6.copy(sphere.center).sub(_v2$3));
- }
- return this;
- }
- equals(sphere) {
- return sphere.center.equals(this.center) && sphere.radius === this.radius;
- }
- clone() {
- return new this.constructor().copy(this);
- }
-}
-const _vector$a = /* @__PURE__ */ new Vector3();
-const _segCenter = /* @__PURE__ */ new Vector3();
-const _segDir = /* @__PURE__ */ new Vector3();
-const _diff = /* @__PURE__ */ new Vector3();
-const _edge1 = /* @__PURE__ */ new Vector3();
-const _edge2 = /* @__PURE__ */ new Vector3();
-const _normal$1 = /* @__PURE__ */ new Vector3();
-class Ray {
- static {
- __name(this, "Ray");
- }
- constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {
- this.origin = origin;
- this.direction = direction;
- }
- set(origin, direction) {
- this.origin.copy(origin);
- this.direction.copy(direction);
- return this;
- }
- copy(ray) {
- this.origin.copy(ray.origin);
- this.direction.copy(ray.direction);
- return this;
- }
- at(t2, target) {
- return target.copy(this.origin).addScaledVector(this.direction, t2);
- }
- lookAt(v) {
- this.direction.copy(v).sub(this.origin).normalize();
- return this;
- }
- recast(t2) {
- this.origin.copy(this.at(t2, _vector$a));
- return this;
- }
- closestPointToPoint(point, target) {
- target.subVectors(point, this.origin);
- const directionDistance = target.dot(this.direction);
- if (directionDistance < 0) {
- return target.copy(this.origin);
- }
- return target.copy(this.origin).addScaledVector(this.direction, directionDistance);
- }
- distanceToPoint(point) {
- return Math.sqrt(this.distanceSqToPoint(point));
- }
- distanceSqToPoint(point) {
- const directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction);
- if (directionDistance < 0) {
- return this.origin.distanceToSquared(point);
- }
- _vector$a.copy(this.origin).addScaledVector(this.direction, directionDistance);
- return _vector$a.distanceToSquared(point);
- }
- distanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {
- _segCenter.copy(v0).add(v1).multiplyScalar(0.5);
- _segDir.copy(v1).sub(v0).normalize();
- _diff.copy(this.origin).sub(_segCenter);
- const segExtent = v0.distanceTo(v1) * 0.5;
- const a01 = -this.direction.dot(_segDir);
- const b0 = _diff.dot(this.direction);
- const b1 = -_diff.dot(_segDir);
- const c = _diff.lengthSq();
- const det = Math.abs(1 - a01 * a01);
- let s0, s1, sqrDist, extDet;
- if (det > 0) {
- s0 = a01 * b1 - b0;
- s1 = a01 * b0 - b1;
- extDet = segExtent * det;
- if (s0 >= 0) {
- if (s1 >= -extDet) {
- if (s1 <= extDet) {
- const invDet = 1 / det;
- s0 *= invDet;
- s1 *= invDet;
- sqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;
- } else {
- s1 = segExtent;
- s0 = Math.max(0, -(a01 * s1 + b0));
- sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;
- }
- } else {
- s1 = -segExtent;
- s0 = Math.max(0, -(a01 * s1 + b0));
- sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;
- }
- } else {
- if (s1 <= -extDet) {
- s0 = Math.max(0, -(-a01 * segExtent + b0));
- s1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
- sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;
- } else if (s1 <= extDet) {
- s0 = 0;
- s1 = Math.min(Math.max(-segExtent, -b1), segExtent);
- sqrDist = s1 * (s1 + 2 * b1) + c;
- } else {
- s0 = Math.max(0, -(a01 * segExtent + b0));
- s1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
- sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;
- }
- }
- } else {
- s1 = a01 > 0 ? -segExtent : segExtent;
- s0 = Math.max(0, -(a01 * s1 + b0));
- sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;
- }
- if (optionalPointOnRay) {
- optionalPointOnRay.copy(this.origin).addScaledVector(this.direction, s0);
- }
- if (optionalPointOnSegment) {
- optionalPointOnSegment.copy(_segCenter).addScaledVector(_segDir, s1);
- }
- return sqrDist;
- }
- intersectSphere(sphere, target) {
- _vector$a.subVectors(sphere.center, this.origin);
- const tca = _vector$a.dot(this.direction);
- const d2 = _vector$a.dot(_vector$a) - tca * tca;
- const radius2 = sphere.radius * sphere.radius;
- if (d2 > radius2) return null;
- const thc = Math.sqrt(radius2 - d2);
- const t0 = tca - thc;
- const t1 = tca + thc;
- if (t1 < 0) return null;
- if (t0 < 0) return this.at(t1, target);
- return this.at(t0, target);
- }
- intersectsSphere(sphere) {
- return this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;
- }
- distanceToPlane(plane) {
- const denominator = plane.normal.dot(this.direction);
- if (denominator === 0) {
- if (plane.distanceToPoint(this.origin) === 0) {
- return 0;
- }
- return null;
- }
- const t2 = -(this.origin.dot(plane.normal) + plane.constant) / denominator;
- return t2 >= 0 ? t2 : null;
- }
- intersectPlane(plane, target) {
- const t2 = this.distanceToPlane(plane);
- if (t2 === null) {
- return null;
- }
- return this.at(t2, target);
- }
- intersectsPlane(plane) {
- const distToPoint = plane.distanceToPoint(this.origin);
- if (distToPoint === 0) {
- return true;
- }
- const denominator = plane.normal.dot(this.direction);
- if (denominator * distToPoint < 0) {
- return true;
- }
- return false;
- }
- intersectBox(box, target) {
- let tmin, tmax, tymin, tymax, tzmin, tzmax;
- const invdirx = 1 / this.direction.x, invdiry = 1 / this.direction.y, invdirz = 1 / this.direction.z;
- const origin = this.origin;
- if (invdirx >= 0) {
- tmin = (box.min.x - origin.x) * invdirx;
- tmax = (box.max.x - origin.x) * invdirx;
- } else {
- tmin = (box.max.x - origin.x) * invdirx;
- tmax = (box.min.x - origin.x) * invdirx;
- }
- if (invdiry >= 0) {
- tymin = (box.min.y - origin.y) * invdiry;
- tymax = (box.max.y - origin.y) * invdiry;
- } else {
- tymin = (box.max.y - origin.y) * invdiry;
- tymax = (box.min.y - origin.y) * invdiry;
- }
- if (tmin > tymax || tymin > tmax) return null;
- if (tymin > tmin || isNaN(tmin)) tmin = tymin;
- if (tymax < tmax || isNaN(tmax)) tmax = tymax;
- if (invdirz >= 0) {
- tzmin = (box.min.z - origin.z) * invdirz;
- tzmax = (box.max.z - origin.z) * invdirz;
- } else {
- tzmin = (box.max.z - origin.z) * invdirz;
- tzmax = (box.min.z - origin.z) * invdirz;
- }
- if (tmin > tzmax || tzmin > tmax) return null;
- if (tzmin > tmin || tmin !== tmin) tmin = tzmin;
- if (tzmax < tmax || tmax !== tmax) tmax = tzmax;
- if (tmax < 0) return null;
- return this.at(tmin >= 0 ? tmin : tmax, target);
- }
- intersectsBox(box) {
- return this.intersectBox(box, _vector$a) !== null;
- }
- intersectTriangle(a, b, c, backfaceCulling, target) {
- _edge1.subVectors(b, a);
- _edge2.subVectors(c, a);
- _normal$1.crossVectors(_edge1, _edge2);
- let DdN = this.direction.dot(_normal$1);
- let sign2;
- if (DdN > 0) {
- if (backfaceCulling) return null;
- sign2 = 1;
- } else if (DdN < 0) {
- sign2 = -1;
- DdN = -DdN;
- } else {
- return null;
- }
- _diff.subVectors(this.origin, a);
- const DdQxE2 = sign2 * this.direction.dot(_edge2.crossVectors(_diff, _edge2));
- if (DdQxE2 < 0) {
- return null;
- }
- const DdE1xQ = sign2 * this.direction.dot(_edge1.cross(_diff));
- if (DdE1xQ < 0) {
- return null;
- }
- if (DdQxE2 + DdE1xQ > DdN) {
- return null;
- }
- const QdN = -sign2 * _diff.dot(_normal$1);
- if (QdN < 0) {
- return null;
- }
- return this.at(QdN / DdN, target);
- }
- applyMatrix4(matrix4) {
- this.origin.applyMatrix4(matrix4);
- this.direction.transformDirection(matrix4);
- return this;
- }
- equals(ray) {
- return ray.origin.equals(this.origin) && ray.direction.equals(this.direction);
- }
- clone() {
- return new this.constructor().copy(this);
- }
-}
-class Matrix4 {
- static {
- __name(this, "Matrix4");
- }
- constructor(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
- Matrix4.prototype.isMatrix4 = true;
- this.elements = [
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1
- ];
- if (n11 !== void 0) {
- this.set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44);
- }
- }
- set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
- const te2 = this.elements;
- te2[0] = n11;
- te2[4] = n12;
- te2[8] = n13;
- te2[12] = n14;
- te2[1] = n21;
- te2[5] = n22;
- te2[9] = n23;
- te2[13] = n24;
- te2[2] = n31;
- te2[6] = n32;
- te2[10] = n33;
- te2[14] = n34;
- te2[3] = n41;
- te2[7] = n42;
- te2[11] = n43;
- te2[15] = n44;
- return this;
- }
- identity() {
- this.set(
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- clone() {
- return new Matrix4().fromArray(this.elements);
- }
- copy(m) {
- const te2 = this.elements;
- const me = m.elements;
- te2[0] = me[0];
- te2[1] = me[1];
- te2[2] = me[2];
- te2[3] = me[3];
- te2[4] = me[4];
- te2[5] = me[5];
- te2[6] = me[6];
- te2[7] = me[7];
- te2[8] = me[8];
- te2[9] = me[9];
- te2[10] = me[10];
- te2[11] = me[11];
- te2[12] = me[12];
- te2[13] = me[13];
- te2[14] = me[14];
- te2[15] = me[15];
- return this;
- }
- copyPosition(m) {
- const te2 = this.elements, me = m.elements;
- te2[12] = me[12];
- te2[13] = me[13];
- te2[14] = me[14];
- return this;
- }
- setFromMatrix3(m) {
- const me = m.elements;
- this.set(
- me[0],
- me[3],
- me[6],
- 0,
- me[1],
- me[4],
- me[7],
- 0,
- me[2],
- me[5],
- me[8],
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- extractBasis(xAxis, yAxis, zAxis) {
- xAxis.setFromMatrixColumn(this, 0);
- yAxis.setFromMatrixColumn(this, 1);
- zAxis.setFromMatrixColumn(this, 2);
- return this;
- }
- makeBasis(xAxis, yAxis, zAxis) {
- this.set(
- xAxis.x,
- yAxis.x,
- zAxis.x,
- 0,
- xAxis.y,
- yAxis.y,
- zAxis.y,
- 0,
- xAxis.z,
- yAxis.z,
- zAxis.z,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- extractRotation(m) {
- const te2 = this.elements;
- const me = m.elements;
- const scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length();
- const scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length();
- const scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length();
- te2[0] = me[0] * scaleX;
- te2[1] = me[1] * scaleX;
- te2[2] = me[2] * scaleX;
- te2[3] = 0;
- te2[4] = me[4] * scaleY;
- te2[5] = me[5] * scaleY;
- te2[6] = me[6] * scaleY;
- te2[7] = 0;
- te2[8] = me[8] * scaleZ;
- te2[9] = me[9] * scaleZ;
- te2[10] = me[10] * scaleZ;
- te2[11] = 0;
- te2[12] = 0;
- te2[13] = 0;
- te2[14] = 0;
- te2[15] = 1;
- return this;
- }
- makeRotationFromEuler(euler) {
- const te2 = this.elements;
- const x = euler.x, y = euler.y, z = euler.z;
- const a = Math.cos(x), b = Math.sin(x);
- const c = Math.cos(y), d = Math.sin(y);
- const e = Math.cos(z), f = Math.sin(z);
- if (euler.order === "XYZ") {
- const ae = a * e, af = a * f, be = b * e, bf = b * f;
- te2[0] = c * e;
- te2[4] = -c * f;
- te2[8] = d;
- te2[1] = af + be * d;
- te2[5] = ae - bf * d;
- te2[9] = -b * c;
- te2[2] = bf - ae * d;
- te2[6] = be + af * d;
- te2[10] = a * c;
- } else if (euler.order === "YXZ") {
- const ce = c * e, cf = c * f, de = d * e, df = d * f;
- te2[0] = ce + df * b;
- te2[4] = de * b - cf;
- te2[8] = a * d;
- te2[1] = a * f;
- te2[5] = a * e;
- te2[9] = -b;
- te2[2] = cf * b - de;
- te2[6] = df + ce * b;
- te2[10] = a * c;
- } else if (euler.order === "ZXY") {
- const ce = c * e, cf = c * f, de = d * e, df = d * f;
- te2[0] = ce - df * b;
- te2[4] = -a * f;
- te2[8] = de + cf * b;
- te2[1] = cf + de * b;
- te2[5] = a * e;
- te2[9] = df - ce * b;
- te2[2] = -a * d;
- te2[6] = b;
- te2[10] = a * c;
- } else if (euler.order === "ZYX") {
- const ae = a * e, af = a * f, be = b * e, bf = b * f;
- te2[0] = c * e;
- te2[4] = be * d - af;
- te2[8] = ae * d + bf;
- te2[1] = c * f;
- te2[5] = bf * d + ae;
- te2[9] = af * d - be;
- te2[2] = -d;
- te2[6] = b * c;
- te2[10] = a * c;
- } else if (euler.order === "YZX") {
- const ac = a * c, ad = a * d, bc = b * c, bd = b * d;
- te2[0] = c * e;
- te2[4] = bd - ac * f;
- te2[8] = bc * f + ad;
- te2[1] = f;
- te2[5] = a * e;
- te2[9] = -b * e;
- te2[2] = -d * e;
- te2[6] = ad * f + bc;
- te2[10] = ac - bd * f;
- } else if (euler.order === "XZY") {
- const ac = a * c, ad = a * d, bc = b * c, bd = b * d;
- te2[0] = c * e;
- te2[4] = -f;
- te2[8] = d * e;
- te2[1] = ac * f + bd;
- te2[5] = a * e;
- te2[9] = ad * f - bc;
- te2[2] = bc * f - ad;
- te2[6] = b * e;
- te2[10] = bd * f + ac;
- }
- te2[3] = 0;
- te2[7] = 0;
- te2[11] = 0;
- te2[12] = 0;
- te2[13] = 0;
- te2[14] = 0;
- te2[15] = 1;
- return this;
- }
- makeRotationFromQuaternion(q) {
- return this.compose(_zero, q, _one);
- }
- lookAt(eye, target, up) {
- const te2 = this.elements;
- _z.subVectors(eye, target);
- if (_z.lengthSq() === 0) {
- _z.z = 1;
- }
- _z.normalize();
- _x.crossVectors(up, _z);
- if (_x.lengthSq() === 0) {
- if (Math.abs(up.z) === 1) {
- _z.x += 1e-4;
- } else {
- _z.z += 1e-4;
- }
- _z.normalize();
- _x.crossVectors(up, _z);
- }
- _x.normalize();
- _y.crossVectors(_z, _x);
- te2[0] = _x.x;
- te2[4] = _y.x;
- te2[8] = _z.x;
- te2[1] = _x.y;
- te2[5] = _y.y;
- te2[9] = _z.y;
- te2[2] = _x.z;
- te2[6] = _y.z;
- te2[10] = _z.z;
- return this;
- }
- multiply(m) {
- return this.multiplyMatrices(this, m);
- }
- premultiply(m) {
- return this.multiplyMatrices(m, this);
- }
- multiplyMatrices(a, b) {
- const ae = a.elements;
- const be = b.elements;
- const te2 = this.elements;
- const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12];
- const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13];
- const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14];
- const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15];
- const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12];
- const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13];
- const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14];
- const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15];
- te2[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
- te2[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
- te2[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
- te2[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
- te2[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
- te2[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
- te2[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
- te2[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
- te2[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
- te2[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
- te2[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
- te2[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
- te2[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
- te2[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
- te2[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
- te2[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
- return this;
- }
- multiplyScalar(s) {
- const te2 = this.elements;
- te2[0] *= s;
- te2[4] *= s;
- te2[8] *= s;
- te2[12] *= s;
- te2[1] *= s;
- te2[5] *= s;
- te2[9] *= s;
- te2[13] *= s;
- te2[2] *= s;
- te2[6] *= s;
- te2[10] *= s;
- te2[14] *= s;
- te2[3] *= s;
- te2[7] *= s;
- te2[11] *= s;
- te2[15] *= s;
- return this;
- }
- determinant() {
- const te2 = this.elements;
- const n11 = te2[0], n12 = te2[4], n13 = te2[8], n14 = te2[12];
- const n21 = te2[1], n22 = te2[5], n23 = te2[9], n24 = te2[13];
- const n31 = te2[2], n32 = te2[6], n33 = te2[10], n34 = te2[14];
- const n41 = te2[3], n42 = te2[7], n43 = te2[11], n44 = te2[15];
- return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);
- }
- transpose() {
- const te2 = this.elements;
- let tmp2;
- tmp2 = te2[1];
- te2[1] = te2[4];
- te2[4] = tmp2;
- tmp2 = te2[2];
- te2[2] = te2[8];
- te2[8] = tmp2;
- tmp2 = te2[6];
- te2[6] = te2[9];
- te2[9] = tmp2;
- tmp2 = te2[3];
- te2[3] = te2[12];
- te2[12] = tmp2;
- tmp2 = te2[7];
- te2[7] = te2[13];
- te2[13] = tmp2;
- tmp2 = te2[11];
- te2[11] = te2[14];
- te2[14] = tmp2;
- return this;
- }
- setPosition(x, y, z) {
- const te2 = this.elements;
- if (x.isVector3) {
- te2[12] = x.x;
- te2[13] = x.y;
- te2[14] = x.z;
- } else {
- te2[12] = x;
- te2[13] = y;
- te2[14] = z;
- }
- return this;
- }
- invert() {
- const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n41 = te2[3], n12 = te2[4], n22 = te2[5], n32 = te2[6], n42 = te2[7], n13 = te2[8], n23 = te2[9], n33 = te2[10], n43 = te2[11], n14 = te2[12], n24 = te2[13], n34 = te2[14], n44 = te2[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
- const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
- if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- const detInv = 1 / det;
- te2[0] = t11 * detInv;
- te2[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;
- te2[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;
- te2[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;
- te2[4] = t12 * detInv;
- te2[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;
- te2[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;
- te2[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;
- te2[8] = t13 * detInv;
- te2[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;
- te2[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;
- te2[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;
- te2[12] = t14 * detInv;
- te2[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;
- te2[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;
- te2[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;
- return this;
- }
- scale(v) {
- const te2 = this.elements;
- const x = v.x, y = v.y, z = v.z;
- te2[0] *= x;
- te2[4] *= y;
- te2[8] *= z;
- te2[1] *= x;
- te2[5] *= y;
- te2[9] *= z;
- te2[2] *= x;
- te2[6] *= y;
- te2[10] *= z;
- te2[3] *= x;
- te2[7] *= y;
- te2[11] *= z;
- return this;
- }
- getMaxScaleOnAxis() {
- const te2 = this.elements;
- const scaleXSq = te2[0] * te2[0] + te2[1] * te2[1] + te2[2] * te2[2];
- const scaleYSq = te2[4] * te2[4] + te2[5] * te2[5] + te2[6] * te2[6];
- const scaleZSq = te2[8] * te2[8] + te2[9] * te2[9] + te2[10] * te2[10];
- return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));
- }
- makeTranslation(x, y, z) {
- if (x.isVector3) {
- this.set(
- 1,
- 0,
- 0,
- x.x,
- 0,
- 1,
- 0,
- x.y,
- 0,
- 0,
- 1,
- x.z,
- 0,
- 0,
- 0,
- 1
- );
- } else {
- this.set(
- 1,
- 0,
- 0,
- x,
- 0,
- 1,
- 0,
- y,
- 0,
- 0,
- 1,
- z,
- 0,
- 0,
- 0,
- 1
- );
- }
- return this;
- }
- makeRotationX(theta) {
- const c = Math.cos(theta), s = Math.sin(theta);
- this.set(
- 1,
- 0,
- 0,
- 0,
- 0,
- c,
- -s,
- 0,
- 0,
- s,
- c,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeRotationY(theta) {
- const c = Math.cos(theta), s = Math.sin(theta);
- this.set(
- c,
- 0,
- s,
- 0,
- 0,
- 1,
- 0,
- 0,
- -s,
- 0,
- c,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeRotationZ(theta) {
- const c = Math.cos(theta), s = Math.sin(theta);
- this.set(
- c,
- -s,
- 0,
- 0,
- s,
- c,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeRotationAxis(axis, angle) {
- const c = Math.cos(angle);
- const s = Math.sin(angle);
- const t2 = 1 - c;
- const x = axis.x, y = axis.y, z = axis.z;
- const tx = t2 * x, ty = t2 * y;
- this.set(
- tx * x + c,
- tx * y - s * z,
- tx * z + s * y,
- 0,
- tx * y + s * z,
- ty * y + c,
- ty * z - s * x,
- 0,
- tx * z - s * y,
- ty * z + s * x,
- t2 * z * z + c,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeScale(x, y, z) {
- this.set(
- x,
- 0,
- 0,
- 0,
- 0,
- y,
- 0,
- 0,
- 0,
- 0,
- z,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- makeShear(xy, xz, yx, yz, zx, zy) {
- this.set(
- 1,
- yx,
- zx,
- 0,
- xy,
- 1,
- zy,
- 0,
- xz,
- yz,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1
- );
- return this;
- }
- compose(position, quaternion, scale) {
- const te2 = this.elements;
- const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;
- const x2 = x + x, y2 = y + y, z2 = z + z;
- const xx = x * x2, xy = x * y2, xz = x * z2;
- const yy = y * y2, yz = y * z2, zz = z * z2;
- const wx = w * x2, wy = w * y2, wz = w * z2;
- const sx = scale.x, sy = scale.y, sz = scale.z;
- te2[0] = (1 - (yy + zz)) * sx;
- te2[1] = (xy + wz) * sx;
- te2[2] = (xz - wy) * sx;
- te2[3] = 0;
- te2[4] = (xy - wz) * sy;
- te2[5] = (1 - (xx + zz)) * sy;
- te2[6] = (yz + wx) * sy;
- te2[7] = 0;
- te2[8] = (xz + wy) * sz;
- te2[9] = (yz - wx) * sz;
- te2[10] = (1 - (xx + yy)) * sz;
- te2[11] = 0;
- te2[12] = position.x;
- te2[13] = position.y;
- te2[14] = position.z;
- te2[15] = 1;
- return this;
- }
- decompose(position, quaternion, scale) {
- const te2 = this.elements;
- let sx = _v1$5.set(te2[0], te2[1], te2[2]).length();
- const sy = _v1$5.set(te2[4], te2[5], te2[6]).length();
- const sz = _v1$5.set(te2[8], te2[9], te2[10]).length();
- const det = this.determinant();
- if (det < 0) sx = -sx;
- position.x = te2[12];
- position.y = te2[13];
- position.z = te2[14];
- _m1$4.copy(this);
- const invSX = 1 / sx;
- const invSY = 1 / sy;
- const invSZ = 1 / sz;
- _m1$4.elements[0] *= invSX;
- _m1$4.elements[1] *= invSX;
- _m1$4.elements[2] *= invSX;
- _m1$4.elements[4] *= invSY;
- _m1$4.elements[5] *= invSY;
- _m1$4.elements[6] *= invSY;
- _m1$4.elements[8] *= invSZ;
- _m1$4.elements[9] *= invSZ;
- _m1$4.elements[10] *= invSZ;
- quaternion.setFromRotationMatrix(_m1$4);
- scale.x = sx;
- scale.y = sy;
- scale.z = sz;
- return this;
- }
- makePerspective(left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem) {
- const te2 = this.elements;
- const x = 2 * near / (right - left);
- const y = 2 * near / (top - bottom);
- const a = (right + left) / (right - left);
- const b = (top + bottom) / (top - bottom);
- let c, d;
- if (coordinateSystem === WebGLCoordinateSystem) {
- c = -(far + near) / (far - near);
- d = -2 * far * near / (far - near);
- } else if (coordinateSystem === WebGPUCoordinateSystem) {
- c = -far / (far - near);
- d = -far * near / (far - near);
- } else {
- throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + coordinateSystem);
- }
- te2[0] = x;
- te2[4] = 0;
- te2[8] = a;
- te2[12] = 0;
- te2[1] = 0;
- te2[5] = y;
- te2[9] = b;
- te2[13] = 0;
- te2[2] = 0;
- te2[6] = 0;
- te2[10] = c;
- te2[14] = d;
- te2[3] = 0;
- te2[7] = 0;
- te2[11] = -1;
- te2[15] = 0;
- return this;
- }
- makeOrthographic(left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem) {
- const te2 = this.elements;
- const w = 1 / (right - left);
- const h = 1 / (top - bottom);
- const p = 1 / (far - near);
- const x = (right + left) * w;
- const y = (top + bottom) * h;
- let z, zInv;
- if (coordinateSystem === WebGLCoordinateSystem) {
- z = (far + near) * p;
- zInv = -2 * p;
- } else if (coordinateSystem === WebGPUCoordinateSystem) {
- z = near * p;
- zInv = -1 * p;
- } else {
- throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + coordinateSystem);
- }
- te2[0] = 2 * w;
- te2[4] = 0;
- te2[8] = 0;
- te2[12] = -x;
- te2[1] = 0;
- te2[5] = 2 * h;
- te2[9] = 0;
- te2[13] = -y;
- te2[2] = 0;
- te2[6] = 0;
- te2[10] = zInv;
- te2[14] = -z;
- te2[3] = 0;
- te2[7] = 0;
- te2[11] = 0;
- te2[15] = 1;
- return this;
- }
- equals(matrix) {
- const te2 = this.elements;
- const me = matrix.elements;
- for (let i = 0; i < 16; i++) {
- if (te2[i] !== me[i]) return false;
- }
- return true;
- }
- fromArray(array, offset = 0) {
- for (let i = 0; i < 16; i++) {
- this.elements[i] = array[i + offset];
- }
- return this;
- }
- toArray(array = [], offset = 0) {
- const te2 = this.elements;
- array[offset] = te2[0];
- array[offset + 1] = te2[1];
- array[offset + 2] = te2[2];
- array[offset + 3] = te2[3];
- array[offset + 4] = te2[4];
- array[offset + 5] = te2[5];
- array[offset + 6] = te2[6];
- array[offset + 7] = te2[7];
- array[offset + 8] = te2[8];
- array[offset + 9] = te2[9];
- array[offset + 10] = te2[10];
- array[offset + 11] = te2[11];
- array[offset + 12] = te2[12];
- array[offset + 13] = te2[13];
- array[offset + 14] = te2[14];
- array[offset + 15] = te2[15];
- return array;
- }
-}
-const _v1$5 = /* @__PURE__ */ new Vector3();
-const _m1$4 = /* @__PURE__ */ new Matrix4();
-const _zero = /* @__PURE__ */ new Vector3(0, 0, 0);
-const _one = /* @__PURE__ */ new Vector3(1, 1, 1);
-const _x = /* @__PURE__ */ new Vector3();
-const _y = /* @__PURE__ */ new Vector3();
-const _z = /* @__PURE__ */ new Vector3();
-const _matrix$2 = /* @__PURE__ */ new Matrix4();
-const _quaternion$3 = /* @__PURE__ */ new Quaternion();
-class Euler {
- static {
- __name(this, "Euler");
- }
- constructor(x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER) {
- this.isEuler = true;
- this._x = x;
- this._y = y;
- this._z = z;
- this._order = order;
- }
- get x() {
- return this._x;
- }
- set x(value) {
- this._x = value;
- this._onChangeCallback();
- }
- get y() {
- return this._y;
- }
- set y(value) {
- this._y = value;
- this._onChangeCallback();
- }
- get z() {
- return this._z;
- }
- set z(value) {
- this._z = value;
- this._onChangeCallback();
- }
- get order() {
- return this._order;
- }
- set order(value) {
- this._order = value;
- this._onChangeCallback();
- }
- set(x, y, z, order = this._order) {
- this._x = x;
- this._y = y;
- this._z = z;
- this._order = order;
- this._onChangeCallback();
- return this;
- }
- clone() {
- return new this.constructor(this._x, this._y, this._z, this._order);
- }
- copy(euler) {
- this._x = euler._x;
- this._y = euler._y;
- this._z = euler._z;
- this._order = euler._order;
- this._onChangeCallback();
- return this;
- }
- setFromRotationMatrix(m, order = this._order, update = true) {
- const te2 = m.elements;
- const m11 = te2[0], m12 = te2[4], m13 = te2[8];
- const m21 = te2[1], m22 = te2[5], m23 = te2[9];
- const m31 = te2[2], m32 = te2[6], m33 = te2[10];
- switch (order) {
- case "XYZ":
- this._y = Math.asin(clamp(m13, -1, 1));
- if (Math.abs(m13) < 0.9999999) {
- this._x = Math.atan2(-m23, m33);
- this._z = Math.atan2(-m12, m11);
- } else {
- this._x = Math.atan2(m32, m22);
- this._z = 0;
- }
- break;
- case "YXZ":
- this._x = Math.asin(-clamp(m23, -1, 1));
- if (Math.abs(m23) < 0.9999999) {
- this._y = Math.atan2(m13, m33);
- this._z = Math.atan2(m21, m22);
- } else {
- this._y = Math.atan2(-m31, m11);
- this._z = 0;
- }
- break;
- case "ZXY":
- this._x = Math.asin(clamp(m32, -1, 1));
- if (Math.abs(m32) < 0.9999999) {
- this._y = Math.atan2(-m31, m33);
- this._z = Math.atan2(-m12, m22);
- } else {
- this._y = 0;
- this._z = Math.atan2(m21, m11);
- }
- break;
- case "ZYX":
- this._y = Math.asin(-clamp(m31, -1, 1));
- if (Math.abs(m31) < 0.9999999) {
- this._x = Math.atan2(m32, m33);
- this._z = Math.atan2(m21, m11);
- } else {
- this._x = 0;
- this._z = Math.atan2(-m12, m22);
- }
- break;
- case "YZX":
- this._z = Math.asin(clamp(m21, -1, 1));
- if (Math.abs(m21) < 0.9999999) {
- this._x = Math.atan2(-m23, m22);
- this._y = Math.atan2(-m31, m11);
- } else {
- this._x = 0;
- this._y = Math.atan2(m13, m33);
- }
- break;
- case "XZY":
- this._z = Math.asin(-clamp(m12, -1, 1));
- if (Math.abs(m12) < 0.9999999) {
- this._x = Math.atan2(m32, m22);
- this._y = Math.atan2(m13, m11);
- } else {
- this._x = Math.atan2(-m23, m33);
- this._y = 0;
- }
- break;
- default:
- console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order);
- }
- this._order = order;
- if (update === true) this._onChangeCallback();
- return this;
- }
- setFromQuaternion(q, order, update) {
- _matrix$2.makeRotationFromQuaternion(q);
- return this.setFromRotationMatrix(_matrix$2, order, update);
- }
- setFromVector3(v, order = this._order) {
- return this.set(v.x, v.y, v.z, order);
- }
- reorder(newOrder) {
- _quaternion$3.setFromEuler(this);
- return this.setFromQuaternion(_quaternion$3, newOrder);
- }
- equals(euler) {
- return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;
- }
- fromArray(array) {
- this._x = array[0];
- this._y = array[1];
- this._z = array[2];
- if (array[3] !== void 0) this._order = array[3];
- this._onChangeCallback();
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this._x;
- array[offset + 1] = this._y;
- array[offset + 2] = this._z;
- array[offset + 3] = this._order;
- return array;
- }
- _onChange(callback) {
- this._onChangeCallback = callback;
- return this;
- }
- _onChangeCallback() {
- }
- *[Symbol.iterator]() {
- yield this._x;
- yield this._y;
- yield this._z;
- yield this._order;
- }
-}
-Euler.DEFAULT_ORDER = "XYZ";
-class Layers {
- static {
- __name(this, "Layers");
- }
- constructor() {
- this.mask = 1 | 0;
- }
- set(channel) {
- this.mask = (1 << channel | 0) >>> 0;
- }
- enable(channel) {
- this.mask |= 1 << channel | 0;
- }
- enableAll() {
- this.mask = 4294967295 | 0;
- }
- toggle(channel) {
- this.mask ^= 1 << channel | 0;
- }
- disable(channel) {
- this.mask &= ~(1 << channel | 0);
- }
- disableAll() {
- this.mask = 0;
- }
- test(layers) {
- return (this.mask & layers.mask) !== 0;
- }
- isEnabled(channel) {
- return (this.mask & (1 << channel | 0)) !== 0;
- }
-}
-let _object3DId = 0;
-const _v1$4 = /* @__PURE__ */ new Vector3();
-const _q1 = /* @__PURE__ */ new Quaternion();
-const _m1$3 = /* @__PURE__ */ new Matrix4();
-const _target = /* @__PURE__ */ new Vector3();
-const _position$3 = /* @__PURE__ */ new Vector3();
-const _scale$2 = /* @__PURE__ */ new Vector3();
-const _quaternion$2 = /* @__PURE__ */ new Quaternion();
-const _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0);
-const _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0);
-const _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1);
-const _addedEvent = { type: "added" };
-const _removedEvent = { type: "removed" };
-const _childaddedEvent = { type: "childadded", child: null };
-const _childremovedEvent = { type: "childremoved", child: null };
-class Object3D extends EventDispatcher {
- static {
- __name(this, "Object3D");
- }
- constructor() {
- super();
- this.isObject3D = true;
- Object.defineProperty(this, "id", { value: _object3DId++ });
- this.uuid = generateUUID();
- this.name = "";
- this.type = "Object3D";
- this.parent = null;
- this.children = [];
- this.up = Object3D.DEFAULT_UP.clone();
- const position = new Vector3();
- const rotation = new Euler();
- const quaternion = new Quaternion();
- const scale = new Vector3(1, 1, 1);
- function onRotationChange() {
- quaternion.setFromEuler(rotation, false);
- }
- __name(onRotationChange, "onRotationChange");
- function onQuaternionChange() {
- rotation.setFromQuaternion(quaternion, void 0, false);
- }
- __name(onQuaternionChange, "onQuaternionChange");
- rotation._onChange(onRotationChange);
- quaternion._onChange(onQuaternionChange);
- Object.defineProperties(this, {
- position: {
- configurable: true,
- enumerable: true,
- value: position
- },
- rotation: {
- configurable: true,
- enumerable: true,
- value: rotation
- },
- quaternion: {
- configurable: true,
- enumerable: true,
- value: quaternion
- },
- scale: {
- configurable: true,
- enumerable: true,
- value: scale
- },
- modelViewMatrix: {
- value: new Matrix4()
- },
- normalMatrix: {
- value: new Matrix3()
- }
- });
- this.matrix = new Matrix4();
- this.matrixWorld = new Matrix4();
- this.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE;
- this.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE;
- this.matrixWorldNeedsUpdate = false;
- this.layers = new Layers();
- this.visible = true;
- this.castShadow = false;
- this.receiveShadow = false;
- this.frustumCulled = true;
- this.renderOrder = 0;
- this.animations = [];
- this.userData = {};
- }
- onBeforeShadow() {
- }
- onAfterShadow() {
- }
- onBeforeRender() {
- }
- onAfterRender() {
- }
- applyMatrix4(matrix) {
- if (this.matrixAutoUpdate) this.updateMatrix();
- this.matrix.premultiply(matrix);
- this.matrix.decompose(this.position, this.quaternion, this.scale);
- }
- applyQuaternion(q) {
- this.quaternion.premultiply(q);
- return this;
- }
- setRotationFromAxisAngle(axis, angle) {
- this.quaternion.setFromAxisAngle(axis, angle);
- }
- setRotationFromEuler(euler) {
- this.quaternion.setFromEuler(euler, true);
- }
- setRotationFromMatrix(m) {
- this.quaternion.setFromRotationMatrix(m);
- }
- setRotationFromQuaternion(q) {
- this.quaternion.copy(q);
- }
- rotateOnAxis(axis, angle) {
- _q1.setFromAxisAngle(axis, angle);
- this.quaternion.multiply(_q1);
- return this;
- }
- rotateOnWorldAxis(axis, angle) {
- _q1.setFromAxisAngle(axis, angle);
- this.quaternion.premultiply(_q1);
- return this;
- }
- rotateX(angle) {
- return this.rotateOnAxis(_xAxis, angle);
- }
- rotateY(angle) {
- return this.rotateOnAxis(_yAxis, angle);
- }
- rotateZ(angle) {
- return this.rotateOnAxis(_zAxis, angle);
- }
- translateOnAxis(axis, distance) {
- _v1$4.copy(axis).applyQuaternion(this.quaternion);
- this.position.add(_v1$4.multiplyScalar(distance));
- return this;
- }
- translateX(distance) {
- return this.translateOnAxis(_xAxis, distance);
- }
- translateY(distance) {
- return this.translateOnAxis(_yAxis, distance);
- }
- translateZ(distance) {
- return this.translateOnAxis(_zAxis, distance);
- }
- localToWorld(vector) {
- this.updateWorldMatrix(true, false);
- return vector.applyMatrix4(this.matrixWorld);
- }
- worldToLocal(vector) {
- this.updateWorldMatrix(true, false);
- return vector.applyMatrix4(_m1$3.copy(this.matrixWorld).invert());
- }
- lookAt(x, y, z) {
- if (x.isVector3) {
- _target.copy(x);
- } else {
- _target.set(x, y, z);
- }
- const parent = this.parent;
- this.updateWorldMatrix(true, false);
- _position$3.setFromMatrixPosition(this.matrixWorld);
- if (this.isCamera || this.isLight) {
- _m1$3.lookAt(_position$3, _target, this.up);
- } else {
- _m1$3.lookAt(_target, _position$3, this.up);
- }
- this.quaternion.setFromRotationMatrix(_m1$3);
- if (parent) {
- _m1$3.extractRotation(parent.matrixWorld);
- _q1.setFromRotationMatrix(_m1$3);
- this.quaternion.premultiply(_q1.invert());
- }
- }
- add(object) {
- if (arguments.length > 1) {
- for (let i = 0; i < arguments.length; i++) {
- this.add(arguments[i]);
- }
- return this;
- }
- if (object === this) {
- console.error("THREE.Object3D.add: object can't be added as a child of itself.", object);
- return this;
- }
- if (object && object.isObject3D) {
- object.removeFromParent();
- object.parent = this;
- this.children.push(object);
- object.dispatchEvent(_addedEvent);
- _childaddedEvent.child = object;
- this.dispatchEvent(_childaddedEvent);
- _childaddedEvent.child = null;
- } else {
- console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", object);
- }
- return this;
- }
- remove(object) {
- if (arguments.length > 1) {
- for (let i = 0; i < arguments.length; i++) {
- this.remove(arguments[i]);
- }
- return this;
- }
- const index = this.children.indexOf(object);
- if (index !== -1) {
- object.parent = null;
- this.children.splice(index, 1);
- object.dispatchEvent(_removedEvent);
- _childremovedEvent.child = object;
- this.dispatchEvent(_childremovedEvent);
- _childremovedEvent.child = null;
- }
- return this;
- }
- removeFromParent() {
- const parent = this.parent;
- if (parent !== null) {
- parent.remove(this);
- }
- return this;
- }
- clear() {
- return this.remove(...this.children);
- }
- attach(object) {
- this.updateWorldMatrix(true, false);
- _m1$3.copy(this.matrixWorld).invert();
- if (object.parent !== null) {
- object.parent.updateWorldMatrix(true, false);
- _m1$3.multiply(object.parent.matrixWorld);
- }
- object.applyMatrix4(_m1$3);
- object.removeFromParent();
- object.parent = this;
- this.children.push(object);
- object.updateWorldMatrix(false, true);
- object.dispatchEvent(_addedEvent);
- _childaddedEvent.child = object;
- this.dispatchEvent(_childaddedEvent);
- _childaddedEvent.child = null;
- return this;
- }
- getObjectById(id2) {
- return this.getObjectByProperty("id", id2);
- }
- getObjectByName(name) {
- return this.getObjectByProperty("name", name);
- }
- getObjectByProperty(name, value) {
- if (this[name] === value) return this;
- for (let i = 0, l = this.children.length; i < l; i++) {
- const child = this.children[i];
- const object = child.getObjectByProperty(name, value);
- if (object !== void 0) {
- return object;
- }
- }
- return void 0;
- }
- getObjectsByProperty(name, value, result = []) {
- if (this[name] === value) result.push(this);
- const children = this.children;
- for (let i = 0, l = children.length; i < l; i++) {
- children[i].getObjectsByProperty(name, value, result);
- }
- return result;
- }
- getWorldPosition(target) {
- this.updateWorldMatrix(true, false);
- return target.setFromMatrixPosition(this.matrixWorld);
- }
- getWorldQuaternion(target) {
- this.updateWorldMatrix(true, false);
- this.matrixWorld.decompose(_position$3, target, _scale$2);
- return target;
- }
- getWorldScale(target) {
- this.updateWorldMatrix(true, false);
- this.matrixWorld.decompose(_position$3, _quaternion$2, target);
- return target;
- }
- getWorldDirection(target) {
- this.updateWorldMatrix(true, false);
- const e = this.matrixWorld.elements;
- return target.set(e[8], e[9], e[10]).normalize();
- }
- raycast() {
- }
- traverse(callback) {
- callback(this);
- const children = this.children;
- for (let i = 0, l = children.length; i < l; i++) {
- children[i].traverse(callback);
- }
- }
- traverseVisible(callback) {
- if (this.visible === false) return;
- callback(this);
- const children = this.children;
- for (let i = 0, l = children.length; i < l; i++) {
- children[i].traverseVisible(callback);
- }
- }
- traverseAncestors(callback) {
- const parent = this.parent;
- if (parent !== null) {
- callback(parent);
- parent.traverseAncestors(callback);
- }
- }
- updateMatrix() {
- this.matrix.compose(this.position, this.quaternion, this.scale);
- this.matrixWorldNeedsUpdate = true;
- }
- updateMatrixWorld(force) {
- if (this.matrixAutoUpdate) this.updateMatrix();
- if (this.matrixWorldNeedsUpdate || force) {
- if (this.matrixWorldAutoUpdate === true) {
- if (this.parent === null) {
- this.matrixWorld.copy(this.matrix);
- } else {
- this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
- }
- }
- this.matrixWorldNeedsUpdate = false;
- force = true;
- }
- const children = this.children;
- for (let i = 0, l = children.length; i < l; i++) {
- const child = children[i];
- child.updateMatrixWorld(force);
- }
- }
- updateWorldMatrix(updateParents, updateChildren) {
- const parent = this.parent;
- if (updateParents === true && parent !== null) {
- parent.updateWorldMatrix(true, false);
- }
- if (this.matrixAutoUpdate) this.updateMatrix();
- if (this.matrixWorldAutoUpdate === true) {
- if (this.parent === null) {
- this.matrixWorld.copy(this.matrix);
- } else {
- this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
- }
- }
- if (updateChildren === true) {
- const children = this.children;
- for (let i = 0, l = children.length; i < l; i++) {
- const child = children[i];
- child.updateWorldMatrix(false, true);
- }
- }
- }
- toJSON(meta) {
- const isRootObject = meta === void 0 || typeof meta === "string";
- const output = {};
- if (isRootObject) {
- meta = {
- geometries: {},
- materials: {},
- textures: {},
- images: {},
- shapes: {},
- skeletons: {},
- animations: {},
- nodes: {}
- };
- output.metadata = {
- version: 4.6,
- type: "Object",
- generator: "Object3D.toJSON"
- };
- }
- const object = {};
- object.uuid = this.uuid;
- object.type = this.type;
- if (this.name !== "") object.name = this.name;
- if (this.castShadow === true) object.castShadow = true;
- if (this.receiveShadow === true) object.receiveShadow = true;
- if (this.visible === false) object.visible = false;
- if (this.frustumCulled === false) object.frustumCulled = false;
- if (this.renderOrder !== 0) object.renderOrder = this.renderOrder;
- if (Object.keys(this.userData).length > 0) object.userData = this.userData;
- object.layers = this.layers.mask;
- object.matrix = this.matrix.toArray();
- object.up = this.up.toArray();
- if (this.matrixAutoUpdate === false) object.matrixAutoUpdate = false;
- if (this.isInstancedMesh) {
- object.type = "InstancedMesh";
- object.count = this.count;
- object.instanceMatrix = this.instanceMatrix.toJSON();
- if (this.instanceColor !== null) object.instanceColor = this.instanceColor.toJSON();
- }
- if (this.isBatchedMesh) {
- object.type = "BatchedMesh";
- object.perObjectFrustumCulled = this.perObjectFrustumCulled;
- object.sortObjects = this.sortObjects;
- object.drawRanges = this._drawRanges;
- object.reservedRanges = this._reservedRanges;
- object.visibility = this._visibility;
- object.active = this._active;
- object.bounds = this._bounds.map((bound) => ({
- boxInitialized: bound.boxInitialized,
- boxMin: bound.box.min.toArray(),
- boxMax: bound.box.max.toArray(),
- sphereInitialized: bound.sphereInitialized,
- sphereRadius: bound.sphere.radius,
- sphereCenter: bound.sphere.center.toArray()
- }));
- object.maxInstanceCount = this._maxInstanceCount;
- object.maxVertexCount = this._maxVertexCount;
- object.maxIndexCount = this._maxIndexCount;
- object.geometryInitialized = this._geometryInitialized;
- object.geometryCount = this._geometryCount;
- object.matricesTexture = this._matricesTexture.toJSON(meta);
- if (this._colorsTexture !== null) object.colorsTexture = this._colorsTexture.toJSON(meta);
- if (this.boundingSphere !== null) {
- object.boundingSphere = {
- center: object.boundingSphere.center.toArray(),
- radius: object.boundingSphere.radius
- };
- }
- if (this.boundingBox !== null) {
- object.boundingBox = {
- min: object.boundingBox.min.toArray(),
- max: object.boundingBox.max.toArray()
- };
- }
- }
- function serialize(library, element) {
- if (library[element.uuid] === void 0) {
- library[element.uuid] = element.toJSON(meta);
- }
- return element.uuid;
- }
- __name(serialize, "serialize");
- if (this.isScene) {
- if (this.background) {
- if (this.background.isColor) {
- object.background = this.background.toJSON();
- } else if (this.background.isTexture) {
- object.background = this.background.toJSON(meta).uuid;
- }
- }
- if (this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true) {
- object.environment = this.environment.toJSON(meta).uuid;
- }
- } else if (this.isMesh || this.isLine || this.isPoints) {
- object.geometry = serialize(meta.geometries, this.geometry);
- const parameters = this.geometry.parameters;
- if (parameters !== void 0 && parameters.shapes !== void 0) {
- const shapes = parameters.shapes;
- if (Array.isArray(shapes)) {
- for (let i = 0, l = shapes.length; i < l; i++) {
- const shape = shapes[i];
- serialize(meta.shapes, shape);
- }
- } else {
- serialize(meta.shapes, shapes);
- }
- }
- }
- if (this.isSkinnedMesh) {
- object.bindMode = this.bindMode;
- object.bindMatrix = this.bindMatrix.toArray();
- if (this.skeleton !== void 0) {
- serialize(meta.skeletons, this.skeleton);
- object.skeleton = this.skeleton.uuid;
- }
- }
- if (this.material !== void 0) {
- if (Array.isArray(this.material)) {
- const uuids = [];
- for (let i = 0, l = this.material.length; i < l; i++) {
- uuids.push(serialize(meta.materials, this.material[i]));
- }
- object.material = uuids;
- } else {
- object.material = serialize(meta.materials, this.material);
- }
- }
- if (this.children.length > 0) {
- object.children = [];
- for (let i = 0; i < this.children.length; i++) {
- object.children.push(this.children[i].toJSON(meta).object);
- }
- }
- if (this.animations.length > 0) {
- object.animations = [];
- for (let i = 0; i < this.animations.length; i++) {
- const animation = this.animations[i];
- object.animations.push(serialize(meta.animations, animation));
- }
- }
- if (isRootObject) {
- const geometries = extractFromCache(meta.geometries);
- const materials = extractFromCache(meta.materials);
- const textures = extractFromCache(meta.textures);
- const images = extractFromCache(meta.images);
- const shapes = extractFromCache(meta.shapes);
- const skeletons = extractFromCache(meta.skeletons);
- const animations = extractFromCache(meta.animations);
- const nodes = extractFromCache(meta.nodes);
- if (geometries.length > 0) output.geometries = geometries;
- if (materials.length > 0) output.materials = materials;
- if (textures.length > 0) output.textures = textures;
- if (images.length > 0) output.images = images;
- if (shapes.length > 0) output.shapes = shapes;
- if (skeletons.length > 0) output.skeletons = skeletons;
- if (animations.length > 0) output.animations = animations;
- if (nodes.length > 0) output.nodes = nodes;
- }
- output.object = object;
- return output;
- function extractFromCache(cache) {
- const values = [];
- for (const key in cache) {
- const data = cache[key];
- delete data.metadata;
- values.push(data);
- }
- return values;
- }
- __name(extractFromCache, "extractFromCache");
- }
- clone(recursive) {
- return new this.constructor().copy(this, recursive);
- }
- copy(source, recursive = true) {
- this.name = source.name;
- this.up.copy(source.up);
- this.position.copy(source.position);
- this.rotation.order = source.rotation.order;
- this.quaternion.copy(source.quaternion);
- this.scale.copy(source.scale);
- this.matrix.copy(source.matrix);
- this.matrixWorld.copy(source.matrixWorld);
- this.matrixAutoUpdate = source.matrixAutoUpdate;
- this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;
- this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
- this.layers.mask = source.layers.mask;
- this.visible = source.visible;
- this.castShadow = source.castShadow;
- this.receiveShadow = source.receiveShadow;
- this.frustumCulled = source.frustumCulled;
- this.renderOrder = source.renderOrder;
- this.animations = source.animations.slice();
- this.userData = JSON.parse(JSON.stringify(source.userData));
- if (recursive === true) {
- for (let i = 0; i < source.children.length; i++) {
- const child = source.children[i];
- this.add(child.clone());
- }
- }
- return this;
- }
-}
-Object3D.DEFAULT_UP = /* @__PURE__ */ new Vector3(0, 1, 0);
-Object3D.DEFAULT_MATRIX_AUTO_UPDATE = true;
-Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;
-const _v0$2 = /* @__PURE__ */ new Vector3();
-const _v1$3 = /* @__PURE__ */ new Vector3();
-const _v2$2 = /* @__PURE__ */ new Vector3();
-const _v3$2 = /* @__PURE__ */ new Vector3();
-const _vab = /* @__PURE__ */ new Vector3();
-const _vac = /* @__PURE__ */ new Vector3();
-const _vbc = /* @__PURE__ */ new Vector3();
-const _vap = /* @__PURE__ */ new Vector3();
-const _vbp = /* @__PURE__ */ new Vector3();
-const _vcp = /* @__PURE__ */ new Vector3();
-const _v40 = /* @__PURE__ */ new Vector4();
-const _v41 = /* @__PURE__ */ new Vector4();
-const _v42 = /* @__PURE__ */ new Vector4();
-class Triangle {
- static {
- __name(this, "Triangle");
- }
- constructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {
- this.a = a;
- this.b = b;
- this.c = c;
- }
- static getNormal(a, b, c, target) {
- target.subVectors(c, b);
- _v0$2.subVectors(a, b);
- target.cross(_v0$2);
- const targetLengthSq = target.lengthSq();
- if (targetLengthSq > 0) {
- return target.multiplyScalar(1 / Math.sqrt(targetLengthSq));
- }
- return target.set(0, 0, 0);
- }
- // static/instance method to calculate barycentric coordinates
- // based on: http://www.blackpawn.com/texts/pointinpoly/default.html
- static getBarycoord(point, a, b, c, target) {
- _v0$2.subVectors(c, a);
- _v1$3.subVectors(b, a);
- _v2$2.subVectors(point, a);
- const dot00 = _v0$2.dot(_v0$2);
- const dot01 = _v0$2.dot(_v1$3);
- const dot02 = _v0$2.dot(_v2$2);
- const dot11 = _v1$3.dot(_v1$3);
- const dot12 = _v1$3.dot(_v2$2);
- const denom = dot00 * dot11 - dot01 * dot01;
- if (denom === 0) {
- target.set(0, 0, 0);
- return null;
- }
- const invDenom = 1 / denom;
- const u = (dot11 * dot02 - dot01 * dot12) * invDenom;
- const v = (dot00 * dot12 - dot01 * dot02) * invDenom;
- return target.set(1 - u - v, v, u);
- }
- static containsPoint(point, a, b, c) {
- if (this.getBarycoord(point, a, b, c, _v3$2) === null) {
- return false;
- }
- return _v3$2.x >= 0 && _v3$2.y >= 0 && _v3$2.x + _v3$2.y <= 1;
- }
- static getInterpolation(point, p1, p2, p3, v1, v2, v3, target) {
- if (this.getBarycoord(point, p1, p2, p3, _v3$2) === null) {
- target.x = 0;
- target.y = 0;
- if ("z" in target) target.z = 0;
- if ("w" in target) target.w = 0;
- return null;
- }
- target.setScalar(0);
- target.addScaledVector(v1, _v3$2.x);
- target.addScaledVector(v2, _v3$2.y);
- target.addScaledVector(v3, _v3$2.z);
- return target;
- }
- static getInterpolatedAttribute(attr, i1, i2, i3, barycoord, target) {
- _v40.setScalar(0);
- _v41.setScalar(0);
- _v42.setScalar(0);
- _v40.fromBufferAttribute(attr, i1);
- _v41.fromBufferAttribute(attr, i2);
- _v42.fromBufferAttribute(attr, i3);
- target.setScalar(0);
- target.addScaledVector(_v40, barycoord.x);
- target.addScaledVector(_v41, barycoord.y);
- target.addScaledVector(_v42, barycoord.z);
- return target;
- }
- static isFrontFacing(a, b, c, direction) {
- _v0$2.subVectors(c, b);
- _v1$3.subVectors(a, b);
- return _v0$2.cross(_v1$3).dot(direction) < 0 ? true : false;
- }
- set(a, b, c) {
- this.a.copy(a);
- this.b.copy(b);
- this.c.copy(c);
- return this;
- }
- setFromPointsAndIndices(points, i0, i1, i2) {
- this.a.copy(points[i0]);
- this.b.copy(points[i1]);
- this.c.copy(points[i2]);
- return this;
- }
- setFromAttributeAndIndices(attribute, i0, i1, i2) {
- this.a.fromBufferAttribute(attribute, i0);
- this.b.fromBufferAttribute(attribute, i1);
- this.c.fromBufferAttribute(attribute, i2);
- return this;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(triangle) {
- this.a.copy(triangle.a);
- this.b.copy(triangle.b);
- this.c.copy(triangle.c);
- return this;
- }
- getArea() {
- _v0$2.subVectors(this.c, this.b);
- _v1$3.subVectors(this.a, this.b);
- return _v0$2.cross(_v1$3).length() * 0.5;
- }
- getMidpoint(target) {
- return target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
- }
- getNormal(target) {
- return Triangle.getNormal(this.a, this.b, this.c, target);
- }
- getPlane(target) {
- return target.setFromCoplanarPoints(this.a, this.b, this.c);
- }
- getBarycoord(point, target) {
- return Triangle.getBarycoord(point, this.a, this.b, this.c, target);
- }
- getInterpolation(point, v1, v2, v3, target) {
- return Triangle.getInterpolation(point, this.a, this.b, this.c, v1, v2, v3, target);
- }
- containsPoint(point) {
- return Triangle.containsPoint(point, this.a, this.b, this.c);
- }
- isFrontFacing(direction) {
- return Triangle.isFrontFacing(this.a, this.b, this.c, direction);
- }
- intersectsBox(box) {
- return box.intersectsTriangle(this);
- }
- closestPointToPoint(p, target) {
- const a = this.a, b = this.b, c = this.c;
- let v, w;
- _vab.subVectors(b, a);
- _vac.subVectors(c, a);
- _vap.subVectors(p, a);
- const d1 = _vab.dot(_vap);
- const d2 = _vac.dot(_vap);
- if (d1 <= 0 && d2 <= 0) {
- return target.copy(a);
- }
- _vbp.subVectors(p, b);
- const d3 = _vab.dot(_vbp);
- const d4 = _vac.dot(_vbp);
- if (d3 >= 0 && d4 <= d3) {
- return target.copy(b);
- }
- const vc = d1 * d4 - d3 * d2;
- if (vc <= 0 && d1 >= 0 && d3 <= 0) {
- v = d1 / (d1 - d3);
- return target.copy(a).addScaledVector(_vab, v);
- }
- _vcp.subVectors(p, c);
- const d5 = _vab.dot(_vcp);
- const d6 = _vac.dot(_vcp);
- if (d6 >= 0 && d5 <= d6) {
- return target.copy(c);
- }
- const vb = d5 * d2 - d1 * d6;
- if (vb <= 0 && d2 >= 0 && d6 <= 0) {
- w = d2 / (d2 - d6);
- return target.copy(a).addScaledVector(_vac, w);
- }
- const va = d3 * d6 - d5 * d4;
- if (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {
- _vbc.subVectors(c, b);
- w = (d4 - d3) / (d4 - d3 + (d5 - d6));
- return target.copy(b).addScaledVector(_vbc, w);
- }
- const denom = 1 / (va + vb + vc);
- v = vb * denom;
- w = vc * denom;
- return target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);
- }
- equals(triangle) {
- return triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);
- }
-}
-const _colorKeywords = {
- "aliceblue": 15792383,
- "antiquewhite": 16444375,
- "aqua": 65535,
- "aquamarine": 8388564,
- "azure": 15794175,
- "beige": 16119260,
- "bisque": 16770244,
- "black": 0,
- "blanchedalmond": 16772045,
- "blue": 255,
- "blueviolet": 9055202,
- "brown": 10824234,
- "burlywood": 14596231,
- "cadetblue": 6266528,
- "chartreuse": 8388352,
- "chocolate": 13789470,
- "coral": 16744272,
- "cornflowerblue": 6591981,
- "cornsilk": 16775388,
- "crimson": 14423100,
- "cyan": 65535,
- "darkblue": 139,
- "darkcyan": 35723,
- "darkgoldenrod": 12092939,
- "darkgray": 11119017,
- "darkgreen": 25600,
- "darkgrey": 11119017,
- "darkkhaki": 12433259,
- "darkmagenta": 9109643,
- "darkolivegreen": 5597999,
- "darkorange": 16747520,
- "darkorchid": 10040012,
- "darkred": 9109504,
- "darksalmon": 15308410,
- "darkseagreen": 9419919,
- "darkslateblue": 4734347,
- "darkslategray": 3100495,
- "darkslategrey": 3100495,
- "darkturquoise": 52945,
- "darkviolet": 9699539,
- "deeppink": 16716947,
- "deepskyblue": 49151,
- "dimgray": 6908265,
- "dimgrey": 6908265,
- "dodgerblue": 2003199,
- "firebrick": 11674146,
- "floralwhite": 16775920,
- "forestgreen": 2263842,
- "fuchsia": 16711935,
- "gainsboro": 14474460,
- "ghostwhite": 16316671,
- "gold": 16766720,
- "goldenrod": 14329120,
- "gray": 8421504,
- "green": 32768,
- "greenyellow": 11403055,
- "grey": 8421504,
- "honeydew": 15794160,
- "hotpink": 16738740,
- "indianred": 13458524,
- "indigo": 4915330,
- "ivory": 16777200,
- "khaki": 15787660,
- "lavender": 15132410,
- "lavenderblush": 16773365,
- "lawngreen": 8190976,
- "lemonchiffon": 16775885,
- "lightblue": 11393254,
- "lightcoral": 15761536,
- "lightcyan": 14745599,
- "lightgoldenrodyellow": 16448210,
- "lightgray": 13882323,
- "lightgreen": 9498256,
- "lightgrey": 13882323,
- "lightpink": 16758465,
- "lightsalmon": 16752762,
- "lightseagreen": 2142890,
- "lightskyblue": 8900346,
- "lightslategray": 7833753,
- "lightslategrey": 7833753,
- "lightsteelblue": 11584734,
- "lightyellow": 16777184,
- "lime": 65280,
- "limegreen": 3329330,
- "linen": 16445670,
- "magenta": 16711935,
- "maroon": 8388608,
- "mediumaquamarine": 6737322,
- "mediumblue": 205,
- "mediumorchid": 12211667,
- "mediumpurple": 9662683,
- "mediumseagreen": 3978097,
- "mediumslateblue": 8087790,
- "mediumspringgreen": 64154,
- "mediumturquoise": 4772300,
- "mediumvioletred": 13047173,
- "midnightblue": 1644912,
- "mintcream": 16121850,
- "mistyrose": 16770273,
- "moccasin": 16770229,
- "navajowhite": 16768685,
- "navy": 128,
- "oldlace": 16643558,
- "olive": 8421376,
- "olivedrab": 7048739,
- "orange": 16753920,
- "orangered": 16729344,
- "orchid": 14315734,
- "palegoldenrod": 15657130,
- "palegreen": 10025880,
- "paleturquoise": 11529966,
- "palevioletred": 14381203,
- "papayawhip": 16773077,
- "peachpuff": 16767673,
- "peru": 13468991,
- "pink": 16761035,
- "plum": 14524637,
- "powderblue": 11591910,
- "purple": 8388736,
- "rebeccapurple": 6697881,
- "red": 16711680,
- "rosybrown": 12357519,
- "royalblue": 4286945,
- "saddlebrown": 9127187,
- "salmon": 16416882,
- "sandybrown": 16032864,
- "seagreen": 3050327,
- "seashell": 16774638,
- "sienna": 10506797,
- "silver": 12632256,
- "skyblue": 8900331,
- "slateblue": 6970061,
- "slategray": 7372944,
- "slategrey": 7372944,
- "snow": 16775930,
- "springgreen": 65407,
- "steelblue": 4620980,
- "tan": 13808780,
- "teal": 32896,
- "thistle": 14204888,
- "tomato": 16737095,
- "turquoise": 4251856,
- "violet": 15631086,
- "wheat": 16113331,
- "white": 16777215,
- "whitesmoke": 16119285,
- "yellow": 16776960,
- "yellowgreen": 10145074
-};
-const _hslA = { h: 0, s: 0, l: 0 };
-const _hslB = { h: 0, s: 0, l: 0 };
-function hue2rgb(p, q, t2) {
- if (t2 < 0) t2 += 1;
- if (t2 > 1) t2 -= 1;
- if (t2 < 1 / 6) return p + (q - p) * 6 * t2;
- if (t2 < 1 / 2) return q;
- if (t2 < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t2);
- return p;
-}
-__name(hue2rgb, "hue2rgb");
-class Color {
- static {
- __name(this, "Color");
- }
- constructor(r, g, b) {
- this.isColor = true;
- this.r = 1;
- this.g = 1;
- this.b = 1;
- return this.set(r, g, b);
- }
- set(r, g, b) {
- if (g === void 0 && b === void 0) {
- const value = r;
- if (value && value.isColor) {
- this.copy(value);
- } else if (typeof value === "number") {
- this.setHex(value);
- } else if (typeof value === "string") {
- this.setStyle(value);
- }
- } else {
- this.setRGB(r, g, b);
- }
- return this;
- }
- setScalar(scalar) {
- this.r = scalar;
- this.g = scalar;
- this.b = scalar;
- return this;
- }
- setHex(hex, colorSpace = SRGBColorSpace) {
- hex = Math.floor(hex);
- this.r = (hex >> 16 & 255) / 255;
- this.g = (hex >> 8 & 255) / 255;
- this.b = (hex & 255) / 255;
- ColorManagement.toWorkingColorSpace(this, colorSpace);
- return this;
- }
- setRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {
- this.r = r;
- this.g = g;
- this.b = b;
- ColorManagement.toWorkingColorSpace(this, colorSpace);
- return this;
- }
- setHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {
- h = euclideanModulo(h, 1);
- s = clamp(s, 0, 1);
- l = clamp(l, 0, 1);
- if (s === 0) {
- this.r = this.g = this.b = l;
- } else {
- const p = l <= 0.5 ? l * (1 + s) : l + s - l * s;
- const q = 2 * l - p;
- this.r = hue2rgb(q, p, h + 1 / 3);
- this.g = hue2rgb(q, p, h);
- this.b = hue2rgb(q, p, h - 1 / 3);
- }
- ColorManagement.toWorkingColorSpace(this, colorSpace);
- return this;
- }
- setStyle(style, colorSpace = SRGBColorSpace) {
- function handleAlpha(string) {
- if (string === void 0) return;
- if (parseFloat(string) < 1) {
- console.warn("THREE.Color: Alpha component of " + style + " will be ignored.");
- }
- }
- __name(handleAlpha, "handleAlpha");
- let m;
- if (m = /^(\w+)\(([^\)]*)\)/.exec(style)) {
- let color;
- const name = m[1];
- const components = m[2];
- switch (name) {
- case "rgb":
- case "rgba":
- if (color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
- handleAlpha(color[4]);
- return this.setRGB(
- Math.min(255, parseInt(color[1], 10)) / 255,
- Math.min(255, parseInt(color[2], 10)) / 255,
- Math.min(255, parseInt(color[3], 10)) / 255,
- colorSpace
- );
- }
- if (color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
- handleAlpha(color[4]);
- return this.setRGB(
- Math.min(100, parseInt(color[1], 10)) / 100,
- Math.min(100, parseInt(color[2], 10)) / 100,
- Math.min(100, parseInt(color[3], 10)) / 100,
- colorSpace
- );
- }
- break;
- case "hsl":
- case "hsla":
- if (color = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
- handleAlpha(color[4]);
- return this.setHSL(
- parseFloat(color[1]) / 360,
- parseFloat(color[2]) / 100,
- parseFloat(color[3]) / 100,
- colorSpace
- );
- }
- break;
- default:
- console.warn("THREE.Color: Unknown color model " + style);
- }
- } else if (m = /^\#([A-Fa-f\d]+)$/.exec(style)) {
- const hex = m[1];
- const size = hex.length;
- if (size === 3) {
- return this.setRGB(
- parseInt(hex.charAt(0), 16) / 15,
- parseInt(hex.charAt(1), 16) / 15,
- parseInt(hex.charAt(2), 16) / 15,
- colorSpace
- );
- } else if (size === 6) {
- return this.setHex(parseInt(hex, 16), colorSpace);
- } else {
- console.warn("THREE.Color: Invalid hex color " + style);
- }
- } else if (style && style.length > 0) {
- return this.setColorName(style, colorSpace);
- }
- return this;
- }
- setColorName(style, colorSpace = SRGBColorSpace) {
- const hex = _colorKeywords[style.toLowerCase()];
- if (hex !== void 0) {
- this.setHex(hex, colorSpace);
- } else {
- console.warn("THREE.Color: Unknown color " + style);
- }
- return this;
- }
- clone() {
- return new this.constructor(this.r, this.g, this.b);
- }
- copy(color) {
- this.r = color.r;
- this.g = color.g;
- this.b = color.b;
- return this;
- }
- copySRGBToLinear(color) {
- this.r = SRGBToLinear(color.r);
- this.g = SRGBToLinear(color.g);
- this.b = SRGBToLinear(color.b);
- return this;
- }
- copyLinearToSRGB(color) {
- this.r = LinearToSRGB(color.r);
- this.g = LinearToSRGB(color.g);
- this.b = LinearToSRGB(color.b);
- return this;
- }
- convertSRGBToLinear() {
- this.copySRGBToLinear(this);
- return this;
- }
- convertLinearToSRGB() {
- this.copyLinearToSRGB(this);
- return this;
- }
- getHex(colorSpace = SRGBColorSpace) {
- ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace);
- return Math.round(clamp(_color$1.r * 255, 0, 255)) * 65536 + Math.round(clamp(_color$1.g * 255, 0, 255)) * 256 + Math.round(clamp(_color$1.b * 255, 0, 255));
- }
- getHexString(colorSpace = SRGBColorSpace) {
- return ("000000" + this.getHex(colorSpace).toString(16)).slice(-6);
- }
- getHSL(target, colorSpace = ColorManagement.workingColorSpace) {
- ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace);
- const r = _color$1.r, g = _color$1.g, b = _color$1.b;
- const max2 = Math.max(r, g, b);
- const min = Math.min(r, g, b);
- let hue, saturation;
- const lightness = (min + max2) / 2;
- if (min === max2) {
- hue = 0;
- saturation = 0;
- } else {
- const delta = max2 - min;
- saturation = lightness <= 0.5 ? delta / (max2 + min) : delta / (2 - max2 - min);
- switch (max2) {
- case r:
- hue = (g - b) / delta + (g < b ? 6 : 0);
- break;
- case g:
- hue = (b - r) / delta + 2;
- break;
- case b:
- hue = (r - g) / delta + 4;
- break;
- }
- hue /= 6;
- }
- target.h = hue;
- target.s = saturation;
- target.l = lightness;
- return target;
- }
- getRGB(target, colorSpace = ColorManagement.workingColorSpace) {
- ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace);
- target.r = _color$1.r;
- target.g = _color$1.g;
- target.b = _color$1.b;
- return target;
- }
- getStyle(colorSpace = SRGBColorSpace) {
- ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace);
- const r = _color$1.r, g = _color$1.g, b = _color$1.b;
- if (colorSpace !== SRGBColorSpace) {
- return `color(${colorSpace} ${r.toFixed(3)} ${g.toFixed(3)} ${b.toFixed(3)})`;
- }
- return `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`;
- }
- offsetHSL(h, s, l) {
- this.getHSL(_hslA);
- return this.setHSL(_hslA.h + h, _hslA.s + s, _hslA.l + l);
- }
- add(color) {
- this.r += color.r;
- this.g += color.g;
- this.b += color.b;
- return this;
- }
- addColors(color1, color2) {
- this.r = color1.r + color2.r;
- this.g = color1.g + color2.g;
- this.b = color1.b + color2.b;
- return this;
- }
- addScalar(s) {
- this.r += s;
- this.g += s;
- this.b += s;
- return this;
- }
- sub(color) {
- this.r = Math.max(0, this.r - color.r);
- this.g = Math.max(0, this.g - color.g);
- this.b = Math.max(0, this.b - color.b);
- return this;
- }
- multiply(color) {
- this.r *= color.r;
- this.g *= color.g;
- this.b *= color.b;
- return this;
- }
- multiplyScalar(s) {
- this.r *= s;
- this.g *= s;
- this.b *= s;
- return this;
- }
- lerp(color, alpha) {
- this.r += (color.r - this.r) * alpha;
- this.g += (color.g - this.g) * alpha;
- this.b += (color.b - this.b) * alpha;
- return this;
- }
- lerpColors(color1, color2, alpha) {
- this.r = color1.r + (color2.r - color1.r) * alpha;
- this.g = color1.g + (color2.g - color1.g) * alpha;
- this.b = color1.b + (color2.b - color1.b) * alpha;
- return this;
- }
- lerpHSL(color, alpha) {
- this.getHSL(_hslA);
- color.getHSL(_hslB);
- const h = lerp(_hslA.h, _hslB.h, alpha);
- const s = lerp(_hslA.s, _hslB.s, alpha);
- const l = lerp(_hslA.l, _hslB.l, alpha);
- this.setHSL(h, s, l);
- return this;
- }
- setFromVector3(v) {
- this.r = v.x;
- this.g = v.y;
- this.b = v.z;
- return this;
- }
- applyMatrix3(m) {
- const r = this.r, g = this.g, b = this.b;
- const e = m.elements;
- this.r = e[0] * r + e[3] * g + e[6] * b;
- this.g = e[1] * r + e[4] * g + e[7] * b;
- this.b = e[2] * r + e[5] * g + e[8] * b;
- return this;
- }
- equals(c) {
- return c.r === this.r && c.g === this.g && c.b === this.b;
- }
- fromArray(array, offset = 0) {
- this.r = array[offset];
- this.g = array[offset + 1];
- this.b = array[offset + 2];
- return this;
- }
- toArray(array = [], offset = 0) {
- array[offset] = this.r;
- array[offset + 1] = this.g;
- array[offset + 2] = this.b;
- return array;
- }
- fromBufferAttribute(attribute, index) {
- this.r = attribute.getX(index);
- this.g = attribute.getY(index);
- this.b = attribute.getZ(index);
- return this;
- }
- toJSON() {
- return this.getHex();
- }
- *[Symbol.iterator]() {
- yield this.r;
- yield this.g;
- yield this.b;
- }
-}
-const _color$1 = /* @__PURE__ */ new Color();
-Color.NAMES = _colorKeywords;
-let _materialId = 0;
-class Material extends EventDispatcher {
- static {
- __name(this, "Material");
- }
- static get type() {
- return "Material";
- }
- get type() {
- return this.constructor.type;
- }
- set type(_value) {
- }
- constructor() {
- super();
- this.isMaterial = true;
- Object.defineProperty(this, "id", { value: _materialId++ });
- this.uuid = generateUUID();
- this.name = "";
- this.blending = NormalBlending;
- this.side = FrontSide;
- this.vertexColors = false;
- this.opacity = 1;
- this.transparent = false;
- this.alphaHash = false;
- this.blendSrc = SrcAlphaFactor;
- this.blendDst = OneMinusSrcAlphaFactor;
- this.blendEquation = AddEquation;
- this.blendSrcAlpha = null;
- this.blendDstAlpha = null;
- this.blendEquationAlpha = null;
- this.blendColor = new Color(0, 0, 0);
- this.blendAlpha = 0;
- this.depthFunc = LessEqualDepth;
- this.depthTest = true;
- this.depthWrite = true;
- this.stencilWriteMask = 255;
- this.stencilFunc = AlwaysStencilFunc;
- this.stencilRef = 0;
- this.stencilFuncMask = 255;
- this.stencilFail = KeepStencilOp;
- this.stencilZFail = KeepStencilOp;
- this.stencilZPass = KeepStencilOp;
- this.stencilWrite = false;
- this.clippingPlanes = null;
- this.clipIntersection = false;
- this.clipShadows = false;
- this.shadowSide = null;
- this.colorWrite = true;
- this.precision = null;
- this.polygonOffset = false;
- this.polygonOffsetFactor = 0;
- this.polygonOffsetUnits = 0;
- this.dithering = false;
- this.alphaToCoverage = false;
- this.premultipliedAlpha = false;
- this.forceSinglePass = false;
- this.visible = true;
- this.toneMapped = true;
- this.userData = {};
- this.version = 0;
- this._alphaTest = 0;
- }
- get alphaTest() {
- return this._alphaTest;
- }
- set alphaTest(value) {
- if (this._alphaTest > 0 !== value > 0) {
- this.version++;
- }
- this._alphaTest = value;
- }
- // onBeforeRender and onBeforeCompile only supported in WebGLRenderer
- onBeforeRender() {
- }
- onBeforeCompile() {
- }
- customProgramCacheKey() {
- return this.onBeforeCompile.toString();
- }
- setValues(values) {
- if (values === void 0) return;
- for (const key in values) {
- const newValue = values[key];
- if (newValue === void 0) {
- console.warn(`THREE.Material: parameter '${key}' has value of undefined.`);
- continue;
- }
- const currentValue = this[key];
- if (currentValue === void 0) {
- console.warn(`THREE.Material: '${key}' is not a property of THREE.${this.type}.`);
- continue;
- }
- if (currentValue && currentValue.isColor) {
- currentValue.set(newValue);
- } else if (currentValue && currentValue.isVector3 && (newValue && newValue.isVector3)) {
- currentValue.copy(newValue);
- } else {
- this[key] = newValue;
- }
- }
- }
- toJSON(meta) {
- const isRootObject = meta === void 0 || typeof meta === "string";
- if (isRootObject) {
- meta = {
- textures: {},
- images: {}
- };
- }
- const data = {
- metadata: {
- version: 4.6,
- type: "Material",
- generator: "Material.toJSON"
- }
- };
- data.uuid = this.uuid;
- data.type = this.type;
- if (this.name !== "") data.name = this.name;
- if (this.color && this.color.isColor) data.color = this.color.getHex();
- if (this.roughness !== void 0) data.roughness = this.roughness;
- if (this.metalness !== void 0) data.metalness = this.metalness;
- if (this.sheen !== void 0) data.sheen = this.sheen;
- if (this.sheenColor && this.sheenColor.isColor) data.sheenColor = this.sheenColor.getHex();
- if (this.sheenRoughness !== void 0) data.sheenRoughness = this.sheenRoughness;
- if (this.emissive && this.emissive.isColor) data.emissive = this.emissive.getHex();
- if (this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1) data.emissiveIntensity = this.emissiveIntensity;
- if (this.specular && this.specular.isColor) data.specular = this.specular.getHex();
- if (this.specularIntensity !== void 0) data.specularIntensity = this.specularIntensity;
- if (this.specularColor && this.specularColor.isColor) data.specularColor = this.specularColor.getHex();
- if (this.shininess !== void 0) data.shininess = this.shininess;
- if (this.clearcoat !== void 0) data.clearcoat = this.clearcoat;
- if (this.clearcoatRoughness !== void 0) data.clearcoatRoughness = this.clearcoatRoughness;
- if (this.clearcoatMap && this.clearcoatMap.isTexture) {
- data.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid;
- }
- if (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) {
- data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid;
- }
- if (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) {
- data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid;
- data.clearcoatNormalScale = this.clearcoatNormalScale.toArray();
- }
- if (this.dispersion !== void 0) data.dispersion = this.dispersion;
- if (this.iridescence !== void 0) data.iridescence = this.iridescence;
- if (this.iridescenceIOR !== void 0) data.iridescenceIOR = this.iridescenceIOR;
- if (this.iridescenceThicknessRange !== void 0) data.iridescenceThicknessRange = this.iridescenceThicknessRange;
- if (this.iridescenceMap && this.iridescenceMap.isTexture) {
- data.iridescenceMap = this.iridescenceMap.toJSON(meta).uuid;
- }
- if (this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture) {
- data.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(meta).uuid;
- }
- if (this.anisotropy !== void 0) data.anisotropy = this.anisotropy;
- if (this.anisotropyRotation !== void 0) data.anisotropyRotation = this.anisotropyRotation;
- if (this.anisotropyMap && this.anisotropyMap.isTexture) {
- data.anisotropyMap = this.anisotropyMap.toJSON(meta).uuid;
- }
- if (this.map && this.map.isTexture) data.map = this.map.toJSON(meta).uuid;
- if (this.matcap && this.matcap.isTexture) data.matcap = this.matcap.toJSON(meta).uuid;
- if (this.alphaMap && this.alphaMap.isTexture) data.alphaMap = this.alphaMap.toJSON(meta).uuid;
- if (this.lightMap && this.lightMap.isTexture) {
- data.lightMap = this.lightMap.toJSON(meta).uuid;
- data.lightMapIntensity = this.lightMapIntensity;
- }
- if (this.aoMap && this.aoMap.isTexture) {
- data.aoMap = this.aoMap.toJSON(meta).uuid;
- data.aoMapIntensity = this.aoMapIntensity;
- }
- if (this.bumpMap && this.bumpMap.isTexture) {
- data.bumpMap = this.bumpMap.toJSON(meta).uuid;
- data.bumpScale = this.bumpScale;
- }
- if (this.normalMap && this.normalMap.isTexture) {
- data.normalMap = this.normalMap.toJSON(meta).uuid;
- data.normalMapType = this.normalMapType;
- data.normalScale = this.normalScale.toArray();
- }
- if (this.displacementMap && this.displacementMap.isTexture) {
- data.displacementMap = this.displacementMap.toJSON(meta).uuid;
- data.displacementScale = this.displacementScale;
- data.displacementBias = this.displacementBias;
- }
- if (this.roughnessMap && this.roughnessMap.isTexture) data.roughnessMap = this.roughnessMap.toJSON(meta).uuid;
- if (this.metalnessMap && this.metalnessMap.isTexture) data.metalnessMap = this.metalnessMap.toJSON(meta).uuid;
- if (this.emissiveMap && this.emissiveMap.isTexture) data.emissiveMap = this.emissiveMap.toJSON(meta).uuid;
- if (this.specularMap && this.specularMap.isTexture) data.specularMap = this.specularMap.toJSON(meta).uuid;
- if (this.specularIntensityMap && this.specularIntensityMap.isTexture) data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid;
- if (this.specularColorMap && this.specularColorMap.isTexture) data.specularColorMap = this.specularColorMap.toJSON(meta).uuid;
- if (this.envMap && this.envMap.isTexture) {
- data.envMap = this.envMap.toJSON(meta).uuid;
- if (this.combine !== void 0) data.combine = this.combine;
- }
- if (this.envMapRotation !== void 0) data.envMapRotation = this.envMapRotation.toArray();
- if (this.envMapIntensity !== void 0) data.envMapIntensity = this.envMapIntensity;
- if (this.reflectivity !== void 0) data.reflectivity = this.reflectivity;
- if (this.refractionRatio !== void 0) data.refractionRatio = this.refractionRatio;
- if (this.gradientMap && this.gradientMap.isTexture) {
- data.gradientMap = this.gradientMap.toJSON(meta).uuid;
- }
- if (this.transmission !== void 0) data.transmission = this.transmission;
- if (this.transmissionMap && this.transmissionMap.isTexture) data.transmissionMap = this.transmissionMap.toJSON(meta).uuid;
- if (this.thickness !== void 0) data.thickness = this.thickness;
- if (this.thicknessMap && this.thicknessMap.isTexture) data.thicknessMap = this.thicknessMap.toJSON(meta).uuid;
- if (this.attenuationDistance !== void 0 && this.attenuationDistance !== Infinity) data.attenuationDistance = this.attenuationDistance;
- if (this.attenuationColor !== void 0) data.attenuationColor = this.attenuationColor.getHex();
- if (this.size !== void 0) data.size = this.size;
- if (this.shadowSide !== null) data.shadowSide = this.shadowSide;
- if (this.sizeAttenuation !== void 0) data.sizeAttenuation = this.sizeAttenuation;
- if (this.blending !== NormalBlending) data.blending = this.blending;
- if (this.side !== FrontSide) data.side = this.side;
- if (this.vertexColors === true) data.vertexColors = true;
- if (this.opacity < 1) data.opacity = this.opacity;
- if (this.transparent === true) data.transparent = true;
- if (this.blendSrc !== SrcAlphaFactor) data.blendSrc = this.blendSrc;
- if (this.blendDst !== OneMinusSrcAlphaFactor) data.blendDst = this.blendDst;
- if (this.blendEquation !== AddEquation) data.blendEquation = this.blendEquation;
- if (this.blendSrcAlpha !== null) data.blendSrcAlpha = this.blendSrcAlpha;
- if (this.blendDstAlpha !== null) data.blendDstAlpha = this.blendDstAlpha;
- if (this.blendEquationAlpha !== null) data.blendEquationAlpha = this.blendEquationAlpha;
- if (this.blendColor && this.blendColor.isColor) data.blendColor = this.blendColor.getHex();
- if (this.blendAlpha !== 0) data.blendAlpha = this.blendAlpha;
- if (this.depthFunc !== LessEqualDepth) data.depthFunc = this.depthFunc;
- if (this.depthTest === false) data.depthTest = this.depthTest;
- if (this.depthWrite === false) data.depthWrite = this.depthWrite;
- if (this.colorWrite === false) data.colorWrite = this.colorWrite;
- if (this.stencilWriteMask !== 255) data.stencilWriteMask = this.stencilWriteMask;
- if (this.stencilFunc !== AlwaysStencilFunc) data.stencilFunc = this.stencilFunc;
- if (this.stencilRef !== 0) data.stencilRef = this.stencilRef;
- if (this.stencilFuncMask !== 255) data.stencilFuncMask = this.stencilFuncMask;
- if (this.stencilFail !== KeepStencilOp) data.stencilFail = this.stencilFail;
- if (this.stencilZFail !== KeepStencilOp) data.stencilZFail = this.stencilZFail;
- if (this.stencilZPass !== KeepStencilOp) data.stencilZPass = this.stencilZPass;
- if (this.stencilWrite === true) data.stencilWrite = this.stencilWrite;
- if (this.rotation !== void 0 && this.rotation !== 0) data.rotation = this.rotation;
- if (this.polygonOffset === true) data.polygonOffset = true;
- if (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor;
- if (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits;
- if (this.linewidth !== void 0 && this.linewidth !== 1) data.linewidth = this.linewidth;
- if (this.dashSize !== void 0) data.dashSize = this.dashSize;
- if (this.gapSize !== void 0) data.gapSize = this.gapSize;
- if (this.scale !== void 0) data.scale = this.scale;
- if (this.dithering === true) data.dithering = true;
- if (this.alphaTest > 0) data.alphaTest = this.alphaTest;
- if (this.alphaHash === true) data.alphaHash = true;
- if (this.alphaToCoverage === true) data.alphaToCoverage = true;
- if (this.premultipliedAlpha === true) data.premultipliedAlpha = true;
- if (this.forceSinglePass === true) data.forceSinglePass = true;
- if (this.wireframe === true) data.wireframe = true;
- if (this.wireframeLinewidth > 1) data.wireframeLinewidth = this.wireframeLinewidth;
- if (this.wireframeLinecap !== "round") data.wireframeLinecap = this.wireframeLinecap;
- if (this.wireframeLinejoin !== "round") data.wireframeLinejoin = this.wireframeLinejoin;
- if (this.flatShading === true) data.flatShading = true;
- if (this.visible === false) data.visible = false;
- if (this.toneMapped === false) data.toneMapped = false;
- if (this.fog === false) data.fog = false;
- if (Object.keys(this.userData).length > 0) data.userData = this.userData;
- function extractFromCache(cache) {
- const values = [];
- for (const key in cache) {
- const data2 = cache[key];
- delete data2.metadata;
- values.push(data2);
- }
- return values;
- }
- __name(extractFromCache, "extractFromCache");
- if (isRootObject) {
- const textures = extractFromCache(meta.textures);
- const images = extractFromCache(meta.images);
- if (textures.length > 0) data.textures = textures;
- if (images.length > 0) data.images = images;
- }
- return data;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(source) {
- this.name = source.name;
- this.blending = source.blending;
- this.side = source.side;
- this.vertexColors = source.vertexColors;
- this.opacity = source.opacity;
- this.transparent = source.transparent;
- this.blendSrc = source.blendSrc;
- this.blendDst = source.blendDst;
- this.blendEquation = source.blendEquation;
- this.blendSrcAlpha = source.blendSrcAlpha;
- this.blendDstAlpha = source.blendDstAlpha;
- this.blendEquationAlpha = source.blendEquationAlpha;
- this.blendColor.copy(source.blendColor);
- this.blendAlpha = source.blendAlpha;
- this.depthFunc = source.depthFunc;
- this.depthTest = source.depthTest;
- this.depthWrite = source.depthWrite;
- this.stencilWriteMask = source.stencilWriteMask;
- this.stencilFunc = source.stencilFunc;
- this.stencilRef = source.stencilRef;
- this.stencilFuncMask = source.stencilFuncMask;
- this.stencilFail = source.stencilFail;
- this.stencilZFail = source.stencilZFail;
- this.stencilZPass = source.stencilZPass;
- this.stencilWrite = source.stencilWrite;
- const srcPlanes = source.clippingPlanes;
- let dstPlanes = null;
- if (srcPlanes !== null) {
- const n = srcPlanes.length;
- dstPlanes = new Array(n);
- for (let i = 0; i !== n; ++i) {
- dstPlanes[i] = srcPlanes[i].clone();
- }
- }
- this.clippingPlanes = dstPlanes;
- this.clipIntersection = source.clipIntersection;
- this.clipShadows = source.clipShadows;
- this.shadowSide = source.shadowSide;
- this.colorWrite = source.colorWrite;
- this.precision = source.precision;
- this.polygonOffset = source.polygonOffset;
- this.polygonOffsetFactor = source.polygonOffsetFactor;
- this.polygonOffsetUnits = source.polygonOffsetUnits;
- this.dithering = source.dithering;
- this.alphaTest = source.alphaTest;
- this.alphaHash = source.alphaHash;
- this.alphaToCoverage = source.alphaToCoverage;
- this.premultipliedAlpha = source.premultipliedAlpha;
- this.forceSinglePass = source.forceSinglePass;
- this.visible = source.visible;
- this.toneMapped = source.toneMapped;
- this.userData = JSON.parse(JSON.stringify(source.userData));
- return this;
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
- set needsUpdate(value) {
- if (value === true) this.version++;
- }
- onBuild() {
- console.warn("Material: onBuild() has been removed.");
- }
-}
-class MeshBasicMaterial extends Material {
- static {
- __name(this, "MeshBasicMaterial");
- }
- static get type() {
- return "MeshBasicMaterial";
- }
- constructor(parameters) {
- super();
- this.isMeshBasicMaterial = true;
- this.color = new Color(16777215);
- this.map = null;
- this.lightMap = null;
- this.lightMapIntensity = 1;
- this.aoMap = null;
- this.aoMapIntensity = 1;
- this.specularMap = null;
- this.alphaMap = null;
- this.envMap = null;
- this.envMapRotation = new Euler();
- this.combine = MultiplyOperation;
- this.reflectivity = 1;
- this.refractionRatio = 0.98;
- this.wireframe = false;
- this.wireframeLinewidth = 1;
- this.wireframeLinecap = "round";
- this.wireframeLinejoin = "round";
- this.fog = true;
- this.setValues(parameters);
- }
- copy(source) {
- super.copy(source);
- this.color.copy(source.color);
- this.map = source.map;
- this.lightMap = source.lightMap;
- this.lightMapIntensity = source.lightMapIntensity;
- this.aoMap = source.aoMap;
- this.aoMapIntensity = source.aoMapIntensity;
- this.specularMap = source.specularMap;
- this.alphaMap = source.alphaMap;
- this.envMap = source.envMap;
- this.envMapRotation.copy(source.envMapRotation);
- this.combine = source.combine;
- this.reflectivity = source.reflectivity;
- this.refractionRatio = source.refractionRatio;
- this.wireframe = source.wireframe;
- this.wireframeLinewidth = source.wireframeLinewidth;
- this.wireframeLinecap = source.wireframeLinecap;
- this.wireframeLinejoin = source.wireframeLinejoin;
- this.fog = source.fog;
- return this;
- }
-}
-const _tables = /* @__PURE__ */ _generateTables();
-function _generateTables() {
- const buffer = new ArrayBuffer(4);
- const floatView = new Float32Array(buffer);
- const uint32View = new Uint32Array(buffer);
- const baseTable = new Uint32Array(512);
- const shiftTable = new Uint32Array(512);
- for (let i = 0; i < 256; ++i) {
- const e = i - 127;
- if (e < -27) {
- baseTable[i] = 0;
- baseTable[i | 256] = 32768;
- shiftTable[i] = 24;
- shiftTable[i | 256] = 24;
- } else if (e < -14) {
- baseTable[i] = 1024 >> -e - 14;
- baseTable[i | 256] = 1024 >> -e - 14 | 32768;
- shiftTable[i] = -e - 1;
- shiftTable[i | 256] = -e - 1;
- } else if (e <= 15) {
- baseTable[i] = e + 15 << 10;
- baseTable[i | 256] = e + 15 << 10 | 32768;
- shiftTable[i] = 13;
- shiftTable[i | 256] = 13;
- } else if (e < 128) {
- baseTable[i] = 31744;
- baseTable[i | 256] = 64512;
- shiftTable[i] = 24;
- shiftTable[i | 256] = 24;
- } else {
- baseTable[i] = 31744;
- baseTable[i | 256] = 64512;
- shiftTable[i] = 13;
- shiftTable[i | 256] = 13;
- }
- }
- const mantissaTable = new Uint32Array(2048);
- const exponentTable = new Uint32Array(64);
- const offsetTable = new Uint32Array(64);
- for (let i = 1; i < 1024; ++i) {
- let m = i << 13;
- let e = 0;
- while ((m & 8388608) === 0) {
- m <<= 1;
- e -= 8388608;
- }
- m &= ~8388608;
- e += 947912704;
- mantissaTable[i] = m | e;
- }
- for (let i = 1024; i < 2048; ++i) {
- mantissaTable[i] = 939524096 + (i - 1024 << 13);
- }
- for (let i = 1; i < 31; ++i) {
- exponentTable[i] = i << 23;
- }
- exponentTable[31] = 1199570944;
- exponentTable[32] = 2147483648;
- for (let i = 33; i < 63; ++i) {
- exponentTable[i] = 2147483648 + (i - 32 << 23);
- }
- exponentTable[63] = 3347054592;
- for (let i = 1; i < 64; ++i) {
- if (i !== 32) {
- offsetTable[i] = 1024;
- }
- }
- return {
- floatView,
- uint32View,
- baseTable,
- shiftTable,
- mantissaTable,
- exponentTable,
- offsetTable
- };
-}
-__name(_generateTables, "_generateTables");
-function toHalfFloat(val) {
- if (Math.abs(val) > 65504) console.warn("THREE.DataUtils.toHalfFloat(): Value out of range.");
- val = clamp(val, -65504, 65504);
- _tables.floatView[0] = val;
- const f = _tables.uint32View[0];
- const e = f >> 23 & 511;
- return _tables.baseTable[e] + ((f & 8388607) >> _tables.shiftTable[e]);
-}
-__name(toHalfFloat, "toHalfFloat");
-function fromHalfFloat(val) {
- const m = val >> 10;
- _tables.uint32View[0] = _tables.mantissaTable[_tables.offsetTable[m] + (val & 1023)] + _tables.exponentTable[m];
- return _tables.floatView[0];
-}
-__name(fromHalfFloat, "fromHalfFloat");
-const DataUtils = {
- toHalfFloat,
- fromHalfFloat
-};
-const _vector$9 = /* @__PURE__ */ new Vector3();
-const _vector2$1 = /* @__PURE__ */ new Vector2();
-class BufferAttribute {
- static {
- __name(this, "BufferAttribute");
- }
- constructor(array, itemSize, normalized = false) {
- if (Array.isArray(array)) {
- throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
- }
- this.isBufferAttribute = true;
- this.name = "";
- this.array = array;
- this.itemSize = itemSize;
- this.count = array !== void 0 ? array.length / itemSize : 0;
- this.normalized = normalized;
- this.usage = StaticDrawUsage;
- this.updateRanges = [];
- this.gpuType = FloatType;
- this.version = 0;
- }
- onUploadCallback() {
- }
- set needsUpdate(value) {
- if (value === true) this.version++;
- }
- setUsage(value) {
- this.usage = value;
- return this;
- }
- addUpdateRange(start, count) {
- this.updateRanges.push({ start, count });
- }
- clearUpdateRanges() {
- this.updateRanges.length = 0;
- }
- copy(source) {
- this.name = source.name;
- this.array = new source.array.constructor(source.array);
- this.itemSize = source.itemSize;
- this.count = source.count;
- this.normalized = source.normalized;
- this.usage = source.usage;
- this.gpuType = source.gpuType;
- return this;
- }
- copyAt(index1, attribute, index2) {
- index1 *= this.itemSize;
- index2 *= attribute.itemSize;
- for (let i = 0, l = this.itemSize; i < l; i++) {
- this.array[index1 + i] = attribute.array[index2 + i];
- }
- return this;
- }
- copyArray(array) {
- this.array.set(array);
- return this;
- }
- applyMatrix3(m) {
- if (this.itemSize === 2) {
- for (let i = 0, l = this.count; i < l; i++) {
- _vector2$1.fromBufferAttribute(this, i);
- _vector2$1.applyMatrix3(m);
- this.setXY(i, _vector2$1.x, _vector2$1.y);
- }
- } else if (this.itemSize === 3) {
- for (let i = 0, l = this.count; i < l; i++) {
- _vector$9.fromBufferAttribute(this, i);
- _vector$9.applyMatrix3(m);
- this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
- }
- }
- return this;
- }
- applyMatrix4(m) {
- for (let i = 0, l = this.count; i < l; i++) {
- _vector$9.fromBufferAttribute(this, i);
- _vector$9.applyMatrix4(m);
- this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
- }
- return this;
- }
- applyNormalMatrix(m) {
- for (let i = 0, l = this.count; i < l; i++) {
- _vector$9.fromBufferAttribute(this, i);
- _vector$9.applyNormalMatrix(m);
- this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
- }
- return this;
- }
- transformDirection(m) {
- for (let i = 0, l = this.count; i < l; i++) {
- _vector$9.fromBufferAttribute(this, i);
- _vector$9.transformDirection(m);
- this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);
- }
- return this;
- }
- set(value, offset = 0) {
- this.array.set(value, offset);
- return this;
- }
- getComponent(index, component) {
- let value = this.array[index * this.itemSize + component];
- if (this.normalized) value = denormalize(value, this.array);
- return value;
- }
- setComponent(index, component, value) {
- if (this.normalized) value = normalize(value, this.array);
- this.array[index * this.itemSize + component] = value;
- return this;
- }
- getX(index) {
- let x = this.array[index * this.itemSize];
- if (this.normalized) x = denormalize(x, this.array);
- return x;
- }
- setX(index, x) {
- if (this.normalized) x = normalize(x, this.array);
- this.array[index * this.itemSize] = x;
- return this;
- }
- getY(index) {
- let y = this.array[index * this.itemSize + 1];
- if (this.normalized) y = denormalize(y, this.array);
- return y;
- }
- setY(index, y) {
- if (this.normalized) y = normalize(y, this.array);
- this.array[index * this.itemSize + 1] = y;
- return this;
- }
- getZ(index) {
- let z = this.array[index * this.itemSize + 2];
- if (this.normalized) z = denormalize(z, this.array);
- return z;
- }
- setZ(index, z) {
- if (this.normalized) z = normalize(z, this.array);
- this.array[index * this.itemSize + 2] = z;
- return this;
- }
- getW(index) {
- let w = this.array[index * this.itemSize + 3];
- if (this.normalized) w = denormalize(w, this.array);
- return w;
- }
- setW(index, w) {
- if (this.normalized) w = normalize(w, this.array);
- this.array[index * this.itemSize + 3] = w;
- return this;
- }
- setXY(index, x, y) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- }
- this.array[index + 0] = x;
- this.array[index + 1] = y;
- return this;
- }
- setXYZ(index, x, y, z) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- z = normalize(z, this.array);
- }
- this.array[index + 0] = x;
- this.array[index + 1] = y;
- this.array[index + 2] = z;
- return this;
- }
- setXYZW(index, x, y, z, w) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- z = normalize(z, this.array);
- w = normalize(w, this.array);
- }
- this.array[index + 0] = x;
- this.array[index + 1] = y;
- this.array[index + 2] = z;
- this.array[index + 3] = w;
- return this;
- }
- onUpload(callback) {
- this.onUploadCallback = callback;
- return this;
- }
- clone() {
- return new this.constructor(this.array, this.itemSize).copy(this);
- }
- toJSON() {
- const data = {
- itemSize: this.itemSize,
- type: this.array.constructor.name,
- array: Array.from(this.array),
- normalized: this.normalized
- };
- if (this.name !== "") data.name = this.name;
- if (this.usage !== StaticDrawUsage) data.usage = this.usage;
- return data;
- }
-}
-class Int8BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Int8BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Int8Array(array), itemSize, normalized);
- }
-}
-class Uint8BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Uint8BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Uint8Array(array), itemSize, normalized);
- }
-}
-class Uint8ClampedBufferAttribute extends BufferAttribute {
- static {
- __name(this, "Uint8ClampedBufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Uint8ClampedArray(array), itemSize, normalized);
- }
-}
-class Int16BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Int16BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Int16Array(array), itemSize, normalized);
- }
-}
-class Uint16BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Uint16BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Uint16Array(array), itemSize, normalized);
- }
-}
-class Int32BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Int32BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Int32Array(array), itemSize, normalized);
- }
-}
-class Uint32BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Uint32BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Uint32Array(array), itemSize, normalized);
- }
-}
-class Float16BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Float16BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Uint16Array(array), itemSize, normalized);
- this.isFloat16BufferAttribute = true;
- }
- getX(index) {
- let x = fromHalfFloat(this.array[index * this.itemSize]);
- if (this.normalized) x = denormalize(x, this.array);
- return x;
- }
- setX(index, x) {
- if (this.normalized) x = normalize(x, this.array);
- this.array[index * this.itemSize] = toHalfFloat(x);
- return this;
- }
- getY(index) {
- let y = fromHalfFloat(this.array[index * this.itemSize + 1]);
- if (this.normalized) y = denormalize(y, this.array);
- return y;
- }
- setY(index, y) {
- if (this.normalized) y = normalize(y, this.array);
- this.array[index * this.itemSize + 1] = toHalfFloat(y);
- return this;
- }
- getZ(index) {
- let z = fromHalfFloat(this.array[index * this.itemSize + 2]);
- if (this.normalized) z = denormalize(z, this.array);
- return z;
- }
- setZ(index, z) {
- if (this.normalized) z = normalize(z, this.array);
- this.array[index * this.itemSize + 2] = toHalfFloat(z);
- return this;
- }
- getW(index) {
- let w = fromHalfFloat(this.array[index * this.itemSize + 3]);
- if (this.normalized) w = denormalize(w, this.array);
- return w;
- }
- setW(index, w) {
- if (this.normalized) w = normalize(w, this.array);
- this.array[index * this.itemSize + 3] = toHalfFloat(w);
- return this;
- }
- setXY(index, x, y) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- }
- this.array[index + 0] = toHalfFloat(x);
- this.array[index + 1] = toHalfFloat(y);
- return this;
- }
- setXYZ(index, x, y, z) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- z = normalize(z, this.array);
- }
- this.array[index + 0] = toHalfFloat(x);
- this.array[index + 1] = toHalfFloat(y);
- this.array[index + 2] = toHalfFloat(z);
- return this;
- }
- setXYZW(index, x, y, z, w) {
- index *= this.itemSize;
- if (this.normalized) {
- x = normalize(x, this.array);
- y = normalize(y, this.array);
- z = normalize(z, this.array);
- w = normalize(w, this.array);
- }
- this.array[index + 0] = toHalfFloat(x);
- this.array[index + 1] = toHalfFloat(y);
- this.array[index + 2] = toHalfFloat(z);
- this.array[index + 3] = toHalfFloat(w);
- return this;
- }
-}
-class Float32BufferAttribute extends BufferAttribute {
- static {
- __name(this, "Float32BufferAttribute");
- }
- constructor(array, itemSize, normalized) {
- super(new Float32Array(array), itemSize, normalized);
- }
-}
-let _id$2 = 0;
-const _m1$2 = /* @__PURE__ */ new Matrix4();
-const _obj = /* @__PURE__ */ new Object3D();
-const _offset = /* @__PURE__ */ new Vector3();
-const _box$2 = /* @__PURE__ */ new Box3();
-const _boxMorphTargets = /* @__PURE__ */ new Box3();
-const _vector$8 = /* @__PURE__ */ new Vector3();
-class BufferGeometry extends EventDispatcher {
- static {
- __name(this, "BufferGeometry");
- }
- constructor() {
- super();
- this.isBufferGeometry = true;
- Object.defineProperty(this, "id", { value: _id$2++ });
- this.uuid = generateUUID();
- this.name = "";
- this.type = "BufferGeometry";
- this.index = null;
- this.indirect = null;
- this.attributes = {};
- this.morphAttributes = {};
- this.morphTargetsRelative = false;
- this.groups = [];
- this.boundingBox = null;
- this.boundingSphere = null;
- this.drawRange = { start: 0, count: Infinity };
- this.userData = {};
- }
- getIndex() {
- return this.index;
- }
- setIndex(index) {
- if (Array.isArray(index)) {
- this.index = new (arrayNeedsUint32(index) ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);
- } else {
- this.index = index;
- }
- return this;
- }
- setIndirect(indirect) {
- this.indirect = indirect;
- return this;
- }
- getIndirect() {
- return this.indirect;
- }
- getAttribute(name) {
- return this.attributes[name];
- }
- setAttribute(name, attribute) {
- this.attributes[name] = attribute;
- return this;
- }
- deleteAttribute(name) {
- delete this.attributes[name];
- return this;
- }
- hasAttribute(name) {
- return this.attributes[name] !== void 0;
- }
- addGroup(start, count, materialIndex = 0) {
- this.groups.push({
- start,
- count,
- materialIndex
- });
- }
- clearGroups() {
- this.groups = [];
- }
- setDrawRange(start, count) {
- this.drawRange.start = start;
- this.drawRange.count = count;
- }
- applyMatrix4(matrix) {
- const position = this.attributes.position;
- if (position !== void 0) {
- position.applyMatrix4(matrix);
- position.needsUpdate = true;
- }
- const normal = this.attributes.normal;
- if (normal !== void 0) {
- const normalMatrix = new Matrix3().getNormalMatrix(matrix);
- normal.applyNormalMatrix(normalMatrix);
- normal.needsUpdate = true;
- }
- const tangent = this.attributes.tangent;
- if (tangent !== void 0) {
- tangent.transformDirection(matrix);
- tangent.needsUpdate = true;
- }
- if (this.boundingBox !== null) {
- this.computeBoundingBox();
- }
- if (this.boundingSphere !== null) {
- this.computeBoundingSphere();
- }
- return this;
- }
- applyQuaternion(q) {
- _m1$2.makeRotationFromQuaternion(q);
- this.applyMatrix4(_m1$2);
- return this;
- }
- rotateX(angle) {
- _m1$2.makeRotationX(angle);
- this.applyMatrix4(_m1$2);
- return this;
- }
- rotateY(angle) {
- _m1$2.makeRotationY(angle);
- this.applyMatrix4(_m1$2);
- return this;
- }
- rotateZ(angle) {
- _m1$2.makeRotationZ(angle);
- this.applyMatrix4(_m1$2);
- return this;
- }
- translate(x, y, z) {
- _m1$2.makeTranslation(x, y, z);
- this.applyMatrix4(_m1$2);
- return this;
- }
- scale(x, y, z) {
- _m1$2.makeScale(x, y, z);
- this.applyMatrix4(_m1$2);
- return this;
- }
- lookAt(vector) {
- _obj.lookAt(vector);
- _obj.updateMatrix();
- this.applyMatrix4(_obj.matrix);
- return this;
- }
- center() {
- this.computeBoundingBox();
- this.boundingBox.getCenter(_offset).negate();
- this.translate(_offset.x, _offset.y, _offset.z);
- return this;
- }
- setFromPoints(points) {
- const positionAttribute = this.getAttribute("position");
- if (positionAttribute === void 0) {
- const position = [];
- for (let i = 0, l = points.length; i < l; i++) {
- const point = points[i];
- position.push(point.x, point.y, point.z || 0);
- }
- this.setAttribute("position", new Float32BufferAttribute(position, 3));
- } else {
- for (let i = 0, l = positionAttribute.count; i < l; i++) {
- const point = points[i];
- positionAttribute.setXYZ(i, point.x, point.y, point.z || 0);
- }
- if (points.length > positionAttribute.count) {
- console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.");
- }
- positionAttribute.needsUpdate = true;
- }
- return this;
- }
- computeBoundingBox() {
- if (this.boundingBox === null) {
- this.boundingBox = new Box3();
- }
- const position = this.attributes.position;
- const morphAttributesPosition = this.morphAttributes.position;
- if (position && position.isGLBufferAttribute) {
- console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this);
- this.boundingBox.set(
- new Vector3(-Infinity, -Infinity, -Infinity),
- new Vector3(Infinity, Infinity, Infinity)
- );
- return;
- }
- if (position !== void 0) {
- this.boundingBox.setFromBufferAttribute(position);
- if (morphAttributesPosition) {
- for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
- const morphAttribute = morphAttributesPosition[i];
- _box$2.setFromBufferAttribute(morphAttribute);
- if (this.morphTargetsRelative) {
- _vector$8.addVectors(this.boundingBox.min, _box$2.min);
- this.boundingBox.expandByPoint(_vector$8);
- _vector$8.addVectors(this.boundingBox.max, _box$2.max);
- this.boundingBox.expandByPoint(_vector$8);
- } else {
- this.boundingBox.expandByPoint(_box$2.min);
- this.boundingBox.expandByPoint(_box$2.max);
- }
- }
- }
- } else {
- this.boundingBox.makeEmpty();
- }
- if (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) {
- console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this);
- }
- }
- computeBoundingSphere() {
- if (this.boundingSphere === null) {
- this.boundingSphere = new Sphere();
- }
- const position = this.attributes.position;
- const morphAttributesPosition = this.morphAttributes.position;
- if (position && position.isGLBufferAttribute) {
- console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this);
- this.boundingSphere.set(new Vector3(), Infinity);
- return;
- }
- if (position) {
- const center = this.boundingSphere.center;
- _box$2.setFromBufferAttribute(position);
- if (morphAttributesPosition) {
- for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
- const morphAttribute = morphAttributesPosition[i];
- _boxMorphTargets.setFromBufferAttribute(morphAttribute);
- if (this.morphTargetsRelative) {
- _vector$8.addVectors(_box$2.min, _boxMorphTargets.min);
- _box$2.expandByPoint(_vector$8);
- _vector$8.addVectors(_box$2.max, _boxMorphTargets.max);
- _box$2.expandByPoint(_vector$8);
- } else {
- _box$2.expandByPoint(_boxMorphTargets.min);
- _box$2.expandByPoint(_boxMorphTargets.max);
- }
- }
- }
- _box$2.getCenter(center);
- let maxRadiusSq = 0;
- for (let i = 0, il = position.count; i < il; i++) {
- _vector$8.fromBufferAttribute(position, i);
- maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
- }
- if (morphAttributesPosition) {
- for (let i = 0, il = morphAttributesPosition.length; i < il; i++) {
- const morphAttribute = morphAttributesPosition[i];
- const morphTargetsRelative = this.morphTargetsRelative;
- for (let j = 0, jl = morphAttribute.count; j < jl; j++) {
- _vector$8.fromBufferAttribute(morphAttribute, j);
- if (morphTargetsRelative) {
- _offset.fromBufferAttribute(position, j);
- _vector$8.add(_offset);
- }
- maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
- }
- }
- }
- this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
- if (isNaN(this.boundingSphere.radius)) {
- console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
- }
- }
- }
- computeTangents() {
- const index = this.index;
- const attributes = this.attributes;
- if (index === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
- console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
- return;
- }
- const positionAttribute = attributes.position;
- const normalAttribute = attributes.normal;
- const uvAttribute = attributes.uv;
- if (this.hasAttribute("tangent") === false) {
- this.setAttribute("tangent", new BufferAttribute(new Float32Array(4 * positionAttribute.count), 4));
- }
- const tangentAttribute = this.getAttribute("tangent");
- const tan1 = [], tan2 = [];
- for (let i = 0; i < positionAttribute.count; i++) {
- tan1[i] = new Vector3();
- tan2[i] = new Vector3();
- }
- const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3();
- function handleTriangle(a, b, c) {
- vA.fromBufferAttribute(positionAttribute, a);
- vB.fromBufferAttribute(positionAttribute, b);
- vC.fromBufferAttribute(positionAttribute, c);
- uvA.fromBufferAttribute(uvAttribute, a);
- uvB.fromBufferAttribute(uvAttribute, b);
- uvC.fromBufferAttribute(uvAttribute, c);
- vB.sub(vA);
- vC.sub(vA);
- uvB.sub(uvA);
- uvC.sub(uvA);
- const r = 1 / (uvB.x * uvC.y - uvC.x * uvB.y);
- if (!isFinite(r)) return;
- sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r);
- tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r);
- tan1[a].add(sdir);
- tan1[b].add(sdir);
- tan1[c].add(sdir);
- tan2[a].add(tdir);
- tan2[b].add(tdir);
- tan2[c].add(tdir);
- }
- __name(handleTriangle, "handleTriangle");
- let groups = this.groups;
- if (groups.length === 0) {
- groups = [{
- start: 0,
- count: index.count
- }];
- }
- for (let i = 0, il = groups.length; i < il; ++i) {
- const group = groups[i];
- const start = group.start;
- const count = group.count;
- for (let j = start, jl = start + count; j < jl; j += 3) {
- handleTriangle(
- index.getX(j + 0),
- index.getX(j + 1),
- index.getX(j + 2)
- );
- }
- }
- const tmp2 = new Vector3(), tmp22 = new Vector3();
- const n = new Vector3(), n2 = new Vector3();
- function handleVertex(v) {
- n.fromBufferAttribute(normalAttribute, v);
- n2.copy(n);
- const t2 = tan1[v];
- tmp2.copy(t2);
- tmp2.sub(n.multiplyScalar(n.dot(t2))).normalize();
- tmp22.crossVectors(n2, t2);
- const test = tmp22.dot(tan2[v]);
- const w = test < 0 ? -1 : 1;
- tangentAttribute.setXYZW(v, tmp2.x, tmp2.y, tmp2.z, w);
- }
- __name(handleVertex, "handleVertex");
- for (let i = 0, il = groups.length; i < il; ++i) {
- const group = groups[i];
- const start = group.start;
- const count = group.count;
- for (let j = start, jl = start + count; j < jl; j += 3) {
- handleVertex(index.getX(j + 0));
- handleVertex(index.getX(j + 1));
- handleVertex(index.getX(j + 2));
- }
- }
- }
- computeVertexNormals() {
- const index = this.index;
- const positionAttribute = this.getAttribute("position");
- if (positionAttribute !== void 0) {
- let normalAttribute = this.getAttribute("normal");
- if (normalAttribute === void 0) {
- normalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3);
- this.setAttribute("normal", normalAttribute);
- } else {
- for (let i = 0, il = normalAttribute.count; i < il; i++) {
- normalAttribute.setXYZ(i, 0, 0, 0);
- }
- }
- const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
- const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
- const cb = new Vector3(), ab = new Vector3();
- if (index) {
- for (let i = 0, il = index.count; i < il; i += 3) {
- const vA = index.getX(i + 0);
- const vB = index.getX(i + 1);
- const vC = index.getX(i + 2);
- pA.fromBufferAttribute(positionAttribute, vA);
- pB.fromBufferAttribute(positionAttribute, vB);
- pC.fromBufferAttribute(positionAttribute, vC);
- cb.subVectors(pC, pB);
- ab.subVectors(pA, pB);
- cb.cross(ab);
- nA.fromBufferAttribute(normalAttribute, vA);
- nB.fromBufferAttribute(normalAttribute, vB);
- nC.fromBufferAttribute(normalAttribute, vC);
- nA.add(cb);
- nB.add(cb);
- nC.add(cb);
- normalAttribute.setXYZ(vA, nA.x, nA.y, nA.z);
- normalAttribute.setXYZ(vB, nB.x, nB.y, nB.z);
- normalAttribute.setXYZ(vC, nC.x, nC.y, nC.z);
- }
- } else {
- for (let i = 0, il = positionAttribute.count; i < il; i += 3) {
- pA.fromBufferAttribute(positionAttribute, i + 0);
- pB.fromBufferAttribute(positionAttribute, i + 1);
- pC.fromBufferAttribute(positionAttribute, i + 2);
- cb.subVectors(pC, pB);
- ab.subVectors(pA, pB);
- cb.cross(ab);
- normalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z);
- normalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z);
- normalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z);
- }
- }
- this.normalizeNormals();
- normalAttribute.needsUpdate = true;
- }
- }
- normalizeNormals() {
- const normals = this.attributes.normal;
- for (let i = 0, il = normals.count; i < il; i++) {
- _vector$8.fromBufferAttribute(normals, i);
- _vector$8.normalize();
- normals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z);
- }
- }
- toNonIndexed() {
- function convertBufferAttribute(attribute, indices2) {
- const array = attribute.array;
- const itemSize = attribute.itemSize;
- const normalized = attribute.normalized;
- const array2 = new array.constructor(indices2.length * itemSize);
- let index = 0, index2 = 0;
- for (let i = 0, l = indices2.length; i < l; i++) {
- if (attribute.isInterleavedBufferAttribute) {
- index = indices2[i] * attribute.data.stride + attribute.offset;
- } else {
- index = indices2[i] * itemSize;
- }
- for (let j = 0; j < itemSize; j++) {
- array2[index2++] = array[index++];
- }
- }
- return new BufferAttribute(array2, itemSize, normalized);
- }
- __name(convertBufferAttribute, "convertBufferAttribute");
- if (this.index === null) {
- console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.");
- return this;
- }
- const geometry2 = new BufferGeometry();
- const indices = this.index.array;
- const attributes = this.attributes;
- for (const name in attributes) {
- const attribute = attributes[name];
- const newAttribute = convertBufferAttribute(attribute, indices);
- geometry2.setAttribute(name, newAttribute);
- }
- const morphAttributes = this.morphAttributes;
- for (const name in morphAttributes) {
- const morphArray = [];
- const morphAttribute = morphAttributes[name];
- for (let i = 0, il = morphAttribute.length; i < il; i++) {
- const attribute = morphAttribute[i];
- const newAttribute = convertBufferAttribute(attribute, indices);
- morphArray.push(newAttribute);
- }
- geometry2.morphAttributes[name] = morphArray;
- }
- geometry2.morphTargetsRelative = this.morphTargetsRelative;
- const groups = this.groups;
- for (let i = 0, l = groups.length; i < l; i++) {
- const group = groups[i];
- geometry2.addGroup(group.start, group.count, group.materialIndex);
- }
- return geometry2;
- }
- toJSON() {
- const data = {
- metadata: {
- version: 4.6,
- type: "BufferGeometry",
- generator: "BufferGeometry.toJSON"
- }
- };
- data.uuid = this.uuid;
- data.type = this.type;
- if (this.name !== "") data.name = this.name;
- if (Object.keys(this.userData).length > 0) data.userData = this.userData;
- if (this.parameters !== void 0) {
- const parameters = this.parameters;
- for (const key in parameters) {
- if (parameters[key] !== void 0) data[key] = parameters[key];
- }
- return data;
- }
- data.data = { attributes: {} };
- const index = this.index;
- if (index !== null) {
- data.data.index = {
- type: index.array.constructor.name,
- array: Array.prototype.slice.call(index.array)
- };
- }
- const attributes = this.attributes;
- for (const key in attributes) {
- const attribute = attributes[key];
- data.data.attributes[key] = attribute.toJSON(data.data);
- }
- const morphAttributes = {};
- let hasMorphAttributes = false;
- for (const key in this.morphAttributes) {
- const attributeArray = this.morphAttributes[key];
- const array = [];
- for (let i = 0, il = attributeArray.length; i < il; i++) {
- const attribute = attributeArray[i];
- array.push(attribute.toJSON(data.data));
- }
- if (array.length > 0) {
- morphAttributes[key] = array;
- hasMorphAttributes = true;
- }
- }
- if (hasMorphAttributes) {
- data.data.morphAttributes = morphAttributes;
- data.data.morphTargetsRelative = this.morphTargetsRelative;
- }
- const groups = this.groups;
- if (groups.length > 0) {
- data.data.groups = JSON.parse(JSON.stringify(groups));
- }
- const boundingSphere = this.boundingSphere;
- if (boundingSphere !== null) {
- data.data.boundingSphere = {
- center: boundingSphere.center.toArray(),
- radius: boundingSphere.radius
- };
- }
- return data;
- }
- clone() {
- return new this.constructor().copy(this);
- }
- copy(source) {
- this.index = null;
- this.attributes = {};
- this.morphAttributes = {};
- this.groups = [];
- this.boundingBox = null;
- this.boundingSphere = null;
- const data = {};
- this.name = source.name;
- const index = source.index;
- if (index !== null) {
- this.setIndex(index.clone(data));
- }
- const attributes = source.attributes;
- for (const name in attributes) {
- const attribute = attributes[name];
- this.setAttribute(name, attribute.clone(data));
- }
- const morphAttributes = source.morphAttributes;
- for (const name in morphAttributes) {
- const array = [];
- const morphAttribute = morphAttributes[name];
- for (let i = 0, l = morphAttribute.length; i < l; i++) {
- array.push(morphAttribute[i].clone(data));
- }
- this.morphAttributes[name] = array;
- }
- this.morphTargetsRelative = source.morphTargetsRelative;
- const groups = source.groups;
- for (let i = 0, l = groups.length; i < l; i++) {
- const group = groups[i];
- this.addGroup(group.start, group.count, group.materialIndex);
- }
- const boundingBox = source.boundingBox;
- if (boundingBox !== null) {
- this.boundingBox = boundingBox.clone();
- }
- const boundingSphere = source.boundingSphere;
- if (boundingSphere !== null) {
- this.boundingSphere = boundingSphere.clone();
- }
- this.drawRange.start = source.drawRange.start;
- this.drawRange.count = source.drawRange.count;
- this.userData = source.userData;
- return this;
- }
- dispose() {
- this.dispatchEvent({ type: "dispose" });
- }
-}
-const _inverseMatrix$3 = /* @__PURE__ */ new Matrix4();
-const _ray$3 = /* @__PURE__ */ new Ray();
-const _sphere$6 = /* @__PURE__ */ new Sphere();
-const _sphereHitAt = /* @__PURE__ */ new Vector3();
-const _vA$1 = /* @__PURE__ */ new Vector3();
-const _vB$1 = /* @__PURE__ */ new Vector3();
-const _vC$1 = /* @__PURE__ */ new Vector3();
-const _tempA = /* @__PURE__ */ new Vector3();
-const _morphA = /* @__PURE__ */ new Vector3();
-const _intersectionPoint = /* @__PURE__ */ new Vector3();
-const _intersectionPointWorld = /* @__PURE__ */ new Vector3();
-class Mesh extends Object3D {
- static {
- __name(this, "Mesh");
- }
- constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {
- super();
- this.isMesh = true;
- this.type = "Mesh";
- this.geometry = geometry;
- this.material = material;
- this.updateMorphTargets();
- }
- copy(source, recursive) {
- super.copy(source, recursive);
- if (source.morphTargetInfluences !== void 0) {
- this.morphTargetInfluences = source.morphTargetInfluences.slice();
- }
- if (source.morphTargetDictionary !== void 0) {
- this.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary);
- }
- this.material = Array.isArray(source.material) ? source.material.slice() : source.material;
- this.geometry = source.geometry;
- return this;
- }
- updateMorphTargets() {
- const geometry = this.geometry;
- const morphAttributes = geometry.morphAttributes;
- const keys = Object.keys(morphAttributes);
- if (keys.length > 0) {
- const morphAttribute = morphAttributes[keys[0]];
- if (morphAttribute !== void 0) {
- this.morphTargetInfluences = [];
- this.morphTargetDictionary = {};
- for (let m = 0, ml = morphAttribute.length; m < ml; m++) {
- const name = morphAttribute[m].name || String(m);
- this.morphTargetInfluences.push(0);
- this.morphTargetDictionary[name] = m;
- }
- }
- }
- }
- getVertexPosition(index, target) {
- const geometry = this.geometry;
- const position = geometry.attributes.position;
- const morphPosition = geometry.morphAttributes.position;
- const morphTargetsRelative = geometry.morphTargetsRelative;
- target.fromBufferAttribute(position, index);
- const morphInfluences = this.morphTargetInfluences;
- if (morphPosition && morphInfluences) {
- _morphA.set(0, 0, 0);
- for (let i = 0, il = morphPosition.length; i < il; i++) {
- const influence = morphInfluences[i];
- const morphAttribute = morphPosition[i];
- if (influence === 0) continue;
- _tempA.fromBufferAttribute(morphAttribute, index);
- if (morphTargetsRelative) {
- _morphA.addScaledVector(_tempA, influence);
- } else {
- _morphA.addScaledVector(_tempA.sub(target), influence);
- }
- }
- target.add(_morphA);
- }
- return target;
- }
- raycast(raycaster, intersects2) {
- const geometry = this.geometry;
- const material = this.material;
- const matrixWorld = this.matrixWorld;
- if (material === void 0) return;
- if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
- _sphere$6.copy(geometry.boundingSphere);
- _sphere$6.applyMatrix4(matrixWorld);
- _ray$3.copy(raycaster.ray).recast(raycaster.near);
- if (_sphere$6.containsPoint(_ray$3.origin) === false) {
- if (_ray$3.intersectSphere(_sphere$6, _sphereHitAt) === null) return;
- if (_ray$3.origin.distanceToSquared(_sphereHitAt) > (raycaster.far - raycaster.near) ** 2) return;
- }
- _inverseMatrix$3.copy(matrixWorld).invert();
- _ray$3.copy(raycaster.ray).applyMatrix4(_inverseMatrix$3);
- if (geometry.boundingBox !== null) {
- if (_ray$3.intersectsBox(geometry.boundingBox) === false) return;
- }
- this._computeIntersections(raycaster, intersects2, _ray$3);
- }
- _computeIntersections(raycaster, intersects2, rayLocalSpace) {
- let intersection;
- const geometry = this.geometry;
- const material = this.material;
- const index = geometry.index;
- const position = geometry.attributes.position;
- const uv = geometry.attributes.uv;
- const uv1 = geometry.attributes.uv1;
- const normal = geometry.attributes.normal;
- const groups = geometry.groups;
- const drawRange = geometry.drawRange;
- if (index !== null) {
- if (Array.isArray(material)) {
- for (let i = 0, il = groups.length; i < il; i++) {
- const group = groups[i];
- const groupMaterial = material[group.materialIndex];
- const start = Math.max(group.start, drawRange.start);
- const end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
- for (let j = start, jl = end; j < jl; j += 3) {
- const a = index.getX(j);
- const b = index.getX(j + 1);
- const c = index.getX(j + 2);
- intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c);
- if (intersection) {
- intersection.faceIndex = Math.floor(j / 3);
- intersection.face.materialIndex = group.materialIndex;
- intersects2.push(intersection);
- }
- }
- }
- } else {
- const start = Math.max(0, drawRange.start);
- const end = Math.min(index.count, drawRange.start + drawRange.count);
- for (let i = start, il = end; i < il; i += 3) {
- const a = index.getX(i);
- const b = index.getX(i + 1);
- const c = index.getX(i + 2);
- intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c);
- if (intersection) {
- intersection.faceIndex = Math.floor(i / 3);
- intersects2.push(intersection);
- }
- }
- }
- } else if (position !== void 0) {
- if (Array.isArray(material)) {
- for (let i = 0, il = groups.length; i < il; i++) {
- const group = groups[i];
- const groupMaterial = material[group.materialIndex];
- const start = Math.max(group.start, drawRange.start);
- const end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
- for (let j = start, jl = end; j < jl; j += 3) {
- const a = j;
- const b = j + 1;
- const c = j + 2;
- intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c);
- if (intersection) {
- intersection.faceIndex = Math.floor(j / 3);
- intersection.face.materialIndex = group.materialIndex;
- intersects2.push(intersection);
- }
- }
- }
- } else {
- const start = Math.max(0, drawRange.start);
- const end = Math.min(position.count, drawRange.start + drawRange.count);
- for (let i = start, il = end; i < il; i += 3) {
- const a = i;
- const b = i + 1;
- const c = i + 2;
- intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c);
- if (intersection) {
- intersection.faceIndex = Math.floor(i / 3);
- intersects2.push(intersection);
- }
- }
- }
- }
- }
-}
-function checkIntersection$1(object, material, raycaster, ray, pA, pB, pC, point) {
- let intersect2;
- if (material.side === BackSide) {
- intersect2 = ray.intersectTriangle(pC, pB, pA, true, point);
- } else {
- intersect2 = ray.intersectTriangle(pA, pB, pC, material.side === FrontSide, point);
- }
- if (intersect2 === null) return null;
- _intersectionPointWorld.copy(point);
- _intersectionPointWorld.applyMatrix4(object.matrixWorld);
- const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);
- if (distance < raycaster.near || distance > raycaster.far) return null;
- return {
- distance,
- point: _intersectionPointWorld.clone(),
- object
- };
-}
-__name(checkIntersection$1, "checkIntersection$1");
-function checkGeometryIntersection(object, material, raycaster, ray, uv, uv1, normal, a, b, c) {
- object.getVertexPosition(a, _vA$1);
- object.getVertexPosition(b, _vB$1);
- object.getVertexPosition(c, _vC$1);
- const intersection = checkIntersection$1(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);
- if (intersection) {
- const barycoord = new Vector3();
- Triangle.getBarycoord(_intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord);
- if (uv) {
- intersection.uv = Triangle.getInterpolatedAttribute(uv, a, b, c, barycoord, new Vector2());
- }
- if (uv1) {
- intersection.uv1 = Triangle.getInterpolatedAttribute(uv1, a, b, c, barycoord, new Vector2());
- }
- if (normal) {
- intersection.normal = Triangle.getInterpolatedAttribute(normal, a, b, c, barycoord, new Vector3());
- if (intersection.normal.dot(ray.direction) > 0) {
- intersection.normal.multiplyScalar(-1);
- }
- }
- const face = {
- a,
- b,
- c,
- normal: new Vector3(),
- materialIndex: 0
- };
- Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);
- intersection.face = face;
- intersection.barycoord = barycoord;
- }
- return intersection;
-}
-__name(checkGeometryIntersection, "checkGeometryIntersection");
-class BoxGeometry extends BufferGeometry {
- static {
- __name(this, "BoxGeometry");
- }
- constructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) {
- super();
- this.type = "BoxGeometry";
- this.parameters = {
- width,
- height,
- depth,
- widthSegments,
- heightSegments,
- depthSegments
- };
- const scope = this;
- widthSegments = Math.floor(widthSegments);
- heightSegments = Math.floor(heightSegments);
- depthSegments = Math.floor(depthSegments);
- const indices = [];
- const vertices = [];
- const normals = [];
- const uvs = [];
- let numberOfVertices = 0;
- let groupStart = 0;
- buildPlane("z", "y", "x", -1, -1, depth, height, width, depthSegments, heightSegments, 0);
- buildPlane("z", "y", "x", 1, -1, depth, height, -width, depthSegments, heightSegments, 1);
- buildPlane("x", "z", "y", 1, 1, width, depth, height, widthSegments, depthSegments, 2);
- buildPlane("x", "z", "y", 1, -1, width, depth, -height, widthSegments, depthSegments, 3);
- buildPlane("x", "y", "z", 1, -1, width, height, depth, widthSegments, heightSegments, 4);
- buildPlane("x", "y", "z", -1, -1, width, height, -depth, widthSegments, heightSegments, 5);
- this.setIndex(indices);
- this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
- this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
- this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
- function buildPlane(u, v, w, udir, vdir, width2, height2, depth2, gridX, gridY, materialIndex) {
- const segmentWidth = width2 / gridX;
- const segmentHeight = height2 / gridY;
- const widthHalf = width2 / 2;
- const heightHalf = height2 / 2;
- const depthHalf = depth2 / 2;
- const gridX1 = gridX + 1;
- const gridY1 = gridY + 1;
- let vertexCounter = 0;
- let groupCount = 0;
- const vector = new Vector3();
- for (let iy = 0; iy < gridY1; iy++) {
- const y = iy * segmentHeight - heightHalf;
- for (let ix = 0; ix < gridX1; ix++) {
- const x = ix * segmentWidth - widthHalf;
- vector[u] = x * udir;
- vector[v] = y * vdir;
- vector[w] = depthHalf;
- vertices.push(vector.x, vector.y, vector.z);
- vector[u] = 0;
- vector[v] = 0;
- vector[w] = depth2 > 0 ? 1 : -1;
- normals.push(vector.x, vector.y, vector.z);
- uvs.push(ix / gridX);
- uvs.push(1 - iy / gridY);
- vertexCounter += 1;
- }
- }
- for (let iy = 0; iy < gridY; iy++) {
- for (let ix = 0; ix < gridX; ix++) {
- const a = numberOfVertices + ix + gridX1 * iy;
- const b = numberOfVertices + ix + gridX1 * (iy + 1);
- const c = numberOfVertices + (ix + 1) + gridX1 * (iy + 1);
- const d = numberOfVertices + (ix + 1) + gridX1 * iy;
- indices.push(a, b, d);
- indices.push(b, c, d);
- groupCount += 6;
- }
- }
- scope.addGroup(groupStart, groupCount, materialIndex);
- groupStart += groupCount;
- numberOfVertices += vertexCounter;
- }
- __name(buildPlane, "buildPlane");
- }
- copy(source) {
- super.copy(source);
- this.parameters = Object.assign({}, source.parameters);
- return this;
- }
- static fromJSON(data) {
- return new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);
- }
-}
-function cloneUniforms(src) {
- const dst = {};
- for (const u in src) {
- dst[u] = {};
- for (const p in src[u]) {
- const property = src[u][p];
- if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {
- if (property.isRenderTargetTexture) {
- console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().");
- dst[u][p] = null;
- } else {
- dst[u][p] = property.clone();
- }
- } else if (Array.isArray(property)) {
- dst[u][p] = property.slice();
- } else {
- dst[u][p] = property;
- }
- }
- }
- return dst;
-}
-__name(cloneUniforms, "cloneUniforms");
-function mergeUniforms(uniforms) {
- const merged = {};
- for (let u = 0; u < uniforms.length; u++) {
- const tmp2 = cloneUniforms(uniforms[u]);
- for (const p in tmp2) {
- merged[p] = tmp2[p];
- }
- }
- return merged;
-}
-__name(mergeUniforms, "mergeUniforms");
-function cloneUniformsGroups(src) {
- const dst = [];
- for (let u = 0; u < src.length; u++) {
- dst.push(src[u].clone());
- }
- return dst;
-}
-__name(cloneUniformsGroups, "cloneUniformsGroups");
-function getUnlitUniformColorSpace(renderer) {
- const currentRenderTarget = renderer.getRenderTarget();
- if (currentRenderTarget === null) {
- return renderer.outputColorSpace;
- }
- if (currentRenderTarget.isXRRenderTarget === true) {
- return currentRenderTarget.texture.colorSpace;
- }
- return ColorManagement.workingColorSpace;
-}
-__name(getUnlitUniformColorSpace, "getUnlitUniformColorSpace");
-const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
-var default_vertex = "void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";
-var default_fragment = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
-class ShaderMaterial extends Material {
- static {
- __name(this, "ShaderMaterial");
- }
- static get type() {
- return "ShaderMaterial";
- }
- constructor(parameters) {
- super();
- this.isShaderMaterial = true;
- this.defines = {};
- this.uniforms = {};
- this.uniformsGroups = [];
- this.vertexShader = default_vertex;
- this.fragmentShader = default_fragment;
- this.linewidth = 1;
- this.wireframe = false;
- this.wireframeLinewidth = 1;
- this.fog = false;
- this.lights = false;
- this.clipping = false;
- this.forceSinglePass = true;
- this.extensions = {
- clipCullDistance: false,
- // set to use vertex shader clipping
- multiDraw: false
- // set to use vertex shader multi_draw / enable gl_DrawID
- };
- this.defaultAttributeValues = {
- "color": [1, 1, 1],
- "uv": [0, 0],
- "uv1": [0, 0]
- };
- this.index0AttributeName = void 0;
- this.uniformsNeedUpdate = false;
- this.glslVersion = null;
- if (parameters !== void 0) {
- this.setValues(parameters);
- }
- }
- copy(source) {
- super.copy(source);
- this.fragmentShader = source.fragmentShader;
- this.vertexShader = source.vertexShader;
- this.uniforms = cloneUniforms(source.uniforms);
- this.uniformsGroups = cloneUniformsGroups(source.uniformsGroups);
- this.defines = Object.assign({}, source.defines);
- this.wireframe = source.wireframe;
- this.wireframeLinewidth = source.wireframeLinewidth;
- this.fog = source.fog;
- this.lights = source.lights;
- this.clipping = source.clipping;
- this.extensions = Object.assign({}, source.extensions);
- this.glslVersion = source.glslVersion;
- return this;
- }
- toJSON(meta) {
- const data = super.toJSON(meta);
- data.glslVersion = this.glslVersion;
- data.uniforms = {};
- for (const name in this.uniforms) {
- const uniform = this.uniforms[name];
- const value = uniform.value;
- if (value && value.isTexture) {
- data.uniforms[name] = {
- type: "t",
- value: value.toJSON(meta).uuid
- };
- } else if (value && value.isColor) {
- data.uniforms[name] = {
- type: "c",
- value: value.getHex()
- };
- } else if (value && value.isVector2) {
- data.uniforms[name] = {
- type: "v2",
- value: value.toArray()
- };
- } else if (value && value.isVector3) {
- data.uniforms[name] = {
- type: "v3",
- value: value.toArray()
- };
- } else if (value && value.isVector4) {
- data.uniforms[name] = {
- type: "v4",
- value: value.toArray()
- };
- } else if (value && value.isMatrix3) {
- data.uniforms[name] = {
- type: "m3",
- value: value.toArray()
- };
- } else if (value && value.isMatrix4) {
- data.uniforms[name] = {
- type: "m4",
- value: value.toArray()
- };
- } else {
- data.uniforms[name] = {
- value
- };
- }
- }
- if (Object.keys(this.defines).length > 0) data.defines = this.defines;
- data.vertexShader = this.vertexShader;
- data.fragmentShader = this.fragmentShader;
- data.lights = this.lights;
- data.clipping = this.clipping;
- const extensions = {};
- for (const key in this.extensions) {
- if (this.extensions[key] === true) extensions[key] = true;
- }
- if (Object.keys(extensions).length > 0) data.extensions = extensions;
- return data;
- }
-}
-class Camera extends Object3D {
- static {
- __name(this, "Camera");
- }
- constructor() {
- super();
- this.isCamera = true;
- this.type = "Camera";
- this.matrixWorldInverse = new Matrix4();
- this.projectionMatrix = new Matrix4();
- this.projectionMatrixInverse = new Matrix4();
- this.coordinateSystem = WebGLCoordinateSystem;
- }
- copy(source, recursive) {
- super.copy(source, recursive);
- this.matrixWorldInverse.copy(source.matrixWorldInverse);
- this.projectionMatrix.copy(source.projectionMatrix);
- this.projectionMatrixInverse.copy(source.projectionMatrixInverse);
- this.coordinateSystem = source.coordinateSystem;
- return this;
- }
- getWorldDirection(target) {
- return super.getWorldDirection(target).negate();
- }
- updateMatrixWorld(force) {
- super.updateMatrixWorld(force);
- this.matrixWorldInverse.copy(this.matrixWorld).invert();
- }
- updateWorldMatrix(updateParents, updateChildren) {
- super.updateWorldMatrix(updateParents, updateChildren);
- this.matrixWorldInverse.copy(this.matrixWorld).invert();
- }
- clone() {
- return new this.constructor().copy(this);
- }
-}
-const _v3$1 = /* @__PURE__ */ new Vector3();
-const _minTarget = /* @__PURE__ */ new Vector2();
-const _maxTarget = /* @__PURE__ */ new Vector2();
-class PerspectiveCamera extends Camera {
- static {
- __name(this, "PerspectiveCamera");
- }
- constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) {
- super();
- this.isPerspectiveCamera = true;
- this.type = "PerspectiveCamera";
- this.fov = fov2;
- this.zoom = 1;
- this.near = near;
- this.far = far;
- this.focus = 10;
- this.aspect = aspect2;
- this.view = null;
- this.filmGauge = 35;
- this.filmOffset = 0;
- this.updateProjectionMatrix();
- }
- copy(source, recursive) {
- super.copy(source, recursive);
- this.fov = source.fov;
- this.zoom = source.zoom;
- this.near = source.near;
- this.far = source.far;
- this.focus = source.focus;
- this.aspect = source.aspect;
- this.view = source.view === null ? null : Object.assign({}, source.view);
- this.filmGauge = source.filmGauge;
- this.filmOffset = source.filmOffset;
- return this;
- }
- /**
- * Sets the FOV by focal length in respect to the current .filmGauge.
- *
- * The default film gauge is 35, so that the focal length can be specified for
- * a 35mm (full frame) camera.
- *
- * Values for focal length and film gauge must have the same unit.
- */
- setFocalLength(focalLength) {
- const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;
- this.fov = RAD2DEG * 2 * Math.atan(vExtentSlope);
- this.updateProjectionMatrix();
- }
- /**
- * Calculates the focal length from the current .fov and .filmGauge.
- */
- getFocalLength() {
- const vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov);
- return 0.5 * this.getFilmHeight() / vExtentSlope;
- }
- getEffectiveFOV() {
- return RAD2DEG * 2 * Math.atan(
- Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom
- );
- }
- getFilmWidth() {
- return this.filmGauge * Math.min(this.aspect, 1);
- }
- getFilmHeight() {
- return this.filmGauge / Math.max(this.aspect, 1);
- }
- /**
- * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
- * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
- */
- getViewBounds(distance, minTarget, maxTarget) {
- _v3$1.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse);
- minTarget.set(_v3$1.x, _v3$1.y).multiplyScalar(-distance / _v3$1.z);
- _v3$1.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse);
- maxTarget.set(_v3$1.x, _v3$1.y).multiplyScalar(-distance / _v3$1.z);
- }
- /**
- * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
- * Copies the result into the target Vector2, where x is width and y is height.
- */
- getViewSize(distance, target) {
- this.getViewBounds(distance, _minTarget, _maxTarget);
- return target.subVectors(_maxTarget, _minTarget);
- }
- /**
- * Sets an offset in a larger frustum. This is useful for multi-window or
- * multi-monitor/multi-machine setups.
- *
- * For example, if you have 3x2 monitors and each monitor is 1920x1080 and
- * the monitors are in grid like this
- *
- * +---+---+---+
- * | A | B | C |
- * +---+---+---+
- * | D | E | F |
- * +---+---+---+
- *
- * then for each monitor you would call it like this
- *
- * const w = 1920;
- * const h = 1080;
- * const fullWidth = w * 3;
- * const fullHeight = h * 2;
- *
- * --A--
- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
- * --B--
- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
- * --C--
- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
- * --D--
- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
- * --E--
- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
- * --F--
- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
- *
- * Note there is no reason monitors have to be the same size or in a grid.
- */
- setViewOffset(fullWidth, fullHeight, x, y, width, height) {
- this.aspect = fullWidth / fullHeight;
- if (this.view === null) {
- this.view = {
- enabled: true,
- fullWidth: 1,
- fullHeight: 1,
- offsetX: 0,
- offsetY: 0,
- width: 1,
- height: 1
- };
- }
- this.view.enabled = true;
- this.view.fullWidth = fullWidth;
- this.view.fullHeight = fullHeight;
- this.view.offsetX = x;
- this.view.offsetY = y;
- this.view.width = width;
- this.view.height = height;
- this.updateProjectionMatrix();
- }
- clearViewOffset() {
- if (this.view !== null) {
- this.view.enabled = false;
- }
- this.updateProjectionMatrix();
- }
- updateProjectionMatrix() {
- const near = this.near;
- let top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom;
- let height = 2 * top;
- let width = this.aspect * height;
- let left = -0.5 * width;
- const view = this.view;
- if (this.view !== null && this.view.enabled) {
- const fullWidth = view.fullWidth, fullHeight = view.fullHeight;
- left += view.offsetX * width / fullWidth;
- top -= view.offsetY * height / fullHeight;
- width *= view.width / fullWidth;
- height *= view.height / fullHeight;
- }
- const skew = this.filmOffset;
- if (skew !== 0) left += near * skew / this.getFilmWidth();
- this.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far, this.coordinateSystem);
- this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
- }
- toJSON(meta) {
- const data = super.toJSON(meta);
- data.object.fov = this.fov;
- data.object.zoom = this.zoom;
- data.object.near = this.near;
- data.object.far = this.far;
- data.object.focus = this.focus;
- data.object.aspect = this.aspect;
- if (this.view !== null) data.object.view = Object.assign({}, this.view);
- data.object.filmGauge = this.filmGauge;
- data.object.filmOffset = this.filmOffset;
- return data;
- }
-}
-const fov = -90;
-const aspect = 1;
-class CubeCamera extends Object3D {
- static {
- __name(this, "CubeCamera");
- }
- constructor(near, far, renderTarget) {
- super();
- this.type = "CubeCamera";
- this.renderTarget = renderTarget;
- this.coordinateSystem = null;
- this.activeMipmapLevel = 0;
- const cameraPX = new PerspectiveCamera(fov, aspect, near, far);
- cameraPX.layers = this.layers;
- this.add(cameraPX);
- const cameraNX = new PerspectiveCamera(fov, aspect, near, far);
- cameraNX.layers = this.layers;
- this.add(cameraNX);
- const cameraPY = new PerspectiveCamera(fov, aspect, near, far);
- cameraPY.layers = this.layers;
- this.add(cameraPY);
- const cameraNY = new PerspectiveCamera(fov, aspect, near, far);
- cameraNY.layers = this.layers;
- this.add(cameraNY);
- const cameraPZ = new PerspectiveCamera(fov, aspect, near, far);
- cameraPZ.layers = this.layers;
- this.add(cameraPZ);
- const cameraNZ = new PerspectiveCamera(fov, aspect, near, far);
- cameraNZ.layers = this.layers;
- this.add(cameraNZ);
- }
- updateCoordinateSystem() {
- const coordinateSystem = this.coordinateSystem;
- const cameras = this.children.concat();
- const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = cameras;
- for (const camera of cameras) this.remove(camera);
- if (coordinateSystem === WebGLCoordinateSystem) {
- cameraPX.up.set(0, 1, 0);
- cameraPX.lookAt(1, 0, 0);
- cameraNX.up.set(0, 1, 0);
- cameraNX.lookAt(-1, 0, 0);
- cameraPY.up.set(0, 0, -1);
- cameraPY.lookAt(0, 1, 0);
- cameraNY.up.set(0, 0, 1);
- cameraNY.lookAt(0, -1, 0);
- cameraPZ.up.set(0, 1, 0);
- cameraPZ.lookAt(0, 0, 1);
- cameraNZ.up.set(0, 1, 0);
- cameraNZ.lookAt(0, 0, -1);
- } else if (coordinateSystem === WebGPUCoordinateSystem) {
- cameraPX.up.set(0, -1, 0);
- cameraPX.lookAt(-1, 0, 0);
- cameraNX.up.set(0, -1, 0);
- cameraNX.lookAt(1, 0, 0);
- cameraPY.up.set(0, 0, 1);
- cameraPY.lookAt(0, 1, 0);
- cameraNY.up.set(0, 0, -1);
- cameraNY.lookAt(0, -1, 0);
- cameraPZ.up.set(0, -1, 0);
- cameraPZ.lookAt(0, 0, 1);
- cameraNZ.up.set(0, -1, 0);
- cameraNZ.lookAt(0, 0, -1);
- } else {
- throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + coordinateSystem);
- }
- for (const camera of cameras) {
- this.add(camera);
- camera.updateMatrixWorld();
- }
- }
- update(renderer, scene) {
- if (this.parent === null) this.updateMatrixWorld();
- const { renderTarget, activeMipmapLevel } = this;
- if (this.coordinateSystem !== renderer.coordinateSystem) {
- this.coordinateSystem = renderer.coordinateSystem;
- this.updateCoordinateSystem();
- }
- const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children;
- const currentRenderTarget = renderer.getRenderTarget();
- const currentActiveCubeFace = renderer.getActiveCubeFace();
- const currentActiveMipmapLevel = renderer.getActiveMipmapLevel();
- const currentXrEnabled = renderer.xr.enabled;
- renderer.xr.enabled = false;
- const generateMipmaps = renderTarget.texture.generateMipmaps;
- renderTarget.texture.generateMipmaps = false;
- renderer.setRenderTarget(renderTarget, 0, activeMipmapLevel);
- renderer.render(scene, cameraPX);
- renderer.setRenderTarget(renderTarget, 1, activeMipmapLevel);
- renderer.render(scene, cameraNX);
- renderer.setRenderTarget(renderTarget, 2, activeMipmapLevel);
- renderer.render(scene, cameraPY);
- renderer.setRenderTarget(renderTarget, 3, activeMipmapLevel);
- renderer.render(scene, cameraNY);
- renderer.setRenderTarget(renderTarget, 4, activeMipmapLevel);
- renderer.render(scene, cameraPZ);
- renderTarget.texture.generateMipmaps = generateMipmaps;
- renderer.setRenderTarget(renderTarget, 5, activeMipmapLevel);
- renderer.render(scene, cameraNZ);
- renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);
- renderer.xr.enabled = currentXrEnabled;
- renderTarget.texture.needsPMREMUpdate = true;
- }
-}
-class CubeTexture extends Texture {
- static {
- __name(this, "CubeTexture");
- }
- constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace) {
- images = images !== void 0 ? images : [];
- mapping = mapping !== void 0 ? mapping : CubeReflectionMapping;
- super(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace);
- this.isCubeTexture = true;
- this.flipY = false;
- }
- get images() {
- return this.image;
- }
- set images(value) {
- this.image = value;
- }
-}
-class WebGLCubeRenderTarget extends WebGLRenderTarget {
- static {
- __name(this, "WebGLCubeRenderTarget");
- }
- constructor(size = 1, options = {}) {
- super(size, size, options);
- this.isWebGLCubeRenderTarget = true;
- const image = { width: size, height: size, depth: 1 };
- const images = [image, image, image, image, image, image];
- this.texture = new CubeTexture(images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace);
- this.texture.isRenderTargetTexture = true;
- this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false;
- this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter;
- }
- fromEquirectangularTexture(renderer, texture) {
- this.texture.type = texture.type;
- this.texture.colorSpace = texture.colorSpace;
- this.texture.generateMipmaps = texture.generateMipmaps;
- this.texture.minFilter = texture.minFilter;
- this.texture.magFilter = texture.magFilter;
- const shader = {
- uniforms: {
- tEquirect: { value: null }
- },
- vertexShader: (
- /* glsl */
- `
-
- varying vec3 vWorldDirection;
-
- vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
-
- return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
-
- }
-
- void main() {
-
- vWorldDirection = transformDirection( position, modelMatrix );
-
- #include
- #include
-
- }
- `
- ),
- fragmentShader: (
- /* glsl */
- `
-
- uniform sampler2D tEquirect;
-
- varying vec3 vWorldDirection;
-
- #include
-
- void main() {
-
- vec3 direction = normalize( vWorldDirection );
-
- vec2 sampleUV = equirectUv( direction );
-
- gl_FragColor = texture2D( tEquirect, sampleUV );
-
- }
- `
- )
- };
- const geometry = new BoxGeometry(5, 5, 5);
- const material = new ShaderMaterial({
- name: "CubemapFromEquirect",
- uniforms: cloneUniforms(shader.uniforms),
- vertexShader: shader.vertexShader,
- fragmentShader: shader.fragmentShader,
- side: BackSide,
- blending: NoBlending
- });
- material.uniforms.tEquirect.value = texture;
- const mesh = new Mesh(geometry, material);
- const currentMinFilter = texture.minFilter;
- if (texture.minFilter === LinearMipmapLinearFilter) texture.minFilter = LinearFilter;
- const camera = new CubeCamera(1, 10, this);
- camera.update(renderer, mesh);
- texture.minFilter = currentMinFilter;
- mesh.geometry.dispose();
- mesh.material.dispose();
- return this;
- }
- clear(renderer, color, depth, stencil) {
- const currentRenderTarget = renderer.getRenderTarget();
- for (let i = 0; i < 6; i++) {
- renderer.setRenderTarget(this, i);
- renderer.clear(color, depth, stencil);
- }
- renderer.setRenderTarget(currentRenderTarget);
- }
-}
-const _vector1 = /* @__PURE__ */ new Vector3();
-const _vector2 = /* @__PURE__ */ new Vector3();
-const _normalMatrix = /* @__PURE__ */ new Matrix3();
-class Plane {
- static {
- __name(this, "Plane");
- }
- constructor(normal = new Vector3(1, 0, 0), constant = 0) {
- this.isPlane = true;
- this.normal = normal;
- this.constant = constant;
- }
- set(normal, constant) {
- this.normal.copy(normal);
- this.constant = constant;
- return this;
- }
- setComponents(x, y, z, w) {
- this.normal.set(x, y, z);
- this.constant = w;
- return this;
- }
- setFromNormalAndCoplanarPoint(normal, point) {
- this.normal.copy(normal);
- this.constant = -point.dot(this.normal);
- return this;
- }
- setFromCoplanarPoints(a, b, c) {
- const normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize();
- this.setFromNormalAndCoplanarPoint(normal, a);
- return this;
- }
- copy(plane) {
- this.normal.copy(plane.normal);
- this.constant = plane.constant;
- return this;
- }
- normalize() {
- const inverseNormalLength = 1 / this.normal.length();
- this.normal.multiplyScalar(inverseNormalLength);
- this.constant *= inverseNormalLength;
- return this;
- }
- negate() {
- this.constant *= -1;
- this.normal.negate();
- return this;
- }
- distanceToPoint(point) {
- return this.normal.dot(point) + this.constant;
- }
- distanceToSphere(sphere) {
- return this.distanceToPoint(sphere.center) - sphere.radius;
- }
- projectPoint(point, target) {
- return target.copy(point).addScaledVector(this.normal, -this.distanceToPoint(point));
- }
- intersectLine(line, target) {
- const direction = line.delta(_vector1);
- const denominator = this.normal.dot(direction);
- if (denominator === 0) {
- if (this.distanceToPoint(line.start) === 0) {
- return target.copy(line.start);
- }
- return null;
- }
- const t2 = -(line.start.dot(this.normal) + this.constant) / denominator;
- if (t2 < 0 || t2 > 1) {
- return null;
- }
- return target.copy(line.start).addScaledVector(direction, t2);
- }
- intersectsLine(line) {
- const startSign = this.distanceToPoint(line.start);
- const endSign = this.distanceToPoint(line.end);
- return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;
- }
- intersectsBox(box) {
- return box.intersectsPlane(this);
- }
- intersectsSphere(sphere) {
- return sphere.intersectsPlane(this);
- }
- coplanarPoint(target) {
- return target.copy(this.normal).multiplyScalar(-this.constant);
- }
- applyMatrix4(matrix, optionalNormalMatrix) {
- const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);
- const referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);
- const normal = this.normal.applyMatrix3(normalMatrix).normalize();
- this.constant = -referencePoint.dot(normal);
- return this;
- }
- translate(offset) {
- this.constant -= offset.dot(this.normal);
- return this;
- }
- equals(plane) {
- return plane.normal.equals(this.normal) && plane.constant === this.constant;
- }
- clone() {
- return new this.constructor().copy(this);
- }
-}
-const _sphere$5 = /* @__PURE__ */ new Sphere();
-const _vector$7 = /* @__PURE__ */ new Vector3();
-class Frustum {
- static {
- __name(this, "Frustum");
- }
- constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {
- this.planes = [p0, p1, p2, p3, p4, p5];
- }
- set(p0, p1, p2, p3, p4, p5) {
- const planes = this.planes;
- planes[0].copy(p0);
- planes[1].copy(p1);
- planes[2].copy(p2);
- planes[3].copy(p3);
- planes[4].copy(p4);
- planes[5].copy(p5);
- return this;
- }
- copy(frustum) {
- const planes = this.planes;
- for (let i = 0; i < 6; i++) {
- planes[i].copy(frustum.planes[i]);
- }
- return this;
- }
- setFromProjectionMatrix(m, coordinateSystem = WebGLCoordinateSystem) {
- const planes = this.planes;
- const me = m.elements;
- const me0 = me[0], me1 = me[1], me2 = me[2], me3 = me[3];
- const me4 = me[4], me5 = me[5], me6 = me[6], me7 = me[7];
- const me8 = me[8], me9 = me[9], me10 = me[10], me11 = me[11];
- const me12 = me[12], me13 = me[13], me14 = me[14], me15 = me[15];
- planes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize();
- planes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize();
- planes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize();
- planes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize();
- planes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize();
- if (coordinateSystem === WebGLCoordinateSystem) {
- planes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize();
- } else if (coordinateSystem === WebGPUCoordinateSystem) {
- planes[5].setComponents(me2, me6, me10, me14).normalize();
- } else {
- throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + coordinateSystem);
- }
- return this;
- }
- intersectsObject(object) {
- if (object.boundingSphere !== void 0) {
- if (object.boundingSphere === null) object.computeBoundingSphere();
- _sphere$5.copy(object.boundingSphere).applyMatrix4(object.matrixWorld);
- } else {
- const geometry = object.geometry;
- if (geometry.boundingSphere === null) geometry.computeBoundingSphere();
- _sphere$5.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);
- }
- return this.intersectsSphere(_sphere$5);
- }
- intersectsSprite(sprite) {
- _sphere$5.center.set(0, 0, 0);
- _sphere$5.radius = 0.7071067811865476;
- _sphere$5.applyMatrix4(sprite.matrixWorld);
- return this.intersectsSphere(_sphere$5);
- }
- intersectsSphere(sphere) {
- const planes = this.planes;
- const center = sphere.center;
- const negRadius = -sphere.radius;
- for (let i = 0; i < 6; i++) {
- const distance = planes[i].distanceToPoint(center);
- if (distance < negRadius) {
- return false;
- }
- }
- return true;
- }
- intersectsBox(box) {
- const planes = this.planes;
- for (let i = 0; i < 6; i++) {
- const plane = planes[i];
- _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;
- _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;
- _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;
- if (plane.distanceToPoint(_vector$7) < 0) {
- return false;
- }
- }
- return true;
- }
- containsPoint(point) {
- const planes = this.planes;
- for (let i = 0; i < 6; i++) {
- if (planes[i].distanceToPoint(point) < 0) {
- return false;
- }
- }
- return true;
- }
- clone() {
- return new this.constructor().copy(this);
- }
-}
-function WebGLAnimation() {
- let context = null;
- let isAnimating = false;
- let animationLoop = null;
- let requestId = null;
- function onAnimationFrame(time, frame) {
- animationLoop(time, frame);
- requestId = context.requestAnimationFrame(onAnimationFrame);
- }
- __name(onAnimationFrame, "onAnimationFrame");
- return {
- start: /* @__PURE__ */ __name(function() {
- if (isAnimating === true) return;
- if (animationLoop === null) return;
- requestId = context.requestAnimationFrame(onAnimationFrame);
- isAnimating = true;
- }, "start"),
- stop: /* @__PURE__ */ __name(function() {
- context.cancelAnimationFrame(requestId);
- isAnimating = false;
- }, "stop"),
- setAnimationLoop: /* @__PURE__ */ __name(function(callback) {
- animationLoop = callback;
- }, "setAnimationLoop"),
- setContext: /* @__PURE__ */ __name(function(value) {
- context = value;
- }, "setContext")
- };
-}
-__name(WebGLAnimation, "WebGLAnimation");
-function WebGLAttributes(gl) {
- const buffers = /* @__PURE__ */ new WeakMap();
- function createBuffer(attribute, bufferType) {
- const array = attribute.array;
- const usage = attribute.usage;
- const size = array.byteLength;
- const buffer = gl.createBuffer();
- gl.bindBuffer(bufferType, buffer);
- gl.bufferData(bufferType, array, usage);
- attribute.onUploadCallback();
- let type;
- if (array instanceof Float32Array) {
- type = gl.FLOAT;
- } else if (array instanceof Uint16Array) {
- if (attribute.isFloat16BufferAttribute) {
- type = gl.HALF_FLOAT;
- } else {
- type = gl.UNSIGNED_SHORT;
- }
- } else if (array instanceof Int16Array) {
- type = gl.SHORT;
- } else if (array instanceof Uint32Array) {
- type = gl.UNSIGNED_INT;
- } else if (array instanceof Int32Array) {
- type = gl.INT;
- } else if (array instanceof Int8Array) {
- type = gl.BYTE;
- } else if (array instanceof Uint8Array) {
- type = gl.UNSIGNED_BYTE;
- } else if (array instanceof Uint8ClampedArray) {
- type = gl.UNSIGNED_BYTE;
- } else {
- throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array);
- }
- return {
- buffer,
- type,
- bytesPerElement: array.BYTES_PER_ELEMENT,
- version: attribute.version,
- size
- };
- }
- __name(createBuffer, "createBuffer");
- function updateBuffer(buffer, attribute, bufferType) {
- const array = attribute.array;
- const updateRanges = attribute.updateRanges;
- gl.bindBuffer(bufferType, buffer);
- if (updateRanges.length === 0) {
- gl.bufferSubData(bufferType, 0, array);
- } else {
- updateRanges.sort((a, b) => a.start - b.start);
- let mergeIndex = 0;
- for (let i = 1; i < updateRanges.length; i++) {
- const previousRange = updateRanges[mergeIndex];
- const range = updateRanges[i];
- if (range.start <= previousRange.start + previousRange.count + 1) {
- previousRange.count = Math.max(
- previousRange.count,
- range.start + range.count - previousRange.start
- );
- } else {
- ++mergeIndex;
- updateRanges[mergeIndex] = range;
- }
- }
- updateRanges.length = mergeIndex + 1;
- for (let i = 0, l = updateRanges.length; i < l; i++) {
- const range = updateRanges[i];
- gl.bufferSubData(
- bufferType,
- range.start * array.BYTES_PER_ELEMENT,
- array,
- range.start,
- range.count
- );
- }
- attribute.clearUpdateRanges();
- }
- attribute.onUploadCallback();
- }
- __name(updateBuffer, "updateBuffer");
- function get(attribute) {
- if (attribute.isInterleavedBufferAttribute) attribute = attribute.data;
- return buffers.get(attribute);
- }
- __name(get, "get");
- function remove(attribute) {
- if (attribute.isInterleavedBufferAttribute) attribute = attribute.data;
- const data = buffers.get(attribute);
- if (data) {
- gl.deleteBuffer(data.buffer);
- buffers.delete(attribute);
- }
- }
- __name(remove, "remove");
- function update(attribute, bufferType) {
- if (attribute.isInterleavedBufferAttribute) attribute = attribute.data;
- if (attribute.isGLBufferAttribute) {
- const cached = buffers.get(attribute);
- if (!cached || cached.version < attribute.version) {
- buffers.set(attribute, {
- buffer: attribute.buffer,
- type: attribute.type,
- bytesPerElement: attribute.elementSize,
- version: attribute.version
- });
- }
- return;
- }
- const data = buffers.get(attribute);
- if (data === void 0) {
- buffers.set(attribute, createBuffer(attribute, bufferType));
- } else if (data.version < attribute.version) {
- if (data.size !== attribute.array.byteLength) {
- throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");
- }
- updateBuffer(data.buffer, attribute, bufferType);
- data.version = attribute.version;
- }
- }
- __name(update, "update");
- return {
- get,
- remove,
- update
- };
-}
-__name(WebGLAttributes, "WebGLAttributes");
-class PlaneGeometry extends BufferGeometry {
- static {
- __name(this, "PlaneGeometry");
- }
- constructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) {
- super();
- this.type = "PlaneGeometry";
- this.parameters = {
- width,
- height,
- widthSegments,
- heightSegments
- };
- const width_half = width / 2;
- const height_half = height / 2;
- const gridX = Math.floor(widthSegments);
- const gridY = Math.floor(heightSegments);
- const gridX1 = gridX + 1;
- const gridY1 = gridY + 1;
- const segment_width = width / gridX;
- const segment_height = height / gridY;
- const indices = [];
- const vertices = [];
- const normals = [];
- const uvs = [];
- for (let iy = 0; iy < gridY1; iy++) {
- const y = iy * segment_height - height_half;
- for (let ix = 0; ix < gridX1; ix++) {
- const x = ix * segment_width - width_half;
- vertices.push(x, -y, 0);
- normals.push(0, 0, 1);
- uvs.push(ix / gridX);
- uvs.push(1 - iy / gridY);
- }
- }
- for (let iy = 0; iy < gridY; iy++) {
- for (let ix = 0; ix < gridX; ix++) {
- const a = ix + gridX1 * iy;
- const b = ix + gridX1 * (iy + 1);
- const c = ix + 1 + gridX1 * (iy + 1);
- const d = ix + 1 + gridX1 * iy;
- indices.push(a, b, d);
- indices.push(b, c, d);
- }
- }
- this.setIndex(indices);
- this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
- this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
- this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
- }
- copy(source) {
- super.copy(source);
- this.parameters = Object.assign({}, source.parameters);
- return this;
- }
- static fromJSON(data) {
- return new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);
- }
-}
-var alphahash_fragment = "#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
-var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif";
-var alphamap_fragment = "#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";
-var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif";
-var alphatest_fragment = "#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif";
-var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif";
-var aomap_fragment = "#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif";
-var aomap_pars_fragment = "#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif";
-var batching_pars_vertex = "#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif";
-var batching_vertex = "#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif";
-var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif";
-var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif";
-var bsdfs = "float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated";
-var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif";
-var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif";
-var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif";
-var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";
-var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif";
-var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif";
-var color_fragment = "#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif";
-var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif";
-var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif";
-var color_vertex = "#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif";
-var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated";
-var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif";
-var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif";
-var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif";
-var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif";
-var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif";
-var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif";
-var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
-var colorspace_pars_fragment = "vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
-var envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif";
-var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif";
-var envmap_pars_fragment = "#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif";
-var envmap_pars_vertex = "#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif";
-var envmap_vertex = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif";
-var fog_vertex = "#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif";
-var fog_pars_vertex = "#ifdef USE_FOG\n varying float vFogDepth;\n#endif";
-var fog_fragment = "#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif";
-var fog_pars_fragment = "#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif";
-var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}";
-var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif";
-var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
-var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert";
-var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif";
-var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif";
-var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
-var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon";
-var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
-var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong";
-var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif";
-var lights_physical_pars_fragment = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
-var lights_fragment_begin = "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
-var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif";
-var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif";
-var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
-var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
-var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif";
-var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif";
-var map_fragment = "#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif";
-var map_pars_fragment = "#ifdef USE_MAP\n uniform sampler2D map;\n#endif";
-var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif";
-var map_particle_pars_fragment = "#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif";
-var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif";
-var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif";
-var morphinstance_vertex = "#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif";
-var morphcolor_vertex = "#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif";
-var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif";
-var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif";
-var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif";
-var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;";
-var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
-var normal_pars_fragment = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
-var normal_pars_vertex = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif";
-var normal_vertex = "#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif";
-var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif";
-var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif";
-var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif";
-var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif";
-var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif";
-var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
-var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}";
-var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif";
-var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;";
-var dithering_fragment = "#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif";
-var dithering_pars_fragment = "#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif";
-var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif";
-var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif";
-var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif";
-var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif";
-var shadowmap_vertex = "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif";
-var shadowmask_pars_fragment = "float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}";
-var skinbase_vertex = "#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
-var skinning_pars_vertex = "#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif";
-var skinning_vertex = "#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif";
-var skinnormal_vertex = "#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif";
-var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif";
-var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif";
-var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
-var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
-var transmission_fragment = "#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif";
-var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n \n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n \n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n \n #else\n \n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n \n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif";
-var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif";
-var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif";
-var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";
-var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif";
-const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
-const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}";
-const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}";
-const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}";
-const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}";
-const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}";
-const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}";
-const fragment$e = "#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}";
-const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}";
-const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}";
-const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}";
-const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}";
-const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
-const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}";
-const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
-const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}";
-const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}";
-const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include