diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d59d25c0..b4b8643d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,6 +47,32 @@ jobs:
GOOS=${p%/*} GOARCH=${p#*/} CGO_ENABLED=0 go build -o /dev/null .
done
+ vm:
+ # Boots a real virtual machine (the Ubuntu cloud image under QEMU/KVM inside a
+ # Docker container) through the EC2 API and checks SSH, cloud-init user data,
+ # the metadata service, stop/start, security groups and cleanup. Only this
+ # test runs here; the rest of the suite is in the go job.
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ defaults:
+ run:
+ working-directory: cli
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-go@v5
+ with:
+ go-version-file: cli/go.mod
+ - name: Enable KVM
+ run: |
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
+ sudo udevadm control --reload-rules
+ sudo udevadm trigger --name-match=kvm
+ ls -l /dev/kvm
+ - name: VM instances
+ run: go test -count=1 -timeout 40m -v -run 'TestVMInstanceLifecycle|TestVMDisksImagesAndBackup' ./internal/svc/ec2
+ env:
+ HC_TEST_VM: "1"
+
console:
runs-on: ubuntu-latest
defaults:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14fe4da7..536fa51c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,14 @@
- Cognito user pools support `USER_SRP_AUTH` (Amplify, amazon-cognito-identity-js, pycognito), `ForgotPassword`/`ConfirmForgotPassword` and `AdminResetUserPassword`. Existing users need their password set again (or one `USER_PASSWORD_AUTH` sign-in) before SRP works.
- CloudFormation updates behave like AWS: queues, topics, parameters, functions, roles, tables, alarms and other resources change in place, replacements create the new resource before deleting the old one, and a failed update rolls back to the previous template (`UPDATE_ROLLBACK_COMPLETE`, `ContinueUpdateRollback`, `DisableRollback`). A replacement that keeps a custom resource name now fails, as in AWS.
+### EC2
+- VM instances: `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` boot the official cloud image as a QEMU virtual machine with its own kernel, systemd and cloud-init. The VM runs inside a container attached to the instance's VPC network with its private IP, so DNS, the metadata service, security groups and published ports work as for container instances; passt gives the guest the container's address and forwards inbound ports. Key pairs, user data (scripts and `#cloud-config`), the root block device size, stop/start/reboot, console output and terminate work through the same EC2 API, CLI, console and Terraform.
+- Guests use KVM when the Docker host has `/dev/kvm` and are emulated (slower) otherwise; instances report `virtualization: "kvm"` or `"emulated"`. `DescribeImages` and `DescribeInstances` report `Hypervisor: kvm` for VM images and instances. Cloud images are pinned to a release, verified by checksum and downloaded once into a Docker volume; the runner image is built locally on first use.
+- VM disks: extra EBS volumes (`BlockDeviceMappings`, `AttachVolume`, `DetachVolume`) are virtio disks in the guest; attaching or detaching reboots the guest because Docker cannot add mounts to a running container. `CreateSnapshot` and `CreateImage` flatten a VM's root disk into a standalone copy, instances launch from such images, and `homecloud backup` archives a VM's root disk as a standalone image. After a restore, a VM instance whose container is gone is recreated from its disk and left stopped.
+- VM containers use Docker's default seccomp profile plus `unshare`, `mount`, `umount2` and `pivot_root` (what passt's sandbox needs) instead of an unconfined one; AppArmor is unconfined (`HC_VM_APPARMOR` names a profile instead).
+- VM instances have run-command (through qemu-guest-agent, installed by cloud-init), the browser terminal (the guest's serial console; log in with a password set by user data) and CloudWatch `HC/EC2` metrics measured inside the guest (CPU, memory, network, disk, process count), all under the same IAM actions as container instances.
+- CI boots a VM with KVM on every change.
+
## 0.3.0 (2026-09-30)
Every service in the console now speaks the AWS protocols, security groups filter traffic inside a VPC, and there's a demo console on the website.
diff --git a/README.md b/README.md
index b53e5372..9ba60954 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
- **Your AWS code, unchanged.** HomeCloud speaks the AWS wire protocols (SigV4, awsJson, awsQuery, REST). Set `AWS_ENDPOINT_URL` and the AWS CLI, boto3 and the Terraform AWS provider work against it, with IAM policies enforced as on AWS.
-- **Real compute, not mocks.** Lambda runs on AWS's official runtime images, RDS is a real PostgreSQL/MySQL/MariaDB, S3 is MinIO, EC2 instances are containers you can shell into, load balancers are nginx, security groups are iptables rules. Your integration tests hit the same kind of thing production does.
+- **Real compute, not mocks.** Lambda runs on AWS's official runtime images, RDS is a real PostgreSQL/MySQL/MariaDB, S3 is MinIO, EC2 instances are containers you can shell into or full VMs under QEMU/KVM, load balancers are nginx, security groups are iptables rules. Your integration tests hit the same kind of thing production does.
- **See what happened.** A web console modeled on AWS's, CloudWatch logs and metrics for every resource, and a CloudTrail record of every AWS API call, so a failed test run can be inspected instead of guessed at.
Built for **developers who want a real AWS-compatible target for local development and CI**. It also suits **college labs** teaching AWS without accounts or bills, and **small teams and homelabs** that want AWS tooling on their own hardware.
@@ -93,7 +93,7 @@ Run `homecloud aws-env` to get the environment variables. For Terraform, point t
| Service | AWS equivalent | Status | Notes |
| --- | --- | --- | --- |
-| Compute | EC2, EBS, AMIs | AWS API | Instances are **containers**, not VMs (VM-backed instances are in progress, [#3](https://github.com/solinode/homecloud/issues/3)). Key pairs, user data, volumes, snapshots, launch templates, Elastic IPs (records only), IMDSv1/v2, browser shell |
+| Compute | EC2, EBS, AMIs | AWS API | Instances are **containers**; `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` boot real **virtual machines** (QEMU, KVM when the host has `/dev/kvm`, emulated otherwise) on the same VPC networking, with extra volumes, snapshots, images, run-command and a serial console. Key pairs, user data, volumes, snapshots, launch templates, Elastic IPs (records only), IMDSv1/v2, browser shell |
| Auto Scaling | EC2 Auto Scaling | AWS API | Target tracking on CPU; scheduled actions and lifecycle hooks are not implemented |
| Networking | VPC, security groups | AWS API | Security groups enforced inside the VPC; network ACLs recorded, not enforced; no peering; IPv4 only |
| Load balancing | ELB v2 | AWS API | Application load balancers (HTTP/HTTPS, path/host rules). No network load balancers |
@@ -184,7 +184,7 @@ HomeCloud needs the Docker socket, which is root-equivalent on the host: treat H
## Roadmap
-- **In progress:** VM-backed instances with QEMU/KVM ([#3](https://github.com/solinode/homecloud/issues/3)), a container image for one-command starts
+- **In progress:** a container image for one-command starts
- **Planned:** multi-node clusters ([#55](https://github.com/solinode/homecloud/issues/55)), edge compute and hardware integrations ([#56](https://github.com/solinode/homecloud/issues/56))
See the [open issues](https://github.com/solinode/homecloud/issues) for everything planned.
diff --git a/cli/internal/runtime/docker.go b/cli/internal/runtime/docker.go
index f87dab3a..6c29b234 100644
--- a/cli/internal/runtime/docker.go
+++ b/cli/internal/runtime/docker.go
@@ -74,27 +74,30 @@ type Mount struct {
}
type RunSpec struct {
- Name string
- Image string
- Cmd []string
- Entrypoint []string
- Env map[string]string
- Labels map[string]string
- NanoCPUs int64
- MemoryMB int64
- Ports []Port
- Mounts []Mount
- Network string
- IP string
- Aliases []string
- Restart string // "", "unless-stopped", "always"
- WorkingDir string
- User string // run as this user (e.g. "0"); empty uses the image's default
- Hostname string
- DNS []string // upstream servers for Docker's embedded DNS
- ExtraHosts []string // "name:ip" entries for /etc/hosts ("host-gateway" is the Docker host)
- CapAdd []string // extra Linux capabilities (e.g. NET_ADMIN)
- Start bool
+ Name string
+ Image string
+ Cmd []string
+ Entrypoint []string
+ Env map[string]string
+ Labels map[string]string
+ NanoCPUs int64
+ MemoryMB int64
+ Ports []Port
+ Mounts []Mount
+ Network string
+ IP string
+ Aliases []string
+ Restart string // "", "unless-stopped", "always"
+ WorkingDir string
+ User string // run as this user (e.g. "0"); empty uses the image's default
+ Hostname string
+ DNS []string // upstream servers for Docker's embedded DNS
+ ExtraHosts []string // "name:ip" entries for /etc/hosts ("host-gateway" is the Docker host)
+ CapAdd []string // extra Linux capabilities (e.g. NET_ADMIN)
+ Devices []string // host devices passed through (e.g. /dev/kvm)
+ SecurityOpt []string // e.g. seccomp=unconfined
+ NoFile int64 // raise the open-file limit (soft and hard) to this; 0 keeps the default
+ Start bool
}
// HostAlias makes the Docker host reachable from containers as host.docker.internal
@@ -159,6 +162,13 @@ func (d *Docker) Run(ctx context.Context, s RunSpec) (string, error) {
hc.CPUPeriod, hc.CPUQuota = 100000, s.NanoCPUs/10000
}
hc.CapAdd = s.CapAdd
+ hc.SecurityOpt = s.SecurityOpt
+ if s.NoFile > 0 {
+ hc.Ulimits = []docker.ULimit{{Name: "nofile", Soft: s.NoFile, Hard: s.NoFile}}
+ }
+ for _, dev := range s.Devices {
+ hc.Devices = append(hc.Devices, docker.Device{PathOnHost: dev, PathInContainer: dev, CgroupPermissions: "rwm"})
+ }
if s.Restart != "" {
hc.RestartPolicy = docker.RestartPolicy{Name: s.Restart}
}
diff --git a/cli/internal/runtime/netns.go b/cli/internal/runtime/netns.go
index f44b8042..e3024273 100644
--- a/cli/internal/runtime/netns.go
+++ b/cli/internal/runtime/netns.go
@@ -14,16 +14,24 @@ import (
// BuildImage builds tag from a single Dockerfile unless the image already exists.
func (d *Docker) BuildImage(ctx context.Context, tag, dockerfile string) error {
+ return d.BuildImageFiles(ctx, tag, map[string][]byte{"Dockerfile": []byte(dockerfile)})
+}
+
+// BuildImageFiles builds tag from a build context (path -> content, including
+// the Dockerfile) unless the image already exists.
+func (d *Docker) BuildImageFiles(ctx context.Context, tag string, files map[string][]byte) error {
if _, err := d.C.InspectImage(tag); err == nil {
return nil
}
var buf bytes.Buffer
tw := tar.NewWriter(&buf)
- if err := tw.WriteHeader(&tar.Header{Name: "Dockerfile", Mode: 0o644, Size: int64(len(dockerfile)), ModTime: time.Now()}); err != nil {
- return err
- }
- if _, err := tw.Write([]byte(dockerfile)); err != nil {
- return err
+ for name, content := range files {
+ if err := tw.WriteHeader(&tar.Header{Name: name, Mode: 0o644, Size: int64(len(content)), ModTime: time.Now()}); err != nil {
+ return err
+ }
+ if _, err := tw.Write(content); err != nil {
+ return err
+ }
}
if err := tw.Close(); err != nil {
return err
diff --git a/cli/internal/runtime/oneshot.go b/cli/internal/runtime/oneshot.go
new file mode 100644
index 00000000..d684b2c8
--- /dev/null
+++ b/cli/internal/runtime/oneshot.go
@@ -0,0 +1,34 @@
+package runtime
+
+import (
+ "context"
+ "fmt"
+ "strings"
+ "time"
+)
+
+// RunOnce runs a short-lived container to completion and returns its output.
+// A non-zero exit is an error (with the output in it). The container is removed.
+func (d *Docker) RunOnce(ctx context.Context, s RunSpec) (string, error) {
+ s.Start = false
+ if s.Labels == nil {
+ s.Labels = Labels("ec2", "helper", nil)
+ }
+ id, err := d.Run(ctx, s)
+ if err != nil {
+ return "", err
+ }
+ defer func() { _ = d.Remove(id) }()
+ if err := d.C.StartContainerWithContext(id, nil, ctx); err != nil {
+ return "", fmt.Errorf("start container: %w", err)
+ }
+ code, err := d.C.WaitContainerWithContext(id, ctx)
+ out, _ := d.Logs(id, 200, time.Time{})
+ if err != nil {
+ return out, err
+ }
+ if code != 0 {
+ return out, fmt.Errorf("exit %d: %s", code, strings.TrimSpace(out))
+ }
+ return out, nil
+}
diff --git a/cli/internal/server/server.go b/cli/internal/server/server.go
index a695a97f..61484e90 100644
--- a/cli/internal/server/server.go
+++ b/cli/internal/server/server.go
@@ -178,6 +178,7 @@ func Run(ctx context.Context, cfg core.Config, opts Options) error {
}
ec2Svc := ec2.New(env, vpcSvc)
ec2Svc.Recover()
+ cw.GuestUsage = ec2Svc.GuestUsage
s3Svc := s3.New(env, secSvc)
vpcSvc.AfterCreate = func(v vpc.VPC) {
s3Svc.ConnectNetwork(v)
@@ -280,7 +281,7 @@ func Run(ctx context.Context, cfg core.Config, opts Options) error {
}
backup := &system.Backup{Cfg: cfg, Docker: dk, AccountID: account, Version: Version,
- Snapshots: map[string]func(io.Writer) error{"dynamodb.db": ddb.Snapshot}}
+ Snapshots: map[string]func(io.Writer) error{"dynamodb.db": ddb.Snapshot}, Flatten: ec2Svc.FlattenForBackup}
mux := http.NewServeMux()
rt := &httpx.Router{Mux: mux, Auth: iamSvc, Account: account, Audit: trailSvc.Record}
for _, s := range []routable{iamSvc, secSvc, cw, vpcSvc, ec2Svc, s3Svc, rdsSvc, lambdaSvc, sqsSvc, snsSvc, ddb, eventsSvc, kmsSvc, ssmSvc, ecrSvc, elbSvc, ecsSvc, sfnSvc, cfnSvc, cognitoSvc, asgSvc, acmSvc, dnsSvc, trailSvc, backup} {
diff --git a/cli/internal/svc/cloudwatch/metrics.go b/cli/internal/svc/cloudwatch/metrics.go
index c83dc64a..f9a47a00 100644
--- a/cli/internal/svc/cloudwatch/metrics.go
+++ b/cli/internal/svc/cloudwatch/metrics.go
@@ -17,6 +17,7 @@ import (
"github.com/homecloudhq/homecloud/cli/internal/core"
"github.com/homecloudhq/homecloud/cli/internal/httpx"
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
"github.com/homecloudhq/homecloud/cli/internal/svc"
)
@@ -110,6 +111,11 @@ type Service struct {
Notify Notifier
// Deliver sends log subscription payloads to a Lambda function ARN.
Deliver func(ctx context.Context, arn string, payload []byte) error
+ // GuestUsage samples the guest of a virtual-machine EC2 instance (through its
+ // guest agent), so its metrics describe the guest rather than the QEMU
+ // container. While it returns an error (agent not up yet) nothing is published.
+ GuestUsage func(ctx context.Context, instanceID string) (*runtime.Usage, error)
+ guestBusy sync.Map // container ID -> true while a guest sample is running
}
func New(env *svc.Env) (*Service, error) {
@@ -294,6 +300,35 @@ func (s *Service) collect(ctx context.Context) {
continue
}
res := c.Labels[core.LabelResource]
+ publish := func(id string, u *runtime.Usage, at time.Time) {
+ dims := map[string]string{n.dim: res}
+ s.Put(n.ns, "CPUUtilization", dims, "Percent", round(u.CPUPercent), at)
+ s.Put(n.ns, "MemoryUtilization", dims, "Percent", round(u.MemoryPercent), at)
+ s.Put(n.ns, "MemoryUsed", dims, "Bytes", float64(u.MemoryBytes), at)
+ s.Put(n.ns, "NetworkIn", dims, "Bytes", s.delta(id+"rx", u.NetRxBytes), at)
+ s.Put(n.ns, "NetworkOut", dims, "Bytes", s.delta(id+"tx", u.NetTxBytes), at)
+ s.Put(n.ns, "DiskReadBytes", dims, "Bytes", s.delta(id+"br", u.BlockRead), at)
+ s.Put(n.ns, "DiskWriteBytes", dims, "Bytes", s.delta(id+"bw", u.BlockWrite), at)
+ s.Put(n.ns, "ProcessCount", dims, "Count", float64(u.Pids), at)
+ }
+ if s.GuestUsage != nil && c.Labels[core.LabelService] == "ec2" && c.Labels["homecloud.virtualization"] != "" {
+ // A guest sample takes a second or more, and much longer while the
+ // guest agent is not up yet: it runs on its own so it never holds up
+ // the tick, and one per instance at a time.
+ if _, busy := s.guestBusy.LoadOrStore(c.ID, true); busy {
+ continue
+ }
+ go func(id string) {
+ defer core.Recover("cloudwatch guest sample " + res)
+ defer s.guestBusy.Delete(id)
+ sctx, cancel := context.WithTimeout(ctx, 30*time.Second)
+ defer cancel()
+ if u, err := s.GuestUsage(sctx, res); err == nil {
+ publish(id, u, time.Now().UTC())
+ }
+ }(c.ID)
+ continue
+ }
wg.Add(1)
sem <- struct{}{}
go func(id string) {
@@ -305,15 +340,7 @@ func (s *Service) collect(ctx context.Context) {
if err != nil {
return
}
- dims := map[string]string{n.dim: res}
- s.Put(n.ns, "CPUUtilization", dims, "Percent", round(u.CPUPercent), now)
- s.Put(n.ns, "MemoryUtilization", dims, "Percent", round(u.MemoryPercent), now)
- s.Put(n.ns, "MemoryUsed", dims, "Bytes", float64(u.MemoryBytes), now)
- s.Put(n.ns, "NetworkIn", dims, "Bytes", s.delta(id+"rx", u.NetRxBytes), now)
- s.Put(n.ns, "NetworkOut", dims, "Bytes", s.delta(id+"tx", u.NetTxBytes), now)
- s.Put(n.ns, "DiskReadBytes", dims, "Bytes", s.delta(id+"br", u.BlockRead), now)
- s.Put(n.ns, "DiskWriteBytes", dims, "Bytes", s.delta(id+"bw", u.BlockWrite), now)
- s.Put(n.ns, "ProcessCount", dims, "Count", float64(u.Pids), now)
+ publish(id, u, now)
}(c.ID)
}
wg.Wait()
diff --git a/cli/internal/svc/ec2/aws.go b/cli/internal/svc/ec2/aws.go
index 144ef035..8f00cae9 100644
--- a/cli/internal/svc/ec2/aws.go
+++ b/cli/internal/svc/ec2/aws.go
@@ -393,6 +393,15 @@ func (s *Service) awsDescribeAccountAttributes(q *awsapi.Req) (any, error) {
// ---- images and instance types ----
+// hypervisor is what the EC2 API reports: instances that run as containers keep
+// the "xen" of the real service's older families; virtual machines are QEMU/KVM.
+func hypervisor(vm bool) string {
+ if vm {
+ return "kvm"
+ }
+ return "xen"
+}
+
func (s *Service) awsName(im Image) string {
if im.AWSName == "" {
return im.Name
@@ -418,9 +427,12 @@ func (s *Service) allImages() []Image {
out := []Image{}
for _, im := range catalog {
im.Owner, im.State = "homecloud", "available"
- out = append(out, im)
+ out = append(out, im.normalized())
+ }
+ for _, im := range store.List[Image](s.env.Store, cImages) {
+ out = append(out, im.normalized())
}
- return append(out, store.List[Image](s.env.Store, cImages)...)
+ return out
}
func (s *Service) imageXML(im Image) map[string]any {
@@ -433,7 +445,7 @@ func (s *Service) imageXML(im Image) map[string]any {
"imageId": im.ID, "imageLocation": owner + "/" + s.awsName(im), "imageState": im.State, "imageOwnerId": owner,
"creationDate": created, "isPublic": im.Owner == "homecloud", "architecture": hostArch(s), "imageType": "machine",
"platformDetails": "Linux/UNIX", "usageOperation": "RunInstances", "name": s.awsName(im), "description": im.Description,
- "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda", "virtualizationType": "hvm", "hypervisor": "xen", "enaSupport": true,
+ "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda", "virtualizationType": "hvm", "hypervisor": hypervisor(im.IsVM()), "enaSupport": true,
"bootMode": "uefi-preferred", "tagSet": tagSet(im.Tags), "productCodes": awsapi.Items{},
"blockDeviceMapping": awsapi.Items{map[string]any{"deviceName": "/dev/xvda",
"ebs": map[string]any{"volumeSize": 8, "deleteOnTermination": true, "volumeType": "gp3", "encrypted": false}}},
@@ -465,7 +477,7 @@ func (s *Service) awsDescribeImages(q *awsapi.Req) (any, error) {
a := attrs{}.set("image-id", im.ID).set("name", s.awsName(im)).set("owner-id", owner).set("owner-alias", alias).
set("state", im.State).set("architecture", hostArch(s)).set("virtualization-type", "hvm").set("root-device-type", "ebs").
set("root-device-name", "/dev/xvda").set("image-type", "machine").set("is-public", strconv.FormatBool(im.Owner == "homecloud")).
- set("platform-details", "Linux/UNIX").set("description", im.Description).set("hypervisor", "xen").
+ set("platform-details", "Linux/UNIX").set("description", im.Description).set("hypervisor", hypervisor(im.IsVM())).
set("block-device-mapping.volume-type", "gp3").set("ena-support", "true").tags(im.Tags)
if !match(fs, a) {
continue
@@ -628,7 +640,7 @@ func (s *Service) instanceXML(i Instance) map[string]any {
"launchTime": i.LaunchTime, "placement": map[string]any{"availabilityZone": i.AvailabilityZone, "groupName": "", "tenancy": "default"},
"monitoring": map[string]any{"state": monitoring}, "architecture": hostArch(s), "rootDeviceType": "ebs", "rootDeviceName": "/dev/xvda",
"blockDeviceMapping": bdm, "virtualizationType": "hvm", "clientToken": i.ClientToken, "tagSet": tagSet(s.tagsOf(i.ID, i.Name, i.Tags)),
- "hypervisor": "xen", "ebsOptimized": i.EBSOptimized, "enaSupport": true, "sourceDestCheck": !i.SourceDestCheckOff,
+ "hypervisor": hypervisor(i.IsVM()), "ebsOptimized": i.EBSOptimized, "enaSupport": true, "sourceDestCheck": !i.SourceDestCheckOff,
"groupSet": s.groupSet(i.SecurityGroups), "platformDetails": "Linux/UNIX", "usageOperation": "RunInstances",
"usageOperationUpdateTime": i.LaunchTime, "bootMode": "uefi", "currentInstanceBootMode": "uefi",
"cpuOptions": map[string]any{"coreCount": max(1, vcpus/2), "threadsPerCore": min(2, vcpus)},
@@ -852,8 +864,20 @@ func (s *Service) awsRunInstances(q *awsapi.Req) (any, error) {
HopLimit: q.ParamInt("MetadataOptions.HttpPutResponseHopLimit", 0), InstanceMetadataTags: q.Param("MetadataOptions.InstanceMetadataTags")}
for _, m := range q.Structs("BlockDeviceMapping") {
dev := m["DeviceName"]
- if dev == "" || m["NoDevice"] != "" || m["VirtualName"] != "" || dev == "/dev/xvda" || dev == "/dev/sda1" || dev == "/dev/sda" {
- continue // the root device is the instance's own disk
+ if dev == "/dev/xvda" || dev == "/dev/sda1" || dev == "/dev/sda" {
+ // The root device is the instance's own disk. Container instances have
+ // no separate root volume; VM instances size and keep theirs by it.
+ if m["NoDevice"] == "" && m["VirtualName"] == "" {
+ root := VolumeSpec{Device: dev, VolumeType: m["Ebs.VolumeType"], Iops: atoi(m["Ebs.Iops"]), Throughput: atoi(m["Ebs.Throughput"]),
+ SizeGB: atoi(m["Ebs.VolumeSize"]), Encrypted: m["Ebs.Encrypted"] == "true", KMSKeyID: m["Ebs.KmsKeyId"]}
+ del := m["Ebs.DeleteOnTermination"] != "false"
+ root.DeleteOnTermination = &del
+ in.RootVolume = &root
+ }
+ continue
+ }
+ if dev == "" || m["NoDevice"] != "" || m["VirtualName"] != "" {
+ continue
}
if !deviceRE.MatchString(dev) {
return nil, invalid("Invalid device name %s", dev)
diff --git a/cli/internal/svc/ec2/capabilities.go b/cli/internal/svc/ec2/capabilities.go
new file mode 100644
index 00000000..22958f14
--- /dev/null
+++ b/cli/internal/svc/ec2/capabilities.go
@@ -0,0 +1,25 @@
+package ec2
+
+import "github.com/homecloudhq/homecloud/cli/internal/httpx"
+
+// Capabilities tells the console what this host can run, so the launch wizard
+// can warn before someone picks a VM image on a host without KVM.
+type Capabilities struct {
+ // VM is "kvm" when virtual machine instances run hardware-accelerated,
+ // "emulated" when the Docker host has no usable /dev/kvm (QEMU emulates the
+ // CPU, which is slow), and "unavailable" when VMs cannot run at all.
+ VM string `json:"vm"`
+}
+
+func (s *Service) capabilities(c *httpx.Ctx) (any, error) {
+ if s.env.Docker == nil {
+ return Capabilities{VM: "unavailable"}, nil
+ }
+ if s.vmRunnerFailure() != nil {
+ return Capabilities{VM: "unavailable"}, nil
+ }
+ if s.vmKVM() {
+ return Capabilities{VM: "kvm"}, nil
+ }
+ return Capabilities{VM: "emulated"}, nil
+}
diff --git a/cli/internal/svc/ec2/catalog.go b/cli/internal/svc/ec2/catalog.go
index e38890cc..49f39483 100644
--- a/cli/internal/svc/ec2/catalog.go
+++ b/cli/internal/svc/ec2/catalog.go
@@ -55,6 +55,30 @@ type Image struct {
AWSName string `json:"-"`
// OwnerID is the catalog image's owner in the EC2 API (the vendor's AWS account).
OwnerID string `json:"-"`
+ // VMBase names the cloud image (vm.Bases) a VM image boots; empty for images
+ // that run as containers. Ref is empty for VM images.
+ VMBase string `json:"vm_base,omitempty"`
+ // Images made from a VM instance (CreateImage) carry their own flattened
+ // disk in the Docker volume VMDisk instead of a VMBase, plus what a launch
+ // needs to know about it.
+ VMDisk string `json:"vm_disk,omitempty"`
+ VMUser string `json:"vm_user,omitempty"`
+ VMArch string `json:"vm_arch,omitempty"` // aarch64 | x86_64
+ VMDiskGB int `json:"vm_disk_gb,omitempty"`
+ // Virtualization is "vm" (QEMU guest with its own kernel) or "container".
+ Virtualization string `json:"virtualization"`
+}
+
+// IsVM reports whether the image boots a virtual machine.
+func (im Image) IsVM() bool { return im.VMBase != "" || im.VMDisk != "" }
+
+// normalized fills derived fields.
+func (im Image) normalized() Image {
+ im.Virtualization = "container"
+ if im.IsVM() {
+ im.Virtualization = "vm"
+ }
+ return im
}
var catalog = []Image{
@@ -64,6 +88,11 @@ var catalog = []Image{
AWSName: "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-{deb}-server-20240101", OwnerID: ownerCanonical},
{ID: "ami-debian-12", Name: "Debian 12", Description: "Debian GNU/Linux 12 (bookworm)", Ref: "debian:12", Platform: "linux", KeepAlive: true,
AWSName: "debian-12-{deb}-20240101-0000", OwnerID: ownerDebian},
+ // Virtual machine images: official cloud images booted under QEMU (see the vm package).
+ {ID: "ami-ubuntu-24-04-vm", Name: "Ubuntu Server 24.04 LTS (VM)", Description: "Canonical Ubuntu 24.04 (Noble Numbat) cloud image, booted as a virtual machine with its own kernel and cloud-init", Platform: "linux", VMBase: "ubuntu-24.04",
+ AWSName: "homecloud/vm/ubuntu-noble-24.04-{deb}-server-20260926", OwnerID: ownerCanonical},
+ {ID: "ami-debian-12-vm", Name: "Debian 12 (VM)", Description: "Debian GNU/Linux 12 (bookworm) cloud image, booted as a virtual machine with its own kernel and cloud-init", Platform: "linux", VMBase: "debian-12",
+ AWSName: "homecloud/vm/debian-12-{deb}-20260923-2610", OwnerID: ownerDebian},
{ID: "ami-amazonlinux-2023", Name: "Amazon Linux 2023", Description: "Amazon Linux 2023 base image", Ref: "amazonlinux:2023", Platform: "linux", KeepAlive: true,
AWSName: "al2023-ami-2023.0.20240101.0-kernel-6.1-{rpm}"},
{ID: "ami-rocky-9", Name: "Rocky Linux 9", Description: "Enterprise Linux compatible", Ref: "rockylinux:9", Platform: "linux", KeepAlive: true},
diff --git a/cli/internal/svc/ec2/ec2.go b/cli/internal/svc/ec2/ec2.go
index c8433b83..b3e37e17 100644
--- a/cli/internal/svc/ec2/ec2.go
+++ b/cli/internal/svc/ec2/ec2.go
@@ -20,6 +20,7 @@ import (
"github.com/homecloudhq/homecloud/cli/internal/runtime"
"github.com/homecloudhq/homecloud/cli/internal/store"
"github.com/homecloudhq/homecloud/cli/internal/svc"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm"
"github.com/homecloudhq/homecloud/cli/internal/svc/vpc"
)
@@ -116,8 +117,25 @@ type Instance struct {
// differs from the AMI (a volume attach recreates the container from a
// snapshot of its disk).
RootImage string `json:"root_image,omitempty"`
+
+ // Virtual machine instances (an AMI with a VMBase): "kvm" when the guest
+ // runs with hardware acceleration, "emulated" when the Docker host has no
+ // /dev/kvm and QEMU emulates the CPU (slow). Empty for container instances.
+ Virtualization string `json:"virtualization,omitempty"`
+ VMBase string `json:"vm_base,omitempty"` // key of the cloud image (vm.Bases)
+ VMUser string `json:"vm_user,omitempty"` // the image's default login user
+ VMDiskGB int `json:"vm_disk_gb,omitempty"` // root disk size
+ // VMNetwork is "passt" (the guest has the instance's address) or "user"
+ // (passt could not start: the guest is behind NAT with forwarded ports).
+ VMNetwork string `json:"vm_network,omitempty"`
+ // VMAMI is the Docker volume holding the disk of the image (made from an
+ // instance) the instance was launched from; the root disk was copied from it.
+ VMAMI string `json:"vm_ami,omitempty"`
}
+// IsVM reports whether the instance is a virtual machine.
+func (i Instance) IsVM() bool { return i.Virtualization != "" }
+
type Volume struct {
ID string `json:"id"`
Name string `json:"name"`
@@ -140,6 +158,8 @@ type Volume struct {
AttachTime time.Time `json:"attach_time,omitempty"`
DeleteOnTermination bool `json:"delete_on_termination,omitempty"`
AttachState string `json:"attach_state,omitempty"` // attaching | attached | detaching
+ // VMRoot is set on the root volume of a VM instance.
+ VMRoot bool `json:"vm_root,omitempty"`
}
func volumeName(id string) string { return "hc-" + id }
@@ -159,6 +179,12 @@ type Service struct {
// Roles resolves instance profiles and issues their role's credentials (IAM).
Roles Roles
imds *imds
+ // IMDSContainer names the metadata service container (default homecloud-imds).
+ // Tests running beside a real installation use their own.
+ IMDSContainer string
+ // VMImageVolume is the Docker volume caching downloaded cloud images.
+ VMImageVolume string
+ vm vmState
}
// Roles is what EC2 needs from IAM for instance profiles.
@@ -209,6 +235,12 @@ func (s *Service) sync(i Instance) Instance {
}
st := s.env.Docker.State(i.ContainerID)
want := i.State
+ if st == "missing" && i.IsVM() {
+ // The disk outlives the container (a restored backup has volumes but no containers).
+ if ri, ok := s.vmRecoverContainer(i); ok {
+ return ri
+ }
+ }
switch st {
case "running":
want = "running"
@@ -219,6 +251,7 @@ func (s *Service) sync(i Instance) Instance {
}
if i.State == "running" {
i.PublicPorts = s.env.Docker.PublishedPorts(i.ContainerID)
+ s.vmWatchPasst(i)
}
if want != i.State && !(i.State == "stopping" || i.State == "shutting-down") {
reason := ""
@@ -283,6 +316,7 @@ func (s *Service) Routes(r *httpx.Router) {
r.Handle("GET /api/v1/ec2/instances/{id}/terminal", "ec2-instance-connect:SendSSHPublicKey", s.terminal, res)
r.Handle("GET /api/v1/ec2/instance-types", "ec2:DescribeInstanceTypes", s.listTypes)
+ r.Handle("GET /api/v1/ec2/capabilities", "ec2:DescribeInstanceTypes", s.capabilities)
r.Handle("GET /api/v1/ec2/images", "ec2:DescribeImages", s.listImages)
r.Handle("POST /api/v1/ec2/images", "ec2:RegisterImage", s.registerImage)
imgRes := httpx.Res("arn:aws:ec2:{region}:{account}:image/{id}")
@@ -323,7 +357,11 @@ type RunInput struct {
Tags core.Tags `json:"tags"`
Volumes []VolumeSpec `json:"volumes"`
FileSystems []FSMount `json:"file_systems"`
- // KeyName puts a key pair's public key in root's authorized_keys.
+ // RootVolume sizes the root disk of a VM instance (default 8 GiB) and
+ // whether it is deleted on termination. Container instances ignore it.
+ RootVolume *VolumeSpec `json:"root_volume,omitempty"`
+ // KeyName puts a key pair's public key in root's authorized_keys (the
+ // default user's, for VM images).
KeyName string `json:"key_name"`
// IAMInstanceProfile (name or ARN) gives the instance its role's credentials
// through the metadata service. The caller must be allowed iam:PassRole.
@@ -370,14 +408,14 @@ func (s *Service) image(id string) (Image, error) {
for _, im := range catalog {
if im.ID == id {
im.Owner, im.State = "homecloud", "available"
- return im, nil
+ return im.normalized(), nil
}
}
im, err := store.Get[Image](s.env.Store, cImages, id)
if err != nil {
return im, core.NotFound("image", id)
}
- return im, nil
+ return im.normalized(), nil
}
// checkTags rejects user tags in the reserved hc: namespace (used by HomeCloud
@@ -459,6 +497,12 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
if err != nil {
return nil, err
}
+ var vmPlan vmPlan
+ if img.IsVM() {
+ if vmPlan, err = s.planVM(in, img); err != nil {
+ return nil, err
+ }
+ }
var key KeyPair
if in.KeyName != "" {
if key, err = s.keyPair(in.KeyName); err != nil {
@@ -491,7 +535,7 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
}
}
for _, v := range in.Volumes {
- if !strings.HasPrefix(v.MountPath, "/") {
+ if !img.IsVM() && !strings.HasPrefix(v.MountPath, "/") { // VM disks have a device, not a mount path
return nil, core.BadRequest("volume mount_path must be absolute")
}
if v.SnapshotID != "" {
@@ -558,6 +602,17 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
Monitoring: in.Attrs.Monitoring, EBSOptimized: in.Attrs.EBSOptimized, ReservationID: reservation, LaunchIndex: n,
ClientToken: in.Attrs.ClientToken, LaunchTemplateID: in.Attrs.LaunchTemplateID, LaunchTemplateVersion: in.Attrs.LaunchTemplateVersion,
}
+ vols := in.Volumes
+ if img.IsVM() {
+ inst.Virtualization, inst.VMBase, inst.VMUser, inst.VMDiskGB, inst.VMAMI = vmPlan.virtualization, img.VMBase, vmPlan.user, vmPlan.diskGB, vmPlan.ami
+ for n := range vols { // extra volumes: name their EBS device when the caller did not
+ if vols[n].Device == "" {
+ vols[n].Device = fmt.Sprintf("/dev/sd%c", 'f'+n)
+ }
+ }
+ inst.ImageRef = "" // a VM image has no Docker image
+ vols = append([]VolumeSpec{vmPlan.root}, vols...)
+ }
if inst.ShutdownBehavior == "" {
inst.ShutdownBehavior = "stop"
}
@@ -569,7 +624,7 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
s.releaseVolumes(inst)
s.vpc.Release(id)
}
- for _, v := range in.Volumes {
+ for _, v := range vols {
del := v.VolumeID == ""
if v.DeleteOnTermination != nil {
del = *v.DeleteOnTermination
@@ -581,7 +636,7 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
size = 8
}
vol, err := s.createVolume(VolumeInput{Size: size, AZ: pl.Subnet.AvailabilityZone, Tags: in.VolumeTags, Type: v.VolumeType,
- Iops: v.Iops, Throughput: v.Throughput, Encrypted: v.Encrypted, KMSKeyID: v.KMSKeyID, SnapshotID: v.SnapshotID, Sync: true})
+ Iops: v.Iops, Throughput: v.Throughput, Encrypted: v.Encrypted, KMSKeyID: v.KMSKeyID, SnapshotID: v.SnapshotID, Sync: true, VMRoot: img.IsVM() && v.MountPath == vm.DiskDir})
if err != nil {
undo()
return launched, err
@@ -608,7 +663,11 @@ func (s *Service) Launch(in RunInput) ([]Instance, error) {
return launched, err
}
launched = append(launched, inst)
- go s.launch(inst, pl.Network)
+ if inst.IsVM() {
+ go s.launchVM(inst, pl.Network)
+ } else {
+ go s.launch(inst, pl.Network)
+ }
}
return launched, nil
}
@@ -631,6 +690,9 @@ func checkMetadata(m MetadataOptions) error {
// runSpec is the container of an instance.
func (s *Service) runSpec(inst Instance, network string) runtime.RunSpec {
+ if inst.IsVM() {
+ return s.vmRunSpec(inst, network)
+ }
mounts := []runtime.Mount{}
for _, v := range inst.Volumes {
mounts = append(mounts, runtime.Mount{Volume: volumeName(v.VolumeID), Target: v.MountPath})
@@ -708,27 +770,30 @@ func (s *Service) bootFiles(inst Instance) (map[string][]byte, error) {
return files, nil
}
+// failLaunch terminates an instance whose launch failed and releases what it claimed.
+func (s *Service) failLaunch(inst Instance, err error) {
+ log.Printf("ec2: launch %s failed: %v", inst.ID, err)
+ already := false
+ _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error {
+ if x.State == "terminated" { // terminated while launching: already cleaned up
+ already = true
+ return nil
+ }
+ n := core.Now()
+ x.State, x.StateReason, x.TerminatedAt = "terminated", "Server.LaunchFailure: "+err.Error(), &n
+ return nil
+ })
+ if !already {
+ s.releaseVolumes(inst)
+ s.vpc.Release(inst.ID)
+ }
+}
+
// launch creates and boots the instance's container in the background.
func (s *Service) launch(inst Instance, network string) {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
defer cancel()
- fail := func(err error) {
- log.Printf("ec2: launch %s failed: %v", inst.ID, err)
- already := false
- _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error {
- if x.State == "terminated" { // terminated while launching: already cleaned up
- already = true
- return nil
- }
- n := core.Now()
- x.State, x.StateReason, x.TerminatedAt = "terminated", "Server.LaunchFailure: "+err.Error(), &n
- return nil
- })
- if !already {
- s.releaseVolumes(inst)
- s.vpc.Release(inst.ID)
- }
- }
+ fail := func(err error) { s.failLaunch(inst, err) }
cid, err := s.env.Docker.Run(ctx, s.runSpec(inst, network))
if err != nil {
fail(err)
@@ -823,6 +888,9 @@ func (s *Service) reboot(c *httpx.Ctx) (any, error) { return s.RebootInstance(c.
// StartInstance starts a stopped instance.
func (s *Service) StartInstance(id string) (any, error) {
return s.transition(id, []string{"stopped"}, func(i Instance) error {
+ if i.IsVM() {
+ return s.vmStart(i)
+ }
if err := s.env.Docker.Start(i.ContainerID); err != nil {
return err
}
@@ -840,12 +908,20 @@ func (s *Service) StopInstance(id string, force bool) (any, error) {
if force {
timeout = 0
}
- return s.transition(id, []string{"running"}, func(i Instance) error { return s.env.Docker.Stop(i.ContainerID, timeout) }, "stopping", "stopped")
+ return s.transition(id, []string{"running"}, func(i Instance) error {
+ if i.IsVM() {
+ return s.vmStop(i, force)
+ }
+ return s.env.Docker.Stop(i.ContainerID, timeout)
+ }, "stopping", "stopped")
}
// RebootInstance restarts a running instance.
func (s *Service) RebootInstance(id string) (any, error) {
return s.transition(id, []string{"running"}, func(i Instance) error {
+ if i.IsVM() {
+ return s.vmReboot(i)
+ }
if err := s.env.Docker.Restart(i.ContainerID); err != nil {
return err
}
@@ -1003,6 +1079,27 @@ func (s *Service) ChangeType(id, typ string) (Instance, error) {
if i.State != "stopped" || i.ContainerID == "" {
return i, core.Errf(http.StatusConflict, "IncorrectInstanceState", "the instance %s must be stopped to change its type", i.ID)
}
+ if i.IsVM() {
+ // The guest's CPU and memory are QEMU arguments: rebuild the container.
+ if _, err := store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error {
+ x.InstanceType, x.VCPUs, x.MemoryMB = it.Name, it.VCPUs, it.MemoryMB
+ return nil
+ }); err != nil {
+ return i, err
+ }
+ if err := recreateVM(s, i.ID); err != nil {
+ // The old container is back unless the rebuild got as far as replacing it:
+ // then the record must describe it again.
+ _, _ = store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error {
+ if x.ContainerID == i.ContainerID {
+ x.InstanceType, x.VCPUs, x.MemoryMB = i.InstanceType, i.VCPUs, i.MemoryMB
+ }
+ return nil
+ })
+ return i, fmt.Errorf("resize virtual machine: %w", err)
+ }
+ return s.get(i.ID)
+ }
mem := it.MemoryMB * 1024 * 1024
if err := s.env.Docker.C.UpdateContainer(i.ContainerID, docker.UpdateContainerOptions{
Memory: int(mem), MemorySwap: int(mem * 2), CPUPeriod: 100000, CPUQuota: int(min(it.VCPUs, s.hostCPU) * 100000),
@@ -1079,6 +1176,9 @@ func (s *Service) runCommand(c *httpx.Ctx) (any, error) {
if in.Timeout <= 0 || in.Timeout > 600 {
in.Timeout = 60
}
+ if i.IsVM() {
+ return s.vmRunCommand(c.R.Context(), i, in.Command, in.Timeout)
+ }
ctx, cancel := context.WithTimeout(c.R.Context(), time.Duration(in.Timeout)*time.Second)
defer cancel()
start := time.Now()
@@ -1097,12 +1197,7 @@ func (s *Service) runCommand(c *httpx.Ctx) (any, error) {
// ---- images ----
func (s *Service) listImages(c *httpx.Ctx) (any, error) {
- out := []Image{}
- for _, im := range catalog {
- im.Owner, im.State = "homecloud", "available"
- out = append(out, im)
- }
- return append(out, store.List[Image](s.env.Store, cImages)...), nil
+ return s.allImages(), nil
}
func (s *Service) getImage(c *httpx.Ctx) (any, error) { return s.image(c.Param("id")) }
@@ -1153,6 +1248,9 @@ func (s *Service) CreateImage(instanceID, name, description string, tags core.Ta
if i.ContainerID == "" || i.State == "terminated" {
return Image{}, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s has no disk to capture", i.ID)
}
+ if i.IsVM() {
+ return s.createVMImage(i, name, description, tags)
+ }
if name == "" {
name = i.ID + "-image"
}
@@ -1184,7 +1282,9 @@ func (s *Service) DeregisterImage(id string) error {
if err != nil {
return core.NotFound("image", id)
}
- if im.SourceInstance != "" {
+ if im.VMDisk != "" {
+ _ = s.env.Docker.RemoveVolume(im.VMDisk)
+ } else if im.SourceInstance != "" {
_ = s.env.Docker.C.RemoveImage(im.Ref)
}
return store.Delete(s.env.Store, cImages, im.ID)
@@ -1207,6 +1307,8 @@ type VolumeInput struct {
// until the copy finishes, unless Sync waits for it.
SnapshotID string
Sync bool
+ // VMRoot marks the root volume of a VM instance (its disk is a qcow2 overlay that snapshots and backups flatten).
+ VMRoot bool
}
func (s *Service) createVolume(in VolumeInput) (Volume, error) {
@@ -1251,7 +1353,12 @@ func (s *Service) createVolume(in VolumeInput) (Volume, error) {
if v.Name == "" && in.Tags["Name"] != "" {
v.Name = in.Tags["Name"]
}
- if err := s.env.Docker.CreateVolume(volumeName(v.ID), runtime.Labels("ebs", v.ID, nil)); err != nil {
+ v.VMRoot = in.VMRoot
+ var extra map[string]string
+ if in.VMRoot {
+ extra = map[string]string{vm.LabelRoot: "true"}
+ }
+ if err := s.env.Docker.CreateVolume(volumeName(v.ID), runtime.Labels("ebs", v.ID, extra)); err != nil {
return v, err
}
if in.SnapshotID == "" {
diff --git a/cli/internal/svc/ec2/imds.go b/cli/internal/svc/ec2/imds.go
index f5d8ff7c..aa6251f0 100644
--- a/cli/internal/svc/ec2/imds.go
+++ b/cli/internal/svc/ec2/imds.go
@@ -77,6 +77,13 @@ func (m *imds) forget(id string) {
}
}
+func (s *Service) imdsName() string {
+ if s.IMDSContainer != "" {
+ return s.IMDSContainer
+ }
+ return imdsContainer
+}
+
func (s *Service) initIMDS() {
if s.imds == nil {
s.imds = &imds{s: s, key: core.RandHex(40), tokens: map[string]imdsToken{}, creds: map[string]cachedCred{}}
@@ -118,13 +125,13 @@ func (s *Service) RunIMDS(ctx context.Context) {
// VPCCreated attaches the metadata helper to a new VPC.
func (s *Service) VPCCreated(v vpc.VPC) {
- _ = s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR))
+ _ = s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR))
}
// NetworkChanged re-routes the metadata address in a VPC's running instances
// after its network was recreated.
func (s *Service) NetworkChanged(v vpc.VPC) {
- _ = s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR))
+ _ = s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR))
for _, i := range store.List[Instance](s.env.Store, cInstances) {
if i.VpcID == v.ID && i.State == "running" && i.ContainerID != "" {
s.metadataRoute(context.Background(), i.ContainerID, i.VpcID)
@@ -171,7 +178,7 @@ http {
// it to every VPC network.
func (s *Service) ensureIMDS(ctx context.Context) error {
conf := []byte(s.imdsConfig())
- c, err := s.env.Docker.Inspect(imdsContainer)
+ c, err := s.env.Docker.Inspect(s.imdsName())
if err == nil && c.State.Running {
// Reload only when the configuration (the secret) changed.
res, err := s.env.Docker.Exec(ctx, c.ID, []string{"cat", "/etc/nginx/nginx.conf"}, nil)
@@ -188,7 +195,7 @@ func (s *Service) ensureIMDS(ctx context.Context) error {
_ = s.env.Docker.Remove(c.ID)
}
id, err := s.env.Docker.Run(ctx, runtime.RunSpec{
- Name: imdsContainer, Image: imdsImage,
+ Name: s.imdsName(), Image: imdsImage,
Entrypoint: []string{"/bin/sh", "-c"},
Cmd: []string{"ip addr add " + imdsIP + "/32 dev lo 2>/dev/null; exec nginx -g 'daemon off;'"},
Labels: runtime.Labels("ec2", "server", map[string]string{"homecloud.name": "instance metadata service"}),
@@ -208,7 +215,7 @@ func (s *Service) ensureIMDS(ctx context.Context) error {
}
}
for _, v := range s.vpc.List() {
- if err := s.env.Docker.ConnectIP(v.Network, imdsContainer, vpc.MetadataAddress(v.CIDR)); err != nil {
+ if err := s.env.Docker.ConnectIP(v.Network, s.imdsName(), vpc.MetadataAddress(v.CIDR)); err != nil {
log.Printf("ec2: attach metadata service to %s: %v", v.ID, err)
}
}
diff --git a/cli/internal/svc/ec2/ports.go b/cli/internal/svc/ec2/ports.go
index 4a5d97ca..6fe8b6f0 100644
--- a/cli/internal/svc/ec2/ports.go
+++ b/cli/internal/svc/ec2/ports.go
@@ -98,7 +98,7 @@ func (s *Service) portsMatch(inst Instance) bool {
return false
}
}
- return true
+ return s.vmFwdMatches(inst)
}
// groupChanged applies a changed security group to the instances using it.
diff --git a/cli/internal/svc/ec2/sg_filter_live_test.go b/cli/internal/svc/ec2/sg_filter_live_test.go
index af5f69ca..9984f9e4 100644
--- a/cli/internal/svc/ec2/sg_filter_live_test.go
+++ b/cli/internal/svc/ec2/sg_filter_live_test.go
@@ -24,6 +24,7 @@ type filterEnv struct {
vpcID string
subnet string
defSG string
+ ec2 *ec2.Service
}
func newFilterEnv(t *testing.T) *filterEnv {
@@ -60,7 +61,7 @@ func newFilterEnv(t *testing.T) *filterEnv {
}
t.Cleanup(func() { _ = v.DeleteVPC(vpcID) })
sn := h.AWSJSON(t, "ec2", "create-subnet", "--vpc-id", vpcID, "--cidr-block", fmt.Sprintf("10.%d.1.0/24", second))["Subnet"].(map[string]any)["SubnetId"].(string)
- return &filterEnv{t: t, h: h, vpc: v, vpcID: vpcID, subnet: sn, defSG: v.DefaultSecurityGroup(vpcID)}
+ return &filterEnv{t: t, h: h, vpc: v, ec2: e, vpcID: vpcID, subnet: sn, defSG: v.DefaultSecurityGroup(vpcID)}
}
func (f *filterEnv) group(t *testing.T, name string) string {
diff --git a/cli/internal/svc/ec2/terminal.go b/cli/internal/svc/ec2/terminal.go
index 9ebc9f55..ec80bdb7 100644
--- a/cli/internal/svc/ec2/terminal.go
+++ b/cli/internal/svc/ec2/terminal.go
@@ -8,6 +8,7 @@ import (
docker "github.com/fsouza/go-dockerclient"
"github.com/homecloudhq/homecloud/cli/internal/core"
"github.com/homecloudhq/homecloud/cli/internal/httpx"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm"
"golang.org/x/net/websocket"
)
@@ -23,13 +24,21 @@ func (s *Service) terminal(c *httpx.Ctx) (any, error) {
if i.State != "running" {
return nil, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s is %s", i.ID, i.State)
}
+ cmd := []string{"/bin/sh", "-c", "cd ~ 2>/dev/null; if command -v bash >/dev/null; then exec bash -l; else exec sh -l; fi"}
+ if i.IsVM() {
+ // A VM has no docker-exec shell: the terminal is its serial console.
+ cmd = vm.SerialAttachCommand()
+ }
c.MarkWritten()
ws := websocket.Server{Handler: func(conn *websocket.Conn) {
defer conn.Close()
+ if i.IsVM() {
+ _ = websocket.Message.Send(conn, "[homecloud] serial console of "+i.ID+": press Enter for a login prompt (one session at a time).\r\n")
+ }
ex, err := s.env.Docker.C.CreateExec(docker.CreateExecOptions{
Container: i.ContainerID, Tty: true, AttachStdin: true, AttachStdout: true, AttachStderr: true,
Env: []string{"TERM=xterm-256color"},
- Cmd: []string{"/bin/sh", "-c", "cd ~ 2>/dev/null; if command -v bash >/dev/null; then exec bash -l; else exec sh -l; fi"},
+ Cmd: cmd,
})
if err != nil {
_ = websocket.Message.Send(conn, "\r\n[homecloud] could not open a shell: "+err.Error()+"\r\n")
diff --git a/cli/internal/svc/ec2/vm.go b/cli/internal/svc/ec2/vm.go
new file mode 100644
index 00000000..fb1f96bf
--- /dev/null
+++ b/cli/internal/svc/ec2/vm.go
@@ -0,0 +1,825 @@
+package ec2
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "log"
+ "math"
+ "net/http"
+ "os"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+
+ docker "github.com/fsouza/go-dockerclient"
+ "github.com/homecloudhq/homecloud/cli/internal/core"
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
+ "github.com/homecloudhq/homecloud/cli/internal/store"
+ "github.com/homecloudhq/homecloud/cli/internal/svc"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/vpc"
+)
+
+// VM instances.
+//
+// An AMI with a VMBase boots an official cloud image under QEMU. The guest
+// runs inside a Docker container (the "VM container", built from the runner
+// image in the vm package) attached to the instance's VPC network with its
+// private address, so addresses, DNS, the metadata service, security groups
+// (iptables in the container's namespace) and published ports work as they do
+// for container instances. Inside the container passt hands the guest the
+// container's address, gateway and routes and forwards every inbound port to
+// it. The root disk is a qcow2 overlay on the cached base image, kept in the
+// instance's root volume (an EBS volume record at /dev/xvda, mounted at /vm).
+// The guest uses hardware acceleration when the Docker host has /dev/kvm and
+// is otherwise emulated.
+//
+// Stage 1 covers the instance lifecycle. Extra volumes, snapshots and images
+// of VM disks and backup are not available for VM instances yet. The browser
+// terminal (serial console), run-command and CloudWatch metrics are in
+// vm_access.go.
+
+const defaultVMImageVolume = "hc-vm-images"
+
+type vmState struct {
+ runnerMu sync.Mutex
+ runnerTag string // built and ready
+ runnerErr error
+ runnerFailed time.Time
+
+ kvmOnce sync.Once
+ kvm bool
+
+ fetchMu sync.Mutex // one download at a time
+}
+
+// vmPlan is what Launch works out once for every instance of a VM launch.
+type vmPlan struct {
+ virtualization string // kvm | emulated
+ user string
+ diskGB int
+ root VolumeSpec
+ ami string // the Docker volume of an image made from an instance
+}
+
+func errVMUnsupported(what string) error {
+ return core.Errf(http.StatusBadRequest, "UnsupportedOperation", "%s VM instances is not supported yet", what)
+}
+
+func atoi(s string) int { n, _ := strconv.Atoi(s); return n }
+
+func (s *Service) vmImageVolume() string {
+ if s.VMImageVolume != "" {
+ return s.VMImageVolume
+ }
+ return defaultVMImageVolume
+}
+
+// planVM validates a launch of a VM image and decides how it runs.
+func (s *Service) planVM(in RunInput, img Image) (vmPlan, error) {
+ var p vmPlan
+ if s.env.Docker == nil {
+ return p, core.Errf(http.StatusServiceUnavailable, "Unsupported", "virtual machine instances need Docker")
+ }
+ arch, err := vm.ArchOf(hostArch(s))
+ if err != nil {
+ return p, core.Errf(http.StatusBadRequest, "Unsupported", "%v", err)
+ }
+ minGB := vm.MinRootGB
+ if img.VMBase != "" {
+ base, ok := vm.Bases[img.VMBase]
+ if !ok {
+ return p, core.Errf(http.StatusBadRequest, "InvalidAMIID.Unavailable", "the image %s has no cloud image %q", img.ID, img.VMBase)
+ }
+ if _, err := base.For(arch); err != nil {
+ return p, core.Errf(http.StatusBadRequest, "InvalidAMIID.Unavailable", "the image %s is not available for %s hosts: %v", img.ID, arch, err)
+ }
+ p.user, p.diskGB = base.DefaultUser, 8
+ } else { // an image made from an instance
+ if img.VMArch != string(arch) {
+ return p, core.Errf(http.StatusBadRequest, "InvalidAMIID.Unavailable", "the image %s was made on a %s host, this one is %s", img.ID, img.VMArch, arch)
+ }
+ p.user, p.diskGB, minGB = img.VMUser, max(8, img.VMDiskGB), img.VMDiskGB
+ }
+ if len(in.FileSystems) > 0 {
+ return p, errVMUnsupported("mounting file systems in")
+ }
+ if err := s.vmRunnerFailure(); err != nil {
+ return p, core.Errf(http.StatusServiceUnavailable, "Unsupported", "virtual machine instances are unavailable: %v", err)
+ }
+ p.root = VolumeSpec{Device: "/dev/xvda", MountPath: vm.DiskDir}
+ del := true
+ p.root.DeleteOnTermination = &del
+ if r := in.RootVolume; r != nil {
+ if r.SizeGB > 0 {
+ p.diskGB = r.SizeGB
+ }
+ if r.DeleteOnTermination != nil {
+ del := *r.DeleteOnTermination
+ p.root.DeleteOnTermination = &del
+ }
+ p.root.VolumeType, p.root.Iops, p.root.Throughput, p.root.Encrypted, p.root.KMSKeyID = r.VolumeType, r.Iops, r.Throughput, r.Encrypted, r.KMSKeyID
+ }
+ if p.diskGB < minGB || p.diskGB > 16384 {
+ return p, core.Errf(http.StatusBadRequest, "InvalidParameterValue", "the root volume of %s must be between %d and 16384 GiB", img.ID, minGB)
+ }
+ p.ami = img.VMDisk
+ p.root.SizeGB = p.diskGB
+ p.virtualization = "emulated"
+ if s.vmKVM() {
+ p.virtualization = "kvm"
+ }
+ return p, nil
+}
+
+// vmKVM reports whether the Docker host offers /dev/kvm. It is probed once by
+// creating a container with the device (HC_VM_ACCEL=kvm|tcg overrides).
+func (s *Service) vmKVM() bool {
+ s.vm.kvmOnce.Do(func() {
+ switch os.Getenv("HC_VM_ACCEL") {
+ case "kvm":
+ s.vm.kvm = true
+ return
+ case "tcg":
+ log.Printf("ec2: HC_VM_ACCEL=tcg: VM instances run emulated (TCG), which is slow")
+ return
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
+ defer cancel()
+ _, err := s.env.Docker.RunOnce(ctx, runtime.RunSpec{
+ Image: helperImage, Entrypoint: []string{"/bin/sh", "-c"}, Cmd: []string{"test -r /dev/kvm && test -w /dev/kvm"},
+ Devices: []string{"/dev/kvm"}, Network: "none",
+ })
+ if err != nil {
+ log.Printf("ec2: /dev/kvm is not usable on the Docker host (%v): VM instances run emulated (TCG), which is slow", err)
+ return
+ }
+ s.vm.kvm = true
+ })
+ return s.vm.kvm
+}
+
+// vmRunnerFailure is the error of a runner image build that failed recently.
+func (s *Service) vmRunnerFailure() error {
+ s.vm.runnerMu.Lock()
+ defer s.vm.runnerMu.Unlock()
+ if s.vm.runnerErr != nil && time.Since(s.vm.runnerFailed) < time.Minute {
+ return s.vm.runnerErr
+ }
+ return nil
+}
+
+// vmRunner builds the runner image on first use (locally, tagged by content
+// hash) and returns its tag. Only VM launches wait for the build; nothing else
+// does. A failed build is remembered for a minute so launches fail fast
+// with the reason.
+func (s *Service) vmRunner(ctx context.Context) (string, error) {
+ s.vm.runnerMu.Lock()
+ defer s.vm.runnerMu.Unlock()
+ tag := vm.RunnerTag()
+ if s.vm.runnerTag == tag {
+ return tag, nil
+ }
+ if s.vm.runnerErr != nil && time.Since(s.vm.runnerFailed) < time.Minute {
+ return "", s.vm.runnerErr
+ }
+ bctx, cancel := context.WithTimeout(ctx, 20*time.Minute)
+ defer cancel()
+ log.Printf("ec2: building the VM runner image %s (first VM launch)", tag)
+ if err := s.env.Docker.BuildImageFiles(bctx, tag, vm.RunnerContext()); err != nil {
+ s.vm.runnerErr = fmt.Errorf("building the VM runner image failed: %w", err)
+ s.vm.runnerFailed = time.Now()
+ return "", s.vm.runnerErr
+ }
+ s.vm.runnerTag, s.vm.runnerErr = tag, nil
+ return tag, nil
+}
+
+// vmEnsureBase downloads the instance's cloud image into the image cache
+// volume unless it is there, verified by checksum.
+func (s *Service) vmEnsureBase(ctx context.Context, runner string, base vm.Base, arch vm.Arch) error {
+ f, err := base.For(arch)
+ if err != nil {
+ return err
+ }
+ s.vm.fetchMu.Lock()
+ defer s.vm.fetchMu.Unlock()
+ vol := s.vmImageVolume()
+ if _, err := s.env.Docker.C.InspectVolume(vol); err != nil {
+ if err := s.env.Docker.CreateVolume(vol, runtime.Labels("ec2", "vm-images", nil)); err != nil {
+ return err
+ }
+ }
+ fctx, cancel := context.WithTimeout(ctx, 45*time.Minute)
+ defer cancel()
+ if _, err := s.env.Docker.RunOnce(fctx, runtime.RunSpec{
+ Image: runner, Entrypoint: []string{"/usr/local/bin/hc-vm-fetch"}, Cmd: []string{f.URL, base.CacheName(arch), f.Sum},
+ Mounts: []runtime.Mount{{Volume: vol, Target: vm.ImagesDir}},
+ }); err != nil {
+ return fmt.Errorf("download %s: %w", f.URL, err)
+ }
+ if base.AgentImage != "" {
+ // Without the packages the guest installs the agent from its mirror, if it can reach it.
+ if out, err := s.env.Docker.RunOnce(fctx, runtime.RunSpec{
+ Image: base.AgentImage, Entrypoint: []string{"/bin/sh", "-c", vm.AgentFetchScript, "hc-agent-fetch"}, Cmd: []string{base.AgentCacheName(arch)},
+ Mounts: []runtime.Mount{{Volume: vol, Target: vm.ImagesDir}},
+ }); err != nil {
+ log.Printf("ec2: downloading the qemu-guest-agent packages for %s in %s failed (guests install it from their package mirror instead): %v %s", base.Key, base.AgentImage, err, tail(out, 600))
+ }
+ }
+ return nil
+}
+
+// vmMachine is the guest hardware of an instance.
+func (s *Service) vmMachine(inst Instance) vm.Machine {
+ arch, _ := vm.ArchOf(hostArch(s))
+ m := vm.Machine{Name: inst.ID, Arch: arch, KVM: inst.Virtualization == "kvm",
+ VCPUs: max(1, int(math.Ceil(inst.VCPUs))), MemoryMB: inst.MemoryMB}
+ for _, d := range vmDataDisks(inst) {
+ m.Disks = append(m.Disks, vm.Disk{ID: d.VolumeID})
+ }
+ return m
+}
+
+// vmRunSpec is the VM container of an instance.
+func (s *Service) vmRunSpec(inst Instance, network string) runtime.RunSpec {
+ mach := s.vmMachine(inst)
+ base := vm.Bases[inst.VMBase]
+ netEnv := os.Getenv("HC_VM_NET")
+ if inst.VMNetwork == "user" { // passt failed for this instance before: stay on user-mode networking
+ netEnv = "user"
+ }
+ dns := ""
+ if v, err := s.vpc.GetVPC(inst.VpcID); err == nil {
+ dns = vpc.DNSAddress(v.CIDR)
+ }
+ mounts := []runtime.Mount{{Volume: s.vmImageVolume(), Target: vm.ImagesDir, ReadOnly: true}}
+ var disks []string
+ for _, v := range inst.Volumes {
+ if v.MountPath == vm.DiskDir { // the root volume
+ mounts = append(mounts, runtime.Mount{Volume: volumeName(v.VolumeID), Target: v.MountPath})
+ continue
+ }
+ mounts = append(mounts, runtime.Mount{Volume: volumeName(v.VolumeID), Target: vm.DisksDir + "/" + v.VolumeID})
+ }
+ for _, d := range vmDataDisks(inst) {
+ size := 1
+ if vol, err := store.Get[Volume](s.env.Store, cVolumes, d.VolumeID); err == nil {
+ size = vol.SizeGB
+ }
+ disks = append(disks, fmt.Sprintf("%s:%d", d.VolumeID, size))
+ }
+ if inst.VMAMI != "" {
+ mounts = append(mounts, runtime.Mount{Volume: inst.VMAMI, Target: "/ami", ReadOnly: true})
+ }
+ spec := runtime.RunSpec{
+ DNS: s.dns(inst.VpcID),
+ Name: svc.ContainerName("ec2", inst.ID),
+ Image: vm.RunnerTag(),
+ Cmd: mach.Command(),
+ Labels: runtime.Labels("ec2", inst.ID, map[string]string{"homecloud.name": inst.Name, "homecloud.virtualization": inst.Virtualization}),
+ // QEMU's own threads (I/O, emulation, the main loop), passt and the helpers
+ // share the container's quota with the guest's vCPUs: a quota the vCPUs
+ // alone exhaust starves passt, and the guest's DHCP and connections time out.
+ NanoCPUs: int64(min(float64(mach.VCPUs)+1.5, s.hostCPU) * 1e9),
+ MemoryMB: inst.MemoryMB + 768,
+ Ports: s.portsFor(inst),
+ Mounts: mounts,
+ Network: network,
+ IP: inst.PrivateIP,
+ Aliases: append([]string{inst.ID, inst.PrivateDNS}, nonEmpty(inst.Name)...),
+ Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"),
+ Env: map[string]string{
+ "HC_VM_BASE": base.CacheName(mach.Arch), "HC_VM_DISK_GB": strconv.Itoa(inst.VMDiskGB), "HC_VM_ARCH": string(mach.Arch), "HC_VM_DNS": dns,
+ "HC_VM_DISKS": strings.Join(disks, " "),
+ // Used only when passt is unavailable (or HC_VM_NET=user is set for the server).
+ "HC_VM_NET": netEnv, "HC_VM_HOSTFWD": hostFwd(s.vpc.IngressPorts(inst.SecurityGroups, 64)),
+ },
+ ExtraHosts: []string{runtime.HostAlias},
+ // passt sandboxes itself (user and mount namespaces, pivot_root), which
+ // Docker's default seccomp profile and, on Ubuntu, its docker-default
+ // AppArmor profile forbid; the container gets no extra capability. It
+ // also opens a socket for each forwarded port, so it needs more than the
+ // 65536 open files some hosts allow by default.
+ SecurityOpt: vmSecurityOpts(),
+ NoFile: 1048576,
+ }
+ if mach.KVM {
+ spec.Devices = []string{"/dev/kvm"}
+ }
+ if inst.VMAMI != "" {
+ spec.Env["HC_VM_AMI"] = "1"
+ }
+ if base.AgentImage != "" {
+ spec.Env["HC_VM_AGENT"] = base.AgentCacheName(mach.Arch)
+ }
+ return spec
+}
+
+// vmFwdMatches reports whether a VM container forwards the ports its groups
+// allow. That only matters with user-mode networking (HC_VM_NET=user), where
+// QEMU forwards a fixed list of ports given at creation; with passt every
+// port reaches the guest and nothing needs rebuilding.
+func (s *Service) vmFwdMatches(inst Instance) bool {
+ if !inst.IsVM() || (os.Getenv("HC_VM_NET") != "user" && inst.VMNetwork != "user") {
+ return true
+ }
+ c, err := s.env.Docker.Inspect(inst.ContainerID)
+ if err != nil || c.Config == nil {
+ return true
+ }
+ for _, e := range c.Config.Env {
+ if v, ok := strings.CutPrefix(e, "HC_VM_HOSTFWD="); ok {
+ return v == hostFwd(s.vpc.IngressPorts(inst.SecurityGroups, 64))
+ }
+ }
+ return true
+}
+
+var (
+ secOptsOnce sync.Once
+ secOpts []string
+)
+
+// vmSecurityOpts confines the VM container with Docker's default seccomp
+// profile plus the four syscalls passt's sandbox needs (vm.SeccompProfile).
+// AppArmor cannot be narrowed from here: Ubuntu's docker-default profile denies
+// the mounts passt's sandbox makes, and a profile would have to be loaded on
+// the host. So the container runs without AppArmor confinement, unless
+// HC_VM_APPARMOR names a profile the administrator loaded on the host (a
+// profile that allows mount, umount and pivot_root inside user namespaces).
+func vmSecurityOpts() []string {
+ secOptsOnce.Do(func() {
+ prof, err := vm.SeccompProfile()
+ if err != nil {
+ log.Printf("ec2: building the VM seccomp profile: %v (using seccomp=unconfined)", err)
+ prof = "unconfined"
+ }
+ aa := os.Getenv("HC_VM_APPARMOR")
+ if aa == "" {
+ aa = "unconfined"
+ }
+ secOpts = []string{"seccomp=" + prof, "apparmor=" + aa}
+ })
+ return secOpts
+}
+
+// hostFwd renders ports as QEMU user-mode networking forwards.
+func hostFwd(ports []runtime.Port) string {
+ var b strings.Builder
+ for _, p := range ports {
+ fmt.Fprintf(&b, ",hostfwd=%s::%d-:%d", p.Protocol, p.ContainerPort, p.ContainerPort)
+ }
+ return b.String()
+}
+
+// vmSeed is the cloud-init seed of an instance, as files to copy into its container.
+func (s *Service) vmSeed(inst Instance) map[string][]byte {
+ seed := vm.Seed{InstanceID: inst.ID, Hostname: strings.TrimSuffix(inst.PrivateDNS, ".internal"), UserData: inst.UserData}
+ if inst.KeyName != "" {
+ if k, err := s.keyPair(inst.KeyName); err == nil {
+ seed.PublicKey = k.PublicKey
+ }
+ }
+ out := map[string][]byte{}
+ for name, b := range seed.Files() {
+ out[strings.TrimPrefix(vm.SeedDir, "/")+"/"+name] = b
+ }
+ return out
+}
+
+func (s *Service) vmPending(id string) bool {
+ i, err := store.Get[Instance](s.env.Store, cInstances, id)
+ return err == nil && i.State == "pending"
+}
+
+// launchVM prepares and boots a VM instance in the background.
+func (s *Service) launchVM(inst Instance, network string) {
+ defer core.Recover("ec2 launch vm " + inst.ID)
+ ctx, cancel := context.WithTimeout(context.Background(), 90*time.Minute)
+ defer cancel()
+ fail := func(err error) { s.failLaunch(inst, err) }
+ runner, err := s.vmRunner(ctx)
+ if err != nil {
+ fail(err)
+ return
+ }
+ arch, _ := vm.ArchOf(hostArch(s))
+ if inst.VMBase != "" {
+ if err := s.vmEnsureBase(ctx, runner, vm.Bases[inst.VMBase], arch); err != nil {
+ fail(err)
+ return
+ }
+ }
+ if !s.vmPending(inst.ID) {
+ return // terminated while the image downloaded
+ }
+ if inst.Virtualization == "emulated" {
+ log.Printf("ec2: %s runs emulated (no /dev/kvm): booting takes a while", inst.ID)
+ }
+ cid, err := s.env.Docker.Run(ctx, s.vmRunSpec(inst, network))
+ if err != nil {
+ fail(err)
+ return
+ }
+ if err := s.env.Docker.CopyIn(ctx, cid, "/", s.vmSeed(inst), 0o644); err != nil {
+ _ = s.env.Docker.Remove(cid)
+ fail(fmt.Errorf("write cloud-init seed: %w", err))
+ return
+ }
+ since := time.Now().Add(-2 * time.Second)
+ if err := s.env.Docker.Start(cid); err != nil {
+ _ = s.env.Docker.Remove(cid)
+ fail(err)
+ return
+ }
+ gone := false
+ _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error {
+ if x.State != "pending" {
+ gone = true
+ return nil
+ }
+ x.ContainerID = cid
+ return nil
+ })
+ if gone { // terminated while launching
+ go s.env.Docker.Remove(cid)
+ return
+ }
+ inst.ContainerID = cid
+ s.metadataRoute(ctx, cid, inst.VpcID)
+ s.vpc.ProtectNow(ctx, s.member(inst, cid))
+ err = s.vmWaitReady(inst, since)
+ if errors.Is(err, errPasstExited) {
+ // passt died while the guest booted: boot it again in user-mode networking.
+ log.Printf("ec2: %s: %v; restarting the guest with user-mode networking", inst.ID, err)
+ if err = s.vmFallbackToUser(inst.ID); err == nil {
+ if cur, gerr := store.Get[Instance](s.env.Store, cInstances, inst.ID); gerr == nil {
+ inst, cid = cur, cur.ContainerID
+ err = s.vmWaitReady(inst, time.Now().Add(-2*time.Second))
+ }
+ }
+ }
+ if err != nil {
+ if out, _ := s.env.Docker.Logs(cid, 30, time.Time{}); out != "" {
+ err = fmt.Errorf("%w: %s", err, tail(out, 1500))
+ }
+ _ = s.env.Docker.Remove(cid)
+ fail(err)
+ return
+ }
+ netMode := "passt"
+ if os.Getenv("HC_VM_NET") == "user" || inst.VMNetwork == "user" {
+ netMode = "user"
+ } else if why := s.vmPasstFailure(cid, time.Time{}); why != "" {
+ netMode = "user"
+ log.Printf("ec2: %s: passt could not start, so the guest uses user-mode networking behind NAT (no private address of its own; only ports allowed at launch are forwarded): %s", inst.ID, why)
+ }
+ _, _ = store.Update(s.env.Store, cInstances, inst.ID, func(x *Instance) error {
+ if x.State != "pending" { // terminated meanwhile
+ return nil
+ }
+ x.VMNetwork = netMode
+ x.State, x.StateReason = "running", ""
+ x.PublicPorts = s.env.Docker.PublishedPorts(cid)
+ return nil
+ })
+ s.syncPortsAsync(inst.ID) // groups may have changed while launching
+}
+
+// passtExitMarker starts the VM container's report of a passt that died.
+const passtExitMarker = "[homecloud] passt exited unexpectedly"
+
+// errPasstExited is what vmWaitReady returns when passt died under a running guest.
+var errPasstExited = errors.New("passt exited")
+
+// vmFallbackToUser records that passt does not work for an instance and
+// rebuilds its container with QEMU's user-mode networking (the guest boots
+// again; it sits behind NAT, and security group changes rebuild it).
+func (s *Service) vmFallbackToUser(id string) error {
+ if _, err := store.Update(s.env.Store, cInstances, id, func(x *Instance) error { x.VMNetwork = "user"; return nil }); err != nil {
+ return err
+ }
+ return s.recreate(id)
+}
+
+var (
+ passtWatchMu sync.Mutex
+ passtWatchLast = map[string]time.Time{}
+)
+
+// vmWatchPasst looks (at most every 20 seconds per instance) for a passt that
+// died under a running guest, which the VM container's supervisor marks with
+// /run/passt.dead, and restarts the guest in user-mode networking.
+func (s *Service) vmWatchPasst(i Instance) {
+ if !i.IsVM() || i.State != "running" || i.VMNetwork == "user" || i.ContainerID == "" || isBusy(i.ID) {
+ return
+ }
+ passtWatchMu.Lock()
+ if time.Since(passtWatchLast[i.ID]) < 20*time.Second {
+ passtWatchMu.Unlock()
+ return
+ }
+ passtWatchLast[i.ID] = time.Now()
+ passtWatchMu.Unlock()
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+ res, err := s.env.Docker.Exec(ctx, i.ContainerID, []string{"test", "-f", "/run/passt.dead"}, nil)
+ if err != nil || res.ExitCode != 0 {
+ return
+ }
+ // The report goes with the container: keep it in the server log.
+ report := ""
+ if out, err := s.env.Docker.Logs(i.ContainerID, 0, time.Time{}); err == nil {
+ if k := strings.LastIndex(out, passtExitMarker); k >= 0 {
+ report = head(out[k:], 4000)
+ }
+ }
+ log.Printf("ec2: %s: passt exited under the running guest; restarting it with user-mode networking (the guest reboots, behind NAT). %s", i.ID, report)
+ go func() {
+ defer core.Recover("ec2 passt fallback " + i.ID)
+ if err := s.vmFallbackToUser(i.ID); err != nil {
+ log.Printf("ec2: %s: restart in user-mode networking: %v", i.ID, err)
+ }
+ }()
+}
+
+// vmPasstFailure returns why passt did not start in the VM container since
+// the given time (what the entrypoint printed before falling back to
+// user-mode networking), or "".
+func (s *Service) vmPasstFailure(cid string, since time.Time) string {
+ out, err := s.env.Docker.Logs(cid, 0, since)
+ if err != nil {
+ return ""
+ }
+ return passtFailure(out)
+}
+
+// passtFailure extracts the entrypoint's report of a passt that did not start
+// from the VM container's log, as one line, or "".
+func passtFailure(out string) string {
+ const marker = "[homecloud] passt did not start"
+ i := strings.LastIndex(out, marker)
+ if i < 0 {
+ return ""
+ }
+ out = out[i:]
+ if j := strings.Index(out, "[homecloud] starting"); j > 0 {
+ out = out[:strings.LastIndexByte(out[:j], '\n')+1] // up to that line, with its timestamp
+ }
+ var lines []string
+ for _, l := range strings.Split(out, "\n") {
+ if l = strings.TrimSpace(l); l != "" {
+ // drop the docker log timestamp
+ if sp := strings.IndexByte(l, ' '); sp > 0 && strings.HasSuffix(l[:sp], "Z") {
+ l = strings.TrimSpace(l[sp+1:])
+ }
+ lines = append(lines, l)
+ }
+ }
+ return strings.Join(lines, "; ")
+}
+
+// vmSettleNetwork waits (up to a minute) for a just-started VM container's
+// entrypoint to choose the guest's network, and records a fallback to
+// user-mode networking: with it, the forwarded ports are fixed when the
+// container is created, so security group changes must rebuild it
+// (vmFwdMatches). The fallback is kept for later rebuilds of the instance.
+func (s *Service) vmSettleNetwork(id, cid string, since time.Time) {
+ deadline := time.Now().Add(time.Minute)
+ for {
+ out, _ := s.env.Docker.Logs(cid, 0, since)
+ if strings.Contains(out, "[homecloud] starting the virtual machine") {
+ if why := passtFailure(out); why != "" {
+ changed := false
+ _, _ = store.Update(s.env.Store, cInstances, id, func(x *Instance) error {
+ changed = x.VMNetwork != "user"
+ x.VMNetwork = "user"
+ return nil
+ })
+ if changed {
+ log.Printf("ec2: %s: passt could not start, so the guest uses user-mode networking behind NAT: %s", id, why)
+ }
+ }
+ return
+ }
+ if time.Now().After(deadline) || s.env.Docker.State(cid) != "running" {
+ return
+ }
+ time.Sleep(500 * time.Millisecond)
+ }
+}
+
+func head(s string, n int) string {
+ if len(s) > n {
+ s = s[:n]
+ }
+ return strings.TrimSpace(s)
+}
+
+func tail(s string, n int) string {
+ s = strings.TrimSpace(s)
+ if len(s) > n {
+ s = s[len(s)-n:]
+ }
+ return s
+}
+
+// vmBootTimeout is how long a guest gets to finish booting before the instance
+// is reported running anyway (images without cloud-init never print the marker).
+func vmBootTimeout(inst Instance) time.Duration {
+ if inst.Virtualization == "kvm" {
+ return 10 * time.Minute
+ }
+ return 30 * time.Minute
+}
+
+// vmWaitReady returns once the guest has booted (cloud-init finished, or a
+// login prompt has been up for a while), the wait timed out (logged; the guest
+// may simply not print the markers) or the VM container stopped, which is an
+// error. It gives up quietly when the instance is terminated or stopped.
+func (s *Service) vmWaitReady(inst Instance, since time.Time) error {
+ deadline := time.Now().Add(vmBootTimeout(inst))
+ var promptSince time.Time
+ for {
+ st := s.env.Docker.State(inst.ContainerID)
+ if st != "running" {
+ return fmt.Errorf("the virtual machine stopped while booting (container %s)", st)
+ }
+ if cur, err := store.Get[Instance](s.env.Store, cInstances, inst.ID); err != nil || cur.State == "terminated" || cur.State == "shutting-down" || cur.State == "stopping" || cur.State == "stopped" {
+ return nil
+ }
+ out, _ := s.env.Docker.Logs(inst.ContainerID, 0, since)
+ if k := strings.LastIndex(out, passtExitMarker); k >= 0 {
+ return fmt.Errorf("%w, so the guest has no network: %s", errPasstExited, head(out[k:], 4000))
+ }
+ done, prompt := vm.Ready(out)
+ if done {
+ return nil
+ }
+ if prompt {
+ if promptSince.IsZero() {
+ promptSince = time.Now()
+ } else if time.Since(promptSince) > 90*time.Second {
+ return nil // a login prompt and no cloud-init final message
+ }
+ }
+ if time.Now().After(deadline) {
+ log.Printf("ec2: %s: no boot-complete marker on the console after %s; reporting it running", inst.ID, vmBootTimeout(inst))
+ return nil
+ }
+ time.Sleep(3 * time.Second)
+ }
+}
+
+// vmShutdownTimeout is how long the guest gets to power off after the ACPI request.
+func vmShutdownTimeout(inst Instance) time.Duration {
+ if inst.Virtualization == "kvm" {
+ return 90 * time.Second
+ }
+ return 3 * time.Minute
+}
+
+// vmPowerOff asks the guest to shut down (ACPI power button through QMP) and
+// waits for QEMU, and with it the container, to exit. It reports whether that
+// happened in time.
+func (s *Service) vmPowerOff(inst Instance) bool {
+ if s.env.Docker.State(inst.ContainerID) != "running" {
+ return true
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
+ if _, err := s.env.Docker.Exec(ctx, inst.ContainerID, []string{"/usr/local/bin/hc-vm-ctl", "system_powerdown"}, nil); err != nil {
+ log.Printf("ec2: power down %s: %v", inst.ID, err)
+ }
+ cancel()
+ deadline := time.Now().Add(vmShutdownTimeout(inst))
+ for time.Now().Before(deadline) {
+ if s.env.Docker.State(inst.ContainerID) != "running" {
+ return true
+ }
+ time.Sleep(time.Second)
+ }
+ return false
+}
+
+// vmStop shuts the guest down gracefully, then kills the container if it is
+// still there; force skips the graceful part.
+func (s *Service) vmStop(inst Instance, force bool) error {
+ if !force && !s.vmPowerOff(inst) {
+ out, _ := s.env.Docker.Logs(inst.ContainerID, 12, time.Time{})
+ log.Printf("ec2: %s did not power off in %s; killing it. Console: %s", inst.ID, vmShutdownTimeout(inst), tail(out, 1500))
+ }
+ return s.env.Docker.Stop(inst.ContainerID, 0)
+}
+
+// vmStart boots a stopped VM (same disk) and waits for the guest to be up.
+func (s *Service) vmStart(inst Instance) error {
+ if base, ok := vm.Bases[inst.VMBase]; ok {
+ // The root disk is an overlay on the cached cloud image: fetch it again if the cache was cleared or the host changed.
+ fctx, cancel := context.WithTimeout(context.Background(), 50*time.Minute)
+ if arch, err := vm.ArchOf(hostArch(s)); err == nil {
+ if runner, err := s.vmRunner(fctx); err != nil {
+ log.Printf("ec2: start %s: %v", inst.ID, err)
+ } else if err := s.vmEnsureBase(fctx, runner, base, arch); err != nil {
+ log.Printf("ec2: start %s: %v", inst.ID, err)
+ }
+ }
+ cancel()
+ }
+ since := time.Now().Add(-2 * time.Second)
+ if err := s.env.Docker.Start(inst.ContainerID); err != nil {
+ return err
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
+ defer cancel()
+ s.metadataRoute(ctx, inst.ContainerID, inst.VpcID)
+ s.vpc.ProtectNow(ctx, s.member(inst, inst.ContainerID))
+ s.vmSettleNetwork(inst.ID, inst.ContainerID, since)
+ return s.vmWaitReady(inst, since)
+}
+
+// vmReboot restarts the guest: a graceful shutdown, then the same container starts again.
+func (s *Service) vmReboot(inst Instance) error {
+ setBusy(inst.ID, true) // the container is down for a while: not "stopped"
+ defer setBusy(inst.ID, false)
+ if err := s.vmStop(inst, false); err != nil {
+ return err
+ }
+ return s.vmStart(inst)
+}
+
+// recreateVM rebuilds the VM container of an instance from its current
+// settings (instance type, ports). A variable so tests can make it fail.
+var recreateVM = func(s *Service, id string) error { return s.recreate(id) }
+
+// rebuildVM replaces an instance's VM container with one built from the
+// instance's current settings. Nothing is snapshotted: the disk lives in the
+// root volume. A running guest is shut down and boots again, as after a reboot.
+// The caller holds recreateMu and has marked the instance busy.
+func (s *Service) rebuildVM(i Instance) error {
+ v, err := s.vpc.GetVPC(i.VpcID)
+ if err != nil {
+ return err
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 35*time.Minute)
+ defer cancel()
+ if _, err := s.vmRunner(ctx); err != nil { // a new HomeCloud version may have a new runner image
+ return err
+ }
+ running := s.env.Docker.State(i.ContainerID) == "running"
+ if running {
+ if err := s.vmStop(i, false); err != nil {
+ return fmt.Errorf("stop: %w", err)
+ }
+ }
+ name := svc.ContainerName("ec2", i.ID)
+ if err := s.env.Docker.C.RenameContainer(dockerRename(i.ContainerID, name+"-old", ctx)); err != nil {
+ return fmt.Errorf("rename: %w", err)
+ }
+ undo := func(cause error) error {
+ _ = s.env.Docker.C.RenameContainer(dockerRename(i.ContainerID, name, ctx))
+ if running {
+ _ = s.env.Docker.Start(i.ContainerID)
+ }
+ return cause
+ }
+ cid, err := s.env.Docker.Run(ctx, s.vmRunSpec(i, v.Network))
+ if err != nil {
+ return undo(fmt.Errorf("recreate: %w", err))
+ }
+ if err := s.env.Docker.CopyIn(ctx, cid, "/", s.vmSeed(i), 0o644); err != nil {
+ _ = s.env.Docker.Remove(cid)
+ return undo(fmt.Errorf("write cloud-init seed: %w", err))
+ }
+ _ = s.env.Docker.Remove(i.ContainerID)
+ // Record the replacement before starting it: whatever happens next, the
+ // instance points at the container that holds its disk.
+ if _, err := store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error { x.ContainerID = cid; return nil }); err != nil {
+ return err
+ }
+ if !running {
+ return nil
+ }
+ since := time.Now().Add(-2 * time.Second)
+ if err := s.env.Docker.Start(cid); err != nil {
+ _, _ = store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error {
+ x.State, x.StateReason, x.PublicPorts = "stopped", "Server.InternalError: the rebuilt virtual machine did not start: "+err.Error(), map[string]int{}
+ return nil
+ })
+ return fmt.Errorf("start the rebuilt virtual machine: %w", err)
+ }
+ s.metadataRoute(ctx, cid, i.VpcID)
+ s.vpc.ProtectNow(ctx, s.member(i, cid))
+ s.vmSettleNetwork(i.ID, cid, since)
+ _, err = store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error {
+ x.PublicPorts = s.env.Docker.PublishedPorts(cid)
+ return nil
+ })
+ return err
+}
+
+func dockerRename(id, name string, ctx context.Context) docker.RenameContainerOptions {
+ return docker.RenameContainerOptions{ID: id, Name: name, Context: ctx}
+}
diff --git a/cli/internal/svc/ec2/vm/disks_test.go b/cli/internal/svc/ec2/vm/disks_test.go
new file mode 100644
index 00000000..b6fab18a
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/disks_test.go
@@ -0,0 +1,57 @@
+package vm
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestQEMUExtraDisks(t *testing.T) {
+ m := Machine{Name: "i-1", Arch: ArchX8664, VCPUs: 1, MemoryMB: 1024,
+ Disks: []Disk{{ID: "vol-0123456789abcdef0"}, {ID: "vol-fedcba9876543210f"}}}
+ s := strings.Join(m.Args(), " ")
+ for _, want := range []string{
+ "-drive file=/disks/vol-0123456789abcdef0/disk.img,if=none,id=data0,format=raw",
+ "-device virtio-blk-pci,drive=data0,serial=vol-0123456789abcdef",
+ "-drive file=/disks/vol-fedcba9876543210f/disk.img,if=none,id=data1,format=raw",
+ "-device virtio-blk-pci,drive=data1,serial=vol-fedcba9876543210",
+ } {
+ if !strings.Contains(s, want) {
+ t.Errorf("command line lacks %q:\n%s", want, s)
+ }
+ }
+ // The NIC first, at a fixed slot; the root disk, then the extra disks in order, the seed last.
+ order := []string{"virtio-net-pci,netdev=net0", "id=root", "id=data0", "id=data1", "id=seed"}
+ last := -1
+ for _, o := range order {
+ i := strings.Index(s, o)
+ if i < 0 || i < last {
+ t.Fatalf("%q out of order in:\n%s", o, s)
+ }
+ last = i
+ }
+ if !strings.Contains(s, "addr=0x3") {
+ t.Errorf("the NIC has no fixed PCI slot:\n%s", s)
+ }
+ // Adding and removing disks leaves the NIC's part of the command line alone.
+ bare := Machine{Name: "i-1", Arch: ArchX8664, VCPUs: 1, MemoryMB: 1024}
+ nic := func(m Machine) string {
+ a := strings.Join(m.Args(), " ")
+ i := strings.Index(a, "-netdev")
+ return a[i : i+strings.Index(a[i:], "-drive")]
+ }
+ if nic(m) != nic(bare) {
+ t.Errorf("the NIC changed with the disks:\n%s\n%s", nic(m), nic(bare))
+ }
+}
+
+func TestDiskSerial(t *testing.T) {
+ if got := (Disk{ID: "vol-0123456789abcdef0"}).Serial(); got != "vol-0123456789abcdef" || len(got) != 20 {
+ t.Errorf("serial %q", got)
+ }
+ if got := (Disk{ID: "vol-1"}).Serial(); got != "vol-1" {
+ t.Errorf("serial %q", got)
+ }
+ if got := (Disk{ID: "vol-x"}).Path(); got != "/disks/vol-x/disk.img" {
+ t.Errorf("path %q", got)
+ }
+}
diff --git a/cli/internal/svc/ec2/vm/fetch_test.go b/cli/internal/svc/ec2/vm/fetch_test.go
new file mode 100644
index 00000000..9fc842f1
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/fetch_test.go
@@ -0,0 +1,71 @@
+package vm
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "testing"
+)
+
+// A cached image that no longer matches its checksum is downloaded again, not used.
+func TestFetchVerifiesTheCachedImage(t *testing.T) {
+ for _, tool := range []string{"sh", "curl", "sha256sum"} {
+ if _, err := exec.LookPath(tool); err != nil {
+ t.Skipf("%s not available", tool)
+ }
+ }
+ dir := t.TempDir()
+ script := filepath.Join(dir, "hc-vm-fetch")
+ if err := os.WriteFile(script, []byte(fetchScript), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ images := filepath.Join(dir, "images")
+ if err := os.Mkdir(images, 0o755); err != nil {
+ t.Fatal(err)
+ }
+ good := []byte("the real image")
+ src := filepath.Join(dir, "upstream.img")
+ if err := os.WriteFile(src, good, 0o644); err != nil {
+ t.Fatal(err)
+ }
+ h := sha256.Sum256(good)
+ sum := hex.EncodeToString(h[:])
+ run := func() ([]byte, error) {
+ cmd := exec.Command("sh", script, "file://"+src, "base.qcow2", sum)
+ cmd.Env = append(os.Environ(), "HC_VM_IMAGES="+images)
+ return cmd.CombinedOutput()
+ }
+ cached := filepath.Join(images, "base.qcow2")
+ // A corrupted (or replaced) cache file.
+ if err := os.WriteFile(cached, []byte("tampered"), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ if out, err := run(); err != nil {
+ t.Fatalf("fetch: %v\n%s", err, out)
+ }
+ if got, _ := os.ReadFile(cached); string(got) != string(good) {
+ t.Fatalf("cache holds %q after the fetch, want the verified image", got)
+ }
+ // A good cache file is kept (no download: the source is gone).
+ if err := os.Remove(src); err != nil {
+ t.Fatal(err)
+ }
+ if out, err := run(); err != nil {
+ t.Fatalf("fetch with a valid cache: %v\n%s", err, out)
+ }
+ // A download that does not match is refused and leaves nothing behind.
+ if err := os.WriteFile(src, []byte("something else"), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(cached, []byte("tampered again"), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ if out, err := run(); err == nil {
+ t.Fatalf("fetch accepted a mismatching download:\n%s", out)
+ }
+ if _, err := os.Stat(cached); !os.IsNotExist(err) {
+ t.Errorf("a mismatching image is in the cache: %v", err)
+ }
+}
diff --git a/cli/internal/svc/ec2/vm/hc-vm-ctl b/cli/internal/svc/ec2/vm/hc-vm-ctl
new file mode 100644
index 00000000..e47413ab
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/hc-vm-ctl
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Sends QMP commands to the VM's QEMU: hc-vm-ctl system_powerdown|system_reset|quit
+set -eu
+[ -S /run/qmp.sock ] || { echo "the virtual machine is not running" >&2; exit 1; }
+printf '{"execute":"qmp_capabilities"}\n{"execute":"%s"}\n' "$1" | socat -t 2 - UNIX-CONNECT:/run/qmp.sock
diff --git a/cli/internal/svc/ec2/vm/hc-vm-fetch b/cli/internal/svc/ec2/vm/hc-vm-fetch
new file mode 100644
index 00000000..e228bcf2
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/hc-vm-fetch
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Downloads a cloud image into the image cache and verifies its checksum.
+# hc-vm-fetch
+# The file appears in the cache only once it is complete and verified. A cached
+# file is verified again before it is used, and downloaded again when it no
+# longer matches. HC_VM_IMAGES overrides the cache directory (tests).
+set -eu
+url=$1; file=$2; sum=$3
+dir=${HC_VM_IMAGES:-/images}
+dest=$dir/$file
+digest() {
+ case ${#sum} in
+ 64) sha256sum "$1" | cut -d' ' -f1 ;;
+ 128) sha512sum "$1" | cut -d' ' -f1 ;;
+ *) echo "unsupported checksum length" >&2; return 2 ;;
+ esac
+}
+if [ -f "$dest" ]; then
+ [ "$(digest "$dest")" = "$sum" ] && exit 0
+ echo "cached $file does not match its checksum; downloading it again" >&2
+ rm -f "$dest"
+fi
+tmp=$dest.part
+curl -fSL --retry 3 --retry-delay 5 --connect-timeout 30 -o "$tmp" "$url"
+got=$(digest "$tmp") || { rm -f "$tmp"; exit 2; }
+if [ "$got" != "$sum" ]; then
+ echo "checksum mismatch for $url: expected $sum, got $got" >&2
+ rm -f "$tmp"
+ exit 3
+fi
+mv "$tmp" "$dest"
diff --git a/cli/internal/svc/ec2/vm/hc-vm-flatten b/cli/internal/svc/ec2/vm/hc-vm-flatten
new file mode 100644
index 00000000..5bbb32b7
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/hc-vm-flatten
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Copies a VM disk volume into a standalone one, for snapshots, images and backups.
+# hc-vm-flatten /src /dst
+# A root volume holds a qcow2 overlay on the cached cloud image (mounted at
+# /images so the backing file resolves); it is converted into a single image
+# that needs no backing file. Any other volume is copied as it is. -U reads the
+# image even though a running guest has it open (the copy is crash-consistent).
+set -eu
+src=$1; dst=$2
+if [ -f "$src/disk.qcow2" ]; then
+ qemu-img convert -U -f qcow2 -O qcow2 "$src/disk.qcow2" "$dst/disk.qcow2"
+else
+ cp -a "$src/." "$dst/"
+fi
diff --git a/cli/internal/svc/ec2/vm/hc-vm-run b/cli/internal/svc/ec2/vm/hc-vm-run
new file mode 100644
index 00000000..dd0b7fc0
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/hc-vm-run
@@ -0,0 +1,152 @@
+#!/bin/sh
+# Entrypoint of a VM container: prepares the instance's disk, the cloud-init
+# seed and the guest's network (passt), then becomes QEMU.
+#
+# /images image cache volume (read-only): the base cloud images
+# /vm the instance's disk volume: disk.qcow2, seed.iso, efivars.fd
+# /hc/seed cloud-init NoCloud files, written by HomeCloud before the first start
+#
+# Environment: HC_VM_BASE (file in /images), HC_VM_DISK_GB, HC_VM_ARCH
+# (aarch64|x86_64), HC_VM_DNS (the resolver address the guest is given),
+# HC_VM_NET=user and HC_VM_HOSTFWD (user-mode networking, see below).
+# The arguments are the QEMU command line.
+set -eu
+
+disk=/vm/disk.qcow2
+if [ ! -f "$disk" ]; then
+ if [ -n "${HC_VM_AMI:-}" ]; then
+ # An image made from an instance: a standalone copy, so the instance does not
+ # depend on the image staying registered.
+ echo "[homecloud] creating disk ($HC_VM_DISK_GB GiB) from the image"
+ qemu-img convert -f qcow2 -O qcow2 /ami/disk.qcow2 "$disk.tmp"
+ qemu-img resize -q "$disk.tmp" "${HC_VM_DISK_GB}G"
+ else
+ echo "[homecloud] creating disk ($HC_VM_DISK_GB GiB) from $HC_VM_BASE"
+ qemu-img create -q -f qcow2 -b "/images/$HC_VM_BASE" -F qcow2 "$disk.tmp" "${HC_VM_DISK_GB}G"
+ fi
+ mv "$disk.tmp" "$disk"
+fi
+
+# Extra volumes are raw images, created sparse on first use and grown when the
+# volume was enlarged. HC_VM_DISKS is ": ..."; the QEMU command
+# line names the files (/disks//disk.img).
+for d in ${HC_VM_DISKS:-}; do
+ id=${d%%:*}; gb=${d##*:}; img=/disks/$id/disk.img
+ want=$((gb * 1073741824))
+ if [ ! -f "$img" ]; then
+ truncate -s "$want" "$img"
+ elif [ "$(stat -c %s "$img")" -lt "$want" ]; then
+ truncate -s "$want" "$img"
+ fi
+done
+
+# The seed is rebuilt on every start so changed user data applies to the next boot.
+# It also carries the guest agent's packages (HC_VM_AGENT, a directory in the
+# image cache), which the vendor data installs without needing the network.
+if [ -d /hc/seed ]; then
+ rm -rf /vm/seed.iso /tmp/seed
+ mkdir -p /tmp/seed
+ cp /hc/seed/* /tmp/seed/
+ if [ -n "${HC_VM_AGENT:-}" ] && [ -f "/images/$HC_VM_AGENT/.complete" ]; then
+ mkdir /tmp/seed/qga
+ cp "/images/$HC_VM_AGENT"/*.deb /tmp/seed/qga/
+ fi
+ genisoimage -quiet -output /vm/seed.iso -volid cidata -joliet -rock /tmp/seed >/dev/null # errors stay in the log
+ rm -rf /tmp/seed
+fi
+
+if [ "$HC_VM_ARCH" = "aarch64" ] && [ ! -f /vm/efivars.fd ]; then
+ cp /usr/share/AAVMF/AAVMF_VARS.fd /vm/efivars.fd
+fi
+
+# passt gives the guest this container's address, gateway and routes, and
+# forwards every inbound TCP and UDP port to it.
+#
+# The guest resolves through HC_VM_DNS (the VPC's resolver address, base+2 as in
+# AWS); passt relays those queries to Docker's resolver in this container's
+# namespace (127.0.0.11), so names resolve as they do for container instances.
+dns=""
+if [ -n "${HC_VM_DNS:-}" ]; then dns="-D $HC_VM_DNS --dns-forward $HC_VM_DNS --dns-host 127.0.0.11"; fi
+rm -f /run/passt.dead /tmp/passt.sock /run/qmp.sock /run/serial.sock /run/qga.sock
+if [ "${HC_VM_NET:-}" != "user" ]; then
+ # -d logs each flow: it is what tells why passt exited. The log is appended
+ # to /run/passt.log and cut back to its last MiB when it passes 4 MiB.
+ : >/run/passt.log
+ # shellcheck disable=SC2086
+ /usr/local/libexec/homecloud/passt -f -d -s /tmp/passt.sock -t all -u all $dns >>/run/passt.log 2>&1 &
+ pid=$!
+ ( while sleep 20; do
+ [ "$(stat -c %s /run/passt.log 2>/dev/null || echo 0)" -gt 4194304 ] &&
+ tail -c 1048576 /run/passt.log > /run/passt.log.tmp && cat /run/passt.log.tmp > /run/passt.log
+ done ) &
+ n=0
+ while [ ! -S /tmp/passt.sock ] && [ $n -lt 50 ]; do n=$((n+1)); sleep 0.1; done
+ # passt binds its socket (as nobody: /tmp is world-writable, /run is not),
+ # then probes the kernel and sandboxes itself, and it can still exit then
+ # ("Failed to sandbox process" where AppArmor restricts user namespaces):
+ # give it 3 seconds, so that a passt that cannot run is caught here, before
+ # the guest boots, rather than by the supervisor below (a second boot).
+ n=0
+ while [ $n -lt 30 ] && kill -0 "$pid" 2>/dev/null && ! grep -q "Failed to sandbox" /run/passt.log; do n=$((n+1)); sleep 0.1; done
+ # Confinement by a host AppArmor profile is what breaks passt on some hosts: say so.
+ aa=$(cat /proc/$pid/attr/current 2>/dev/null || true)
+ case "$aa" in ""|unconfined) ;; *) echo "[homecloud] passt runs under the AppArmor profile $aa" ;; esac
+ if [ ! -S /tmp/passt.sock ] || ! kill -0 "$pid" 2>/dev/null || grep -q "Failed to sandbox" /run/passt.log; then
+ # It must be gone, with every port it bound, before QEMU forwards ports itself.
+ kill "$pid" 2>/dev/null || true
+ wait "$pid" 2>/dev/null || true
+ pid=""
+ echo "[homecloud] passt did not start; falling back to user-mode networking:" >&2
+ tail -n 40 /run/passt.log >&2 || true
+ if grep -q "Too many open files" /run/passt.log; then
+ echo "hint: the open-file limit ($(ulimit -Hn)) is too low for passt's port forwarding" >&2
+ elif grep -q "Failed to bind" /run/passt.log; then
+ echo "hint: passt binds its socket as user nobody, so the socket directory must be world-writable" >&2
+ elif grep -qE "sandbox|namespace|remount|pivot_root|mount" /run/passt.log; then
+ if [ "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns 2>/dev/null)" = 1 ]; then
+ echo "hint: the Docker host restricts unprivileged user namespaces with AppArmor (kernel.apparmor_restrict_unprivileged_userns=1, the Ubuntu 24.04 default), which passt's sandbox needs; set HC_VM_APPARMOR to a host profile that allows userns, mount and pivot_root, or set that sysctl to 0, to give VM guests passt networking" >&2
+ else
+ echo "hint: the container's seccomp or AppArmor profile blocks passt's sandbox (it needs seccomp to allow unshare, mount, umount2 and pivot_root, and no AppArmor profile that denies them)" >&2
+ fi
+ fi
+ HC_VM_NET=user
+ fi
+fi
+if [ "${HC_VM_NET:-}" = "user" ]; then
+ # QEMU's user-mode networking: the guest sits behind NAT at 10.0.2.15 and
+ # only the ports HC_VM_HOSTFWD lists (",hostfwd=tcp::22-:22,...", the ports
+ # the security groups allow when the container was created) reach it.
+ n=$#
+ while [ "$n" -gt 0 ]; do
+ a=$1; shift; n=$((n-1))
+ case "$a" in
+ stream,id=net0,*) a="user,id=net0${HC_VM_HOSTFWD:-}" ;;
+ esac
+ set -- "$@" "$a"
+ done
+fi
+
+echo "[homecloud] starting the virtual machine"
+# QEMU runs as a child so that this script can watch passt: if passt exits, the
+# guest has lost its network (passt also exits with QEMU, which is fine).
+"$@" &
+qemu=$!
+trap 'kill -TERM "$qemu" 2>/dev/null' TERM INT
+alive() { [ -r "/proc/$1/status" ] && ! grep -q '^State:[[:space:]]*Z' "/proc/$1/status"; }
+reported=
+while alive "$qemu"; do
+ if [ -n "${pid:-}" ] && [ -z "$reported" ] && ! alive "$pid"; then
+ reported=1
+ touch /run/passt.dead # HomeCloud looks for this and restarts the guest in user-mode networking
+ st=0; wait "$pid" || st=$?
+ echo "[homecloud] passt exited unexpectedly (status $st; 137 is SIGKILL, 159 SIGSYS); the guest has lost its network:" >&2
+ tail -n 40 /run/passt.log >&2
+ echo "passt's AppArmor confinement: ${aa:-unknown}" >&2
+ for f in /sys/fs/cgroup/memory.events /sys/fs/cgroup/memory.current /sys/fs/cgroup/memory.max; do
+ [ -r "$f" ] && echo "$f: $(tr '\n' ' ' < "$f")" >&2
+ done
+ fi
+ sleep 2 &
+ wait $!
+done
+wait "$qemu"
diff --git a/cli/internal/svc/ec2/vm/images.go b/cli/internal/svc/ec2/vm/images.go
new file mode 100644
index 00000000..474b2a36
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/images.go
@@ -0,0 +1,127 @@
+package vm
+
+import (
+ "fmt"
+ "regexp"
+ "strings"
+)
+
+// Base is an official cloud image, pinned to a release and verified by
+// checksum after download. Bump the release, URLs and checksums together (the
+// checksum files next to the images list them; ParseChecksums reads them and
+// TestCatalogMatchesPublishedChecksums, with HC_TEST_NET=1, compares).
+type Base struct {
+ Key string // stable key, used in cache file names
+ Release string
+ DefaultUser string
+ Files map[Arch]File
+ // AgentImage is the Docker image of the same distribution release: the
+ // qemu-guest-agent packages (and the dependencies its minimal userland
+ // lacks) are downloaded in it once and handed to the guest on the seed
+ // disk, so installing the agent needs no network in the guest.
+ AgentImage string
+}
+
+// AgentCacheName is the directory in the image cache that holds the guest
+// agent's packages for an architecture.
+func (b Base) AgentCacheName(a Arch) string {
+ return fmt.Sprintf("%s-%s-qemu-guest-agent", b.Key, a.Deb())
+}
+
+// AgentFetchScript downloads qemu-guest-agent and the packages it needs that
+// the distribution's minimal image lacks into /images/<$1> (run in a container
+// of AgentImage). The file names are shortened: the seed disk is an ISO image.
+const AgentFetchScript = `set -eu
+dest=/images/$1
+[ -f "$dest/.complete" ] && exit 0
+rm -rf "$dest.part"
+mkdir -p "$dest.part/partial"
+export DEBIAN_FRONTEND=noninteractive
+apt-get update -qq
+apt-get install -y -qq --download-only --no-install-recommends -o Dir::Cache::archives="$dest.part" qemu-guest-agent >/dev/null
+rm -rf "$dest.part/partial" "$dest.part/lock"
+n=0
+for f in "$dest.part"/*.deb; do n=$((n+1)); mv "$f" "$dest.part/p$n.deb"; done
+[ "$n" -gt 0 ]
+touch "$dest.part/.complete"
+rm -rf "$dest"
+mv "$dest.part" "$dest"
+`
+
+// File is one architecture's image.
+type File struct {
+ URL string
+ // Sum is the hex SHA-256 (64 digits) or SHA-512 (128 digits) of the file.
+ Sum string
+}
+
+// Name of the image file in the cache: unique per release, architecture and content.
+func (b Base) CacheName(a Arch) string {
+ f := b.Files[a]
+ return fmt.Sprintf("%s-%s-%s-%.12s.qcow2", b.Key, a.Deb(), b.Release, f.Sum)
+}
+
+// For returns the image for an architecture.
+func (b Base) For(a Arch) (File, error) {
+ f, ok := b.Files[a]
+ if !ok {
+ return File{}, fmt.Errorf("no %s image for %s", b.Key, a)
+ }
+ return f, nil
+}
+
+// Bases are the VM images HomeCloud can launch, by key.
+var Bases = map[string]Base{
+ "ubuntu-24.04": {
+ Key: "ubuntu-24.04", Release: "20260926", DefaultUser: "ubuntu", AgentImage: "ubuntu:24.04",
+ Files: map[Arch]File{
+ ArchAArch64: {
+ URL: "https://cloud-images.ubuntu.com/releases/noble/release-20260926/ubuntu-24.04-server-cloudimg-arm64.img",
+ Sum: "1d6bffe64b848468ac97f821d369a4846d983de1800ccf6b5ec8853e85cefc55",
+ },
+ ArchX8664: {
+ URL: "https://cloud-images.ubuntu.com/releases/noble/release-20260926/ubuntu-24.04-server-cloudimg-amd64.img",
+ Sum: "6a81c37564db9b1ee84e141922625e1d7c5b389b99bb3c572e0243607d5bb4d2",
+ },
+ },
+ },
+ "debian-12": {
+ Key: "debian-12", Release: "20260923-2610", DefaultUser: "debian", AgentImage: "debian:12",
+ Files: map[Arch]File{
+ ArchAArch64: {
+ URL: "https://cloud.debian.org/images/cloud/bookworm/20260923-2610/debian-12-genericcloud-arm64-20260923-2610.qcow2",
+ Sum: "89a752d5c7d8e88bee39a57d88d496cca574f7d1e8df5df7a169825435f99feb11ed13ab27ec7bee96fe1584be4ff9479358fbca6cc859efa109f4aba18724c8",
+ },
+ ArchX8664: {
+ URL: "https://cloud.debian.org/images/cloud/bookworm/20260923-2610/debian-12-genericcloud-amd64-20260923-2610.qcow2",
+ Sum: "3d94c9dd66d8a283fde060b8810373b7ae04038b956ee00d553d1ae564f6fbdeaa2fd6e7404e87e53348b5a9509170f3ea7c0731ba737590c5c4cb8d559a47f8",
+ },
+ },
+ },
+}
+
+var sumRE = regexp.MustCompile(`^(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{128})$`)
+
+// ValidSum reports whether s is a SHA-256 or SHA-512 hex digest.
+func ValidSum(s string) bool { return sumRE.MatchString(s) }
+
+// ParseChecksums reads a SHA256SUMS or SHA512SUMS file (" " or
+// " *", one per line; "# comments" and blank lines are skipped)
+// into digests by file name.
+func ParseChecksums(text string) (map[string]string, error) {
+ out := map[string]string{}
+ for n, line := range strings.Split(text, "\n") {
+ line = strings.TrimSpace(line)
+ if line == "" || strings.HasPrefix(line, "#") {
+ continue
+ }
+ sum, name, ok := strings.Cut(line, " ")
+ name = strings.TrimSpace(name)
+ name = strings.TrimPrefix(name, "*") // binary mode marker
+ if !ok || name == "" || !ValidSum(sum) {
+ return nil, fmt.Errorf("checksums line %d: %q is not \" \"", n+1, line)
+ }
+ out[name] = strings.ToLower(sum)
+ }
+ return out, nil
+}
diff --git a/cli/internal/svc/ec2/vm/qemu.go b/cli/internal/svc/ec2/vm/qemu.go
new file mode 100644
index 00000000..79b79dc0
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/qemu.go
@@ -0,0 +1,130 @@
+package vm
+
+import (
+ "crypto/sha256"
+ "fmt"
+ "strconv"
+)
+
+// Sockets inside the VM container: the guest's serial console (one client at a
+// time), the qemu-guest-agent channel and its virtio-serial port name.
+const (
+ SerialSocket = "/run/serial.sock"
+ QGASocket = "/run/qga.sock"
+ QGAChannel = "org.qemu.guest_agent.0"
+)
+
+// Machine is a guest's hardware.
+type Machine struct {
+ Name string // instance ID
+ Arch Arch
+ KVM bool // hardware acceleration; otherwise TCG emulation
+ VCPUs int
+ MemoryMB int64
+ // Disks are the extra volumes, attached as virtio disks after the root disk
+ // in this order (so /dev/vdb, /dev/vdc, ...). Each is a raw image file
+ // /disks//disk.img, and its serial makes /dev/disk/by-id/virtio-.
+ Disks []Disk
+}
+
+// Disk is an extra volume of a VM.
+type Disk struct {
+ ID string // the volume ID
+}
+
+// DisksDir is where the VM container mounts the extra volumes (one per volume ID).
+const DisksDir = "/disks"
+
+// Path of the disk's image file in the VM container.
+func (d Disk) Path() string { return DisksDir + "/" + d.ID + "/disk.img" }
+
+// Serial is the virtio serial of the disk: the volume ID cut to the 20
+// characters virtio-blk allows.
+func (d Disk) Serial() string {
+ if len(d.ID) > 20 {
+ return d.ID[:20]
+ }
+ return d.ID
+}
+
+// MAC is a stable, locally administered address derived from the instance ID.
+func (m Machine) MAC() string {
+ sum := sha256.Sum256([]byte(m.Name))
+ return fmt.Sprintf("52:54:00:%02x:%02x:%02x", sum[0], sum[1], sum[2])
+}
+
+// Args is the QEMU command line (without the binary). The runner's entrypoint
+// prepares /vm/disk.qcow2, /vm/seed.iso, /vm/efivars.fd and the passt socket
+// before it starts QEMU.
+//
+// The guest's serial console is served on SerialSocket (the browser terminal)
+// and logged to QEMU's stdout, i.e. the container's log, which is what
+// GetConsoleOutput returns. The guest agent's channel is QGASocket. QMP listens on /run/qmp.sock for the
+// power controls (hc-vm-ctl).
+func (m Machine) Args() []string {
+ vcpus := max(1, m.VCPUs)
+ args := []string{
+ "-name", m.Name,
+ "-nodefaults", "-no-user-config",
+ }
+ switch m.Arch {
+ case ArchAArch64:
+ args = append(args, "-machine", "virt,gic-version=max")
+ default:
+ args = append(args, "-machine", "q35")
+ }
+ if m.KVM {
+ args = append(args, "-accel", "kvm", "-cpu", "host")
+ } else if m.Arch == ArchAArch64 {
+ // pauth-impdef makes pointer authentication cheap to emulate.
+ args = append(args, "-accel", "tcg,thread=multi", "-cpu", "max,pauth-impdef=on")
+ } else {
+ args = append(args, "-accel", "tcg,thread=multi", "-cpu", "max")
+ }
+ args = append(args, "-smp", strconv.Itoa(vcpus), "-m", strconv.FormatInt(m.MemoryMB, 10))
+ if m.Arch == ArchAArch64 {
+ args = append(args,
+ "-drive", "if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd",
+ "-drive", "if=pflash,format=raw,unit=1,file="+DiskDir+"/efivars.fd",
+ )
+ }
+ args = append(args,
+ // The NIC is wired to passt inside the container (see hc-vm-run). It is
+ // declared first, at a fixed PCI slot, so that its name in the guest
+ // (enp0s3) does not change when disks are added or removed: the guest's
+ // network configuration refers to it.
+ "-netdev", "stream,id=net0,addr.type=unix,addr.path=/tmp/passt.sock,server=off",
+ "-device", "virtio-net-pci,netdev=net0,mac="+m.MAC()+",romfile=,addr=0x3",
+ // Root disk, extra volumes, then the cloud-init seed (label cidata, found by NoCloud).
+ "-drive", "file="+DiskDir+"/disk.qcow2,if=none,id=root,format=qcow2",
+ "-device", "virtio-blk-pci,drive=root,bootindex=1",
+ )
+ for i, d := range m.Disks {
+ args = append(args,
+ "-drive", fmt.Sprintf("file=%s,if=none,id=data%d,format=raw", d.Path(), i),
+ "-device", fmt.Sprintf("virtio-blk-pci,drive=data%d,serial=%s", i, d.Serial()),
+ )
+ }
+ args = append(args,
+ "-drive", "file="+DiskDir+"/seed.iso,if=none,id=seed,format=raw,readonly=on",
+ "-device", "virtio-blk-pci,drive=seed",
+ "-device", "virtio-rng-pci",
+ "-display", "none", "-monitor", "none",
+ // The serial console is a socket the browser terminal attaches to;
+ // logfile tees everything the guest prints to QEMU's stdout (the
+ // container's log) whether or not anyone is attached.
+ "-chardev", "socket,id=ser0,path="+SerialSocket+",server=on,wait=off,logfile=/dev/stdout,logappend=on",
+ "-serial", "chardev:ser0",
+ // qemu-guest-agent's channel (run-command, guest metrics).
+ "-chardev", "socket,id=qga0,path="+QGASocket+",server=on,wait=off",
+ "-device", "virtio-serial-pci,id=vser0",
+ "-device", "virtserialport,bus=vser0.0,chardev=qga0,name="+QGAChannel,
+ "-qmp", "unix:/run/qmp.sock,server=on,wait=off",
+ )
+ return args
+}
+
+// Command is the container command: the QEMU binary and its arguments.
+func (m Machine) Command() []string {
+ return append([]string{m.Arch.QEMU()}, m.Args()...)
+}
diff --git a/cli/internal/svc/ec2/vm/qga.go b/cli/internal/svc/ec2/vm/qga.go
new file mode 100644
index 00000000..bfaa49f2
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/qga.go
@@ -0,0 +1,266 @@
+package vm
+
+import (
+ "bytes"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// The pure parts of talking to qemu-guest-agent (QGA) over the virtio-serial
+// socket: request encoding, reply framing, guest-exec results and the parsers
+// of the /proc sample the CloudWatch metrics come from. The connection itself
+// (a docker exec of socat into the VM container) is in the ec2 package.
+
+// QGARequest encodes a command as one line.
+func QGARequest(cmd string, args any) []byte {
+ m := map[string]any{"execute": cmd}
+ if args != nil {
+ m["arguments"] = args
+ }
+ b, _ := json.Marshal(m)
+ return append(b, '\n')
+}
+
+// QGASync is the handshake that discards whatever a previous client left in
+// the channel: the agent answers with 0xFF and the same id (guest-sync-delimited).
+func QGASync(id int64) []byte { return QGARequest("guest-sync-delimited", map[string]int64{"id": id}) }
+
+// QGAReply is a parsed reply line.
+type QGAReply struct {
+ Return json.RawMessage `json:"return"`
+ Error *struct {
+ Class string `json:"class"`
+ Desc string `json:"desc"`
+ } `json:"error"`
+ // Synced is set for the reply to guest-sync-delimited (it starts with 0xFF).
+ Synced bool `json:"-"`
+}
+
+// Err is the agent's error, if the command failed.
+func (r QGAReply) Err() error {
+ if r.Error == nil {
+ return nil
+ }
+ return fmt.Errorf("guest agent: %s: %s", r.Error.Class, r.Error.Desc)
+}
+
+// ParseQGAReply parses one line of the agent's output. ok is false for
+// anything that is not a reply (partial or garbled lines are skipped by the caller).
+func ParseQGAReply(line []byte) (r QGAReply, ok bool) {
+ line = bytes.TrimSpace(line)
+ synced := false
+ if i := bytes.IndexByte(line, 0xFF); i >= 0 {
+ synced = true
+ line = bytes.TrimSpace(line[i+1:])
+ }
+ if len(line) == 0 || line[0] != '{' || json.Unmarshal(line, &r) != nil {
+ return QGAReply{}, false
+ }
+ r.Synced = synced
+ return r, r.Return != nil || r.Error != nil
+}
+
+// QGAExecRequest starts a program in the guest and captures its output.
+func QGAExecRequest(path string, args []string) []byte {
+ return QGARequest("guest-exec", map[string]any{"path": path, "arg": args, "capture-output": true})
+}
+
+// QGAExecStatusRequest polls a guest-exec by pid.
+func QGAExecStatusRequest(pid int64) []byte {
+ return QGARequest("guest-exec-status", map[string]int64{"pid": pid})
+}
+
+// ParseExecPID is the pid in the reply to guest-exec.
+func ParseExecPID(ret json.RawMessage) (int64, error) {
+ var v struct {
+ PID int64 `json:"pid"`
+ }
+ if err := json.Unmarshal(ret, &v); err != nil || v.PID == 0 {
+ return 0, fmt.Errorf("guest-exec returned no pid: %s", ret)
+ }
+ return v.PID, nil
+}
+
+// ExecStatus is the result of guest-exec-status.
+type ExecStatus struct {
+ Exited bool
+ ExitCode int
+ Stdout string
+ Stderr string
+ Truncated bool
+}
+
+// ParseExecStatus decodes the reply of guest-exec-status.
+func ParseExecStatus(ret json.RawMessage) (ExecStatus, error) {
+ var v struct {
+ Exited bool `json:"exited"`
+ ExitCode int `json:"exitcode"`
+ Signal int `json:"signal"`
+ OutData string `json:"out-data"`
+ ErrData string `json:"err-data"`
+ OutTrunc bool `json:"out-truncated"`
+ ErrTrunc bool `json:"err-truncated"`
+ }
+ if err := json.Unmarshal(ret, &v); err != nil {
+ return ExecStatus{}, fmt.Errorf("guest-exec-status: %w", err)
+ }
+ out, err := base64.StdEncoding.DecodeString(v.OutData)
+ if err != nil {
+ return ExecStatus{}, fmt.Errorf("guest-exec-status: out-data: %w", err)
+ }
+ errs, err := base64.StdEncoding.DecodeString(v.ErrData)
+ if err != nil {
+ return ExecStatus{}, fmt.Errorf("guest-exec-status: err-data: %w", err)
+ }
+ st := ExecStatus{Exited: v.Exited, ExitCode: v.ExitCode, Stdout: string(out), Stderr: string(errs), Truncated: v.OutTrunc || v.ErrTrunc}
+ if v.Signal != 0 && v.ExitCode == 0 {
+ st.ExitCode = 128 + v.Signal // the shell's convention
+ }
+ return st, nil
+}
+
+// ShellCommand is the guest-exec program and arguments that run a shell
+// command with a timeout (coreutils timeout when present; it exits 124).
+func ShellCommand(command string, timeoutSeconds int) (path string, args []string) {
+ const wrapper = `if command -v timeout >/dev/null 2>&1; then exec timeout -k 5 "$1" /bin/sh -c "$2"; else exec /bin/sh -c "$2"; fi`
+ return "/bin/sh", []string{"-c", wrapper, "hc", strconv.Itoa(timeoutSeconds), command}
+}
+
+// StatsCommand samples the guest's /proc for CloudWatch: CPU time twice, a
+// second apart (so the utilization needs no state between samples), then memory,
+// network, disks and the process count.
+const StatsCommand = `cat /proc/stat; echo "==cpu2"; sleep 1; cat /proc/stat; echo "==meminfo"; cat /proc/meminfo; echo "==netdev"; cat /proc/net/dev; echo "==diskstats"; cat /proc/diskstats; echo "==procs"; ls -d /proc/[0-9]* | wc -l`
+
+// GuestStats is one sample of the guest.
+type GuestStats struct {
+ CPUPercent float64
+ MemoryUsed uint64 // bytes: MemTotal - MemAvailable
+ MemoryTotal uint64
+ NetRx uint64 // cumulative bytes over all interfaces but lo
+ NetTx uint64
+ DiskRead uint64 // cumulative bytes over whole block devices
+ DiskWrite uint64
+ Processes uint64
+}
+
+// MemoryPercent is used memory as a share of the guest's memory.
+func (g GuestStats) MemoryPercent() float64 {
+ if g.MemoryTotal == 0 {
+ return 0
+ }
+ return float64(g.MemoryUsed) / float64(g.MemoryTotal) * 100
+}
+
+// ParseGuestStats parses the output of StatsCommand.
+func ParseGuestStats(out string) (GuestStats, error) {
+ secs := map[string]string{}
+ cur := "cpu1"
+ var b strings.Builder
+ flush := func() { secs[cur] = b.String(); b.Reset() }
+ for _, l := range strings.Split(out, "\n") {
+ if name, ok := strings.CutPrefix(l, "=="); ok {
+ flush()
+ cur = strings.TrimSpace(name)
+ continue
+ }
+ b.WriteString(l + "\n")
+ }
+ flush()
+
+ var g GuestStats
+ t1, i1, ok1 := cpuTimes(secs["cpu1"])
+ t2, i2, ok2 := cpuTimes(secs["cpu2"])
+ if !ok1 || !ok2 {
+ return g, fmt.Errorf("no cpu line in the guest's /proc/stat")
+ }
+ if t2 > t1 {
+ busy := float64(t2-t1) - float64(i2-i1)
+ g.CPUPercent = max(0, min(100, busy/float64(t2-t1)*100))
+ }
+ var avail uint64
+ for _, l := range strings.Split(secs["meminfo"], "\n") {
+ f := strings.Fields(l)
+ if len(f) < 2 {
+ continue
+ }
+ kb, _ := strconv.ParseUint(f[1], 10, 64)
+ switch f[0] {
+ case "MemTotal:":
+ g.MemoryTotal = kb * 1024
+ case "MemAvailable:":
+ avail = kb * 1024
+ }
+ }
+ if g.MemoryTotal == 0 {
+ return g, fmt.Errorf("no MemTotal in the guest's /proc/meminfo")
+ }
+ g.MemoryUsed = g.MemoryTotal - min(avail, g.MemoryTotal)
+ for _, l := range strings.Split(secs["netdev"], "\n") {
+ name, rest, ok := strings.Cut(l, ":")
+ if !ok || strings.TrimSpace(name) == "lo" {
+ continue
+ }
+ f := strings.Fields(rest)
+ if len(f) < 9 {
+ continue
+ }
+ rx, _ := strconv.ParseUint(f[0], 10, 64)
+ tx, _ := strconv.ParseUint(f[8], 10, 64)
+ g.NetRx += rx
+ g.NetTx += tx
+ }
+ for _, l := range strings.Split(secs["diskstats"], "\n") {
+ f := strings.Fields(l)
+ if len(f) < 10 || !wholeDisk(f[2]) {
+ continue
+ }
+ r, _ := strconv.ParseUint(f[5], 10, 64) // sectors read
+ w, _ := strconv.ParseUint(f[9], 10, 64) // sectors written
+ g.DiskRead += r * 512
+ g.DiskWrite += w * 512
+ }
+ g.Processes, _ = strconv.ParseUint(strings.TrimSpace(secs["procs"]), 10, 64)
+ return g, nil
+}
+
+// cpuTimes returns the total and idle (idle + iowait) jiffies of the aggregate cpu line.
+func cpuTimes(s string) (total, idle uint64, ok bool) {
+ for _, l := range strings.Split(s, "\n") {
+ f := strings.Fields(l)
+ if len(f) < 5 || f[0] != "cpu" {
+ continue
+ }
+ for i, v := range f[1:] {
+ if i >= 8 { // guest and guest_nice are already part of user and nice
+ break
+ }
+ n, err := strconv.ParseUint(v, 10, 64)
+ if err != nil {
+ return 0, 0, false
+ }
+ total += n
+ if i == 3 || i == 4 {
+ idle += n
+ }
+ }
+ return total, idle, true
+ }
+ return 0, 0, false
+}
+
+// wholeDisk is true for virtio, SCSI/SATA and NVMe disks, not partitions, loop or device-mapper devices.
+func wholeDisk(name string) bool {
+ for _, p := range []string{"vd", "sd", "xvd", "hd"} {
+ if rest, ok := strings.CutPrefix(name, p); ok && rest != "" {
+ return strings.Trim(rest, "abcdefghijklmnopqrstuvwxyz") == ""
+ }
+ }
+ if rest, ok := strings.CutPrefix(name, "nvme"); ok {
+ // nvme0n1 is a disk, nvme0n1p1 a partition
+ return !strings.Contains(rest, "p") && strings.Contains(rest, "n")
+ }
+ return false
+}
diff --git a/cli/internal/svc/ec2/vm/qga_test.go b/cli/internal/svc/ec2/vm/qga_test.go
new file mode 100644
index 00000000..6e7e278b
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/qga_test.go
@@ -0,0 +1,170 @@
+package vm
+
+import (
+ "encoding/base64"
+ "encoding/json"
+ "strings"
+ "testing"
+)
+
+func TestQGARequests(t *testing.T) {
+ if got := string(QGASync(42)); got != `{"arguments":{"id":42},"execute":"guest-sync-delimited"}`+"\n" {
+ t.Errorf("sync: %q", got)
+ }
+ if got := string(QGAExecStatusRequest(7)); got != `{"arguments":{"pid":7},"execute":"guest-exec-status"}`+"\n" {
+ t.Errorf("status: %q", got)
+ }
+ var m map[string]any
+ if err := json.Unmarshal(QGAExecRequest("/bin/sh", []string{"-c", "echo \"hi\""}), &m); err != nil {
+ t.Fatal(err)
+ }
+ a := m["arguments"].(map[string]any)
+ if m["execute"] != "guest-exec" || a["path"] != "/bin/sh" || a["capture-output"] != true || len(a["arg"].([]any)) != 2 {
+ t.Errorf("exec: %v", m)
+ }
+}
+
+func TestParseQGAReply(t *testing.T) {
+ r, ok := ParseQGAReply([]byte("\xff{\"return\": 42}\n"))
+ if !ok || !r.Synced || string(r.Return) != "42" {
+ t.Errorf("sync reply: %+v %v", r, ok)
+ }
+ r, ok = ParseQGAReply([]byte(`{"return": {"pid": 9}}`))
+ if !ok || r.Synced {
+ t.Fatalf("reply: %+v %v", r, ok)
+ }
+ if pid, err := ParseExecPID(r.Return); err != nil || pid != 9 {
+ t.Errorf("pid %d %v", pid, err)
+ }
+ r, ok = ParseQGAReply([]byte(`{"error": {"class": "CommandNotFound", "desc": "nope"}}`))
+ if !ok || r.Err() == nil || !strings.Contains(r.Err().Error(), "nope") {
+ t.Errorf("error reply: %+v %v", r, ok)
+ }
+ for _, junk := range []string{"", "garbage", `{"partial"`, `{"x":1}`, "\xff"} {
+ if _, ok := ParseQGAReply([]byte(junk)); ok {
+ t.Errorf("%q parsed as a reply", junk)
+ }
+ }
+ if _, err := ParseExecPID(json.RawMessage(`{}`)); err == nil {
+ t.Error("missing pid accepted")
+ }
+}
+
+func TestParseExecStatus(t *testing.T) {
+ b64 := func(s string) string { return base64.StdEncoding.EncodeToString([]byte(s)) }
+ st, err := ParseExecStatus(json.RawMessage(`{"exited":true,"exitcode":3,"out-data":"` + b64("out\n") + `","err-data":"` + b64("bad\n") + `"}`))
+ if err != nil || !st.Exited || st.ExitCode != 3 || st.Stdout != "out\n" || st.Stderr != "bad\n" {
+ t.Errorf("%+v %v", st, err)
+ }
+ st, _ = ParseExecStatus(json.RawMessage(`{"exited":false}`))
+ if st.Exited {
+ t.Errorf("running reported as exited: %+v", st)
+ }
+ st, _ = ParseExecStatus(json.RawMessage(`{"exited":true,"signal":9,"out-truncated":true}`))
+ if st.ExitCode != 137 || !st.Truncated {
+ t.Errorf("signal: %+v", st)
+ }
+ if _, err := ParseExecStatus(json.RawMessage(`{"exited":true,"out-data":"***"}`)); err == nil {
+ t.Error("bad base64 accepted")
+ }
+}
+
+func TestShellCommand(t *testing.T) {
+ p, args := ShellCommand(`echo "a b"; exit 3`, 30)
+ if p != "/bin/sh" || len(args) != 5 || args[3] != "30" || args[4] != `echo "a b"; exit 3` || !strings.Contains(args[1], "timeout -k 5") {
+ t.Errorf("%s %q", p, args)
+ }
+}
+
+const sampleProc = `cpu 1000 0 500 8000 100 0 0 0 0 0
+cpu0 1000 0 500 8000 100 0 0 0 0 0
+intr 1
+==cpu2
+cpu 1100 0 550 8050 100 0 0 0 0 0
+cpu0 1100 0 550 8050 100 0 0 0 0 0
+==meminfo
+MemTotal: 2048000 kB
+MemFree: 100000 kB
+MemAvailable: 1024000 kB
+==netdev
+Inter-| Receive | Transmit
+ face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
+ lo: 5000 10 0 0 0 0 0 0 5000 10 0 0 0 0 0 0
+ ens3: 1000 5 0 0 0 0 0 0 2000 6 0 0 0 0 0 0
+==diskstats
+ 252 0 vda 100 0 2000 50 30 0 400 20 0 0 0 0 0 0 0 0 0
+ 252 1 vda1 90 0 1800 40 25 0 350 10 0 0 0 0 0 0 0 0 0
+ 7 0 loop0 1 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ 259 0 nvme0n1 5 0 100 0 5 0 100 0 0 0 0 0 0 0 0 0 0
+ 259 1 nvme0n1p1 5 0 100 0 5 0 100 0 0 0 0 0 0 0 0 0 0
+==procs
+87
+`
+
+func TestParseGuestStats(t *testing.T) {
+ g, err := ParseGuestStats(sampleProc)
+ if err != nil {
+ t.Fatal(err)
+ }
+ // 200 jiffies passed, 50 of them idle: 150/200 busy... total delta = 100+0+50+50+0 = 200, idle delta 50.
+ if g.CPUPercent != 75 {
+ t.Errorf("cpu %v, want 75", g.CPUPercent)
+ }
+ if g.MemoryTotal != 2048000*1024 || g.MemoryUsed != 1024000*1024 || g.MemoryPercent() != 50 {
+ t.Errorf("memory %+v", g)
+ }
+ if g.NetRx != 1000 || g.NetTx != 2000 {
+ t.Errorf("network rx %d tx %d (lo must not count)", g.NetRx, g.NetTx)
+ }
+ // vda (2000 sectors read, 400 written) and nvme0n1 (100, 100); partitions and loop devices excluded.
+ if g.DiskRead != (2000+100)*512 || g.DiskWrite != (400+100)*512 {
+ t.Errorf("disk read %d write %d", g.DiskRead, g.DiskWrite)
+ }
+ if g.Processes != 87 {
+ t.Errorf("processes %d", g.Processes)
+ }
+}
+
+func TestParseGuestStatsErrors(t *testing.T) {
+ if _, err := ParseGuestStats("nothing useful\n"); err == nil {
+ t.Error("output without /proc/stat accepted")
+ }
+ cpu := "cpu 1 0 1 1 0 0 0 0 0 0\n==cpu2\ncpu 2 0 2 2 0 0 0 0 0 0\n"
+ if _, err := ParseGuestStats(cpu); err == nil || !strings.Contains(err.Error(), "MemTotal") {
+ t.Errorf("missing meminfo: %v", err)
+ }
+ // An idle interval (no jiffies passed) reports 0, not NaN.
+ g, err := ParseGuestStats("cpu 1 0 1 1 0\n==cpu2\ncpu 1 0 1 1 0\n==meminfo\nMemTotal: 10 kB\n")
+ if err != nil || g.CPUPercent != 0 || g.MemoryUsed != 10*1024 {
+ t.Errorf("%+v %v", g, err)
+ }
+}
+
+func TestWholeDisk(t *testing.T) {
+ for name, want := range map[string]bool{"vda": true, "vdb": true, "sda": true, "xvda": true, "nvme0n1": true,
+ "vda1": false, "sda2": false, "nvme0n1p2": false, "loop0": false, "dm-0": false, "sr0": false, "vd": false} {
+ if got := wholeDisk(name); got != want {
+ t.Errorf("wholeDisk(%q) = %v", name, got)
+ }
+ }
+}
+
+func TestAttachCommands(t *testing.T) {
+ if s := strings.Join(SerialAttachCommand(), " "); s != "socat -,raw,echo=0 UNIX-CONNECT:/run/serial.sock" {
+ t.Error(s)
+ }
+ if s := strings.Join(QGAAttachCommand(), " "); s != "socat -t 1 - UNIX-CONNECT:/run/qga.sock" {
+ t.Error(s)
+ }
+}
+
+func TestSeedInstallsGuestAgent(t *testing.T) {
+ f := Seed{InstanceID: "i", Hostname: "h", UserData: "#cloud-config\npackages: [htop]\n"}.Files()
+ v := string(f["vendor-data"])
+ if !strings.HasPrefix(v, "#!/bin/sh") || !strings.Contains(v, "qemu-guest-agent") || !strings.Contains(v, "systemctl enable --now qemu-guest-agent") {
+ t.Errorf("vendor-data:\n%s", v)
+ }
+ if !strings.Contains(string(f["user-data"]), "htop") {
+ t.Error("user data lost")
+ }
+}
diff --git a/cli/internal/svc/ec2/vm/runner.Dockerfile b/cli/internal/svc/ec2/vm/runner.Dockerfile
new file mode 100644
index 00000000..b8df04c3
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/runner.Dockerfile
@@ -0,0 +1,28 @@
+FROM debian:trixie-slim@sha256:a99cfc517144bc59b1978475ec53b46ecabec7e43635402ee5b77cc54cd1b20a
+# The guest architecture is the Docker host's: aarch64 guests use UEFI (AAVMF)
+# firmware, x86_64 guests use SeaBIOS (bundled with QEMU).
+RUN set -eu; \
+ arch="$(dpkg --print-architecture)"; \
+ case "$arch" in \
+ arm64) pkgs="qemu-system-arm qemu-efi-aarch64" ;; \
+ amd64) pkgs="qemu-system-x86" ;; \
+ *) echo "unsupported architecture $arch" >&2; exit 1 ;; \
+ esac; \
+ apt-get update; \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ $pkgs qemu-utils passt genisoimage socat curl ca-certificates; \
+ rm -rf /var/lib/apt/lists/*; \
+ # passt runs from a path of its own: a Docker host with the passt package
+ # attaches its AppArmor profile, written for the host's passt version, to
+ # /usr/bin/passt, and it would confine this one too (on GitHub's Ubuntu
+ # 24.04 runners that passt lost its network at the first inbound
+ # connection). The AVX2 build is found next to the binary.
+ mkdir -p /usr/local/libexec/homecloud; \
+ cp -L /usr/bin/passt /usr/local/libexec/homecloud/passt; \
+ if [ -e /usr/bin/passt.avx2 ]; then cp -L /usr/bin/passt.avx2 /usr/local/libexec/homecloud/passt.avx2; fi
+COPY hc-vm-run /usr/local/bin/hc-vm-run
+COPY hc-vm-fetch /usr/local/bin/hc-vm-fetch
+COPY hc-vm-ctl /usr/local/bin/hc-vm-ctl
+COPY hc-vm-flatten /usr/local/bin/hc-vm-flatten
+RUN chmod 0755 /usr/local/bin/hc-vm-*
+ENTRYPOINT ["/usr/local/bin/hc-vm-run"]
diff --git a/cli/internal/svc/ec2/vm/seccomp-docker-default.json b/cli/internal/svc/ec2/vm/seccomp-docker-default.json
new file mode 100644
index 00000000..c4d91109
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/seccomp-docker-default.json
@@ -0,0 +1,833 @@
+{
+ "defaultAction": "SCMP_ACT_ERRNO",
+ "defaultErrnoRet": 1,
+ "archMap": [
+ {
+ "architecture": "SCMP_ARCH_X86_64",
+ "subArchitectures": [
+ "SCMP_ARCH_X86",
+ "SCMP_ARCH_X32"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_AARCH64",
+ "subArchitectures": [
+ "SCMP_ARCH_ARM"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_MIPS64",
+ "subArchitectures": [
+ "SCMP_ARCH_MIPS",
+ "SCMP_ARCH_MIPS64N32"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_MIPS64N32",
+ "subArchitectures": [
+ "SCMP_ARCH_MIPS",
+ "SCMP_ARCH_MIPS64"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_MIPSEL64",
+ "subArchitectures": [
+ "SCMP_ARCH_MIPSEL",
+ "SCMP_ARCH_MIPSEL64N32"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_MIPSEL64N32",
+ "subArchitectures": [
+ "SCMP_ARCH_MIPSEL",
+ "SCMP_ARCH_MIPSEL64"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_S390X",
+ "subArchitectures": [
+ "SCMP_ARCH_S390"
+ ]
+ },
+ {
+ "architecture": "SCMP_ARCH_RISCV64",
+ "subArchitectures": null
+ }
+ ],
+ "syscalls": [
+ {
+ "names": [
+ "accept",
+ "accept4",
+ "access",
+ "adjtimex",
+ "alarm",
+ "bind",
+ "brk",
+ "cachestat",
+ "capget",
+ "capset",
+ "chdir",
+ "chmod",
+ "chown",
+ "chown32",
+ "clock_adjtime",
+ "clock_adjtime64",
+ "clock_getres",
+ "clock_getres_time64",
+ "clock_gettime",
+ "clock_gettime64",
+ "clock_nanosleep",
+ "clock_nanosleep_time64",
+ "close",
+ "close_range",
+ "connect",
+ "copy_file_range",
+ "creat",
+ "dup",
+ "dup2",
+ "dup3",
+ "epoll_create",
+ "epoll_create1",
+ "epoll_ctl",
+ "epoll_ctl_old",
+ "epoll_pwait",
+ "epoll_pwait2",
+ "epoll_wait",
+ "epoll_wait_old",
+ "eventfd",
+ "eventfd2",
+ "execve",
+ "execveat",
+ "exit",
+ "exit_group",
+ "faccessat",
+ "faccessat2",
+ "fadvise64",
+ "fadvise64_64",
+ "fallocate",
+ "fanotify_mark",
+ "fchdir",
+ "fchmod",
+ "fchmodat",
+ "fchmodat2",
+ "fchown",
+ "fchown32",
+ "fchownat",
+ "fcntl",
+ "fcntl64",
+ "fdatasync",
+ "fgetxattr",
+ "flistxattr",
+ "flock",
+ "fork",
+ "fremovexattr",
+ "fsetxattr",
+ "fstat",
+ "fstat64",
+ "fstatat64",
+ "fstatfs",
+ "fstatfs64",
+ "fsync",
+ "ftruncate",
+ "ftruncate64",
+ "futex",
+ "futex_requeue",
+ "futex_time64",
+ "futex_wait",
+ "futex_waitv",
+ "futex_wake",
+ "futimesat",
+ "getcpu",
+ "getcwd",
+ "getdents",
+ "getdents64",
+ "getegid",
+ "getegid32",
+ "geteuid",
+ "geteuid32",
+ "getgid",
+ "getgid32",
+ "getgroups",
+ "getgroups32",
+ "getitimer",
+ "getpeername",
+ "getpgid",
+ "getpgrp",
+ "getpid",
+ "getppid",
+ "getpriority",
+ "getrandom",
+ "getresgid",
+ "getresgid32",
+ "getresuid",
+ "getresuid32",
+ "getrlimit",
+ "get_robust_list",
+ "getrusage",
+ "getsid",
+ "getsockname",
+ "getsockopt",
+ "get_thread_area",
+ "gettid",
+ "gettimeofday",
+ "getuid",
+ "getuid32",
+ "getxattr",
+ "inotify_add_watch",
+ "inotify_init",
+ "inotify_init1",
+ "inotify_rm_watch",
+ "io_cancel",
+ "ioctl",
+ "io_destroy",
+ "io_getevents",
+ "io_pgetevents",
+ "io_pgetevents_time64",
+ "ioprio_get",
+ "ioprio_set",
+ "io_setup",
+ "io_submit",
+ "ipc",
+ "kill",
+ "landlock_add_rule",
+ "landlock_create_ruleset",
+ "landlock_restrict_self",
+ "lchown",
+ "lchown32",
+ "lgetxattr",
+ "link",
+ "linkat",
+ "listen",
+ "listxattr",
+ "llistxattr",
+ "_llseek",
+ "lremovexattr",
+ "lseek",
+ "lsetxattr",
+ "lstat",
+ "lstat64",
+ "madvise",
+ "map_shadow_stack",
+ "membarrier",
+ "memfd_create",
+ "memfd_secret",
+ "mincore",
+ "mkdir",
+ "mkdirat",
+ "mknod",
+ "mknodat",
+ "mlock",
+ "mlock2",
+ "mlockall",
+ "mmap",
+ "mmap2",
+ "mprotect",
+ "mq_getsetattr",
+ "mq_notify",
+ "mq_open",
+ "mq_timedreceive",
+ "mq_timedreceive_time64",
+ "mq_timedsend",
+ "mq_timedsend_time64",
+ "mq_unlink",
+ "mremap",
+ "msgctl",
+ "msgget",
+ "msgrcv",
+ "msgsnd",
+ "msync",
+ "munlock",
+ "munlockall",
+ "munmap",
+ "name_to_handle_at",
+ "nanosleep",
+ "newfstatat",
+ "_newselect",
+ "open",
+ "openat",
+ "openat2",
+ "pause",
+ "pidfd_open",
+ "pidfd_send_signal",
+ "pipe",
+ "pipe2",
+ "pkey_alloc",
+ "pkey_free",
+ "pkey_mprotect",
+ "poll",
+ "ppoll",
+ "ppoll_time64",
+ "prctl",
+ "pread64",
+ "preadv",
+ "preadv2",
+ "prlimit64",
+ "process_mrelease",
+ "pselect6",
+ "pselect6_time64",
+ "pwrite64",
+ "pwritev",
+ "pwritev2",
+ "read",
+ "readahead",
+ "readlink",
+ "readlinkat",
+ "readv",
+ "recv",
+ "recvfrom",
+ "recvmmsg",
+ "recvmmsg_time64",
+ "recvmsg",
+ "remap_file_pages",
+ "removexattr",
+ "rename",
+ "renameat",
+ "renameat2",
+ "restart_syscall",
+ "rmdir",
+ "rseq",
+ "rt_sigaction",
+ "rt_sigpending",
+ "rt_sigprocmask",
+ "rt_sigqueueinfo",
+ "rt_sigreturn",
+ "rt_sigsuspend",
+ "rt_sigtimedwait",
+ "rt_sigtimedwait_time64",
+ "rt_tgsigqueueinfo",
+ "sched_getaffinity",
+ "sched_getattr",
+ "sched_getparam",
+ "sched_get_priority_max",
+ "sched_get_priority_min",
+ "sched_getscheduler",
+ "sched_rr_get_interval",
+ "sched_rr_get_interval_time64",
+ "sched_setaffinity",
+ "sched_setattr",
+ "sched_setparam",
+ "sched_setscheduler",
+ "sched_yield",
+ "seccomp",
+ "select",
+ "semctl",
+ "semget",
+ "semop",
+ "semtimedop",
+ "semtimedop_time64",
+ "send",
+ "sendfile",
+ "sendfile64",
+ "sendmmsg",
+ "sendmsg",
+ "sendto",
+ "setfsgid",
+ "setfsgid32",
+ "setfsuid",
+ "setfsuid32",
+ "setgid",
+ "setgid32",
+ "setgroups",
+ "setgroups32",
+ "setitimer",
+ "setpgid",
+ "setpriority",
+ "setregid",
+ "setregid32",
+ "setresgid",
+ "setresgid32",
+ "setresuid",
+ "setresuid32",
+ "setreuid",
+ "setreuid32",
+ "setrlimit",
+ "set_robust_list",
+ "setsid",
+ "setsockopt",
+ "set_thread_area",
+ "set_tid_address",
+ "setuid",
+ "setuid32",
+ "setxattr",
+ "shmat",
+ "shmctl",
+ "shmdt",
+ "shmget",
+ "shutdown",
+ "sigaltstack",
+ "signalfd",
+ "signalfd4",
+ "sigprocmask",
+ "sigreturn",
+ "socketcall",
+ "socketpair",
+ "splice",
+ "stat",
+ "stat64",
+ "statfs",
+ "statfs64",
+ "statx",
+ "symlink",
+ "symlinkat",
+ "sync",
+ "sync_file_range",
+ "syncfs",
+ "sysinfo",
+ "tee",
+ "tgkill",
+ "time",
+ "timer_create",
+ "timer_delete",
+ "timer_getoverrun",
+ "timer_gettime",
+ "timer_gettime64",
+ "timer_settime",
+ "timer_settime64",
+ "timerfd_create",
+ "timerfd_gettime",
+ "timerfd_gettime64",
+ "timerfd_settime",
+ "timerfd_settime64",
+ "times",
+ "tkill",
+ "truncate",
+ "truncate64",
+ "ugetrlimit",
+ "umask",
+ "uname",
+ "unlink",
+ "unlinkat",
+ "utime",
+ "utimensat",
+ "utimensat_time64",
+ "utimes",
+ "vfork",
+ "vmsplice",
+ "wait4",
+ "waitid",
+ "waitpid",
+ "write",
+ "writev"
+ ],
+ "action": "SCMP_ACT_ALLOW"
+ },
+ {
+ "names": [
+ "process_vm_readv",
+ "process_vm_writev",
+ "ptrace"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "minKernel": "4.8"
+ }
+ },
+ {
+ "names": [
+ "socket"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 40,
+ "op": "SCMP_CMP_NE"
+ }
+ ]
+ },
+ {
+ "names": [
+ "personality"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 0,
+ "op": "SCMP_CMP_EQ"
+ }
+ ]
+ },
+ {
+ "names": [
+ "personality"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 8,
+ "op": "SCMP_CMP_EQ"
+ }
+ ]
+ },
+ {
+ "names": [
+ "personality"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 131072,
+ "op": "SCMP_CMP_EQ"
+ }
+ ]
+ },
+ {
+ "names": [
+ "personality"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 131080,
+ "op": "SCMP_CMP_EQ"
+ }
+ ]
+ },
+ {
+ "names": [
+ "personality"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 4294967295,
+ "op": "SCMP_CMP_EQ"
+ }
+ ]
+ },
+ {
+ "names": [
+ "sync_file_range2",
+ "swapcontext"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "ppc64le"
+ ]
+ }
+ },
+ {
+ "names": [
+ "arm_fadvise64_64",
+ "arm_sync_file_range",
+ "sync_file_range2",
+ "breakpoint",
+ "cacheflush",
+ "set_tls"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "arm",
+ "arm64"
+ ]
+ }
+ },
+ {
+ "names": [
+ "arch_prctl"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "amd64",
+ "x32"
+ ]
+ }
+ },
+ {
+ "names": [
+ "modify_ldt"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "amd64",
+ "x32",
+ "x86"
+ ]
+ }
+ },
+ {
+ "names": [
+ "s390_pci_mmio_read",
+ "s390_pci_mmio_write",
+ "s390_runtime_instr"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "s390",
+ "s390x"
+ ]
+ }
+ },
+ {
+ "names": [
+ "riscv_flush_icache"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "arches": [
+ "riscv64"
+ ]
+ }
+ },
+ {
+ "names": [
+ "open_by_handle_at"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_DAC_READ_SEARCH"
+ ]
+ }
+ },
+ {
+ "names": [
+ "bpf",
+ "clone",
+ "clone3",
+ "fanotify_init",
+ "fsconfig",
+ "fsmount",
+ "fsopen",
+ "fspick",
+ "lookup_dcookie",
+ "mount",
+ "mount_setattr",
+ "move_mount",
+ "open_tree",
+ "perf_event_open",
+ "quotactl",
+ "quotactl_fd",
+ "setdomainname",
+ "sethostname",
+ "setns",
+ "syslog",
+ "umount",
+ "umount2",
+ "unshare"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_ADMIN"
+ ]
+ }
+ },
+ {
+ "names": [
+ "clone"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 0,
+ "value": 2114060288,
+ "op": "SCMP_CMP_MASKED_EQ"
+ }
+ ],
+ "excludes": {
+ "caps": [
+ "CAP_SYS_ADMIN"
+ ],
+ "arches": [
+ "s390",
+ "s390x"
+ ]
+ }
+ },
+ {
+ "names": [
+ "clone"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "args": [
+ {
+ "index": 1,
+ "value": 2114060288,
+ "op": "SCMP_CMP_MASKED_EQ"
+ }
+ ],
+ "comment": "s390 parameter ordering for clone is different",
+ "includes": {
+ "arches": [
+ "s390",
+ "s390x"
+ ]
+ },
+ "excludes": {
+ "caps": [
+ "CAP_SYS_ADMIN"
+ ]
+ }
+ },
+ {
+ "names": [
+ "clone3"
+ ],
+ "action": "SCMP_ACT_ERRNO",
+ "errnoRet": 38,
+ "excludes": {
+ "caps": [
+ "CAP_SYS_ADMIN"
+ ]
+ }
+ },
+ {
+ "names": [
+ "reboot"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_BOOT"
+ ]
+ }
+ },
+ {
+ "names": [
+ "chroot"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_CHROOT"
+ ]
+ }
+ },
+ {
+ "names": [
+ "delete_module",
+ "init_module",
+ "finit_module"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_MODULE"
+ ]
+ }
+ },
+ {
+ "names": [
+ "acct"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_PACCT"
+ ]
+ }
+ },
+ {
+ "names": [
+ "kcmp",
+ "pidfd_getfd",
+ "process_madvise",
+ "process_vm_readv",
+ "process_vm_writev",
+ "ptrace"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_PTRACE"
+ ]
+ }
+ },
+ {
+ "names": [
+ "iopl",
+ "ioperm"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_RAWIO"
+ ]
+ }
+ },
+ {
+ "names": [
+ "settimeofday",
+ "stime",
+ "clock_settime",
+ "clock_settime64"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_TIME"
+ ]
+ }
+ },
+ {
+ "names": [
+ "vhangup"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_TTY_CONFIG"
+ ]
+ }
+ },
+ {
+ "names": [
+ "get_mempolicy",
+ "mbind",
+ "set_mempolicy",
+ "set_mempolicy_home_node"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYS_NICE"
+ ]
+ }
+ },
+ {
+ "names": [
+ "syslog"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_SYSLOG"
+ ]
+ }
+ },
+ {
+ "names": [
+ "bpf"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_BPF"
+ ]
+ }
+ },
+ {
+ "names": [
+ "perf_event_open"
+ ],
+ "action": "SCMP_ACT_ALLOW",
+ "includes": {
+ "caps": [
+ "CAP_PERFMON"
+ ]
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/cli/internal/svc/ec2/vm/seccomp.go b/cli/internal/svc/ec2/vm/seccomp.go
new file mode 100644
index 00000000..69724de5
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/seccomp.go
@@ -0,0 +1,41 @@
+package vm
+
+import (
+ _ "embed"
+ "encoding/json"
+)
+
+// dockerDefaultSeccomp is Docker's default seccomp profile (moby v27.4.1,
+// profiles/seccomp/default.json, Apache-2.0).
+//
+//go:embed seccomp-docker-default.json
+var dockerDefaultSeccomp []byte
+
+// PasstSyscalls are what passt's self-sandboxing needs beyond the default
+// profile, which allows them only to containers with CAP_SYS_ADMIN: it moves into
+// new user, mount, IPC, UTS and PID namespaces (unshare, clone), mounts and
+// pivots into an empty tmpfs there and drops to nobody. The kernel still checks
+// capabilities: inside the namespaces it creates, never on the host.
+//
+// These four are the minimum, found by removing each from a wider list until
+// passt failed: without unshare it cannot create its user namespace, without
+// mount, umount2 or pivot_root its sandbox fails. (clone, clone3, setns, chroot
+// and sethostname are not needed.)
+var PasstSyscalls = []string{"unshare", "mount", "umount2", "pivot_root"}
+
+// SeccompProfile is the seccomp profile of VM containers: Docker's default plus
+// PasstSyscalls. Everything the default profile forbids stays forbidden
+// (kexec, bpf, keyctl, perf_event_open, ptrace of others, module loading, ...).
+func SeccompProfile() (string, error) {
+ var p map[string]any
+ if err := json.Unmarshal(dockerDefaultSeccomp, &p); err != nil {
+ return "", err
+ }
+ rules, _ := p["syscalls"].([]any)
+ p["syscalls"] = append(rules, map[string]any{
+ "names": PasstSyscalls,
+ "action": "SCMP_ACT_ALLOW",
+ })
+ b, err := json.Marshal(p)
+ return string(b), err
+}
diff --git a/cli/internal/svc/ec2/vm/seccomp_test.go b/cli/internal/svc/ec2/vm/seccomp_test.go
new file mode 100644
index 00000000..9920186f
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/seccomp_test.go
@@ -0,0 +1,43 @@
+package vm
+
+import (
+ "encoding/json"
+ "strings"
+ "testing"
+)
+
+func TestSeccompProfile(t *testing.T) {
+ s, err := SeccompProfile()
+ if err != nil {
+ t.Fatal(err)
+ }
+ var p struct {
+ DefaultAction string `json:"defaultAction"`
+ Syscalls []struct {
+ Names []string `json:"names"`
+ Action string `json:"action"`
+ Args []any `json:"args"`
+ } `json:"syscalls"`
+ }
+ if err := json.Unmarshal([]byte(s), &p); err != nil {
+ t.Fatal(err)
+ }
+ if p.DefaultAction != "SCMP_ACT_ERRNO" {
+ t.Errorf("default action %q: the profile must stay deny-by-default", p.DefaultAction)
+ }
+ last := p.Syscalls[len(p.Syscalls)-1]
+ if last.Action != "SCMP_ACT_ALLOW" || len(last.Args) != 0 || strings.Join(last.Names, ",") != "unshare,mount,umount2,pivot_root" {
+ t.Errorf("added rule %+v", last)
+ }
+ // Nothing else was loosened: the default profile's rules are all still there,
+ // and dangerous calls it leaves out are not in the added rule.
+ if len(p.Syscalls) < 5 {
+ t.Errorf("only %d rules: Docker's default profile is missing", len(p.Syscalls))
+ }
+ for _, n := range last.Names {
+ switch n {
+ case "kexec_load", "init_module", "finit_module", "bpf", "keyctl", "perf_event_open", "reboot", "ptrace":
+ t.Errorf("%s added", n)
+ }
+ }
+}
diff --git a/cli/internal/svc/ec2/vm/seed.go b/cli/internal/svc/ec2/vm/seed.go
new file mode 100644
index 00000000..99d4a4db
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/seed.go
@@ -0,0 +1,117 @@
+package vm
+
+import (
+ "encoding/json"
+ "strings"
+)
+
+// Seed is what cloud-init reads from the NoCloud datasource (an ISO with the
+// label "cidata"). Guests can also reach the instance metadata service, but
+// NoCloud comes first in the images' datasource lists, so cloud-init settles on
+// the seed and never probes the network for a datasource.
+type Seed struct {
+ InstanceID string
+ Hostname string
+ // PublicKey is authorized for the image's default user.
+ PublicKey string
+ // UserData is passed through untouched: a script (#!), a #cloud-config
+ // document or any other format cloud-init understands.
+ UserData string
+}
+
+// Files returns the seed's files by name (meta-data, user-data).
+func (s Seed) Files() map[string][]byte {
+ // JSON is valid YAML and quotes everything safely.
+ q := func(v string) string { b, _ := json.Marshal(v); return string(b) }
+ var meta strings.Builder
+ meta.WriteString("instance-id: " + q(s.InstanceID) + "\n")
+ meta.WriteString("local-hostname: " + q(s.Hostname) + "\n")
+ meta.WriteString("hostname: " + q(s.Hostname) + "\n")
+ if k := strings.TrimSpace(s.PublicKey); k != "" {
+ meta.WriteString("public-keys:\n - " + q(k) + "\n")
+ }
+ user := s.UserData
+ if strings.TrimSpace(user) == "" {
+ user = "#cloud-config\n{}\n"
+ }
+ return map[string][]byte{"meta-data": []byte(meta.String()), "user-data": []byte(user), "vendor-data": []byte(VendorData)}
+}
+
+// VendorData installs and starts qemu-guest-agent, which run-command and the
+// CloudWatch guest metrics talk to. It is a script rather than cloud-config
+// `packages:` because cloud-init does not merge list keys of vendor-data with
+// the user's own cloud-config, which would silently drop the agent whenever
+// the user data sets packages or runcmd. The agent is started by the
+// virtio-serial port on most images, hence the explicit start.
+//
+// The cloud images do not ship the agent. Its packages come from the seed disk
+// (AgentSeedDir, filled from the image cache by the VM container), so the
+// guest needs no network for it: a guest in user-mode networking, or one
+// whose network is not up yet, still gets it. The guest's package mirror is
+// the fallback, and while the agent is missing the script runs again on every
+// boot.
+const VendorData = `#!/bin/sh
+# HomeCloud: installs and starts qemu-guest-agent (run-command and the instance's metrics).
+pb=/var/lib/cloud/scripts/per-boot/homecloud-guest-agent
+if ! command -v qemu-ga >/dev/null 2>&1; then
+ dev=$(blkid -L cidata 2>/dev/null || blkid -L CIDATA 2>/dev/null || true)
+ mnt=$(mktemp -d)
+ if [ -n "$dev" ] && mount -o ro "$dev" "$mnt" 2>/dev/null; then
+ debs=""
+ for f in "$mnt"/` + AgentSeedDir + `/*.deb; do
+ [ -f "$f" ] || continue
+ p=$(dpkg-deb -f "$f" Package)
+ dpkg-query -W -f='${Status}' "$p" 2>/dev/null | grep -q ' installed$' || debs="$debs $f"
+ done
+ n=0
+ while [ -n "$debs" ] && [ $n -lt 15 ]; do
+ dpkg -i $debs && break
+ n=$((n+1)); sleep 4 # dpkg may be locked by another first-boot job
+ done
+ umount "$mnt"
+ fi
+ rmdir "$mnt" 2>/dev/null
+fi
+if ! command -v qemu-ga >/dev/null 2>&1; then
+ echo "homecloud: qemu-guest-agent is not on the seed disk; installing it from the package mirror"
+ export DEBIAN_FRONTEND=noninteractive
+ n=0
+ until apt-get update -qq && apt-get install -y -qq qemu-guest-agent; do
+ n=$((n+1)); [ $n -ge 3 ] && break; sleep 5
+ done
+fi
+if command -v qemu-ga >/dev/null 2>&1; then
+ rm -f "$pb"
+ systemctl enable --now qemu-guest-agent 2>/dev/null || systemctl start qemu-guest-agent 2>/dev/null || true
+else
+ echo "homecloud: qemu-guest-agent could not be installed; trying again at the next boot" >&2
+ if [ "$0" != "$pb" ]; then mkdir -p "${pb%/*}" && cp "$0" "$pb" && chmod 0755 "$pb"; fi
+fi
+`
+
+// AgentSeedDir is the directory on the seed disk with the guest agent's packages.
+const AgentSeedDir = "qga"
+
+// ReadyMarkers are what the guest prints on its serial console when it is up.
+var (
+ // CloudInitDone is printed by cloud-init's final stage.
+ CloudInitDone = "finished at"
+ // LoginPrompt is what getty prints; it is the fallback for images
+ // without cloud-init.
+ LoginPrompt = " login: "
+)
+
+// Ready inspects a boot's console output. done is true once cloud-init
+// finished; prompt is true once a login prompt appeared (guests that never run
+// cloud-init's final stage still get there).
+func Ready(console string) (done, prompt bool) {
+ for _, line := range strings.Split(console, "\n") {
+ if strings.Contains(line, "Cloud-init v.") && strings.Contains(line, CloudInitDone) {
+ done = true
+ }
+ if strings.Contains(line, LoginPrompt) {
+ prompt = true
+ }
+ }
+ return done, prompt
+}
diff --git a/cli/internal/svc/ec2/vm/serial.go b/cli/internal/svc/ec2/vm/serial.go
new file mode 100644
index 00000000..daef8961
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/serial.go
@@ -0,0 +1,15 @@
+package vm
+
+// SerialAttachCommand is what a docker exec with a TTY runs in the VM
+// container to connect the terminal to the guest's serial console. socat puts
+// the TTY in raw mode, so keystrokes reach the guest's getty unmodified. QEMU
+// serves one client at a time; the next connects when the previous one leaves.
+func SerialAttachCommand() []string {
+ return []string{"socat", "-,raw,echo=0", "UNIX-CONNECT:" + SerialSocket}
+}
+
+// QGAAttachCommand is what a docker exec (stdin open) runs to talk to the guest agent.
+// -t 1 lets socat end a second after stdin closes.
+func QGAAttachCommand() []string {
+ return []string{"socat", "-t", "1", "-", "UNIX-CONNECT:" + QGASocket}
+}
diff --git a/cli/internal/svc/ec2/vm/vm.go b/cli/internal/svc/ec2/vm/vm.go
new file mode 100644
index 00000000..5241929e
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/vm.go
@@ -0,0 +1,106 @@
+// Package vm holds what EC2 needs to run an instance as a virtual machine:
+// the runner image (QEMU, passt and helper scripts, built locally), the
+// cloud image catalog, the QEMU command line and the cloud-init seed. It has no
+// dependency on the rest of HomeCloud so each piece can be tested on its own.
+//
+// A VM instance is a QEMU process inside a Docker container (the "VM
+// container") attached to the instance's VPC network with its private
+// address, so everything that works per container keeps working: addresses,
+// DNS, the metadata service, security groups and published ports. passt gives
+// the guest the container's address, gateway and routes and forwards every
+// inbound port to it.
+package vm
+
+import (
+ "crypto/sha256"
+ _ "embed"
+ "encoding/hex"
+ "fmt"
+ "sort"
+)
+
+// Arch is the guest architecture, which is the Docker host's.
+type Arch string
+
+const (
+ ArchAArch64 Arch = "aarch64"
+ ArchX8664 Arch = "x86_64"
+)
+
+// ArchOf maps a Docker or EC2 architecture name to a guest architecture.
+func ArchOf(name string) (Arch, error) {
+ switch name {
+ case "aarch64", "arm64":
+ return ArchAArch64, nil
+ case "x86_64", "amd64":
+ return ArchX8664, nil
+ }
+ return "", fmt.Errorf("virtual machines are not supported on %q hosts (need aarch64 or x86_64)", name)
+}
+
+// Cloud image file names use Debian-style architecture names.
+func (a Arch) Deb() string {
+ if a == ArchAArch64 {
+ return "arm64"
+ }
+ return "amd64"
+}
+
+// QEMU is the qemu-system binary for the architecture.
+func (a Arch) QEMU() string { return "qemu-system-" + string(a) }
+
+//go:embed runner.Dockerfile
+var runnerDockerfile string
+
+//go:embed hc-vm-run
+var runScript string
+
+//go:embed hc-vm-fetch
+var fetchScript string
+
+//go:embed hc-vm-ctl
+var ctlScript string
+
+//go:embed hc-vm-flatten
+var flattenScript string
+
+// RunnerContext is the build context of the runner image.
+func RunnerContext() map[string][]byte {
+ return map[string][]byte{
+ "Dockerfile": []byte(runnerDockerfile),
+ "hc-vm-run": []byte(runScript),
+ "hc-vm-fetch": []byte(fetchScript),
+ "hc-vm-ctl": []byte(ctlScript),
+ "hc-vm-flatten": []byte(flattenScript),
+ }
+}
+
+// RunnerTag names the runner image by the hash of its build context, so a
+// change to the Dockerfile or scripts builds a new image.
+func RunnerTag() string {
+ files := RunnerContext()
+ names := make([]string, 0, len(files))
+ for n := range files {
+ names = append(names, n)
+ }
+ sort.Strings(names)
+ h := sha256.New()
+ for _, n := range names {
+ fmt.Fprintf(h, "%s\x00%d\x00", n, len(files[n]))
+ h.Write(files[n])
+ }
+ return "homecloud/vm-runner:" + hex.EncodeToString(h.Sum(nil))[:12]
+}
+
+// Paths inside the VM container.
+const (
+ ImagesDir = "/images" // image cache volume (read-only)
+ DiskDir = "/vm" // the instance's root volume
+ SeedDir = "/hc/seed" // cloud-init NoCloud files
+)
+
+// LabelRoot marks the Docker volume of a VM's root disk: backups flatten it.
+const LabelRoot = "homecloud.vm-root"
+
+// MinRootGB is the smallest root disk: it must hold the cloud image.
+const MinRootGB = 4
diff --git a/cli/internal/svc/ec2/vm/vm_test.go b/cli/internal/svc/ec2/vm/vm_test.go
new file mode 100644
index 00000000..0e4bb2b2
--- /dev/null
+++ b/cli/internal/svc/ec2/vm/vm_test.go
@@ -0,0 +1,256 @@
+package vm
+
+import (
+ "io"
+ "net/http"
+ "os"
+ "path"
+ "strings"
+ "testing"
+ "time"
+)
+
+func joined(args []string) string { return strings.Join(args, " ") }
+
+func TestQEMUAArch64Emulated(t *testing.T) {
+ m := Machine{Name: "i-0abc", Arch: ArchAArch64, VCPUs: 2, MemoryMB: 4096}
+ c := m.Command()
+ if c[0] != "qemu-system-aarch64" {
+ t.Fatalf("binary %q", c[0])
+ }
+ s := joined(c)
+ for _, want := range []string{
+ "-machine virt,gic-version=max",
+ "-accel tcg,thread=multi -cpu max,pauth-impdef=on",
+ "-smp 2 -m 4096",
+ "if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd",
+ "if=pflash,format=raw,unit=1,file=/vm/efivars.fd",
+ "file=/vm/disk.qcow2,if=none,id=root,format=qcow2",
+ "virtio-blk-pci,drive=root,bootindex=1",
+ "file=/vm/seed.iso,if=none,id=seed,format=raw,readonly=on",
+ "-netdev stream,id=net0,addr.type=unix,addr.path=/tmp/passt.sock,server=off",
+ "virtio-net-pci,netdev=net0,mac=" + m.MAC(),
+ "-chardev socket,id=ser0,path=/run/serial.sock,server=on,wait=off,logfile=/dev/stdout,logappend=on -serial chardev:ser0",
+ "-chardev socket,id=qga0,path=/run/qga.sock,server=on,wait=off",
+ "-device virtio-serial-pci,id=vser0",
+ "-device virtserialport,bus=vser0.0,chardev=qga0,name=org.qemu.guest_agent.0",
+ "-qmp unix:/run/qmp.sock,server=on,wait=off",
+ "-nodefaults",
+ } {
+ if !strings.Contains(s, want) {
+ t.Errorf("command line lacks %q:\n%s", want, s)
+ }
+ }
+ if strings.Contains(s, "kvm") {
+ t.Errorf("emulated machine mentions kvm: %s", s)
+ }
+}
+
+func TestQEMUX86KVM(t *testing.T) {
+ m := Machine{Name: "i-1", Arch: ArchX8664, KVM: true, VCPUs: 4, MemoryMB: 16384}
+ c := m.Command()
+ if c[0] != "qemu-system-x86_64" {
+ t.Fatalf("binary %q", c[0])
+ }
+ s := joined(c)
+ for _, want := range []string{"-machine q35", "-accel kvm -cpu host", "-smp 4 -m 16384"} {
+ if !strings.Contains(s, want) {
+ t.Errorf("command line lacks %q:\n%s", want, s)
+ }
+ }
+ if strings.Contains(s, "pflash") || strings.Contains(s, "tcg") {
+ t.Errorf("x86 KVM machine has firmware drives or TCG: %s", s)
+ }
+}
+
+func TestQEMUDefaultsAndMAC(t *testing.T) {
+ // Fractional instance types round up to a vCPU in the caller; zero must not produce -smp 0.
+ if s := joined(Machine{Name: "a", Arch: ArchX8664, MemoryMB: 512}.Args()); !strings.Contains(s, "-smp 1 ") {
+ t.Errorf("no vCPU count: %s", s)
+ }
+ a, b := Machine{Name: "i-a"}.MAC(), Machine{Name: "i-b"}.MAC()
+ if a == b || a != (Machine{Name: "i-a"}).MAC() {
+ t.Errorf("MAC not stable per instance: %s %s", a, b)
+ }
+ if !strings.HasPrefix(a, "52:54:00:") || len(a) != 17 {
+ t.Errorf("MAC %q", a)
+ }
+}
+
+func TestSeedFiles(t *testing.T) {
+ f := Seed{InstanceID: "i-0abc", Hostname: "ip-10-0-1-5", PublicKey: "ssh-ed25519 AAAA test\n", UserData: "#!/bin/sh\necho hi\n"}.Files()
+ meta := string(f["meta-data"])
+ for _, want := range []string{
+ `instance-id: "i-0abc"`, `local-hostname: "ip-10-0-1-5"`, `hostname: "ip-10-0-1-5"`,
+ "public-keys:\n - \"ssh-ed25519 AAAA test\"\n",
+ } {
+ if !strings.Contains(meta, want) {
+ t.Errorf("meta-data lacks %q:\n%s", want, meta)
+ }
+ }
+ if string(f["user-data"]) != "#!/bin/sh\necho hi\n" {
+ t.Errorf("user data changed: %q", f["user-data"])
+ }
+ // #cloud-config passes through too.
+ cc := "#cloud-config\nwrite_files:\n- path: /x\n content: y\n"
+ if got := string(Seed{UserData: cc}.Files()["user-data"]); got != cc {
+ t.Errorf("cloud-config changed: %q", got)
+ }
+}
+
+func TestSeedWithoutKeyOrUserData(t *testing.T) {
+ f := Seed{InstanceID: "i-1", Hostname: "h"}.Files()
+ if strings.Contains(string(f["meta-data"]), "public-keys") {
+ t.Errorf("empty key produced public-keys:\n%s", f["meta-data"])
+ }
+ if !strings.HasPrefix(string(f["user-data"]), "#cloud-config") {
+ t.Errorf("empty user data must still be a valid document: %q", f["user-data"])
+ }
+ // A key with quotes cannot break the YAML.
+ m := string(Seed{InstanceID: "i", Hostname: "h", PublicKey: `ssh-rsa A"B\C x`}.Files()["meta-data"])
+ if !strings.Contains(m, `"ssh-rsa A\"B\\C x"`) {
+ t.Errorf("key not escaped:\n%s", m)
+ }
+}
+
+func TestReady(t *testing.T) {
+ boot := "[ 32.2] cloud-init[464]: Cloud-init v. 22.4.2 running 'modules:final' at Wed\n"
+ if d, p := Ready(boot); d || p {
+ t.Errorf("running is not ready: %v %v", d, p)
+ }
+ done := boot + "2026-09-30T14:31:25Z [ 32.8] cloud-init[464]: Cloud-init v. 22.4.2 finished at Wed, 30 Sep 2026 14:31:25 +0000. Datasource DataSourceNoCloud [seed=/dev/vdb][dsmode=net]. Up 32.80 seconds\n"
+ if d, _ := Ready(done); !d {
+ t.Error("finished marker not recognised")
+ }
+ if _, p := Ready("Debian GNU/Linux 12 exp1 ttyAMA0\n\nexp1 login: "); !p {
+ t.Error("login prompt not recognised")
+ }
+}
+
+func TestRunnerTagFollowsContent(t *testing.T) {
+ a := RunnerTag()
+ if !strings.HasPrefix(a, "homecloud/vm-runner:") || len(a) != len("homecloud/vm-runner:")+12 {
+ t.Fatalf("tag %q", a)
+ }
+ if a != RunnerTag() {
+ t.Error("tag not stable")
+ }
+ old := runScript
+ runScript += "\n# changed\n"
+ defer func() { runScript = old }()
+ if RunnerTag() == a {
+ t.Error("tag did not change with the entrypoint")
+ }
+ ctx := RunnerContext()
+ for _, f := range []string{"Dockerfile", "hc-vm-run", "hc-vm-fetch", "hc-vm-ctl"} {
+ if len(ctx[f]) == 0 {
+ t.Errorf("build context lacks %s", f)
+ }
+ }
+ if !strings.Contains(runnerDockerfile, "@sha256:") {
+ t.Error("runner base image must be pinned by digest")
+ }
+}
+
+func TestParseChecksums(t *testing.T) {
+ sha256 := strings.Repeat("ab", 32)
+ sha512 := strings.Repeat("cd", 64)
+ got, err := ParseChecksums("# header\n" + sha256 + " *ubuntu.img\n\n" + sha512 + " debian.qcow2\n" + strings.ToUpper(sha256) + " upper.img\n")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got["ubuntu.img"] != sha256 || got["debian.qcow2"] != sha512 || got["upper.img"] != sha256 || len(got) != 3 {
+ t.Errorf("parsed %v", got)
+ }
+ for _, bad := range []string{"zz file\n", sha256 + "\n", sha256[:60] + " file\n", sha256 + " \n"} {
+ if _, err := ParseChecksums(bad); err == nil {
+ t.Errorf("accepted %q", bad)
+ }
+ }
+}
+
+func TestCatalogIsPinned(t *testing.T) {
+ for key, b := range Bases {
+ if b.Key != key || b.Release == "" || b.DefaultUser == "" {
+ t.Errorf("%s: incomplete %+v", key, b)
+ }
+ for _, arch := range []Arch{ArchAArch64, ArchX8664} {
+ f, err := b.For(arch)
+ if err != nil {
+ t.Errorf("%s: %v", key, err)
+ continue
+ }
+ if !strings.HasPrefix(f.URL, "https://") {
+ t.Errorf("%s/%s: URL %q is not https", key, arch, f.URL)
+ }
+ if !ValidSum(f.Sum) {
+ t.Errorf("%s/%s: checksum %q", key, arch, f.Sum)
+ }
+ if !strings.Contains(f.URL, "-"+arch.Deb()) {
+ t.Errorf("%s/%s: URL %q is for another architecture", key, arch, f.URL)
+ }
+ if !strings.Contains(f.URL, strings.TrimPrefix(b.Release, "release-")) {
+ t.Errorf("%s/%s: URL %q is not pinned to release %s", key, arch, f.URL, b.Release)
+ }
+ if n := b.CacheName(arch); !strings.HasSuffix(n, ".qcow2") || strings.ContainsAny(n, "/ ") {
+ t.Errorf("cache name %q", n)
+ }
+ }
+ if b.CacheName(ArchAArch64) == b.CacheName(ArchX8664) {
+ t.Errorf("%s: both architectures share a cache file", key)
+ }
+ }
+ if _, err := (Base{Key: "x"}).For(ArchX8664); err == nil {
+ t.Error("missing architecture accepted")
+ }
+}
+
+func TestArchOf(t *testing.T) {
+ for in, want := range map[string]Arch{"arm64": ArchAArch64, "aarch64": ArchAArch64, "x86_64": ArchX8664, "amd64": ArchX8664} {
+ if got, err := ArchOf(in); err != nil || got != want {
+ t.Errorf("%s: %v %v", in, got, err)
+ }
+ }
+ if _, err := ArchOf("riscv64"); err == nil {
+ t.Error("riscv64 accepted")
+ }
+}
+
+// TestCatalogMatchesPublishedChecksums compares the pinned checksums with the
+// vendors' published files (a pin goes stale when a release is withdrawn). It
+// needs the network: HC_TEST_NET=1.
+func TestCatalogMatchesPublishedChecksums(t *testing.T) {
+ if os.Getenv("HC_TEST_NET") != "1" {
+ t.Skip("set HC_TEST_NET=1 to check the pinned checksums against the vendors' files")
+ }
+ c := http.Client{Timeout: time.Minute}
+ sums := map[string]map[string]string{}
+ for key, b := range Bases {
+ for arch, f := range b.Files {
+ dir := f.URL[:strings.LastIndex(f.URL, "/")+1]
+ file := path.Base(f.URL)
+ name := "SHA256SUMS"
+ if len(f.Sum) == 128 {
+ name = "SHA512SUMS"
+ }
+ if sums[dir+name] == nil {
+ resp, err := c.Get(dir + name)
+ if err != nil {
+ t.Fatal(err)
+ }
+ body, _ := io.ReadAll(resp.Body)
+ resp.Body.Close()
+ if resp.StatusCode != 200 {
+ t.Errorf("%s: %s", dir+name, resp.Status)
+ continue
+ }
+ if sums[dir+name], err = ParseChecksums(string(body)); err != nil {
+ t.Fatalf("%s: %v", dir+name, err)
+ }
+ }
+ if got := sums[dir+name][file]; got != f.Sum {
+ t.Errorf("%s/%s: pinned %s, published %q", key, arch, f.Sum, got)
+ }
+ }
+ }
+}
diff --git a/cli/internal/svc/ec2/vm_access.go b/cli/internal/svc/ec2/vm_access.go
new file mode 100644
index 00000000..acaf4341
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_access.go
@@ -0,0 +1,242 @@
+package ec2
+
+import (
+ "bufio"
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+
+ docker "github.com/fsouza/go-dockerclient"
+ "github.com/homecloudhq/homecloud/cli/internal/core"
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm"
+)
+
+// Access to a running VM guest: run-command and the CloudWatch metrics go
+// through qemu-guest-agent (QGA) on the virtio-serial channel QEMU serves as a
+// socket in the VM container; the browser terminal attaches to the serial
+// console socket (see terminal.go).
+//
+// QEMU serves one QGA client at a time, so calls to one guest are serialized.
+// Each call is its own `docker exec socat` session that performs the
+// guest-sync handshake first (the channel may hold a previous client's leftovers).
+
+// qgaSlots holds one semaphore per VM container.
+var qgaSlots sync.Map
+
+func qgaSlot(cid string) chan struct{} {
+ v, _ := qgaSlots.LoadOrStore(cid, make(chan struct{}, 1))
+ return v.(chan struct{})
+}
+
+var errGuestAgent = errors.New("qemu-guest-agent in the guest is not connected (it did not answer the handshake)")
+
+// qgaCall sends one command to the guest agent and returns its reply. ctx
+// bounds the whole call, including waiting for the agent and for other callers.
+func (s *Service) qgaCall(ctx context.Context, cid string, req []byte) (vm.QGAReply, error) {
+ slot := qgaSlot(cid)
+ select {
+ case slot <- struct{}{}:
+ defer func() { <-slot }()
+ case <-ctx.Done():
+ return vm.QGAReply{}, errGuestAgent
+ }
+ ectx, cancel := context.WithCancel(ctx)
+ defer cancel()
+ ex, err := s.env.Docker.C.CreateExec(docker.CreateExecOptions{
+ Container: cid, Cmd: vm.QGAAttachCommand(), AttachStdin: true, AttachStdout: true, AttachStderr: true, Context: ectx,
+ })
+ if err != nil {
+ return vm.QGAReply{}, err
+ }
+ inR, inW := io.Pipe()
+ outR, outW := io.Pipe()
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ defer outW.Close()
+ _ = s.env.Docker.C.StartExec(ex.ID, docker.StartExecOptions{InputStream: inR, OutputStream: outW, ErrorStream: io.Discard, Context: ectx})
+ }()
+ defer func() {
+ inW.Close()
+ cancel()
+ outR.Close()
+ inR.Close()
+ select {
+ case <-done:
+ case <-time.After(5 * time.Second):
+ }
+ }()
+ lines := make(chan []byte, 16)
+ go func() {
+ defer close(lines)
+ br := bufio.NewReader(outR)
+ for {
+ l, err := br.ReadBytes('\n')
+ if len(l) > 0 {
+ select {
+ case lines <- l:
+ case <-ectx.Done():
+ return
+ }
+ }
+ if err != nil {
+ return
+ }
+ }
+ }()
+ write := func(b []byte) { go inW.Write(b) } // a stalled connection must not block the loop
+
+ syncID := time.Now().UnixNano() & 0x7fffffff
+ want := strconv.FormatInt(syncID, 10)
+ synced := false
+ write(vm.QGASync(syncID))
+ tick := time.NewTicker(2 * time.Second)
+ defer tick.Stop()
+ for {
+ select {
+ case <-ctx.Done():
+ return vm.QGAReply{}, errGuestAgent
+ case <-tick.C:
+ if !synced {
+ write(vm.QGASync(syncID))
+ }
+ case l, ok := <-lines:
+ if !ok {
+ return vm.QGAReply{}, errors.New("the connection to the guest agent closed")
+ }
+ r, ok := vm.ParseQGAReply(l)
+ if !ok {
+ continue
+ }
+ if !synced {
+ if r.Synced && string(r.Return) == want {
+ synced = true
+ write(req)
+ }
+ continue
+ }
+ if r.Synced {
+ continue
+ }
+ return r, r.Err()
+ }
+ }
+}
+
+// guestExec runs a shell command in the guest through the agent and waits for
+// it, up to timeout (enforced in the guest with timeout(1) and here).
+func (s *Service) guestExec(ctx context.Context, inst Instance, command string, timeout time.Duration) (vm.ExecStatus, error) {
+ path, args := vm.ShellCommand(command, int(timeout.Seconds()))
+ call := func(req []byte) (vm.QGAReply, error) {
+ cctx, cancel := context.WithTimeout(ctx, 20*time.Second)
+ defer cancel()
+ return s.qgaCall(cctx, inst.ContainerID, req)
+ }
+ r, err := call(vm.QGAExecRequest(path, args))
+ if err != nil {
+ return vm.ExecStatus{}, err
+ }
+ pid, err := vm.ParseExecPID(r.Return)
+ if err != nil {
+ return vm.ExecStatus{}, err
+ }
+ // The guest's timeout(1) ends the command at timeout (plus its 5s kill grace).
+ deadline := time.Now().Add(timeout + 15*time.Second)
+ for {
+ r, err := call(vm.QGAExecStatusRequest(pid))
+ if err != nil {
+ return vm.ExecStatus{}, err
+ }
+ st, err := vm.ParseExecStatus(r.Return)
+ if err != nil {
+ return st, err
+ }
+ if st.Exited {
+ return st, nil
+ }
+ if time.Now().After(deadline) || ctx.Err() != nil {
+ return st, core.Errf(http.StatusGatewayTimeout, "RequestTimeout", "the command did not finish in %s", timeout)
+ }
+ select {
+ case <-ctx.Done():
+ case <-time.After(400 * time.Millisecond):
+ }
+ }
+}
+
+// vmAgentWhy tells, from the guest's console, why its agent does not answer.
+func (s *Service) vmAgentWhy(i Instance) string {
+ out, _ := s.env.Docker.Logs(i.ContainerID, 0, time.Time{})
+ switch {
+ case strings.Contains(out, "homecloud: qemu-guest-agent could not be installed"):
+ return "installing it failed on this boot (its packages were not on the seed disk and the guest could not reach its package mirror; see /var/log/cloud-init-output.log in the guest); it is tried again at every boot"
+ case !strings.Contains(out, vm.CloudInitDone):
+ return "the guest is still booting (cloud-init installs and starts the agent at the end of the boot)"
+ default:
+ return "the guest has booted but the agent is not running (an image without it, or it was stopped or removed in the guest)"
+ }
+}
+
+// vmRunCommand is run-command for VM instances.
+func (s *Service) vmRunCommand(ctx context.Context, i Instance, command string, timeoutSeconds int) (any, error) {
+ timeout := time.Duration(timeoutSeconds) * time.Second
+ start := time.Now()
+ st, err := s.guestExec(ctx, i, command, timeout)
+ if err != nil {
+ var ce *core.Error
+ if errors.As(err, &ce) {
+ return nil, err
+ }
+ if errors.Is(err, errGuestAgent) {
+ return nil, core.Errf(http.StatusConflict, "InvalidInstanceState", "run-command needs qemu-guest-agent in the guest, and it is not connected: %s", s.vmAgentWhy(i))
+ }
+ return nil, core.Errf(http.StatusConflict, "InvalidInstanceState", "%v", err)
+ }
+ status := "Success"
+ switch {
+ case st.ExitCode == 124 && time.Since(start) >= timeout:
+ status = "TimedOut"
+ case st.ExitCode != 0:
+ status = "Failed"
+ }
+ return map[string]any{"command_id": core.NewID("cmd"), "instance_id": i.ID, "status": status, "exit_code": st.ExitCode,
+ "stdout": st.Stdout, "stderr": st.Stderr, "duration_ms": time.Since(start).Milliseconds()}, nil
+}
+
+// GuestUsage samples a running VM instance's guest through the agent, for the
+// CloudWatch collector. Unlike Docker's stats of the VM container (which
+// measure QEMU), this is what the guest itself sees. An error means there is
+// nothing to publish now (not running, agent not up yet).
+func (s *Service) GuestUsage(ctx context.Context, instanceID string) (*runtime.Usage, error) {
+ i, err := s.get(instanceID)
+ if err != nil {
+ return nil, err
+ }
+ if !i.IsVM() || i.State != "running" || i.ContainerID == "" {
+ return nil, fmt.Errorf("%s is not a running VM", instanceID)
+ }
+ ctx, cancel := context.WithTimeout(ctx, 25*time.Second)
+ defer cancel()
+ st, err := s.guestExec(ctx, i, vm.StatsCommand, 15*time.Second)
+ if err != nil {
+ return nil, err
+ }
+ if st.ExitCode != 0 {
+ return nil, fmt.Errorf("guest stats exited %d: %s", st.ExitCode, st.Stderr)
+ }
+ g, err := vm.ParseGuestStats(st.Stdout)
+ if err != nil {
+ return nil, err
+ }
+ return &runtime.Usage{
+ CPUPercent: g.CPUPercent, MemoryBytes: g.MemoryUsed, MemoryLimit: g.MemoryTotal, MemoryPercent: g.MemoryPercent(),
+ NetRxBytes: g.NetRx, NetTxBytes: g.NetTx, BlockRead: g.DiskRead, BlockWrite: g.DiskWrite, Pids: g.Processes,
+ }, nil
+}
diff --git a/cli/internal/svc/ec2/vm_access_live_test.go b/cli/internal/svc/ec2/vm_access_live_test.go
new file mode 100644
index 00000000..e18d92d2
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_access_live_test.go
@@ -0,0 +1,167 @@
+package ec2_test
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/homecloudhq/homecloud/cli/internal/svc/cloudwatch"
+ "golang.org/x/net/websocket"
+)
+
+// vmAccessChecks exercises what the guest agent and the serial console give a
+// running VM instance: run-command, CloudWatch metrics from the guest and the
+// browser terminal. Every wait has a deadline.
+func (f *filterEnv) vmAccessChecks(t *testing.T, id string) {
+ t.Helper()
+ h := f.h
+ type cmdResult struct {
+ Status string `json:"status"`
+ ExitCode int `json:"exit_code"`
+ Stdout string `json:"stdout"`
+ Stderr string `json:"stderr"`
+ }
+ runCmd := func(command string, timeout int) (int, cmdResult, string) {
+ code, body := h.NativeAs(t, h.AccessKeyID, h.SecretKey, "POST", "/api/v1/ec2/instances/"+id+"/commands",
+ map[string]any{"command": command, "timeout_seconds": timeout})
+ var r cmdResult
+ _ = json.Unmarshal(body, &r)
+ return code, r, string(body)
+ }
+
+ // run-command: stdout, stderr and the exit code come from the guest. The
+ // agent may need a moment after the boot marker.
+ var r cmdResult
+ end, lastBody := time.Now().Add(vmTestBudget), ""
+ for {
+ code, res, body := runCmd(`echo out-$(hostname); echo err-text >&2; exit 3`, 60)
+ if code == http.StatusOK {
+ r = res
+ break
+ }
+ if body != lastBody {
+ t.Logf("run-command: %d %s", code, body)
+ lastBody = body
+ }
+ if time.Now().After(end) {
+ // What the guest printed about the agent (cloud-init's output is on the console).
+ var b strings.Builder
+ logs, _ := h.Env.Docker.Logs(f.vmGet(id).ContainerID, 0, time.Time{})
+ for _, l := range strings.Split(logs, "\n") {
+ if strings.Contains(l, "homecloud") || strings.Contains(l, "guest-agent") || strings.Contains(l, "guest_agent") || strings.Contains(l, "dpkg") || strings.Contains(l, "apt") || strings.Contains(l, "Cloud-init") {
+ b.WriteString(l + "\n")
+ }
+ }
+ t.Fatalf("timed out waiting for run-command through the guest agent; console lines about it:\n%s", b.String())
+ }
+ time.Sleep(3 * time.Second)
+ }
+ if r.Status != "Failed" || r.ExitCode != 3 || !strings.HasPrefix(r.Stdout, "out-ip-") || strings.TrimSpace(r.Stderr) != "err-text" {
+ t.Errorf("run-command result: %+v", r)
+ }
+ if _, r, body := runCmd(`cat /etc/os-release | head -1; uname -m`, 60); r.Status != "Success" || r.ExitCode != 0 || !strings.Contains(r.Stdout, "NAME=") {
+ t.Errorf("second run-command: %s", body)
+ }
+ start := time.Now()
+ if _, r, body := runCmd(`sleep 120`, 3); r.Status != "TimedOut" || time.Since(start) > 60*time.Second {
+ t.Errorf("a command past its timeout: %s (took %s)", body, time.Since(start))
+ }
+ // The same IAM action as container instances: a user without ssm:SendCommand is refused.
+ akid, secret := h.User(t, "vm-nossm")
+ if code, body := h.NativeAs(t, akid, secret, "POST", "/api/v1/ec2/instances/"+id+"/commands", map[string]any{"command": "id"}); code != http.StatusForbidden {
+ t.Errorf("run-command without permission: %d %s", code, body)
+ }
+ t.Logf("run-command through the guest agent verified")
+
+ // CloudWatch metrics describe the guest (a QEMU container has a handful of
+ // processes; a booted Ubuntu has dozens, and its memory is the guest's).
+ cw, err := cloudwatch.New(h.Env)
+ if err != nil {
+ t.Fatal(err)
+ }
+ cw.GuestUsage = f.ec2.GuestUsage
+ ctx, cancel := context.WithCancel(context.Background())
+ done := make(chan struct{})
+ go func() { cw.Run(ctx); close(done) }()
+ defer func() { cancel(); <-done }()
+ dims := map[string]string{"InstanceId": id}
+ last := func(name string) (float64, bool) {
+ pts, _ := cw.Statistics("HC/EC2", name, dims, time.Now().Add(-time.Hour), time.Now().Add(time.Minute), time.Minute)
+ if len(pts) == 0 {
+ return 0, false
+ }
+ return pts[len(pts)-1].Maximum, true
+ }
+ waitFor(t, "guest metrics in CloudWatch", 6*time.Minute, func() bool {
+ _, a := last("CPUUtilization")
+ _, b := last("MemoryUtilization")
+ _, c := last("ProcessCount")
+ return a && b && c
+ })
+ if v, _ := last("ProcessCount"); v < 20 {
+ t.Errorf("ProcessCount %v: measures the QEMU container, not the guest", v)
+ }
+ if v, _ := last("MemoryUsed"); v < 50<<20 || v > 1<<30 {
+ t.Errorf("MemoryUsed %v bytes: expected the t3.micro guest's (between 50 MiB and 1 GiB)", v)
+ }
+ if v, _ := last("MemoryUtilization"); v <= 0 || v >= 100 {
+ t.Errorf("MemoryUtilization %v", v)
+ }
+ if v, ok := last("CPUUtilization"); !ok || v < 0 || v > 100 {
+ t.Errorf("CPUUtilization %v", v)
+ }
+ for _, name := range []string{"NetworkIn", "NetworkOut", "DiskReadBytes", "DiskWriteBytes"} {
+ if _, ok := last(name); !ok {
+ t.Errorf("no %s datapoint", name)
+ }
+ }
+ t.Logf("guest metrics published")
+
+ // The browser terminal is the serial console: a login prompt appears.
+ cfg, err := websocket.NewConfig("ws"+strings.TrimPrefix(h.URL, "http")+"/api/v1/ec2/instances/"+id+"/terminal", h.URL)
+ if err != nil {
+ t.Fatal(err)
+ }
+ cfg.Header.Set("Authorization", "Bearer "+h.AccessKeyID+":"+h.SecretKey)
+ conn, err := websocket.DialConfig(cfg)
+ if err != nil {
+ t.Fatalf("terminal: %v", err)
+ }
+ defer conn.Close()
+ frames := make(chan string, 256)
+ go func() {
+ defer close(frames)
+ for {
+ var m string
+ if websocket.Message.Receive(conn, &m) != nil {
+ return
+ }
+ frames <- m
+ }
+ }()
+ var got strings.Builder
+ deadline := time.After(3 * time.Minute)
+ nudge := time.NewTicker(3 * time.Second)
+ defer nudge.Stop()
+ for !strings.Contains(got.String(), " login:") {
+ select {
+ case m, ok := <-frames:
+ if !ok {
+ t.Fatalf("terminal closed before a login prompt; got %q", got.String())
+ }
+ got.WriteString(m)
+ case <-nudge.C:
+ _ = websocket.Message.Send(conn, `{"t":"i","d":"\r"}`)
+ case <-deadline:
+ t.Fatalf("no login prompt on the serial terminal; got %q", got.String())
+ }
+ }
+ t.Logf("serial terminal shows the login prompt")
+ // The log (GetConsoleOutput) still has the boot output with a client attached.
+ if out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string); !strings.Contains(out, "Cloud-init v.") {
+ t.Errorf("console output lost the boot log: %.300s", out)
+ }
+}
diff --git a/cli/internal/svc/ec2/vm_disks.go b/cli/internal/svc/ec2/vm_disks.go
new file mode 100644
index 00000000..db4793bd
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_disks.go
@@ -0,0 +1,218 @@
+package ec2
+
+import (
+ "context"
+ "fmt"
+ "log"
+ "net/http"
+ "slices"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/homecloudhq/homecloud/cli/internal/core"
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
+ "github.com/homecloudhq/homecloud/cli/internal/store"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2/vm"
+)
+
+// VM disks.
+//
+// Every EBS volume of a VM instance is a Docker volume mounted into the VM
+// container. The root volume (EBS device /dev/xvda, mounted at /vm) holds
+// disk.qcow2, an overlay on the cached cloud image (or a standalone copy of an
+// image made from an instance). Any other volume is mounted at /disks/ and holds disk.img, a sparse raw image of the volume's size that the
+// guest sees as a virtio disk: /dev/vdb, /dev/vdc, ... in the order of the EBS
+// device names (/dev/sdf before /dev/sdg), and always as
+// /dev/disk/by-id/virtio-.
+//
+// Docker cannot add a mount to a running container, so attaching or detaching
+// a volume rebuilds the VM container (vm.go rebuildVM): the guest is shut down
+// gracefully and boots again with the new set of disks. There is no hot-plug.
+//
+// Snapshots, images and backups of a root volume are flattened (qemu-img
+// convert) into a standalone qcow2 so that they do not depend on the cached
+// cloud image. Other volumes are copied as they are.
+
+// vmRoot is the root volume attachment of a VM instance.
+func vmRoot(i Instance) (VolumeAttachment, bool) {
+ for _, v := range i.Volumes {
+ if v.MountPath == vm.DiskDir {
+ return v, true
+ }
+ }
+ return VolumeAttachment{}, false
+}
+
+// vmDataDisks are the extra volumes of a VM instance in guest order: by EBS
+// device name, then volume ID.
+func vmDataDisks(i Instance) []VolumeAttachment {
+ var out []VolumeAttachment
+ for _, v := range i.Volumes {
+ if v.MountPath != vm.DiskDir {
+ out = append(out, v)
+ }
+ }
+ slices.SortFunc(out, func(a, b VolumeAttachment) int {
+ if c := strings.Compare(a.Device, b.Device); c != 0 {
+ return c
+ }
+ return strings.Compare(a.VolumeID, b.VolumeID)
+ })
+ return out
+}
+
+// vmFlatten copies the Docker volume src into the empty volume dst: a root
+// volume becomes a standalone qcow2, any other volume is copied as it is.
+func (s *Service) vmFlatten(ctx context.Context, src, dst string) error {
+ runner, err := s.vmRunner(ctx)
+ if err != nil {
+ return err
+ }
+ _, err = s.env.Docker.RunOnce(ctx, runtime.RunSpec{
+ Image: runner, Entrypoint: []string{"/usr/local/bin/hc-vm-flatten"}, Cmd: []string{"/src", "/dst"},
+ Mounts: []runtime.Mount{
+ {Volume: src, Target: "/src", ReadOnly: true},
+ {Volume: s.vmImageVolume(), Target: vm.ImagesDir, ReadOnly: true},
+ {Volume: dst, Target: "/dst"},
+ },
+ })
+ return err
+}
+
+// snapshotCopy fills a snapshot's volume from a volume.
+func (s *Service) snapshotCopy(ctx context.Context, v Volume, dst string) error {
+ if v.VMRoot {
+ return s.vmFlatten(ctx, volumeName(v.ID), dst)
+ }
+ return s.copyVolume(ctx, volumeName(v.ID), dst)
+}
+
+func amiVolume(id string) string { return "hc-" + id }
+
+// createVMImage captures a VM instance's root disk as an AMI: a flattened
+// copy in a Docker volume of its own, so the image does not depend on the
+// instance, its volume or the cloud image cache. Launching it copies the disk
+// again into the new instance's root volume.
+func (s *Service) createVMImage(i Instance, name, description string, tags core.Tags) (Image, error) {
+ if i.State != "running" && i.State != "stopped" {
+ return Image{}, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s is %s", i.ID, i.State)
+ }
+ root, ok := vmRoot(i)
+ if !ok {
+ return Image{}, core.Errf(http.StatusConflict, "IncorrectInstanceState", "instance %s has no root volume", i.ID)
+ }
+ if name == "" {
+ name = i.ID + "-image"
+ }
+ for _, im := range store.List[Image](s.env.Store, cImages) {
+ if im.Name == name {
+ return Image{}, core.Errf(http.StatusConflict, "InvalidAMIName.Duplicate", "AMI name %s is already in use by AMI %s", name, im.ID)
+ }
+ }
+ arch, _ := vm.ArchOf(hostArch(s))
+ id := core.NewID("ami")
+ vol := amiVolume(id)
+ if err := s.env.Docker.CreateVolume(vol, runtime.Labels("ami", id, nil)); err != nil {
+ return Image{}, err
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), time.Hour)
+ defer cancel()
+ // A running guest's disk is read while it is open (crash-consistent);
+ // stop the instance for a clean image.
+ if err := s.vmFlatten(ctx, volumeName(root.VolumeID), vol); err != nil {
+ _ = s.env.Docker.RemoveVolume(vol)
+ return Image{}, fmt.Errorf("capture image: %w", err)
+ }
+ im := Image{ID: id, Name: name, Description: description, Platform: "linux", Owner: s.env.AccountID, State: "available",
+ CreatedAt: core.Now().Format(time.RFC3339), SourceInstance: i.ID, Tags: tags,
+ VMDisk: vol, VMUser: i.VMUser, VMArch: string(arch), VMDiskGB: i.VMDiskGB}
+ if err := store.Put(s.env.Store, cImages, im.ID, im); err != nil {
+ _ = s.env.Docker.RemoveVolume(vol)
+ return Image{}, err
+ }
+ return im.normalized(), nil
+}
+
+// FlattenForBackup gives homecloud backup a standalone copy of a VM root
+// volume (the volume's own file is an overlay on the cloud image cache, which a
+// backup leaves out). It returns the name of a temporary volume to archive in
+// its place and a function that removes it; "" for any other volume.
+func (s *Service) FlattenForBackup(ctx context.Context, volume string, labels map[string]string) (string, func(), error) {
+ if labels[vm.LabelRoot] != "true" {
+ return "", nil, nil
+ }
+ tmp := "hc-tmp-flat-" + core.RandHex(6)
+ // Not labelled as managed: a leftover must never be picked up by a later backup.
+ if err := s.env.Docker.CreateVolume(tmp, map[string]string{"homecloud.helper": "backup"}); err != nil {
+ return "", nil, err
+ }
+ cleanup := func() { _ = s.env.Docker.RemoveVolume(tmp) }
+ if err := s.vmFlatten(ctx, volume, tmp); err != nil {
+ cleanup()
+ return "", nil, fmt.Errorf("flatten %s: %w", volume, err)
+ }
+ return tmp, cleanup, nil
+}
+
+var (
+ vmRecMu sync.Mutex
+ vmRec = map[string]bool{}
+)
+
+// vmRecoverContainer recreates the VM container of an instance whose
+// container is gone but whose root volume is there, as after homecloud restore
+// on a host that has the volumes but no containers. The instance comes back
+// stopped: starting it boots the restored disk. It reports false when there is
+// nothing to recover from (the volume or the network is missing too).
+func (s *Service) vmRecoverContainer(i Instance) (Instance, bool) {
+ vmRecMu.Lock()
+ if vmRec[i.ID] {
+ vmRecMu.Unlock()
+ return i, true // another call is on it
+ }
+ vmRec[i.ID] = true
+ vmRecMu.Unlock()
+ defer func() { vmRecMu.Lock(); delete(vmRec, i.ID); vmRecMu.Unlock() }()
+
+ root, ok := vmRoot(i)
+ if !ok {
+ return i, false
+ }
+ if _, err := s.env.Docker.C.InspectVolume(volumeName(root.VolumeID)); err != nil {
+ return i, false
+ }
+ v, err := s.vpc.GetVPC(i.VpcID)
+ if err != nil {
+ return i, false
+ }
+ if _, err := s.env.Docker.C.NetworkInfo(v.Network); err != nil {
+ return i, false
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 25*time.Minute)
+ defer cancel()
+ if _, err := s.vmRunner(ctx); err != nil { // the runner image may not exist on this host yet
+ log.Printf("ec2: recreate the virtual machine container of %s: %v", i.ID, err)
+ return i, false
+ }
+ cid, err := s.env.Docker.Run(ctx, s.vmRunSpec(i, v.Network))
+ if err != nil {
+ log.Printf("ec2: recreate the virtual machine container of %s: %v", i.ID, err)
+ return i, false
+ }
+ if err := s.env.Docker.CopyIn(ctx, cid, "/", s.vmSeed(i), 0o644); err != nil {
+ _ = s.env.Docker.Remove(cid)
+ return i, false
+ }
+ out, err := store.Update(s.env.Store, cInstances, i.ID, func(x *Instance) error {
+ x.ContainerID, x.State, x.StateReason, x.PublicPorts = cid, "stopped", "Server.Restore: the virtual machine's container was recreated from its disk", map[string]int{}
+ return nil
+ })
+ if err != nil {
+ _ = s.env.Docker.Remove(cid)
+ return i, false
+ }
+ log.Printf("ec2: %s: recreated its virtual machine container from the root volume (stopped; start it to boot)", i.ID)
+ return out, true
+}
diff --git a/cli/internal/svc/ec2/vm_disks_live_test.go b/cli/internal/svc/ec2/vm_disks_live_test.go
new file mode 100644
index 00000000..602c6f2a
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_disks_live_test.go
@@ -0,0 +1,256 @@
+package ec2_test
+
+import (
+ "context"
+ "encoding/json"
+ "io"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/homecloudhq/homecloud/cli/internal/core"
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
+ "github.com/homecloudhq/homecloud/cli/internal/system"
+ "golang.org/x/crypto/ssh"
+)
+
+// TestVMDisksImagesAndBackup exercises the disk side of VM instances on a real
+// guest: an extra volume at launch, a snapshot restored and attached to the
+// running guest, a detach, an image made from the instance (launched into a new
+// instance after the first is terminated) and a backup and restore of the
+// instance's disk. It boots the guest about five times: slow when emulated.
+//
+// HC_TEST_VM=1 go test -timeout 90m -run TestVMDisksImagesAndBackup ./internal/svc/ec2
+func TestVMDisksImagesAndBackup(t *testing.T) {
+ if os.Getenv("HC_TEST_VM") != "1" {
+ t.Skip("set HC_TEST_VM=1 to boot a real VM (slow; downloads a cloud image)")
+ }
+ // dockertest (newVMLab) labels everything this test creates with an account of
+ // its own and removes it afterwards; the backup below archives only that
+ // account's volumes (never another installation's).
+ lab := newVMLab(t)
+ acct := runtime.Account
+ f, h, signer, sg := lab.filterEnv, lab.h, lab.signer, lab.sg
+ d := h.Env.Docker
+ // Volumes that outlive their instance (detached or not deleted on termination) and snapshots.
+ var leftVolumes, leftSnapshots []string
+ t.Cleanup(func() {
+ for _, v := range leftVolumes {
+ _, _ = h.AWSErr(t, "ec2", "delete-volume", "--volume-id", v)
+ }
+ for _, s := range leftSnapshots {
+ _, _ = h.AWSErr(t, "ec2", "delete-snapshot", "--snapshot-id", s)
+ }
+ })
+
+ // volumes maps device names to volume IDs for an instance.
+ volumes := func(instance string) map[string]string {
+ out := map[string]string{}
+ for _, v := range h.AWSJSON(t, "ec2", "describe-volumes", "--filters", "Name=attachment.instance-id,Values="+instance)["Volumes"].([]any) {
+ m := v.(map[string]any)
+ att := m["Attachments"].([]any)[0].(map[string]any)
+ out[att["Device"].(string)] = m["VolumeId"].(string)
+ }
+ return out
+ }
+ serial := func(volID string) string { return "/dev/disk/by-id/virtio-" + volID[:20] }
+ waitVolume := func(volID, state string) {
+ waitFor(t, volID+" "+state, vmTestBudget, func() bool {
+ vs := h.AWSJSON(t, "ec2", "describe-volumes", "--volume-ids", volID)["Volumes"].([]any)
+ m := vs[0].(map[string]any)
+ if state == "attached" {
+ a := m["Attachments"].([]any)
+ return m["State"] == "in-use" && len(a) == 1 && a[0].(map[string]any)["State"] == "attached"
+ }
+ return m["State"] == state
+ })
+ }
+
+ // 1. Launch with an extra 2 GiB volume; the guest sees it as a virtio disk.
+ run := h.AWSJSON(t, "ec2", "run-instances", "--image-id", vmTestImage, "--instance-type", "t3.micro", "--key-name", "vmtest",
+ "--subnet-id", f.subnet, "--security-group-ids", sg,
+ "--block-device-mappings", `[{"DeviceName":"/dev/xvda","Ebs":{"VolumeSize":10}},{"DeviceName":"/dev/sdf","Ebs":{"VolumeSize":2,"DeleteOnTermination":true}}]`)
+ inst := run["Instances"].([]any)[0].(map[string]any)
+ id, az := inst["InstanceId"].(string), inst["Placement"].(map[string]any)["AvailabilityZone"].(string)
+ t.Cleanup(func() { _, _ = h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", id) })
+ i := f.vmWaitState(t, id, "running")
+ vols := volumes(id)
+ if len(vols) != 2 || vols["/dev/xvda"] == "" || vols["/dev/sdf"] == "" {
+ t.Fatalf("volumes of %s: %v", id, vols)
+ }
+ data1 := vols["/dev/sdf"]
+ leftVolumes = append(leftVolumes, data1)
+ c := f.sshDial(t, id, i.PublicPorts["22/tcp"], signer, vmTestUser)
+ if got := sshRun(t, c, "lsblk -dbno NAME,SIZE,SERIAL | grep "+data1[:20]); !strings.Contains(got, "2147483648") {
+ t.Fatalf("the data disk is not 2 GiB with serial %s: %q", data1[:20], got)
+ }
+ sshRun(t, c, "test -b "+serial(data1))
+ sshRun(t, c, "sudo mkfs.ext4 -q "+serial(data1)+" && sudo mkdir -p /mnt/data && sudo mount "+serial(data1)+" /mnt/data && echo on-disk | sudo tee /mnt/data/data.txt && sync")
+ sshRun(t, c, "echo root-marker > /home/"+vmTestUser+"/marker.txt && sync")
+ c.Close()
+ t.Logf("extra volume %s is a virtio disk in the guest", data1)
+
+ // 2. Snapshot it, restore the snapshot to a new volume and attach that to the running guest.
+ snap := h.AWSJSON(t, "ec2", "create-snapshot", "--volume-id", data1)["SnapshotId"].(string)
+ leftSnapshots = append(leftSnapshots, snap)
+ waitFor(t, "snapshot "+snap, vmTestBudget, func() bool {
+ ss := h.AWSJSON(t, "ec2", "describe-snapshots", "--snapshot-ids", snap)["Snapshots"].([]any)
+ return ss[0].(map[string]any)["State"] == "completed"
+ })
+ data2 := h.AWSJSON(t, "ec2", "create-volume", "--snapshot-id", snap, "--availability-zone", az)["VolumeId"].(string)
+ leftVolumes = append(leftVolumes, data2)
+ waitVolume(data2, "available")
+ h.AWS(t, "ec2", "attach-volume", "--volume-id", data2, "--instance-id", id, "--device", "/dev/sdg")
+ waitVolume(data2, "attached") // the guest was rebuilt (reboots) with the new disk
+ c = f.sshDial(t, id, 0, signer, vmTestUser)
+ sshRun(t, c, "test -b "+serial(data2))
+ if got := sshRun(t, c, "sudo mkdir -p /mnt/snap && sudo mount "+serial(data2)+" /mnt/snap && cat /mnt/snap/data.txt"); got != "on-disk" {
+ t.Errorf("the snapshot's disk holds %q", got)
+ }
+ if got := sshRun(t, c, "cat /home/"+vmTestUser+"/marker.txt"); got != "root-marker" {
+ t.Errorf("root disk after the attach: %q", got)
+ }
+ c.Close()
+ t.Logf("snapshot %s restored to %s and attached to the running guest", snap, data2)
+
+ // 3. Detach the first data volume: its disk leaves the guest, the other stays.
+ h.AWS(t, "ec2", "detach-volume", "--volume-id", data1)
+ waitVolume(data1, "available")
+ c = f.sshDial(t, id, 0, signer, vmTestUser)
+ if out, err := run1(c, "test -e "+serial(data1)); err == nil {
+ t.Errorf("the detached disk is still in the guest: %s", out)
+ }
+ sshRun(t, c, "test -b "+serial(data2))
+ c.Close()
+ // The root volume cannot be detached.
+ if msg, err := h.AWSErr(t, "ec2", "detach-volume", "--volume-id", vols["/dev/xvda"]); err == nil || !strings.Contains(msg, "root volume") {
+ t.Errorf("detaching the root volume: %v %s", err, msg)
+ }
+
+ // 4. An image from the instance (stopped, so it is clean) is a standalone copy of its disk.
+ h.AWS(t, "ec2", "stop-instances", "--instance-ids", id)
+ f.vmWaitState(t, id, "stopped")
+ ami := h.AWSJSON(t, "ec2", "create-image", "--instance-id", id, "--name", "vm-custom-image")["ImageId"].(string)
+ im := h.AWSJSON(t, "ec2", "describe-images", "--image-ids", ami)["Images"].([]any)[0].(map[string]any)
+ if im["Hypervisor"] != "kvm" || im["VirtualizationType"] != "hvm" || im["State"] != "available" {
+ t.Errorf("image %v", im)
+ }
+ var amiVol string
+ var imgs []struct {
+ ID string `json:"id"`
+ VMDisk string `json:"vm_disk"`
+ }
+ _ = json.Unmarshal(h.Native(t, "GET", "/api/v1/ec2/images", nil), &imgs)
+ for _, x := range imgs {
+ if x.ID == ami {
+ amiVol = x.VMDisk
+ }
+ }
+ if amiVol == "" {
+ t.Fatalf("image %s has no disk volume", ami)
+ }
+ t.Logf("image %s made from %s (volume %s)", ami, id, amiVol)
+
+ // 5. Back up the stopped instance, lose its container and disk, restore: the disk is
+ // standalone in the archive (no backing image) and boots.
+ rootVol := vols["/dev/xvda"]
+ cid := f.vmGet(id).ContainerID
+ cfg := core.DefaultConfig()
+ cfg.DataDir = t.TempDir()
+ b := &system.Backup{Cfg: cfg, Docker: d, AccountID: acct, Version: "test", OwnVolumesOnly: true, Flatten: f.ec2.FlattenForBackup}
+ // The archive holds whole disks: a file, not memory.
+ archive, err := os.Create(filepath.Join(t.TempDir(), "backup.tar.gz"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer archive.Close()
+ if err := b.Write(context.Background(), archive, true, t.Logf); err != nil {
+ t.Fatal(err)
+ }
+ size, _ := archive.Seek(0, io.SeekCurrent)
+ t.Logf("backup: %d bytes", size)
+ if size < 50<<20 {
+ t.Fatalf("the backup (%d bytes) cannot hold the instance's disk", size)
+ }
+ if _, err := archive.Seek(0, io.SeekStart); err != nil {
+ t.Fatal(err)
+ }
+ if err := d.Remove(cid); err != nil {
+ t.Fatal(err)
+ }
+ if err := d.RemoveVolume("hc-" + rootVol); err != nil {
+ t.Fatal(err)
+ }
+ restoreCfg := t.TempDir()
+ if _, err := system.Restore(context.Background(), d, archive, system.RestoreOptions{DataDir: restoreCfg, Force: true, Logf: t.Logf}); err != nil {
+ t.Fatal(err)
+ }
+ // The record still exists: reading it recreates the VM container from the restored disk.
+ var got vmInstance
+ waitFor(t, "container recreated", 5*time.Minute, func() bool {
+ got = f.vmGet(id)
+ return got.State == "stopped" && got.ContainerID != "" && got.ContainerID != cid
+ })
+ h.AWS(t, "ec2", "start-instances", "--instance-ids", id)
+ f.vmWaitState(t, id, "running")
+ c = f.sshDial(t, id, 0, signer, vmTestUser)
+ if got := sshRun(t, c, "cat /home/"+vmTestUser+"/marker.txt"); got != "root-marker" {
+ t.Errorf("the restored disk holds %q", got)
+ }
+ c.Close()
+ if info := vmExec(t, d, f.vmGet(id).ContainerID, "qemu-img info -U --output=json /vm/disk.qcow2"); strings.Contains(info, "backing-filename") {
+ t.Errorf("the restored root disk still has a backing file: %s", info)
+ }
+ t.Logf("backup restored: %s boots from its restored disk", id)
+
+ // 6. Terminate the source instance; the image launches on its own.
+ h.AWS(t, "ec2", "terminate-instances", "--instance-ids", id)
+ f.vmWaitState(t, id, "terminated")
+ run2 := h.AWSJSON(t, "ec2", "run-instances", "--image-id", ami, "--instance-type", "t3.micro", "--key-name", "vmtest", "--subnet-id", f.subnet, "--security-group-ids", sg)
+ id2 := run2["Instances"].([]any)[0].(map[string]any)["InstanceId"].(string)
+ t.Cleanup(func() { _, _ = h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", id2) })
+ i2 := f.vmWaitState(t, id2, "running")
+ c = f.sshDial(t, id2, i2.PublicPorts["22/tcp"], signer, vmTestUser)
+ if got := sshRun(t, c, "cat /home/"+vmTestUser+"/marker.txt"); got != "root-marker" {
+ t.Errorf("the instance launched from the image holds %q", got)
+ }
+ if got := sshRun(t, c, "hostname"); got == id || !strings.HasPrefix(got, "ip-") {
+ t.Errorf("hostname %q", got)
+ }
+ c.Close()
+ h.AWS(t, "ec2", "terminate-instances", "--instance-ids", id2)
+ f.vmWaitState(t, id2, "terminated")
+ h.AWS(t, "ec2", "deregister-image", "--image-id", ami)
+ if _, err := d.C.InspectVolume(amiVol); err == nil {
+ t.Errorf("image volume %s remains after deregistering", amiVol)
+ }
+ // The restored-and-terminated instance's volumes were deleted with it (DeleteOnTermination).
+ if _, err := d.C.InspectVolume("hc-" + rootVol); err == nil {
+ t.Errorf("root volume %s remains after terminate", rootVol)
+ }
+}
+
+// run1 runs a command over SSH and returns its output and error.
+func run1(c *ssh.Client, cmd string) (string, error) {
+ s, err := c.NewSession()
+ if err != nil {
+ return "", err
+ }
+ defer s.Close()
+ out, err := s.CombinedOutput(cmd)
+ return string(out), err
+}
+
+// vmExec runs a command in a container and returns its output.
+func vmExec(t *testing.T, d *runtime.Docker, cid, cmd string) string {
+ t.Helper()
+ ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+ defer cancel()
+ res, err := d.Exec(ctx, cid, []string{"/bin/sh", "-c", cmd}, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return res.Stdout + res.Stderr
+}
diff --git a/cli/internal/svc/ec2/vm_internal_test.go b/cli/internal/svc/ec2/vm_internal_test.go
new file mode 100644
index 00000000..36ff6e6d
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_internal_test.go
@@ -0,0 +1,111 @@
+package ec2
+
+import (
+ "errors"
+ "strings"
+ "testing"
+
+ "github.com/homecloudhq/homecloud/cli/internal/runtime"
+ "github.com/homecloudhq/homecloud/cli/internal/store"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/svctest"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/vpc"
+)
+
+// A failed rebuild during a resize leaves the record describing the container
+// that is still there (the old type); a rebuild that replaced the container
+// keeps the new type.
+func TestChangeTypeRollsBackAFailedVMRebuild(t *testing.T) {
+ env := svctest.Env(t)
+ s := New(env, vpc.New(env))
+ inst := Instance{ID: "i-vmresize", State: "stopped", ContainerID: "c-old", Virtualization: "kvm", VMBase: "ubuntu-24.04",
+ InstanceType: "t3.micro", VCPUs: 2, MemoryMB: 1024}
+ if err := store.Put(env.Store, cInstances, inst.ID, inst); err != nil {
+ t.Fatal(err)
+ }
+ setBusy(inst.ID, true) // no Docker here: keep get from syncing with it
+ defer setBusy(inst.ID, false)
+ prev := recreateVM
+ defer func() { recreateVM = prev }()
+
+ recreateVM = func(*Service, string) error { return errors.New("rename: boom") }
+ if _, err := s.ChangeType(inst.ID, "t3.large"); err == nil || !strings.Contains(err.Error(), "boom") {
+ t.Fatalf("ChangeType = %v, want the rebuild error", err)
+ }
+ got, _ := store.Get[Instance](env.Store, cInstances, inst.ID)
+ if got.InstanceType != "t3.micro" || got.VCPUs != 2 || got.MemoryMB != 1024 {
+ t.Errorf("after a failed rebuild: %s %v vCPU %d MiB, want the old t3.micro", got.InstanceType, got.VCPUs, got.MemoryMB)
+ }
+
+ recreateVM = func(s *Service, id string) error {
+ _, err := store.Update(s.env.Store, cInstances, id, func(x *Instance) error { x.ContainerID = "c-new"; return nil })
+ if err != nil {
+ return err
+ }
+ return errors.New("start the rebuilt virtual machine: boom")
+ }
+ if _, err := s.ChangeType(inst.ID, "t3.large"); err == nil {
+ t.Fatal("ChangeType succeeded")
+ }
+ got, _ = store.Get[Instance](env.Store, cInstances, inst.ID)
+ if got.InstanceType != "t3.large" || got.ContainerID != "c-new" {
+ t.Errorf("after a rebuild that replaced the container: %s in %s, want t3.large in c-new", got.InstanceType, got.ContainerID)
+ }
+}
+
+func TestPasstFailure(t *testing.T) {
+ logs := "2026-10-07T13:57:58.1Z [homecloud] creating disk (10 GiB)\n" +
+ "2026-10-07T13:57:59.0Z [homecloud] passt did not start; falling back to user-mode networking:\n" +
+ "2026-10-07T13:57:59.0Z 0.5852: Failed to sandbox process, exiting\n" +
+ "2026-10-07T13:57:59.1Z hint: the Docker host restricts unprivileged user namespaces\n" +
+ "2026-10-07T13:57:59.2Z [homecloud] starting the virtual machine\n" +
+ "2026-10-07T13:58:10.0Z [ 1.0] Linux version ...\n"
+ want := "[homecloud] passt did not start; falling back to user-mode networking:; 0.5852: Failed to sandbox process, exiting; hint: the Docker host restricts unprivileged user namespaces"
+ if got := passtFailure(logs); got != want {
+ t.Errorf("passtFailure =\n%q\nwant\n%q", got, want)
+ }
+ if got := passtFailure("2026-10-07T13:57:59.2Z [homecloud] starting the virtual machine\n"); got != "" {
+ t.Errorf("passt started, but passtFailure = %q", got)
+ }
+}
+
+func TestHostFwd(t *testing.T) {
+ if got := hostFwd(nil); got != "" {
+ t.Errorf("no ports: %q", got)
+ }
+ got := hostFwd([]runtime.Port{{ContainerPort: 22, Protocol: "tcp"}, {ContainerPort: 53, Protocol: "udp"}})
+ if want := ",hostfwd=tcp::22-:22,hostfwd=udp::53-:53"; got != want {
+ t.Errorf("hostFwd = %q, want %q", got, want)
+ }
+}
+
+func TestVMImagesAreMarked(t *testing.T) {
+ seen := 0
+ for _, im := range catalog {
+ n := im.normalized()
+ if !im.IsVM() {
+ if n.Virtualization != "container" || im.Ref == "" {
+ t.Errorf("%s: container image %+v", im.ID, n)
+ }
+ continue
+ }
+ seen++
+ if n.Virtualization != "vm" || im.Ref != "" || im.KeepAlive {
+ t.Errorf("%s: VM image %+v", im.ID, n)
+ }
+ if len(im.Name) < 5 || im.Name[len(im.Name)-4:] != "(VM)" {
+ t.Errorf("%s: name %q does not end in (VM)", im.ID, im.Name)
+ }
+ if im.AWSName == "" || im.OwnerID == "" {
+ t.Errorf("%s: no AWS name or owner", im.ID)
+ }
+ }
+ if seen < 2 {
+ t.Errorf("only %d VM images in the catalog", seen)
+ }
+}
+
+func TestErrVMUnsupported(t *testing.T) {
+ if err := errVMUnsupported("attaching volumes to"); err == nil || err.Error() != "UnsupportedOperation: attaching volumes to VM instances is not supported yet" {
+ t.Errorf("%v", err)
+ }
+}
diff --git a/cli/internal/svc/ec2/vm_live_test.go b/cli/internal/svc/ec2/vm_live_test.go
new file mode 100644
index 00000000..f6d57b3d
--- /dev/null
+++ b/cli/internal/svc/ec2/vm_live_test.go
@@ -0,0 +1,470 @@
+package ec2_test
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net"
+ "net/http"
+ "os"
+ "strconv"
+ "strings"
+ "testing"
+ "time"
+
+ docker "github.com/fsouza/go-dockerclient"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/ec2"
+ "golang.org/x/crypto/ssh"
+)
+
+// The VM instance test boots a real Ubuntu cloud image under QEMU in a Docker
+// container. It needs Docker, downloads the image once (about 600 MB, into the
+// Docker volume hc-test-vm-images, reused by later runs) and is slow when the
+// Docker host has no /dev/kvm (the guest is emulated). Run it with
+//
+// HC_TEST_VM=1 go test -timeout 60m -run TestVMInstance ./internal/svc/ec2
+//
+// (DOCKER_HOST=unix://$HOME/.orbstack/run/docker.sock on macOS with OrbStack).
+
+const vmTestBudget = 12 * time.Minute // per wait for a guest to boot or a rebuild; emulated boots take up to about 5 minutes
+
+// The Ubuntu image is the default; HC_TEST_VM_IMAGE=debian boots Debian instead (faster to boot emulated).
+var vmTestImage, vmTestUser = func() (string, string) {
+ if os.Getenv("HC_TEST_VM_IMAGE") == "debian" {
+ return "ami-debian-12-vm", "debian"
+ }
+ return "ami-ubuntu-24-04-vm", "ubuntu"
+}()
+
+type vmInstance struct {
+ State string `json:"state"`
+ ContainerID string `json:"container_id"`
+ PrivateIP string `json:"private_ip"`
+ Virtualization string `json:"virtualization"`
+ VMUser string `json:"vm_user"`
+ VMNetwork string `json:"vm_network"`
+ PublicPorts map[string]int `json:"public_ports"`
+ StateReason string `json:"state_reason"`
+}
+
+func (f *filterEnv) vmGet(id string) vmInstance {
+ var i vmInstance
+ _ = json.Unmarshal(f.h.Native(f.t, "GET", "/api/v1/ec2/instances/"+id, nil), &i)
+ return i
+}
+
+func (f *filterEnv) vmWaitState(t *testing.T, id, state string) vmInstance {
+ t.Helper()
+ var i vmInstance
+ waitFor(t, id+" "+state, vmTestBudget, func() bool {
+ i = f.vmGet(id)
+ if i.State == "terminated" && state != "terminated" {
+ t.Fatalf("%s terminated: %s", id, i.StateReason)
+ }
+ return i.State == state
+ })
+ return i
+}
+
+// startIMDS runs the instance metadata service for this test: its own helper
+// container (so a real installation's is left alone) and an HTTP endpoint the
+// containers reach through host.docker.internal.
+func (f *filterEnv) startIMDS(t *testing.T) {
+ t.Helper()
+ ln, err := net.Listen("tcp", "0.0.0.0:0")
+ if err != nil {
+ t.Fatal(err)
+ }
+ mux := http.NewServeMux()
+ mux.Handle(ec2.IMDSPath, f.ec2.IMDSHandler())
+ srv := &http.Server{Handler: mux}
+ go srv.Serve(ln)
+ f.h.Env.ContainerAPI = fmt.Sprintf("http://host.docker.internal:%d", ln.Addr().(*net.TCPAddr).Port)
+ ctx, cancel := context.WithCancel(context.Background())
+ done := make(chan struct{})
+ go func() { f.ec2.RunIMDS(ctx); close(done) }()
+ t.Cleanup(func() {
+ cancel()
+ <-done
+ _ = srv.Close()
+ _ = f.h.Env.Docker.Remove(f.ec2.IMDSContainer)
+ })
+ // The helper attaches to the VPC, then instances can route to it.
+ v, err := f.vpc.GetVPC(f.vpcID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ waitFor(t, "metadata service", 5*time.Minute, func() bool {
+ c, err := f.h.Env.Docker.Inspect(f.ec2.IMDSContainer)
+ if err != nil || !c.State.Running {
+ return false
+ }
+ n, ok := c.NetworkSettings.Networks[v.Network]
+ return ok && n.IPAddress != ""
+ })
+}
+
+// sshDial connects to the guest through its published SSH port on the Docker host.
+// On a timeout it reports what the guest and the container look like.
+func (f *filterEnv) sshDial(t *testing.T, id string, port int, signer ssh.Signer, user string) *ssh.Client {
+ t.Helper()
+ var c *ssh.Client
+ var lastErr error
+ end := time.Now().Add(vmTestBudget)
+ for {
+ // The published port changes when the container is rebuilt: look it up each time.
+ if p := f.vmGet(id).PublicPorts["22/tcp"]; p != 0 {
+ port = p
+ }
+ c, lastErr = ssh.Dial("tcp", fmt.Sprintf("127.0.0.1:%d", port), &ssh.ClientConfig{
+ User: user, Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), Timeout: 15 * time.Second,
+ })
+ if lastErr == nil {
+ break
+ }
+ if time.Now().After(end) {
+ t.Fatalf("ssh to %s on published port %d: %v\n%s", id, port, lastErr, f.vmDiagnose(id))
+ }
+ time.Sleep(2 * time.Second)
+ }
+ t.Cleanup(func() { c.Close() })
+ return c
+}
+
+// vmDiagnose describes a guest that cannot be reached: its console's network
+// lines and the listening sockets in the VM container.
+func (f *filterEnv) vmDiagnose(id string) string {
+ i := f.vmGet(id)
+ var b strings.Builder
+ fmt.Fprintf(&b, "state %s, network %q, ports %v\n", i.State, i.VMNetwork, i.PublicPorts)
+ logs, _ := f.h.Env.Docker.Logs(i.ContainerID, 0, time.Time{})
+ for _, l := range strings.Split(logs, "\n") {
+ if strings.Contains(l, "ci-info") || strings.Contains(l, "[homecloud]") || strings.Contains(l, "passt") || strings.Contains(l, "DHCP") || strings.Contains(l, "sshd") || strings.Contains(l, "ssh.service") {
+ b.WriteString(l + "\n")
+ }
+ }
+ if k := strings.Index(logs, "[homecloud] passt exited unexpectedly"); k >= 0 {
+ rest := strings.Split(logs[k:], "\n")
+ b.WriteString("--- from the supervisor's report:\n" + strings.Join(rest[:min(len(rest), 70)], "\n") + "\n")
+ }
+ b.WriteString("--- last console lines:\n")
+ lines := strings.Split(strings.TrimSpace(logs), "\n")
+ b.WriteString(strings.Join(lines[max(0, len(lines)-25):], "\n") + "\n")
+ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
+ defer cancel()
+ probe := "timeout 5 bash -c 'exec 3<>/dev/tcp/" + i.PrivateIP + "/22; head -c 60 <&3' 2>&1; echo; iptables -S INPUT 2>&1 | head -20"
+ if res, err := f.h.Env.Docker.Exec(ctx, i.ContainerID, []string{"/bin/sh", "-c", "cat /proc/net/tcp6 | head -8; echo; ls -l /tmp; tail -n 40 /run/passt.log; echo banner-from-inside:; " + probe}, nil); err == nil {
+ b.WriteString(res.Stdout + res.Stderr)
+ }
+ return b.String()
+}
+
+func sshRun(t *testing.T, c *ssh.Client, cmd string) string {
+ t.Helper()
+ s, err := c.NewSession()
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer s.Close()
+ out, err := s.CombinedOutput(cmd)
+ if err != nil {
+ t.Fatalf("ssh %q: %v\n%s", cmd, err, out)
+ }
+ return strings.TrimSpace(string(out))
+}
+
+// banner reports whether from (a container instance) reads an SSH banner from ip:22.
+func (f *filterEnv) banner(t *testing.T, from node, ip string) bool {
+ cid := f.container(from)
+ if cid == "" {
+ return false
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+ defer cancel()
+ res, err := f.h.Env.Docker.Exec(ctx, cid, []string{"/bin/sh", "-c", "echo | nc -w 4 " + ip + " 22"}, nil)
+ return err == nil && strings.Contains(res.Stdout, "SSH-2.0")
+}
+
+func (f *filterEnv) bannerEventually(t *testing.T, want bool, from node, ip, what string) {
+ t.Helper()
+ end := time.Now().Add(vmTestBudget)
+ for time.Now().Before(end) {
+ if f.banner(t, from, ip) == want {
+ return
+ }
+ time.Sleep(2 * time.Second)
+ }
+ t.Fatalf("%s: SSH banner from %s to %s reachable = %v, want %v", what, from.id, ip, !want, want)
+}
+
+// vmLab is a test VPC with internet access, its own metadata service, a key
+// pair, a security group letting SSH in from anywhere and a probe container.
+type vmLab struct {
+ *filterEnv
+ signer ssh.Signer
+ sg string
+ helper node
+}
+
+func newVMLab(t *testing.T) *vmLab {
+ if os.Getenv("HC_TEST_VM") != "1" {
+ t.Skip("set HC_TEST_VM=1 to boot a real VM (slow; downloads a cloud image)")
+ }
+ f := newFilterEnv(t)
+ h := f.h
+ f.ec2.VMImageVolume = "hc-test-vm-images"
+ // The image cache is not the test's (dockertest removes everything labelled
+ // with the test's account): later tests and runs reuse the download.
+ if _, err := h.Env.Docker.C.InspectVolume(f.ec2.VMImageVolume); err != nil {
+ if err := h.Env.Docker.CreateVolume(f.ec2.VMImageVolume, map[string]string{"homecloud.test": "vm-image-cache"}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ // Our own metadata service container, named before anything can attach the
+ // default one (a real installation's) to the test VPC.
+ f.ec2.IMDSContainer = fmt.Sprintf("hc-test-imds-%d", time.Now().UnixNano()%1e9)
+ // Published ports need a VPC with an internet gateway (otherwise its network is internal).
+ f.vpc.NetworkChanged = f.ec2.NetworkChanged
+ igw := h.AWSJSON(t, "ec2", "create-internet-gateway")["InternetGateway"].(map[string]any)["InternetGatewayId"].(string)
+ h.AWS(t, "ec2", "attach-internet-gateway", "--internet-gateway-id", igw, "--vpc-id", f.vpcID)
+ rtb := h.AWSJSON(t, "ec2", "describe-route-tables", "--filters", "Name=vpc-id,Values="+f.vpcID)["RouteTables"].([]any)[0].(map[string]any)["RouteTableId"].(string)
+ h.AWS(t, "ec2", "create-route", "--route-table-id", rtb, "--destination-cidr-block", "0.0.0.0/0", "--gateway-id", igw)
+ t.Cleanup(func() {
+ _, _ = h.AWSErr(t, "ec2", "detach-internet-gateway", "--internet-gateway-id", igw, "--vpc-id", f.vpcID)
+ _, _ = h.AWSErr(t, "ec2", "delete-internet-gateway", "--internet-gateway-id", igw)
+ })
+ f.startIMDS(t)
+
+ // A key pair, and a security group that lets SSH in from anywhere (published on the host).
+ key := h.AWSJSON(t, "ec2", "create-key-pair", "--key-name", "vmtest", "--key-type", "ed25519")
+ signer, err := ssh.ParsePrivateKey([]byte(key["KeyMaterial"].(string)))
+ if err != nil {
+ t.Fatal(err)
+ }
+ sg := f.group(t, "vm-ssh")
+ h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "0.0.0.0/0")
+
+ // A container instance in the VPC to probe the guest from.
+ helper := f.launchImage(t, "ami-alpine-3-20", f.group(t, "probe"))
+ return &vmLab{filterEnv: f, signer: signer, sg: sg, helper: helper}
+}
+
+func TestVMInstanceLifecycle(t *testing.T) {
+ lab := newVMLab(t)
+ f, h, signer, sg, helper := lab.filterEnv, lab.h, lab.signer, lab.sg, lab.helper
+
+ userData := "#!/bin/sh\necho hc-userdata-ran > /var/tmp/userdata.txt\n"
+ run := h.AWSJSON(t, "ec2", "run-instances", "--image-id", vmTestImage, "--instance-type", "t3.micro", "--key-name", "vmtest",
+ "--subnet-id", f.subnet, "--security-group-ids", sg, "--user-data", userData,
+ "--block-device-mappings", `[{"DeviceName":"/dev/xvda","Ebs":{"VolumeSize":10,"DeleteOnTermination":true}}]`,
+ "--tag-specifications", `ResourceType=instance,Tags=[{Key=Name,Value=vm-test}]`)
+ inst := run["Instances"].([]any)[0].(map[string]any)
+ id, ip := inst["InstanceId"].(string), inst["PrivateIpAddress"].(string)
+ if inst["Hypervisor"] != "kvm" || inst["VirtualizationType"] != "hvm" {
+ t.Errorf("run-instances reports hypervisor %v, virtualization %v", inst["Hypervisor"], inst["VirtualizationType"])
+ }
+ terminated := false
+ t.Cleanup(func() {
+ if !terminated {
+ _, _ = h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", id)
+ }
+ })
+ i := f.vmWaitState(t, id, "running")
+ t.Logf("%s is running (%s, guest %s) after boot", id, i.Virtualization, ip)
+ if i.Virtualization != "kvm" && i.Virtualization != "emulated" || i.VMUser != vmTestUser {
+ t.Fatalf("instance reports virtualization %q, user %q", i.Virtualization, i.VMUser)
+ }
+ // The guest has the instance's private address with passt, or sits behind NAT in the
+ // user-mode fallback (passt could not run on this host): both must work, and the
+ // fallback is reported rather than hidden.
+ userNet := i.VMNetwork == "user"
+ if i.VMNetwork != "passt" && !userNet {
+ t.Fatalf("vm_network = %q", i.VMNetwork)
+ }
+ if userNet {
+ logs, _ := h.Env.Docker.Logs(i.ContainerID, 0, time.Time{})
+ if k := strings.Index(logs, "[homecloud] passt"); k >= 0 {
+ logs = logs[k:]
+ }
+ t.Logf("NOTE: this guest ran in the user-mode networking FALLBACK (vm_network=user), not with passt; it has no private address of its own. Why:\n%.1500s", logs)
+ }
+ if i.PublicPorts["22/tcp"] == 0 {
+ ci, _ := h.Env.Docker.Inspect(i.ContainerID)
+ if ci != nil {
+ t.Logf("port bindings %v, network ports %v", ci.HostConfig.PortBindings, ci.NetworkSettings.Ports)
+ }
+ t.Fatalf("ssh not published: %v", i.PublicPorts)
+ }
+ // The root volume is an EBS volume attached at /dev/xvda with the requested size.
+ desc := h.AWSJSON(t, "ec2", "describe-volumes", "--filters", "Name=attachment.instance-id,Values="+id)["Volumes"].([]any)
+ if len(desc) != 1 || desc[0].(map[string]any)["Size"].(float64) != 10 {
+ t.Fatalf("root volume: %v", desc)
+ }
+ volID := desc[0].(map[string]any)["VolumeId"].(string)
+
+ // Log in through the published port and inspect the guest.
+ c := f.sshDial(t, id, i.PublicPorts["22/tcp"], signer, vmTestUser)
+ if got, want := sshRun(t, c, "hostname"), "ip-"+strings.ReplaceAll(ip, ".", "-"); got != want {
+ t.Errorf("hostname %q, want %q", got, want)
+ }
+ // cloud-init may still be running user data when it finishes the boot marker; it is done by now.
+ waitFor(t, "user data file", 2*time.Minute, func() bool {
+ s, err := c.NewSession()
+ if err != nil {
+ return false
+ }
+ defer s.Close()
+ out, err := s.CombinedOutput("cat /var/tmp/userdata.txt")
+ return err == nil && strings.TrimSpace(string(out)) == "hc-userdata-ran"
+ })
+ if got := sshRun(t, c, "curl -s -m 10 http://169.254.169.254/latest/meta-data/instance-id"); got != id {
+ t.Errorf("instance-id from the metadata service inside the guest = %q, want %q", got, id)
+ }
+ // (With HC_VM_NET=user, the fallback, the guest sits behind NAT at 10.0.2.15.)
+ // (The fallback can also start later, when passt dies under the running guest: read the mode after the guest answered.)
+ if got := sshRun(t, c, "ip -4 -o addr show scope global"); f.vmGet(id).VMNetwork != "user" && !strings.Contains(got, ip+"/") {
+ t.Errorf("guest addresses %q lack the instance's private address %s", got, ip)
+ }
+ if got := sshRun(t, c, "uname -m"); got != "aarch64" && got != "x86_64" {
+ t.Errorf("uname -m = %q", got)
+ }
+ if got, _ := strconv.Atoi(sshRun(t, c, "df -BG --output=size / | tail -1 | tr -d ' G'")); got < 9 {
+ t.Errorf("root file system is %dG, want the 10 GiB volume grown into", got)
+ }
+ if got := sshRun(t, c, "getent hosts example.com >/dev/null && echo dns-ok"); got != "dns-ok" {
+ t.Errorf("DNS inside the guest: %q", got)
+ }
+ sshRun(t, c, "echo persisted > /home/"+vmTestUser+"/keep.txt && sync")
+
+ // The serial console is the instance's console output.
+ // (The AWS CLI decodes the base64 output itself.)
+ if out := h.AWSJSON(t, "ec2", "get-console-output", "--instance-id", id)["Output"].(string); !strings.Contains(out, "Cloud-init v.") || !strings.Contains(out, "finished at") {
+ t.Errorf("console output lacks cloud-init lines: %.300s", out)
+ }
+ f.vmAccessChecks(t, id) // run-command, guest metrics and the serial terminal
+ c.Close()
+ t.Logf("guest checks passed")
+
+ // Stop and start keep the disk.
+ h.AWS(t, "ec2", "stop-instances", "--instance-ids", id)
+ f.vmWaitState(t, id, "stopped")
+ if h.Env.Docker.State(i.ContainerID) == "running" {
+ t.Error("container still running after stop")
+ }
+ h.AWS(t, "ec2", "start-instances", "--instance-ids", id)
+ i = f.vmWaitState(t, id, "running")
+ c = f.sshDial(t, id, i.PublicPorts["22/tcp"], signer, vmTestUser)
+ if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt && cat /var/tmp/userdata.txt"); got != "persisted\nhc-userdata-ran" {
+ t.Errorf("after stop/start: %q", got)
+ }
+ if got := sshRun(t, c, "curl -s -m 10 http://169.254.169.254/latest/meta-data/instance-id"); got != id {
+ t.Errorf("after start, instance-id from metadata = %q", got)
+ }
+ c.Close()
+ t.Logf("stop/start kept the disk")
+
+ // Security groups apply to the guest. With the world-open rule the probe reaches SSH.
+ f.bannerEventually(t, true, helper, ip, "world-open rule")
+ // Revoking it unpublishes the port; the container is rebuilt, so the guest reboots.
+ h.AWS(t, "ec2", "revoke-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "0.0.0.0/0")
+ waitFor(t, "port unpublished", vmTestBudget, func() bool { g := f.vmGet(id); return g.State == "running" && len(g.PublicPorts) == 0 })
+ // A rule for the probe's address only lets it in, once the guest is back up.
+ h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32")
+ f.bannerEventually(t, true, helper, ip, "rule for the probe")
+ // Revoking that rule closes SSH for the running guest (nothing to unpublish, no reboot).
+ h.AWS(t, "ec2", "revoke-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32")
+ f.bannerEventually(t, false, helper, ip, "rule revoked")
+ for n := 0; n < 3; n++ {
+ if f.banner(t, helper, ip) {
+ t.Fatal("SSH reachable without a rule")
+ }
+ }
+ h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", helper.ip+"/32")
+ f.bannerEventually(t, true, helper, ip, "rule for the probe again")
+ // A loopback-only rule publishes the port again (another rebuild); the disk survived.
+ h.AWS(t, "ec2", "authorize-security-group-ingress", "--group-id", sg, "--protocol", "tcp", "--port", "22", "--cidr", "127.0.0.1/32")
+ waitFor(t, "loopback port published", vmTestBudget, func() bool { return f.vmGet(id).PublicPorts["22/tcp"] > 0 })
+ c = f.sshDial(t, id, f.vmGet(id).PublicPorts["22/tcp"], signer, vmTestUser)
+ if got := sshRun(t, c, "cat /home/"+vmTestUser+"/keep.txt"); got != "persisted" {
+ t.Errorf("after the rebuild: %q", got)
+ }
+ c.Close()
+ t.Logf("security group rules and the rebuild verified")
+
+ // Terminate removes the container and the root volume.
+ cid := f.vmGet(id).ContainerID
+ h.AWS(t, "ec2", "terminate-instances", "--instance-ids", id)
+ terminated = true
+ f.vmWaitState(t, id, "terminated")
+ if st := h.Env.Docker.State(cid); st != "missing" {
+ t.Errorf("container is %s after terminate", st)
+ }
+ if _, err := h.Env.Docker.C.InspectVolume("hc-" + volID); err == nil {
+ t.Errorf("root volume %s still exists after terminate", volID)
+ } else if !errors.Is(err, docker.ErrNoSuchVolume) {
+ t.Errorf("inspect volume: %v", err)
+ }
+ if out := h.AWS(t, "ec2", "describe-volumes", "--filters", "Name=volume-id,Values="+volID); strings.Contains(out, volID) {
+ t.Errorf("volume record %s remains: %s", volID, out)
+ }
+}
+
+// launchImage starts a container instance of a catalog image in the test VPC.
+func (f *filterEnv) launchImage(t *testing.T, image string, sgs ...string) node {
+ t.Helper()
+ args := []string{"ec2", "run-instances", "--image-id", image, "--subnet-id", f.subnet}
+ if len(sgs) > 0 {
+ args = append(args, "--security-group-ids")
+ args = append(args, sgs...)
+ }
+ i := f.h.AWSJSON(t, args...)["Instances"].([]any)[0].(map[string]any)
+ n := node{id: i["InstanceId"].(string), ip: i["PrivateIpAddress"].(string)}
+ t.Cleanup(func() { _, _ = f.h.AWSErr(t, "ec2", "terminate-instances", "--instance-ids", n.id) })
+ waitFor(t, n.id+" running", 3*time.Minute, func() bool { return f.container(n) != "" })
+ return n
+}
+
+// The VM AMIs are in the catalog and marked as virtual machines.
+func TestVMImagesInCatalog(t *testing.T) {
+ h := liveHarness(t)
+ out := h.AWSJSON(t, "ec2", "describe-images", "--image-ids", vmTestImage, "ami-ubuntu-24-04")["Images"].([]any)
+ if len(out) != 2 {
+ t.Fatalf("images: %v", out)
+ }
+ for _, im := range out {
+ m := im.(map[string]any)
+ isVM := m["ImageId"] == vmTestImage
+ want := "xen"
+ if isVM {
+ want = "kvm"
+ if !strings.HasSuffix(m["Description"].(string), "with its own kernel and cloud-init") && !strings.Contains(m["Description"].(string), "virtual machine") {
+ t.Errorf("VM image description %q does not say it is a virtual machine", m["Description"])
+ }
+ if !strings.Contains(m["Name"].(string), "/vm/") {
+ t.Errorf("VM image name %q is not distinct from the container image's", m["Name"])
+ }
+ }
+ if m["Hypervisor"] != want || m["VirtualizationType"] != "hvm" {
+ t.Errorf("%v: hypervisor %v, virtualization %v", m["ImageId"], m["Hypervisor"], m["VirtualizationType"])
+ }
+ }
+ var imgs []struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Virtualization string `json:"virtualization"`
+ }
+ if err := json.Unmarshal(h.Native(t, "GET", "/api/v1/ec2/images", nil), &imgs); err != nil {
+ t.Fatal(err)
+ }
+ seen := map[string]string{}
+ for _, im := range imgs {
+ seen[im.ID] = im.Virtualization
+ if im.Virtualization == "vm" && !strings.HasSuffix(im.Name, "(VM)") {
+ t.Errorf("VM image %s named %q", im.ID, im.Name)
+ }
+ }
+ if seen[vmTestImage] != "vm" || seen["ami-debian-12-vm"] != "vm" || seen["ami-ubuntu-24-04"] != "container" || seen["ami-nginx"] != "container" {
+ t.Errorf("virtualization by image: %v", seen)
+ }
+}
diff --git a/cli/internal/svc/ec2/volumes.go b/cli/internal/svc/ec2/volumes.go
index 99b4eceb..92fa84a2 100644
--- a/cli/internal/svc/ec2/volumes.go
+++ b/cli/internal/svc/ec2/volumes.go
@@ -124,7 +124,7 @@ func (s *Service) CreateSnapshot(volumeID, description string, tags core.Tags) (
defer core.Recover("snapshot " + sn.ID)
ctx, cancel := context.WithTimeout(context.Background(), time.Hour)
defer cancel()
- err := s.copyVolume(ctx, volumeName(v.ID), snapVolume(sn.ID))
+ err := s.snapshotCopy(ctx, v, snapVolume(sn.ID))
_, _ = store.Update(s.env.Store, cSnapshots, sn.ID, func(x *Snapshot) error {
now := core.Now()
x.CompletedAt = &now
@@ -207,6 +207,9 @@ func (s *Service) AttachVolume(volumeID, instanceID, device string) (Volume, err
if i.State != "running" && i.State != "stopped" {
return Volume{}, core.Errf(http.StatusBadRequest, "IncorrectState", "Instance '%s' is not 'running' or 'stopped'.", i.ID)
}
+ if i.IsVM() && (device == "/dev/xvda" || device == "/dev/sda1" || device == "/dev/sda") {
+ return Volume{}, core.Errf(http.StatusBadRequest, "InvalidParameterValue", "Value (%s) for parameter device is invalid: it is the root device of a VM instance.", device)
+ }
for _, a := range i.Volumes {
if a.Device == device {
return Volume{}, core.Errf(http.StatusBadRequest, "InvalidParameterValue", "Attachment point %s is already in use", device)
@@ -277,6 +280,9 @@ func (s *Service) DetachVolume(volumeID, instanceID, device string, force bool)
if err != nil {
return v, err
}
+ if root, ok := vmRoot(i); ok && root.VolumeID == v.ID {
+ return v, core.Errf(http.StatusBadRequest, "OperationNotPermitted", "Volume '%s' is the root volume of instance %s; terminate the instance to release it.", v.ID, i.ID)
+ }
v, err = store.Update(s.env.Store, cVolumes, v.ID, func(x *Volume) error { x.AttachState = "detaching"; return nil })
if err != nil {
return v, err
@@ -360,6 +366,9 @@ func (s *Service) recreate(id string) error {
if i.ContainerID == "" || i.State == "terminated" {
return nil
}
+ if i.IsVM() {
+ return s.rebuildVM(i)
+ }
v, err := s.vpc.GetVPC(i.VpcID)
if err != nil {
return err
diff --git a/cli/internal/svc/vpc/ingressports_test.go b/cli/internal/svc/vpc/ingressports_test.go
new file mode 100644
index 00000000..3c89b9fe
--- /dev/null
+++ b/cli/internal/svc/vpc/ingressports_test.go
@@ -0,0 +1,43 @@
+package vpc
+
+import (
+ "strconv"
+ "testing"
+
+ "github.com/homecloudhq/homecloud/cli/internal/store"
+ "github.com/homecloudhq/homecloud/cli/internal/svc/svctest"
+)
+
+func TestIngressPorts(t *testing.T) {
+ s := &Service{env: svctest.Env(t)}
+ put := func(id string, rules ...Rule) {
+ if err := store.Put(s.env.Store, cSGs, id, SecurityGroup{ID: id, Ingress: rules}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ put("sg-a",
+ Rule{Protocol: "tcp", FromPort: 22, ToPort: 22, CIDR: "10.0.0.0/8"}, // any source counts
+ Rule{Protocol: "udp", FromPort: 53, ToPort: 53, SourceGroup: "sg-b"},
+ Rule{Protocol: "tcp", FromPort: 8000, ToPort: 8002, CIDR: "0.0.0.0/0"},
+ Rule{Protocol: "icmp", FromPort: -1, ToPort: -1, CIDR: "0.0.0.0/0"}, // not a port
+ Rule{Protocol: "-1", FromPort: 0, ToPort: 65535, CIDR: "0.0.0.0/0"}, // all traffic: too many ports
+ )
+ put("sg-b", Rule{Protocol: "tcp", FromPort: 22, ToPort: 22, CIDR: "0.0.0.0/0"}, Rule{Protocol: "tcp", FromPort: 1000, ToPort: 2000, CIDR: "0.0.0.0/0"})
+
+ var list []string
+ for _, p := range s.IngressPorts([]string{"sg-a", "sg-b", "sg-missing"}, 64) {
+ list = append(list, p.Protocol+":"+strconv.Itoa(p.ContainerPort))
+ }
+ want := []string{"tcp:22", "udp:53", "tcp:8000", "tcp:8001", "tcp:8002"}
+ if len(list) != len(want) {
+ t.Fatalf("ports %v, want %v (the 1001-port range and all-traffic rule exceed the limit, 22 is listed once)", list, want)
+ }
+ for i := range want {
+ if list[i] != want[i] {
+ t.Fatalf("ports %v, want %v", list, want)
+ }
+ }
+ if n := len(s.IngressPorts([]string{"sg-a"}, 2)); n != 2 {
+ t.Errorf("limit 2 returned %d ports", n)
+ }
+}
diff --git a/cli/internal/svc/vpc/vpc.go b/cli/internal/svc/vpc/vpc.go
index dc1bd5b2..e698a0f3 100644
--- a/cli/internal/svc/vpc/vpc.go
+++ b/cli/internal/svc/vpc/vpc.go
@@ -391,6 +391,37 @@ func (s *Service) PublishedPorts(ids []string) []runtime.Port {
return out
}
+// IngressPorts lists the TCP and UDP ports the ingress rules of the given
+// groups open, whatever their source, up to limit ports. It is for
+// listeners that must be created per port (a VM without passt); a rule for
+// more ports than remain under the limit, or for all protocols, is skipped.
+func (s *Service) IngressPorts(ids []string, limit int) []runtime.Port {
+ seen := map[string]bool{}
+ var out []runtime.Port
+ for _, id := range ids {
+ g, err := store.Get[SecurityGroup](s.env.Store, cSGs, id)
+ if err != nil {
+ continue
+ }
+ for _, r := range g.Ingress {
+ if (r.Protocol != "tcp" && r.Protocol != "udp") || r.FromPort < 1 || r.ToPort > 65535 || r.FromPort > r.ToPort {
+ continue
+ }
+ if r.ToPort-r.FromPort+1 > limit-len(out) {
+ continue
+ }
+ for p := r.FromPort; p <= r.ToPort; p++ {
+ k := fmt.Sprintf("%d/%s", p, r.Protocol)
+ if !seen[k] {
+ seen[k] = true
+ out = append(out, runtime.Port{ContainerPort: p, Protocol: r.Protocol})
+ }
+ }
+ }
+ }
+ return out
+}
+
func (s *Service) GetVPC(id string) (VPC, error) { return store.Get[VPC](s.env.Store, cVPCs, id) }
// List returns every VPC.
diff --git a/cli/internal/system/backup.go b/cli/internal/system/backup.go
index edd1afd2..32ee77bc 100644
--- a/cli/internal/system/backup.go
+++ b/cli/internal/system/backup.go
@@ -69,6 +69,10 @@ type Backup struct {
// Snapshots capture files that a service keeps open, by path relative to
// the data directory (e.g. "dynamodb.db"); they replace a plain copy.
Snapshots map[string]func(io.Writer) error
+ // Flatten, when set, may return another volume to archive in place of the
+ // named one (and a function that removes it afterwards): EC2 uses it to back
+ // up a VM root disk as a standalone image. It returns "" to archive the volume itself.
+ Flatten func(ctx context.Context, volume string, labels map[string]string) (string, func(), error)
}
// excluded reports whether a data-directory path stays out of backups.
@@ -127,11 +131,14 @@ func (b *Backup) Write(ctx context.Context, w io.Writer, volumes bool, logf func
if acct := v.Labels[core.LabelAccount]; acct != b.AccountID && (acct != "" || b.OwnVolumesOnly) {
continue // another installation's volume
}
+ if v.Labels[core.LabelService] == "ec2" && v.Labels[core.LabelResource] == "vm-images" {
+ continue // the cloud image cache: downloaded again when a VM needs it
+ }
lb, _ := json.Marshal(v.Labels)
if err := addBytes(tw, "volumes/"+v.Name+".json", lb); err != nil {
return err
}
- n, err := b.addVolume(ctx, tw, v.Name)
+ n, err := b.addVolume(ctx, tw, v.Name, v.Labels)
if err != nil {
m.Skipped[v.Name] = err.Error()
logf("backup: volume %s skipped: %v", v.Name, err)
@@ -153,7 +160,7 @@ func (b *Backup) Write(ctx context.Context, w io.Writer, volumes bool, logf func
// addVolume copies a volume through a stopped helper container, pausing the
// containers that use it meanwhile.
-func (b *Backup) addVolume(ctx context.Context, tw *tar.Writer, name string) (int64, error) {
+func (b *Backup) addVolume(ctx context.Context, tw *tar.Writer, name string, labels map[string]string) (int64, error) {
var paused []string
if cs, err := b.Docker.C.ListContainers(docker.ListContainersOptions{Filters: map[string][]string{"volume": {name}, "status": {"running"}}}); err == nil {
for _, c := range cs {
@@ -167,7 +174,19 @@ func (b *Backup) addVolume(ctx context.Context, tw *tar.Writer, name string) (in
_ = b.Docker.C.UnpauseContainer(id)
}
}()
- id, err := createHelper(ctx, b.Docker, name)
+ src := name
+ if b.Flatten != nil {
+ // A VM's root disk is an overlay on an image a backup leaves out: archive a standalone copy.
+ alt, cleanup, err := b.Flatten(ctx, name, labels)
+ if err != nil {
+ return 0, err
+ }
+ if alt != "" {
+ defer cleanup()
+ src = alt
+ }
+ }
+ id, err := createHelper(ctx, b.Docker, src)
if err != nil {
return 0, err
}
diff --git a/console/components/ec2/images-list.tsx b/console/components/ec2/images-list.tsx
index e513ea9e..644171cb 100644
--- a/console/components/ec2/images-list.tsx
+++ b/console/components/ec2/images-list.tsx
@@ -23,7 +23,8 @@ import { TimeAgo } from "@/components/console/time-ago"
import { api, errorMessage, seg } from "@/lib/api"
import { revalidate, useApi } from "@/lib/hooks"
import type { Image } from "@/lib/types"
-import { instanceHref } from "./instance-actions"
+import { Badge } from "@/components/ui/badge"
+import { instanceHref, isVMImage } from "./instance-actions"
const IMAGES_PATH = "/api/v1/ec2/images"
type Owner = "all" | "catalog" | "mine"
@@ -40,7 +41,18 @@ const columns: Column[] = [
value: (im) => im.description,
hideBelow: "lg",
},
- { id: "ref", header: "Docker image", cell: (im) => {im.ref} , value: (im) => im.ref },
+ {
+ id: "kind",
+ header: "Type",
+ cell: (im) => {isVMImage(im) ? "VM" : "Container"} ,
+ value: (im) => (isVMImage(im) ? "VM" : "Container"),
+ },
+ {
+ id: "ref",
+ header: "Docker image / VM base",
+ cell: (im) => {im.ref || im.vm_base || "-"} ,
+ value: (im) => im.ref || im.vm_base || "",
+ },
{
id: "owner",
header: "Owner",
@@ -58,7 +70,7 @@ const columns: Column[] = [
{
id: "boot",
header: "Boot mode",
- cell: (im) => (im.keep_alive ? "VM-like (keep alive)" : "Application"),
+ cell: (im) => (isVMImage(im) ? "Virtual machine" : im.keep_alive ? "OS-like (keep alive)" : "Application"),
value: (im) => (im.keep_alive ? "keep alive" : "application"),
hideBelow: "md",
},
diff --git a/console/components/ec2/instance-actions.tsx b/console/components/ec2/instance-actions.tsx
index 324377d4..36d9e03b 100644
--- a/console/components/ec2/instance-actions.tsx
+++ b/console/components/ec2/instance-actions.tsx
@@ -15,7 +15,8 @@ import { StatusBadge } from "@/components/console/status-badge"
import { api, errorMessage, seg } from "@/lib/api"
import { revalidate, useApi } from "@/lib/hooks"
import { formatMemoryMB, pluralize } from "@/lib/format"
-import type { Image, Instance, InstanceState, InstanceType } from "@/lib/types"
+import { Badge } from "@/components/ui/badge"
+import type { Ec2Capabilities, Image, Instance, InstanceState, InstanceType } from "@/lib/types"
export const INSTANCES_PATH = "/api/v1/ec2/instances"
@@ -72,6 +73,30 @@ export function PublicPorts({ instance, empty = "-", compact }: { instance: Inst
)
}
+export const isVMInstance = (i: Pick) => i.virtualization === "kvm" || i.virtualization === "emulated"
+
+export const isVMImage = (im: Pick) => im.virtualization === "vm" || !!im.vm_base
+
+/** "Container", "VM · KVM" or "VM · emulated". */
+export function instanceKind(i: Pick) {
+ if (!isVMInstance(i)) return "Container"
+ return i.virtualization === "kvm" ? "VM · KVM" : "VM · emulated"
+}
+
+/** Type badge for an instance: Container / VM · KVM / VM · emulated (slow). */
+export function InstanceKindBadge({ instance }: { instance: Pick }) {
+ const vm = isVMInstance(instance)
+ return (
+
+ {instanceKind(instance)}
+
+ )
+}
+
+export function useEc2Capabilities() {
+ return useApi("/api/v1/ec2/capabilities", { revalidateOnFocus: false })
+}
+
export function useInstanceTypes() {
return useApi("/api/v1/ec2/instance-types", { revalidateOnFocus: false })
}
diff --git a/console/components/ec2/instance-console-output.tsx b/console/components/ec2/instance-console-output.tsx
index 92652fa7..41bfb4b1 100644
--- a/console/components/ec2/instance-console-output.tsx
+++ b/console/components/ec2/instance-console-output.tsx
@@ -14,7 +14,7 @@ import { formatTime } from "@/lib/format"
import { useApi } from "@/lib/hooks"
import type { ConsoleOutput, Instance } from "@/lib/types"
import { cn } from "@/lib/utils"
-import { INSTANCES_PATH } from "./instance-actions"
+import { INSTANCES_PATH, isVMInstance } from "./instance-actions"
// Docker log lines start with an RFC 3339 timestamp.
const TS = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z /gm
@@ -59,8 +59,8 @@ export function InstanceConsoleOutput({ instance }: { instance: Instance }) {
return (
diff --git a/console/components/ec2/instance-detail.tsx b/console/components/ec2/instance-detail.tsx
index 11f47dbd..a11d3b39 100644
--- a/console/components/ec2/instance-detail.tsx
+++ b/console/components/ec2/instance-detail.tsx
@@ -27,7 +27,7 @@ import { formatDate, formatMemoryMB } from "@/lib/format"
import { revalidate, useApi, useQueryParam, useSetQueryParam } from "@/lib/hooks"
import { ASG_GROUP_TAG } from "@/lib/types"
import type { Instance } from "@/lib/types"
-import { INSTANCES_PATH, PublicPorts, instanceLabel, isTransitional, pollInterval, useInstanceActions } from "./instance-actions"
+import { INSTANCES_PATH, InstanceKindBadge, PublicPorts, instanceLabel, isVMInstance, isTransitional, pollInterval, useInstanceActions } from "./instance-actions"
import { instanceProfileHref } from "@/components/iam/common"
import { InstanceConsoleOutput } from "./instance-console-output"
import { InstanceMonitoring } from "./instance-monitoring"
@@ -166,7 +166,7 @@ export function InstanceDetail() {
Details
Monitoring
- Console output
+ {isVMInstance(inst) ? "System log" : "Console output"}
Run command
Connect
@@ -204,6 +204,18 @@ function BackButton() {
)
}
+function VirtualizationValue({ inst }: { inst: Instance }) {
+ if (!isVMInstance(inst)) return
Shares the host kernel
+ return (
+
+
+
+ {inst.virtualization === "kvm" ? "Own kernel, hardware accelerated (KVM)" : "Own kernel, CPU emulated (no /dev/kvm on the host, so it is slow)"}
+
+
+ )
+}
+
function DetailsTab({ inst }: { inst: Instance }) {
return (
@@ -225,10 +237,11 @@ function DetailsTab({ inst }: { inst: Instance }) {
),
},
- { label: "Image reference", value:
},
+ { label: "Virtualization", value:
},
+ ...(inst.image_ref ? [{ label: "Image reference", value:
}] : []),
{
label: "Boot mode",
- value: inst.keep_alive ? "Keep alive (VM-like: runs user data, then idles)" : "Application (runs the image's own process)",
+ value: isVMInstance(inst) ? "Virtual machine (own kernel, boots from a cloud image)" : inst.keep_alive ? "Keep alive (VM-like: runs user data, then idles)" : "Application (runs the image's own process)",
},
{ label: "Launch time", value:
{formatDate(inst.launch_time)} ( ) },
{ label: "Terminated at", value: inst.terminated_at ? formatDate(inst.terminated_at) : "" },
diff --git a/console/components/ec2/instances-list.tsx b/console/components/ec2/instances-list.tsx
index d28aee60..5657469b 100644
--- a/console/components/ec2/instances-list.tsx
+++ b/console/components/ec2/instances-list.tsx
@@ -17,7 +17,7 @@ import { StatusBadge } from "@/components/console/status-badge"
import { TimeAgo } from "@/components/console/time-ago"
import { useApi } from "@/lib/hooks"
import type { Instance } from "@/lib/types"
-import { INSTANCES_PATH, PublicPorts, instanceHref, pollInterval, useInstanceActions } from "./instance-actions"
+import { INSTANCES_PATH, InstanceKindBadge, PublicPorts, instanceKind, instanceHref, pollInterval, useInstanceActions } from "./instance-actions"
const STATES = ["all", "pending", "running", "stopping", "stopped", "shutting-down", "terminated"] as const
@@ -39,13 +39,14 @@ const columns: Column
[] = [
value: (i) => i.id,
},
{ id: "state", header: "Instance state", cell: (i) => , value: (i) => i.state },
+ { id: "kind", header: "Type", cell: (i) => , value: (i) => instanceKind(i) },
{ id: "type", header: "Instance type", cell: (i) => {i.instance_type} , value: (i) => i.instance_type },
{
id: "image",
header: "Image",
cell: (i) => (
- {i.image_ref}
+ {i.image_ref || i.image_id}
),
value: (i) => `${i.image_ref} ${i.image_id}`,
@@ -138,7 +139,7 @@ export function InstancesList() {
a.vpc_id.localeCompare(b.vpc_id) || a.availability_zone.localeCompare(b.availability_zone) || a.name.localeCompare(b.name))
+ return [...list].sort(
+ (a, b) =>
+ a.vpc_id.localeCompare(b.vpc_id) ||
+ a.availability_zone.localeCompare(b.availability_zone) ||
+ a.name.localeCompare(b.name),
+ );
}
export function LaunchWizard() {
- const router = useRouter()
- const imageParam = useQueryParam("image")
-
- const images = useApi("/api/v1/ec2/images", { revalidateOnFocus: false })
- const types = useInstanceTypes()
- const subnets = useApi("/api/v1/vpc/subnets", { revalidateOnFocus: false })
- const fileSystems = useApi(FILE_SYSTEMS_PATH, { revalidateOnFocus: false })
-
- const [name, setName] = useState("")
- const [tagRows, setTagRows] = useState([])
- const [imageId, setImageId] = useState("")
- const [imageFilter, setImageFilter] = useState("all")
- const [imageQuery, setImageQuery] = useState("")
- const [type, setType] = useState(DEFAULT_TYPE)
- const [subnetId, setSubnetId] = useState("")
- const [sgIds, setSgIds] = useState([])
- const [sgVpc, setSgVpc] = useState("")
- const [volumes, setVolumes] = useState([])
- const [fsRows, setFsRows] = useState([])
- const [userData, setUserData] = useState("")
- const [keyName, setKeyName] = useState("")
- const [creatingKey, setCreatingKey] = useState(false)
- const keyPairs = useApi(KEY_PAIRS_PATH)
- const [profile, setProfile] = useState("")
- const [mdEndpoint, setMdEndpoint] = useState<"enabled" | "disabled">("enabled")
- const [mdTokens, setMdTokens] = useState<"optional" | "required">("required")
- const [mdHops, setMdHops] = useState("2")
- const [mdTags, setMdTags] = useState<"enabled" | "disabled">("disabled")
- const [count, setCount] = useState("1")
- const [submitted, setSubmitted] = useState(false)
- const [pending, setPending] = useState(false)
+ const router = useRouter();
+ const imageParam = useQueryParam("image");
+
+ const images = useApi("/api/v1/ec2/images", {
+ revalidateOnFocus: false,
+ });
+ const types = useInstanceTypes();
+ const subnets = useApi("/api/v1/vpc/subnets", {
+ revalidateOnFocus: false,
+ });
+ const fileSystems = useApi(FILE_SYSTEMS_PATH, {
+ revalidateOnFocus: false,
+ });
+ const caps = useEc2Capabilities();
+
+ const [name, setName] = useState("");
+ const [tagRows, setTagRows] = useState([]);
+ const [kind, setKind] = useState("container");
+ const [rootGb, setRootGb] = useState("8");
+ const [imageId, setImageId] = useState("");
+ const [imageFilter, setImageFilter] = useState("all");
+ const [imageQuery, setImageQuery] = useState("");
+ const [type, setType] = useState(DEFAULT_TYPE);
+ const [subnetId, setSubnetId] = useState("");
+ const [sgIds, setSgIds] = useState([]);
+ const [sgVpc, setSgVpc] = useState("");
+ const [volumes, setVolumes] = useState([]);
+ const [fsRows, setFsRows] = useState([]);
+ const [userData, setUserData] = useState("");
+ const [keyName, setKeyName] = useState("");
+ const [creatingKey, setCreatingKey] = useState(false);
+ const keyPairs = useApi(KEY_PAIRS_PATH);
+ const [profile, setProfile] = useState("");
+ const [mdEndpoint, setMdEndpoint] = useState<"enabled" | "disabled">(
+ "enabled",
+ );
+ const [mdTokens, setMdTokens] = useState<"optional" | "required">("required");
+ const [mdHops, setMdHops] = useState("2");
+ const [mdTags, setMdTags] = useState<"enabled" | "disabled">("disabled");
+ const [count, setCount] = useState("1");
+ const [submitted, setSubmitted] = useState(false);
+ const [pending, setPending] = useState(false);
// Default image: ?image=, else Ubuntu 24.04, else the first.
useEffect(() => {
- if (imageId || !images.data?.length) return
- const want = [imageParam, DEFAULT_IMAGE].find((id) => id && images.data!.some((im) => im.id === id))
- setImageId(want ?? images.data[0].id)
- if (imageParam && images.data.some((im) => im.id === imageParam && im.owner !== "homecloud")) setImageFilter("mine")
- }, [images.data, imageParam, imageId])
+ if (imageId || !images.data?.length) return;
+ const want = [imageParam, DEFAULT_IMAGE].find(
+ (id) => id && images.data!.some((im) => im.id === id),
+ );
+ const pick =
+ images.data.find((im) => im.id === want) ??
+ images.data.find((im) => !isVMImage(im)) ??
+ images.data[0];
+ setKind(isVMImage(pick) ? "vm" : "container");
+ setImageId(pick.id);
+ if (
+ imageParam &&
+ images.data.some((im) => im.id === imageParam && im.owner !== "homecloud")
+ )
+ setImageFilter("mine");
+ }, [images.data, imageParam, imageId]);
- const sortedSubnets = useMemo(() => sortSubnets(subnets.data ?? []), [subnets.data])
+ const sortedSubnets = useMemo(
+ () => sortSubnets(subnets.data ?? []),
+ [subnets.data],
+ );
// Default subnet: the default VPC's subnet in zone "a".
useEffect(() => {
- if (subnetId || !sortedSubnets.length) return
- const pick = sortedSubnets.find((s) => s.default && s.availability_zone.endsWith("a")) ?? sortedSubnets.find((s) => s.default) ?? sortedSubnets[0]
- setSubnetId(pick.id)
- }, [sortedSubnets, subnetId])
+ if (subnetId || !sortedSubnets.length) return;
+ const pick =
+ sortedSubnets.find(
+ (s) => s.default && s.availability_zone.endsWith("a"),
+ ) ??
+ sortedSubnets.find((s) => s.default) ??
+ sortedSubnets[0];
+ setSubnetId(pick.id);
+ }, [sortedSubnets, subnetId]);
- const subnet = sortedSubnets.find((s) => s.id === subnetId)
- const vpcId = subnet?.vpc_id ?? ""
- const sgs = useApi(vpcId ? "/api/v1/vpc/security-groups" : null, { query: { vpc_id: vpcId } })
+ const subnet = sortedSubnets.find((s) => s.id === subnetId);
+ const vpcId = subnet?.vpc_id ?? "";
+ const sgs = useApi(
+ vpcId ? "/api/v1/vpc/security-groups" : null,
+ { query: { vpc_id: vpcId } },
+ );
// Reset the security group selection to the VPC's default group whenever the VPC changes.
useEffect(() => {
- if (!vpcId || !sgs.data || sgVpc === vpcId) return
- const groups = sgs.data.filter((g) => g.vpc_id === vpcId)
- const def = groups.find((g) => g.name === "default")
- setSgIds(def ? [def.id] : [])
- setSgVpc(vpcId)
- }, [vpcId, sgs.data, sgVpc])
-
- const image = images.data?.find((im) => im.id === imageId)
- const instanceType = types.data?.find((t) => t.name === type)
- const groups = (sgs.data ?? []).filter((g) => g.vpc_id === vpcId)
- const selectedGroups = groups.filter((g) => sgIds.includes(g.id))
+ if (!vpcId || !sgs.data || sgVpc === vpcId) return;
+ const groups = sgs.data.filter((g) => g.vpc_id === vpcId);
+ const def = groups.find((g) => g.name === "default");
+ setSgIds(def ? [def.id] : []);
+ setSgVpc(vpcId);
+ }, [vpcId, sgs.data, sgVpc]);
+
+ const image = images.data?.find((im) => im.id === imageId);
+ const instanceType = types.data?.find((t) => t.name === type);
+ const groups = (sgs.data ?? []).filter((g) => g.vpc_id === vpcId);
+ const selectedGroups = groups.filter((g) => sgIds.includes(g.id));
const publishedPorts = Array.from(
- new Set(selectedGroups.flatMap((g) => g.ingress.filter((r) => (r.protocol === "tcp" || r.protocol === "udp") && (r.cidr === "0.0.0.0/0" || r.cidr === "127.0.0.1/32")).map((r) => (r.from_port === r.to_port ? `${r.from_port}/${r.protocol}` : `${r.from_port}-${r.to_port}/${r.protocol}`)))),
- )
+ new Set(
+ selectedGroups.flatMap((g) =>
+ g.ingress
+ .filter(
+ (r) =>
+ (r.protocol === "tcp" || r.protocol === "udp") &&
+ (r.cidr === "0.0.0.0/0" || r.cidr === "127.0.0.1/32"),
+ )
+ .map((r) =>
+ r.from_port === r.to_port
+ ? `${r.from_port}/${r.protocol}`
+ : `${r.from_port}-${r.to_port}/${r.protocol}`,
+ ),
+ ),
+ ),
+ );
+
+ const isVM = kind === "vm";
+ const chooseKind = (k: Kind) => {
+ if (k === kind) return;
+ setKind(k);
+ const want = k === "vm" ? DEFAULT_VM_IMAGE : DEFAULT_IMAGE;
+ const list = (images.data ?? []).filter(
+ (im) => isVMImage(im) === (k === "vm"),
+ );
+ setImageId((list.find((im) => im.id === want) ?? list[0])?.id ?? "");
+ if (k === "vm") {
+ setVolumes([]);
+ setFsRows([]);
+ }
+ };
const visibleImages = useMemo(() => {
- const q = imageQuery.trim().toLowerCase()
+ const q = imageQuery.trim().toLowerCase();
return (images.data ?? []).filter((im) => {
- if (imageFilter === "catalog" && im.owner !== "homecloud") return false
- if (imageFilter === "mine" && im.owner === "homecloud") return false
- if (!q) return true
- return [im.name, im.description, im.ref, im.id].some((s) => s?.toLowerCase().includes(q))
- })
- }, [images.data, imageFilter, imageQuery])
+ if (isVMImage(im) !== (kind === "vm")) return false;
+ if (imageFilter === "catalog" && im.owner !== "homecloud") return false;
+ if (imageFilter === "mine" && im.owner === "homecloud") return false;
+ if (!q) return true;
+ return [im.name, im.description, im.ref, im.id].some((s) =>
+ s?.toLowerCase().includes(q),
+ );
+ });
+ }, [images.data, imageFilter, imageQuery, kind]);
// ---- validation ----
- const n = Number(count)
+ const n = Number(count);
const errors = useMemo(() => {
- const e: Record = {}
- if (name.length > 128) e.name = "Names are at most 128 characters"
- if (!imageId) e.image = "Choose an image"
- if (!type) e.type = "Choose an instance type"
- if (!subnetId) e.subnet = "Choose a subnet"
- if (!Number.isInteger(n) || n < 1 || n > 20) e.count = "Enter a whole number from 1 to 20"
- const keys = tagRows.map((r) => r.key.trim()).filter(Boolean)
- if (new Set(keys).size !== keys.length) e.tags = "Tag keys must be unique"
- else if (tagRows.some((r) => !r.key.trim() && r.value.trim())) e.tags = "Every tag with a value needs a key"
- const mounts = new Set()
+ const e: Record = {};
+ if (name.length > 128) e.name = "Names are at most 128 characters";
+ if (!imageId) e.image = "Choose an image";
+ if (!type) e.type = "Choose an instance type";
+ if (!subnetId) e.subnet = "Choose a subnet";
+ if (!Number.isInteger(n) || n < 1 || n > 20)
+ e.count = "Enter a whole number from 1 to 20";
+ const keys = tagRows.map((r) => r.key.trim()).filter(Boolean);
+ if (new Set(keys).size !== keys.length) e.tags = "Tag keys must be unique";
+ else if (tagRows.some((r) => !r.key.trim() && r.value.trim()))
+ e.tags = "Every tag with a value needs a key";
+ const mounts = new Set();
volumes.forEach((v, i) => {
- const size = Number(v.size)
- if (!Number.isInteger(size) || size < 1 || size > 16384) e[`vol${i}size`] = "1-16384 GiB"
- if (!v.mount.startsWith("/")) e[`vol${i}mount`] = "Must be an absolute path starting with /"
- else if (v.mount === "/" || /\s/.test(v.mount)) e[`vol${i}mount`] = "Choose a directory other than /, without spaces"
- else if (mounts.has(v.mount.replace(/\/+$/, ""))) e[`vol${i}mount`] = "Mount paths must be unique"
- mounts.add(v.mount.replace(/\/+$/, ""))
- })
+ const size = Number(v.size);
+ if (!Number.isInteger(size) || size < 1 || size > 16384)
+ e[`vol${i}size`] = "1-16384 GiB";
+ if (!v.mount.startsWith("/"))
+ e[`vol${i}mount`] = "Must be an absolute path starting with /";
+ else if (v.mount === "/" || /\s/.test(v.mount))
+ e[`vol${i}mount`] = "Choose a directory other than /, without spaces";
+ else if (mounts.has(v.mount.replace(/\/+$/, "")))
+ e[`vol${i}mount`] = "Mount paths must be unique";
+ mounts.add(v.mount.replace(/\/+$/, ""));
+ });
fsRows.forEach((f, i) => {
- if (!f.id) e[`fs${i}id`] = "Choose a file system"
- if (!f.mount.startsWith("/")) e[`fs${i}mount`] = "Must be an absolute path starting with /"
- else if (f.mount === "/" || /\s/.test(f.mount)) e[`fs${i}mount`] = "Choose a directory other than /, without spaces"
- else if (mounts.has(f.mount.replace(/\/+$/, ""))) e[`fs${i}mount`] = "Mount paths must be unique"
- mounts.add(f.mount.replace(/\/+$/, ""))
- })
- if (userData.length > 16 * 1024) e.userData = "User data is limited to 16 KB"
- if (keyName.trim() && !/^[\x20-\x7e]{1,255}$/.test(keyName.trim())) e.keyName = "Key pair names are 1-255 ASCII characters"
- const hops = Number(mdHops)
- if (!Number.isInteger(hops) || hops < 1 || hops > 64) e.mdHops = "Enter a hop limit from 1 to 64"
- return e
- }, [name, imageId, type, subnetId, n, tagRows, volumes, fsRows, userData, keyName, mdHops])
- const err = (k: string) => (submitted ? errors[k] : undefined)
- const valid = Object.keys(errors).length === 0
+ if (!f.id) e[`fs${i}id`] = "Choose a file system";
+ if (!f.mount.startsWith("/"))
+ e[`fs${i}mount`] = "Must be an absolute path starting with /";
+ else if (f.mount === "/" || /\s/.test(f.mount))
+ e[`fs${i}mount`] = "Choose a directory other than /, without spaces";
+ else if (mounts.has(f.mount.replace(/\/+$/, "")))
+ e[`fs${i}mount`] = "Mount paths must be unique";
+ mounts.add(f.mount.replace(/\/+$/, ""));
+ });
+ if (userData.length > 16 * 1024)
+ e.userData = "User data is limited to 16 KB";
+ if (keyName.trim() && !/^[\x20-\x7e]{1,255}$/.test(keyName.trim()))
+ e.keyName = "Key pair names are 1-255 ASCII characters";
+ const root = Number(rootGb);
+ if (isVM && (!Number.isInteger(root) || root < 4 || root > 16384))
+ e.rootGb = "4-16384 GiB";
+ const hops = Number(mdHops);
+ if (!Number.isInteger(hops) || hops < 1 || hops > 64)
+ e.mdHops = "Enter a hop limit from 1 to 64";
+ return e;
+ }, [
+ name,
+ imageId,
+ type,
+ subnetId,
+ n,
+ tagRows,
+ volumes,
+ fsRows,
+ userData,
+ keyName,
+ mdHops,
+ isVM,
+ rootGb,
+ ]);
+ const err = (k: string) => (submitted ? errors[k] : undefined);
+ const valid = Object.keys(errors).length === 0;
const launch = async () => {
- setSubmitted(true)
+ setSubmitted(true);
if (!valid) {
- toast.error("Fix the highlighted fields before launching")
- return
+ toast.error("Fix the highlighted fields before launching");
+ return;
}
const body: RunInstancesInput = {
name: name.trim() || undefined,
@@ -186,51 +330,82 @@ export function LaunchWizard() {
user_data: userData || undefined,
key_name: keyName.trim() || undefined,
iam_instance_profile: profile || undefined,
- metadata_options: { http_endpoint: mdEndpoint, http_tokens: mdTokens, hop_limit: Number(mdHops), instance_metadata_tags: mdTags },
+ metadata_options: {
+ http_endpoint: mdEndpoint,
+ http_tokens: mdTokens,
+ hop_limit: Number(mdHops),
+ instance_metadata_tags: mdTags,
+ },
count: n,
tags: rowsToTags(tagRows),
- volumes: volumes.length
- ? volumes.map((v) => ({ size_gb: Number(v.size), mount_path: v.mount.replace(/(.)\/+$/, "$1"), delete_on_termination: v.del }))
- : undefined,
- file_systems: fsRows.length
- ? fsRows.map((f) => ({ file_system_id: f.id, mount_path: f.mount.replace(/(.)\/+$/, "$1"), read_only: f.ro }))
- : undefined,
- }
- setPending(true)
+ root_volume: isVM ? { size_gb: Number(rootGb) } : undefined,
+ volumes:
+ volumes.length && !isVM
+ ? volumes.map((v) => ({
+ size_gb: Number(v.size),
+ mount_path: v.mount.replace(/(.)\/+$/, "$1"),
+ delete_on_termination: v.del,
+ }))
+ : undefined,
+ file_systems:
+ fsRows.length && !isVM
+ ? fsRows.map((f) => ({
+ file_system_id: f.id,
+ mount_path: f.mount.replace(/(.)\/+$/, "$1"),
+ read_only: f.ro,
+ }))
+ : undefined,
+ };
+ setPending(true);
try {
- const out = await api.post(INSTANCES_PATH, body)
- toast.success(out.length === 1 ? `Launched ${out[0].id}` : `Launched ${pluralize(out.length, "instance")}: ${out.map((i) => i.id).join(", ")}`)
- await revalidate("/api/v1/ec2")
- router.push(out.length === 1 ? instanceHref(out[0].id) : "/ec2/")
+ const out = await api.post(INSTANCES_PATH, body);
+ toast.success(
+ out.length === 1
+ ? `Launched ${out[0].id}`
+ : `Launched ${pluralize(out.length, "instance")}: ${out.map((i) => i.id).join(", ")}`,
+ );
+ await revalidate("/api/v1/ec2");
+ router.push(out.length === 1 ? instanceHref(out[0].id) : "/ec2/");
} catch (e) {
- toast.error(errorMessage(e))
- setPending(false)
+ toast.error(errorMessage(e));
+ setPending(false);
}
- }
+ };
- const setVol = (i: number, patch: Partial) => setVolumes(volumes.map((v, j) => (j === i ? { ...v, ...patch } : v)))
- const setFs = (i: number, patch: Partial) => setFsRows(fsRows.map((f, j) => (j === i ? { ...f, ...patch } : f)))
- const fsById = (id: string) => fileSystems.data?.find((f) => f.id === id)
+ const setVol = (i: number, patch: Partial) =>
+ setVolumes(volumes.map((v, j) => (j === i ? { ...v, ...patch } : v)));
+ const setFs = (i: number, patch: Partial) =>
+ setFsRows(fsRows.map((f, j) => (j === i ? { ...f, ...patch } : f)));
+ const fsById = (id: string) => fileSystems.data?.find((f) => f.id === id);
const addFs = () => {
- const free = (fileSystems.data ?? []).find((f) => !fsRows.some((r) => r.id === f.id))
- const used = new Set(fsRows.map((r) => r.mount))
- let mount = "/mnt/efs"
- for (let k = 2; used.has(mount); k++) mount = `/mnt/efs${k}`
- setFsRows([...fsRows, { id: free?.id ?? "", mount, ro: !!free?.read_only }])
- }
+ const free = (fileSystems.data ?? []).find(
+ (f) => !fsRows.some((r) => r.id === f.id),
+ );
+ const used = new Set(fsRows.map((r) => r.mount));
+ let mount = "/mnt/efs";
+ for (let k = 2; used.has(mount); k++) mount = `/mnt/efs${k}`;
+ setFsRows([
+ ...fsRows,
+ { id: free?.id ?? "", mount, ro: !!free?.read_only },
+ ]);
+ };
return (
+ {/* ---- Container or VM ---- */}
+
+
+
+ {(
+ [
+ [
+ "container",
+ "Container",
+ Box,
+ "Starts in seconds and is lightweight, but shares the host kernel.",
+ ],
+ [
+ "vm",
+ "Virtual machine",
+ Monitor,
+ "Has its own kernel and stronger isolation. Boots in about a minute; needs KVM on the host for full speed.",
+ ],
+ ] as [Kind, string, typeof Box, string][]
+ ).map(([k, label, Icon, blurb]) => {
+ const active = kind === k;
+ return (
+ chooseKind(k)}
+ className={cn(
+ "relative flex items-start gap-3 rounded-lg border p-3 text-left transition-colors",
+ active
+ ? "border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10"
+ : "hover:bg-muted/50",
+ )}
+ >
+
+
+ {label}
+
+ {blurb}
+
+
+ {active && (
+
+
+
+ )}
+
+ );
+ })}
+
+ {isVM && caps.data?.vm === "emulated" && (
+
+
+
+ This host has no KVM (
+ /dev/kvm ), so
+ virtual machines are emulated and will be slow. Booting can
+ take several minutes. Containers are not affected.
+
+
+ )}
+ {isVM && caps.data?.vm === "unavailable" && (
+
+
+
+ Virtual machines are currently unavailable on this host.
+ Launching one is likely to fail.
+
+
+ )}
+
+
+
{/* ---- Image ---- */}
- setImageQuery(e.target.value)} placeholder="Search images" className="h-8 pl-8" />
+ setImageQuery(e.target.value)}
+ placeholder="Search images"
+ className="h-8 pl-8"
+ />
-
+
{(
[
["all", "All"],
@@ -280,7 +564,9 @@ export function LaunchWizard() {
onClick={() => setImageFilter(k)}
className={cn(
"rounded px-3 py-1 font-medium transition-colors",
- imageFilter === k ? "bg-background text-foreground shadow-xs" : "text-muted-foreground hover:text-foreground",
+ imageFilter === k
+ ? "bg-background text-foreground shadow-xs"
+ : "text-muted-foreground hover:text-foreground",
)}
>
{label}
@@ -289,7 +575,10 @@ export function LaunchWizard() {
{images.error ? (
-
images.mutate()} />
+ images.mutate()}
+ />
) : !images.data ? (
{Array.from({ length: 6 }, (_, i) => (
@@ -300,8 +589,12 @@ export function LaunchWizard() {
{imageFilter === "mine" && !imageQuery ? (
<>
- You have no custom images yet. Create one from an instance or{" "}
-
+ You have no custom images yet. Create one from an instance
+ or{" "}
+
register a Docker image
.
@@ -311,9 +604,13 @@ export function LaunchWizard() {
)}
) : (
-
+
{visibleImages.map((im) => {
- const active = im.id === imageId
+ const active = im.id === imageId;
return (
setImageId(im.id)}
className={cn(
"relative flex flex-col gap-1 rounded-lg border p-3 text-left transition-colors",
- active ? "border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10" : "hover:bg-muted/50",
+ active
+ ? "border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10"
+ : "hover:bg-muted/50",
)}
>
{active && (
@@ -331,38 +630,85 @@ export function LaunchWizard() {
)}
- {im.name}
- {im.description && {im.description} }
-
- {im.ref}
+
+ {im.name}
+
+ {im.description && (
+
+ {im.description}
+
+ )}
+
+ {im.ref || im.vm_base}
- {im.owner === "homecloud" ? "HomeCloud catalog" : "Custom"}
- {!im.keep_alive && Application image }
+
+ {im.owner === "homecloud"
+ ? "HomeCloud catalog"
+ : "Custom"}
+
+ {isVMImage(im) ? (
+ VM
+ ) : (
+ !im.keep_alive && (
+ Application image
+ )
+ )}
- )
+ );
})}
)}
- {err("image") &&
{err("image")}
}
+ {err("image") && (
+
{err("image")}
+ )}
{image && (
- Selected {image.id} ({image.ref}).{" "}
- {image.keep_alive
- ? "Boots like a VM: runs user data once, then stays up until stopped."
- : "Runs the image's own entrypoint; the instance stops when that process exits."}
+ Selected{" "}
+ {image.id} {" "}
+ ({image.ref || image.vm_base}).{" "}
+ {isVMImage(image)
+ ? "Boots a virtual machine with its own kernel; cloud-init runs user data at first boot."
+ : image.keep_alive
+ ? "Boots like a VM: runs user data once, then stays up until stopped."
+ : "Runs the image's own entrypoint; the instance stops when that process exits."}
)}
{/* ---- Instance type ---- */}
-
Compare instance types}>
+
+ Compare instance types
+
+ }
+ >
-
+
-
+
{instanceType && (
@@ -385,7 +731,10 @@ export function LaunchWizard() {
{/* ---- Key pair ---- */}
-
+
-
setKeyName(v === "__none" ? "" : v)}>
+ setKeyName(v === "__none" ? "" : v)}
+ >
- Proceed without a key pair
+
+ Proceed without a key pair
+
{(keyPairs.data ?? []).map((k) => (
{k.name} ({k.type})
@@ -407,11 +761,21 @@ export function LaunchWizard() {
))}
- setCreatingKey(true)}>
+ setCreatingKey(true)}
+ >
Create
- {creatingKey && setCreatingKey(false)} onCreated={(k) => setKeyName(k.name)} />}
+ {creatingKey && (
+ setCreatingKey(false)}
+ onCreated={(k) => setKeyName(k.name)}
+ />
+ )}
@@ -426,27 +790,50 @@ export function LaunchWizard() {
subnet ? (
<>
VPC{" "}
-
+
{subnet.vpc_id}
{" "}
- · {subnet.cidr} · {subnet.availability_zone} · {formatNumber(subnet.available_ips)} available IPs
+ · {subnet.cidr} · {subnet.availability_zone} ·{" "}
+ {formatNumber(subnet.available_ips)} available IPs
>
) : undefined
}
>
{subnets.error ? (
- subnets.mutate()} />
+ subnets.mutate()}
+ />
) : (
-
+
-
+
{sortedSubnets.map((s) => (
-
+
{s.name || s.id}
- {s.id} · {s.vpc_id} · {s.cidr} · {s.availability_zone} · {formatNumber(s.available_ips)} IPs
+ {s.id} · {s.vpc_id} · {s.cidr} ·{" "}
+ {s.availability_zone} ·{" "}
+ {formatNumber(s.available_ips)} IPs
))}
@@ -458,7 +845,10 @@ export function LaunchWizard() {
Security groups
-
+
Manage security groups
@@ -467,30 +857,55 @@ export function LaunchWizard() {
) : !sgs.data || !vpcId ? (
) : groups.length === 0 ? (
-
This VPC has no security groups.
+
+ This VPC has no security groups.
+
) : (
{groups.map((g) => {
- const checked = sgIds.includes(g.id)
+ const checked = sgIds.includes(g.id);
return (
-
+
setSgIds(v ? [...sgIds, g.id] : sgIds.filter((x) => x !== g.id))}
+ onCheckedChange={(v) =>
+ setSgIds(
+ v
+ ? [...sgIds, g.id]
+ : sgIds.filter((x) => x !== g.id),
+ )
+ }
/>
{g.name} {" "}
- {g.id}
+
+ {g.id}
+
- {g.description && {g.description} }
+ {g.description && (
+
+ {g.description}
+
+ )}
{g.ingress.length === 0 ? (
- No inbound rules
+
+ No inbound rules
+
) : (
g.ingress.map((r) => (
-
+
{ruleSummary(r)}
))
@@ -498,20 +913,36 @@ export function LaunchWizard() {
- )
+ );
})}
)}
{sgs.data && sgIds.length === 0 && (
-
No group selected: the VPC's default security group will be used.
+
+ No group selected: the VPC's default security group
+ will be used.
+
)}
- Inbound (ingress) rules decide which ports are published on this host: each allowed port is mapped to a random host port, shown on the
- instance as a clickable link. Rules are applied at launch.
+ Inbound (ingress) rules decide which ports are published on
+ this host: each allowed port is mapped to a random host
+ port, shown on the instance as a clickable link. Rules are
+ applied at launch.
{selectedGroups.length > 0 && (
- <> Ports to publish: {publishedPorts.length ? {publishedPorts.join(", ")} : "none"}.>
+ <>
+ {" "}
+ Ports to publish:{" "}
+ {publishedPorts.length ? (
+
+ {publishedPorts.join(", ")}
+
+ ) : (
+ "none"
+ )}
+ .
+ >
)}
@@ -520,124 +951,269 @@ export function LaunchWizard() {
{/* ---- Storage ---- */}
-
-
- {volumes.length === 0 &&
No additional volumes.
}
- {volumes.map((v, i) => (
-
-
- setVol(i, { size: e.target.value })} className="h-8" />
-
-
- setVol(i, { mount: e.target.value })} placeholder="/data" className="h-8 font-mono" />
-
-
- setVol(i, { del: !!c })} />
- Delete on termination
-
-
setVolumes(volumes.filter((_, j) => j !== i))}
- aria-label="Remove volume"
+ {isVM && (
+
+ )}
+ {!isVM && (
+
+
+ {volumes.length === 0 && (
+
+ No additional volumes.
+
+ )}
+ {volumes.map((v, i) => (
+
-
-
-
- ))}
-
-
= 8}
- onClick={() => setVolumes([...volumes, { size: "8", mount: volumes.length ? `/data${volumes.length + 1}` : "/data", del: true }])}
- >
- Add new volume
-
-
-
Sizes are advisory: Docker volumes are not capped.
-
-
-
- {/* ---- File systems (EFS) ---- */}
-
- Manage file systems
-
- }
- >
-
- {fileSystems.error ? (
-
fileSystems.mutate()} />
- ) : fileSystems.data?.length === 0 ? (
-
- You have no file systems.{" "}
-
- Create a file system
- {" "}
- to share files between instances.
-
- ) : (
- fsRows.length === 0 && No file systems mounted.
- )}
- {fsRows.map((f, i) => {
- const fs = fsById(f.id)
- return (
-
-
- v && setFs(i, { id: v, ro: f.ro || !!fsById(v)?.read_only })}>
-
-
-
-
- {(fileSystems.data ?? []).map((x) => (
-
- {fsLabel(x)}
-
- {x.id}
- {x.read_only ? " · read-only" : ""}
-
-
- ))}
-
-
+
+ setVol(i, { size: e.target.value })}
+ className="h-8"
+ />
-
- setFs(i, { mount: e.target.value })} placeholder="/mnt/efs" className="h-8 font-mono" />
+
+ setVol(i, { mount: e.target.value })}
+ placeholder="/data"
+ className="h-8 font-mono"
+ />
- setFs(i, { ro: !!c })} />
- Read-only
+ setVol(i, { del: !!c })}
+ />
+ Delete on termination
setFsRows(fsRows.filter((_, j) => j !== i))}
- aria-label="Remove file system"
+ onClick={() =>
+ setVolumes(volumes.filter((_, j) => j !== i))
+ }
+ aria-label="Remove volume"
>
- {fs?.read_only && This file system is read-only, so it is mounted read-only.
}
- )
- })}
- {(fileSystems.data?.length ?? 0) > 0 && (
+ ))}
-
= 8} onClick={addFs}>
- Add file system
+ = 8}
+ onClick={() =>
+ setVolumes([
+ ...volumes,
+ {
+ size: "8",
+ mount: volumes.length
+ ? `/data${volumes.length + 1}`
+ : "/data",
+ del: true,
+ },
+ ])
+ }
+ >
+ Add new volume
- )}
-
-
+
+ Sizes are advisory: Docker volumes are not capped.
+
+
+
+ )}
+
+ {/* ---- File systems (EFS) ---- */}
+ {!isVM && (
+
+ Manage file systems
+
+ }
+ >
+
+ {fileSystems.error ? (
+
fileSystems.mutate()}
+ />
+ ) : fileSystems.data?.length === 0 ? (
+
+ You have no file systems.{" "}
+
+ Create a file system
+ {" "}
+ to share files between instances.
+
+ ) : (
+ fsRows.length === 0 && (
+
+ No file systems mounted.
+
+ )
+ )}
+ {fsRows.map((f, i) => {
+ const fs = fsById(f.id);
+ return (
+
+
+
+ v &&
+ setFs(i, {
+ id: v,
+ ro: f.ro || !!fsById(v)?.read_only,
+ })
+ }
+ >
+
+
+
+
+ {(fileSystems.data ?? []).map((x) => (
+
+
+ {fsLabel(x)}
+
+
+ {x.id}
+ {x.read_only ? " · read-only" : ""}
+
+
+ ))}
+
+
+
+
+ setFs(i, { mount: e.target.value })}
+ placeholder="/mnt/efs"
+ className="h-8 font-mono"
+ />
+
+
+ setFs(i, { ro: !!c })}
+ />
+ Read-only
+
+
+ setFsRows(fsRows.filter((_, j) => j !== i))
+ }
+ aria-label="Remove file system"
+ >
+
+
+ {fs?.read_only && (
+
+ This file system is read-only, so it is mounted
+ read-only.
+
+ )}
+
+ );
+ })}
+ {(fileSystems.data?.length ?? 0) > 0 && (
+
+
= 8}
+ onClick={addFs}
+ >
+ Add file system
+
+
+ )}
+
+
+ )}
{/* ---- Advanced ---- */}
@@ -649,12 +1225,21 @@ export function LaunchWizard() {
help="The profile's role credentials are served to the instance by the metadata service (169.254.169.254)."
>
-
+
- setMdEndpoint(v as "enabled" | "disabled")}>
+
+ setMdEndpoint(v as "enabled" | "disabled")
+ }
+ >
@@ -664,22 +1249,59 @@ export function LaunchWizard() {
-
- setMdTokens(v as "optional" | "required")} disabled={mdEndpoint === "disabled"}>
+
+
+ setMdTokens(v as "optional" | "required")
+ }
+ disabled={mdEndpoint === "disabled"}
+ >
- V2 only (token required)
- V1 and V2 (token optional)
+
+ V2 only (token required)
+
+
+ V1 and V2 (token optional)
+
-
- setMdHops(e.target.value)} className="w-28" disabled={mdEndpoint === "disabled"} />
+
+ setMdHops(e.target.value)}
+ className="w-28"
+ disabled={mdEndpoint === "disabled"}
+ />
- setMdTags(v as "enabled" | "disabled")} disabled={mdEndpoint === "disabled"}>
+
+ setMdTags(v as "enabled" | "disabled")
+ }
+ disabled={mdEndpoint === "disabled"}
+ >
@@ -702,7 +1324,9 @@ export function LaunchWizard() {
rows={7}
value={userData}
onChange={(e) => setUserData(e.target.value)}
- placeholder={"#!/bin/sh\napt-get update && apt-get install -y curl"}
+ placeholder={
+ "#!/bin/sh\napt-get update && apt-get install -y curl"
+ }
className="font-mono text-[13px]"
spellCheck={false}
/>
@@ -711,8 +1335,10 @@ export function LaunchWizard() {
- {image.name} is an application image: it runs its own entrypoint, so user data is written to
- /var/lib/homecloud/user-data but not executed. Only keep-alive images run it.
+ {image.name} is an application image: it
+ runs its own entrypoint, so user data is written to
+ /var/lib/homecloud/user-data but not executed. Only
+ keep-alive images run it.
)}
@@ -724,15 +1350,32 @@ export function LaunchWizard() {
-
- setCount(e.target.value)} className="h-8 w-28" />
+
+ setCount(e.target.value)}
+ className="h-8 w-28"
+ />
+
+ {isVM ? "Virtual machine" : "Container"}
+
{image ? (
<>
{image.name}
- {image.id}
+
+ {image.id}
+
>
) : (
"-"
@@ -743,7 +1386,8 @@ export function LaunchWizard() {
{instanceType && (
{" "}
- ({formatVcpu(instanceType.vcpus)}, {formatMemoryMB(instanceType.memory_mb)})
+ ({formatVcpu(instanceType.vcpus)},{" "}
+ {formatMemoryMB(instanceType.memory_mb)})
)}
@@ -751,17 +1395,25 @@ export function LaunchWizard() {
{subnet ? (
<>
{subnet.name || subnet.id}
- {subnet.availability_zone}
+
+ {subnet.availability_zone}
+
>
) : (
"-"
)}
- {selectedGroups.length ? selectedGroups.map((g) => g.name).join(", ") : "default"}
+ {selectedGroups.length
+ ? selectedGroups.map((g) => g.name).join(", ")
+ : "default"}
+
+
+ {keyName.trim() || "None"}
+
+
+ {profile || "None"}
- {keyName.trim() || "None"}
- {profile || "None"}
{volumes.length
? `Root + ${pluralize(volumes.length, "volume")} (${volumes.reduce((a, v) => a + (Number(v.size) || 0), 0)} GiB)`
@@ -770,36 +1422,47 @@ export function LaunchWizard() {
{fsRows.length > 0 && (
{fsRows.map((f, i) => {
- const fs = fsById(f.id)
+ const fs = fsById(f.id);
return (
{fs ? (
-
+
{fsLabel(fs)}
) : (
- Not chosen
+
+ Not chosen
+
)}{" "}
{f.mount || "-"}
{f.ro ? " (ro)" : ""}
- )
+ );
})}
)}
{Number.isInteger(n) && n > 1 && instanceType && (
- {formatNumber(instanceType.vcpus * n)} vCPUs, {formatMemoryMB(instanceType.memory_mb * n)}
+ {formatNumber(instanceType.vcpus * n)} vCPUs,{" "}
+ {formatMemoryMB(instanceType.memory_mb * n)}
)}
- {submitted && !valid && Some settings need attention. Check the highlighted fields.
}
+ {submitted && !valid && (
+
+ Some settings need attention. Check the highlighted fields.
+
+ )}
{pending ? : }
- Launch {Number.isInteger(n) && n > 1 ? `${n} instances` : "instance"}
+ Launch{" "}
+ {Number.isInteger(n) && n > 1 ? `${n} instances` : "instance"}
Cancel
@@ -810,14 +1473,20 @@ export function LaunchWizard() {
- )
+ );
}
-function SummaryItem({ label, children }: { label: string; children: React.ReactNode }) {
+function SummaryItem({
+ label,
+ children,
+}: {
+ label: string;
+ children: React.ReactNode;
+}) {
return (
{label}
{children}
- )
+ );
}
diff --git a/console/lib/demo/ids.ts b/console/lib/demo/ids.ts
index 57a94848..29e14c6b 100644
--- a/console/lib/demo/ids.ts
+++ b/console/lib/demo/ids.ts
@@ -38,6 +38,8 @@ export const INSTANCE = {
bastion: stableId("i-", "shop-bastion"),
batch: stableId("i-", "shop-batch-worker"),
dev: stableId("i-", "dev-sandbox"),
+ ledger: stableId("i-", "shop-ledger-vm"),
+ audit: stableId("i-", "audit-vm"),
}
export const AMI = {
@@ -46,6 +48,8 @@ export const AMI = {
alpine: stableId("ami-", "alpine-3.20"),
amazonLinux: stableId("ami-", "amazon-linux-2023"),
shopWeb: stableId("ami-", "shop-web-v14"),
+ ubuntuVm: stableId("ami-", "ubuntu-24.04-vm"),
+ debianVm: stableId("ami-", "debian-12-vm"),
}
export const KEY_PAIRS = ["shop-prod", "shop-dev", "alice-laptop"]
diff --git a/console/lib/demo/svc/ec2.ts b/console/lib/demo/svc/ec2.ts
index 8ee4d5bd..31e17742 100644
--- a/console/lib/demo/svc/ec2.ts
+++ b/console/lib/demo/svc/ec2.ts
@@ -6,6 +6,7 @@ import {
ASG_GROUP_TAG,
type CommandResult,
type ConsoleOutput,
+ type Ec2Capabilities,
type ElasticIP,
type Image,
type Instance,
@@ -55,12 +56,17 @@ const TYPES: InstanceType[] = [
export const findType = (n: string) => TYPES.find((t) => t.name === n)
const cat = (id: string, name: string, description: string, ref: string, keep_alive = true): Image => ({
- id, name, description, ref, platform: "linux", keep_alive, owner: "homecloud", state: "available",
+ id, name, description, ref, platform: "linux", keep_alive, owner: "homecloud", state: "available", virtualization: "container",
+})
+const vmImage = (id: string, name: string, description: string, vm_base: string): Image => ({
+ id, name, description, ref: "", platform: "linux", keep_alive: true, owner: "homecloud", state: "available", virtualization: "vm", vm_base,
})
const CATALOG: Image[] = [
cat(AMI.ubuntu, "Ubuntu Server 24.04 LTS", "Canonical Ubuntu 24.04 (Noble Numbat)", "ubuntu:24.04"),
cat("ami-ubuntu-22-04", "Ubuntu Server 22.04 LTS", "Canonical Ubuntu 22.04 (Jammy Jellyfish)", "ubuntu:22.04"),
cat(AMI.debian, "Debian 12", "Debian GNU/Linux 12 (bookworm)", "debian:12"),
+ vmImage(AMI.ubuntuVm, "Ubuntu Server 24.04 LTS (VM)", "Canonical Ubuntu 24.04 (Noble Numbat) cloud image, booted as a virtual machine with its own kernel and cloud-init", "ubuntu-24.04"),
+ vmImage(AMI.debianVm, "Debian 12 (VM)", "Debian GNU/Linux 12 (bookworm) cloud image, booted as a virtual machine with its own kernel and cloud-init", "debian-12"),
cat(AMI.amazonLinux, "Amazon Linux 2023", "Amazon Linux 2023 base image", "amazonlinux:2023"),
cat("ami-rocky-9", "Rocky Linux 9", "Enterprise Linux compatible", "rockylinux:9"),
cat("ami-fedora-41", "Fedora 41", "Fedora Linux 41", "fedora:41"),
@@ -106,6 +112,7 @@ interface InstSpec {
profile?: boolean
terminated?: number
reason?: string
+ virt?: Instance["virtualization"]
}
function mkInstance(o: InstSpec): Instance {
@@ -139,6 +146,8 @@ function mkInstance(o: InstSpec): Instance {
terminated_at: o.terminated ? ago(o.terminated) : undefined,
tags: { Name: o.name, ...o.tags },
key_name: o.key,
+ virtualization: o.virt,
+ vm_user: o.virt ? "ubuntu" : undefined,
iam_profile_arn: o.profile ? PROFILE : undefined,
iam_profile_id: o.profile ? "AIPADEMOWEBROLE0000" : undefined,
metadata_options: { http_tokens: o.profile ? "required" : "optional", http_endpoint: "enabled", hop_limit: o.profile ? 2 : 1, instance_metadata_tags: "disabled" },
@@ -183,6 +192,14 @@ function seed(): Ec2State {
id: INSTANCE.dev, name: "dev-sandbox", image: AMI.debian, ref: "debian:12", type: "t3.micro", subnet: SUBNET.defaultA, ip: "172.31.3.44", sgs: [SG.defaultVpc], launched: 40 * DAY, state: "stopped",
key: KEY_PAIRS[1], tags: { Environment: "dev", Owner: "alice" },
}),
+ mkInstance({
+ id: INSTANCE.ledger, name: "shop-ledger-vm", image: AMI.ubuntuVm, ref: "", type: "t3.medium", subnet: SUBNET.privateB, ip: "10.0.12.77", sgs: [SG.web], launched: 6 * DAY, virt: "kvm",
+ key: KEY_PAIRS[0], tags: { ...PUB_TAGS, Role: "ledger" },
+ }),
+ mkInstance({
+ id: INSTANCE.audit, name: "audit-vm", image: AMI.debianVm, ref: "", type: "t3.small", subnet: SUBNET.defaultB, ip: "172.31.16.9", sgs: [SG.defaultVpc], launched: 2 * DAY, virt: "emulated",
+ key: KEY_PAIRS[1], tags: { Environment: "dev", Owner: "alice" },
+ }),
mkInstance({
id: stableId("i-", "shop-web-old"), name: "shop-web-old", image: AMI.amazonLinux, ref: "amazonlinux:2023", type: "t3.small", subnet: SUBNET.privateA, ip: "10.0.11.19", sgs: [SG.web], launched: 60 * DAY, state: "terminated",
terminated: 3 * DAY, reason: "Client.UserInitiatedShutdown", tags: { ...PUB_TAGS, Role: "web", "note": "replaced by the ASG" },
@@ -380,6 +397,7 @@ export function launchInstances(inp: RunInstancesInput, extraTags: Tags = {}): I
const inst: Instance = {
id, name, arn: arn("ec2", `instance/${id}`), image_id: img.id, image_ref: img.ref, instance_type: type.name, vcpus: type.vcpus, memory_mb: type.memory_mb, state: "pending",
vpc_id: sn.vpc_id, subnet_id: sn.id, availability_zone: sn.availability_zone, private_ip: ip, private_dns: dnsOf(ip), security_groups: sgs, volumes: attachments, file_systems: fsList,
+ virtualization: img.virtualization === "vm" ? "kvm" : undefined, vm_user: img.virtualization === "vm" ? "ubuntu" : undefined,
user_data: inp.user_data || undefined, keep_alive: img.keep_alive, public_ports: {}, public_host: "localhost", launch_time: new Date().toISOString(),
tags: { ...(name ? { Name: name } : {}), ...(inp.tags ?? {}), ...extraTags }, key_name: inp.key_name || undefined, iam_profile_arn: profileArn,
iam_profile_id: profileArn ? "AIPA" + hex(16).toUpperCase() : undefined,
@@ -439,8 +457,31 @@ function finishTerminateNow(s: Ec2State, i: Instance) {
const FAKE_PRIVATE_KEY = (name: string) =>
`-----BEGIN OPENSSH PRIVATE KEY-----\ndemo-not-a-real-private-key-${name}\nThis is placeholder text generated by the HomeCloud demo.\nInstall HomeCloud to create real key pairs.\n-----END OPENSSH PRIVATE KEY-----\n`
+function vmLog(i: Instance, t: (n: number) => string): string {
+ const slow = i.virtualization === "emulated"
+ const k = (n: number) => `[${(n * (slow ? 9 : 1)).toFixed(6).padStart(12)}]`
+ const lines = [
+ `[homecloud] ${t(0)} starting virtual machine ${i.id} (${i.instance_type}, ${i.virtualization === "kvm" ? "KVM acceleration" : "emulated, no /dev/kvm"})`,
+ `${k(0)} Linux version 6.8.0-45-generic (buildd@lcy02-amd64-044) #45-Ubuntu SMP PREEMPT_DYNAMIC`,
+ `${k(0.02)} Command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-45-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0`,
+ `${k(0.4)} virtio_net virtio0 enp0s2: renamed from eth0`,
+ `${k(1.1)} EXT4-fs (vda1): mounted filesystem with ordered data mode.`,
+ `${k(2.3)} systemd[1]: Reached target Basic System.`,
+ `Cloud-init v. 24.2 running 'init-local' at ${t(9)}. Up ${slow ? "41.2" : "4.8"} seconds.`,
+ `ci-info: eth0: True ${i.private_ip} 255.255.255.0 global`,
+ `Cloud-init v. 24.2 running 'modules:config' at ${t(14)}. Up ${slow ? "58.0" : "9.6"} seconds.`,
+ ...(i.user_data ? i.user_data.split("\n").filter((l) => l.trim() && !l.startsWith("#")).slice(0, 6).map((l) => `+ ${l}`) : []),
+ `Cloud-init v. 24.2 finished at ${t(19)}. Datasource DataSourceNoCloud. Up ${slow ? "73.4" : "14.1"} seconds`,
+ `Ubuntu 24.04.1 LTS ${i.name} ttyS0`,
+ "",
+ `${i.name} login:`,
+ ]
+ return lines.join("\n") + "\n"
+}
+
function consoleLog(i: Instance): string {
const t = (n: number) => new Date(new Date(i.launch_time).getTime() + n * 1000).toISOString().replace("T", " ").slice(0, 19)
+ if (i.virtualization) return vmLog(i, t)
const lines = [
`[homecloud] ${t(0)} creating instance ${i.id} (${i.instance_type}) from ${i.image_ref}`,
`[homecloud] ${t(1)} network ${i.vpc_id} ${i.subnet_id} address ${i.private_ip}`,
@@ -581,6 +622,7 @@ function routes(r: Router) {
r.post(`${I}/:id/image`, ({ params, body }) => createImage(instById(params.id), body?.name, body?.description))
r.get("/api/v1/ec2/instance-types", () => TYPES)
+ r.get("/api/v1/ec2/capabilities", (): Ec2Capabilities => ({ vm: "kvm" }))
// ---- images ----
const IM = "/api/v1/ec2/images"
diff --git a/console/lib/types/ec2.ts b/console/lib/types/ec2.ts
index adabc943..f85f6ec8 100644
--- a/console/lib/types/ec2.ts
+++ b/console/lib/types/ec2.ts
@@ -42,6 +42,15 @@ export interface Instance {
iam_profile_arn?: string
iam_profile_id?: string
metadata_options?: MetadataOptions
+ /** VM instances: "kvm" (hardware accelerated) or "emulated" (no /dev/kvm, slow). Absent for containers. */
+ virtualization?: "kvm" | "emulated" | (string & {})
+ vm_user?: string
+}
+
+/** What this host can run; GET /api/v1/ec2/capabilities. */
+export interface Ec2Capabilities {
+ /** "kvm" = VMs accelerated, "emulated" = no /dev/kvm (slow), "unavailable" */
+ vm: "kvm" | "emulated" | "unavailable" | (string & {})
}
/** Instance metadata service (IMDS) options. */
@@ -72,6 +81,9 @@ export interface Image {
state: string
created_at?: string
source_instance?: string
+ /** "vm" (own kernel, QEMU guest) or "container" */
+ virtualization?: "vm" | "container" | (string & {})
+ vm_base?: string
}
export interface Volume {
@@ -100,6 +112,8 @@ export interface RunInstancesInput {
tags?: Tags
volumes?: { volume_id?: string; size_gb?: number; mount_path: string; delete_on_termination?: boolean }[]
file_systems?: FileSystemMount[]
+ /** VM images only: root disk size */
+ root_volume?: { size_gb?: number; delete_on_termination?: boolean }
key_name?: string
/** instance profile name or ARN */
iam_instance_profile?: string
diff --git a/docs/architecture.md b/docs/architecture.md
index d2b1d52e..24f3ce7b 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -55,6 +55,31 @@ The data directory defaults to `~/.homecloud` (override with `--data-dir` or `HO
**EC2.** An instance is a container with CPU quota and memory limits taken from its instance type. OS images (Ubuntu, Debian, …) boot a small init script that runs user data once and then idles, so the instance behaves like a VM that stays up; application images (e.g. `ami-nginx`) run their own entrypoint. Instance metadata is written to `/var/lib/homecloud/instance.json`. Volumes are named Docker volumes. "Create image" commits the container into `homecloud/ami:`. The browser terminal is a WebSocket bridged to `docker exec` with a TTY.
+**EC2 VM instances.** The catalog also has VM images (`ami-ubuntu-24-04-vm`, `ami-debian-12-vm`, marked "(VM)", `virtualization: "vm"`, EC2 hypervisor `kvm`): the official cloud images for the Docker host's architecture, pinned to a release and verified by SHA-256/512 after download, kept in a HomeCloud-managed Docker volume (`hc-vm-images`) so each is downloaded once. Launching one starts a **VM container**: a Docker container, built locally on first use from `cli/internal/svc/ec2/vm/runner.Dockerfile` (Debian pinned by digest with QEMU, passt, UEFI firmware, genisoimage, tagged by content hash), that runs a single QEMU process. The container is attached to the instance's VPC network with the instance's private IP exactly like a container instance, so everything that is per container keeps working unchanged: VPC addressing, DNS, the metadata service (a route in the container's namespace), security groups (iptables in the container's namespace, which see the guest's traffic because the guest lives behind the container's sockets) and published ports.
+
+| | Container instance | VM instance |
+|---|---|---|
+| Kernel, init | the host's; a small init script or the image's entrypoint | the guest's own; systemd, cloud-init |
+| Root disk | writable layer of the container | qcow2 overlay on the cached cloud image, in the root EBS volume (`/dev/xvda`, sized by the root block device mapping, default 8 GiB) |
+| Networking | the container's veth | the same veth; passt gives the guest the container's address, gateway and routes and forwards every inbound TCP and UDP port to it |
+| Login | `docker exec` (terminal, run-command) | SSH with the key pair (the image's default user `ubuntu` or `debian`); the browser terminal is the serial console, run-command goes through the guest agent |
+| User data, key | boot script, `/root/.ssh/authorized_keys` | cloud-init NoCloud seed ISO (`cidata`): instance ID, hostname, the key pair's public key, user data as sent (script, `#cloud-config`, ...) |
+| Console output | container log | the guest's serial console (the container log) |
+| Stop, reboot | container stop, restart | ACPI power button through QMP, then a kill after a timeout; reboot is stop + start of the same container |
+| Extra volumes | Docker volumes mounted at a directory (`/mnt/sdf`) | Docker volumes holding a sparse raw `disk.img`, attached as virtio disks (see below) |
+| Snapshots, images | copy of the volume's files; `docker commit` | root disk flattened (`qemu-img convert`) into a standalone qcow2; other volumes copied |
+| Terminate | container and volumes removed | container removed; root volume removed unless `DeleteOnTermination` is false |
+
+**VM disks.** The root volume (EBS device `/dev/xvda`, mounted at `/vm` in the VM container) holds `disk.qcow2`, an overlay on the cached cloud image (or a standalone copy, for an instance launched from an image made from an instance). Any other volume is mounted at `/disks/` and holds `disk.img`, a sparse raw image of the volume's size, created on first use and grown at the next start if the volume was enlarged. The guest sees them as virtio disks in the order of their EBS device names (`/dev/sdf` before `/dev/sdg`): `/dev/vdb`, `/dev/vdc`, and so on (the root disk is `/dev/vda`; the cloud-init seed is the last one), and always as `/dev/disk/by-id/virtio-`, which is the name to use in `fstab`. `BlockDeviceMappings` at launch and `AttachVolume`/`DetachVolume` work; the root volume cannot be detached. Docker cannot add a mount to a running container, so there is no hot-plug: attaching or detaching a volume rebuilds the VM container, which shuts the guest down gracefully and boots it again with the new set of disks (the volume shows `attaching`/`detaching` until then). The NIC sits at a fixed PCI slot so its name in the guest does not change when disks come and go.
+
+`CreateSnapshot` of a root volume and `CreateImage` of an instance flatten the overlay with `qemu-img convert`, so they never depend on the cloud image cache, the instance or its volume. A running guest's disk is read while it is open (crash-consistent, like an EBS snapshot of a running instance); stop the instance first for a clean image. An image made from an instance is a Docker volume (`hc-`) holding that disk; `RunInstances` from it copies the disk into the new instance's root volume (so deregistering the image leaves running instances alone), at least as large as the image's disk, on a host of the same architecture. Snapshots restore to volumes and volumes attach as data disks as before.
+
+`homecloud backup` archives a VM's root volume as a standalone qcow2 (the volume carries the label `homecloud.vm-root`, and the server hands such volumes to a flatten step while the VM container is paused); the image cache is left out. A restore brings volumes back but no containers: when HomeCloud then finds a VM instance whose container is gone but whose root volume exists it recreates the container and leaves the instance `stopped`, instead of terminating it as it does for container instances; starting it boots the restored disk.
+
+The guest runs with `-accel kvm -cpu host` when the Docker host has `/dev/kvm` (probed once by creating a container with the device; `HC_VM_ACCEL=kvm|tcg` overrides) and is otherwise emulated (`-accel tcg`, logged as a warning). The instance reports `virtualization: "kvm"` or `"emulated"`. Docker for Mac (OrbStack, Docker Desktop) has no `/dev/kvm`, so guests there are emulated; a native macOS `hvf` guest is not implemented. `-smp` and `-m` come from the instance type, and the container's limits are a little higher for QEMU's own overhead. An instance is `pending` until the guest is up: cloud-init's final message (or a login prompt for a while) on the serial console, with a generous timeout (30 minutes emulated). Changing security-group rules that change which ports are published rebuilds the container like for container instances; the disk is in the volume, but the guest is shut down and boots again. **Security trade-off.** passt sandboxes itself (user, mount and pid namespaces, `pivot_root`, then runs as `nobody`). Docker's default seccomp profile blocks that, so the VM container uses a custom profile: Docker's default (moby v27.4.1, embedded in `vm/seccomp-docker-default.json`, deny by default) plus an unconditional allow for exactly `unshare`, `mount`, `umount2` and `pivot_root`, the minimum found by removing each syscall in turn until passt failed. Everything else the default profile forbids (`bpf`, `keyctl`, `kexec_load`, module loading, `perf_event_open`, ...) stays forbidden, and the kernel still checks capabilities, which passt only has inside the namespaces it creates. AppArmor is not narrowed: on Ubuntu hosts the `docker-default` profile denies the remount and `pivot_root` of passt's sandbox (verified on Ubuntu 24.04 with `kernel.apparmor_restrict_unprivileged_userns=1`), and a narrower profile would have to be loaded on the host, which HomeCloud (a Docker client) cannot do, so the VM container runs with `apparmor=unconfined`. An administrator who loads a profile allowing mount, umount and `pivot_root` inside user namespaces can name it with `HC_VM_APPARMOR`. The container still gets only Docker's default capabilities, no `SYS_ADMIN`, no privileged mode and no host devices except `/dev/kvm` when accelerated; the trust is that of a root process in a container without MAC confinement running QEMU and passt, so use VM images only where you would accept that. passt also opens a socket per forwarded port, so the VM container's open-file limit is raised to 1048576 (Docker's default on some hosts is 65536 or 1024, which made passt fail with "Too many open files"). Instances report `vm_network: "passt"` or `"user"`. If passt cannot start (for example a host whose security modules forbid the user namespace), or when the server runs with `HC_VM_NET=user`, the container falls back to QEMU's user-mode networking: the guest then sits behind NAT at 10.0.2.15, still reaches the metadata service and DNS, and only the TCP/UDP ports that the instance's security groups open (at most 64, whatever their source) are forwarded to it; a rule that opens another port rebuilds the container (the guest reboots), for the automatic fallback too; the server logs why passt failed. The container's entrypoint stays up as a supervisor of QEMU and passt: passt runs with `-d`, its log (`/run/passt.log`, kept under 4 MiB) and, when it dies under a running guest, its exit status and the container's memory counters go to the container log and `/run/passt.dead` is created. HomeCloud notices that (when the instance is read, at most every 20 seconds) or during the boot wait, records `vm_network: "user"` for the instance and rebuilds the container with user-mode networking, so a passt failure costs the guest its private address and a reboot, not its connectivity. The mode sticks to the instance until it is terminated.
+
+**Guest agent, run-command, terminal, metrics.** The command line adds a virtio-serial port `org.qemu.guest_agent.0` backed by a socket in the VM container (`/run/qga.sock`), and cloud-init's vendor-data (a script, so it survives a user-data `packages:` or `runcmd:`) installs and starts `qemu-guest-agent`. *Run-command* (`POST /api/v1/ec2/instances/{id}/commands`, `ssm:SendCommand` as for containers) sends `guest-exec` for `/bin/sh -c` (wrapped in the guest's `timeout(1)` so the command is killed at its timeout; status `TimedOut`) and polls `guest-exec-status` for stdout, stderr and the exit code. Each agent call is a `docker exec` of `socat` into the VM container that does the `guest-sync-delimited` handshake first; QEMU serves one agent client at a time, so calls to one guest are serialized. The agent needs the image's network on first boot to install it (images are Debian/Ubuntu); until it is up run-command fails with a clear error. The *browser terminal* cannot be a shell through the agent (`guest-exec` is not interactive), so it attaches to the guest's **serial console**: the serial port is a QEMU socket chardev (`/run/serial.sock`) with `logfile=/dev/stdout`, which tees everything the guest prints into the container log so `GetConsoleOutput` and the boot-ready detection are unchanged whether or not a terminal is attached. The terminal WebSocket runs `docker exec -t ... socat -,raw,echo=0 UNIX-CONNECT:/run/serial.sock`; the user presses Enter and logs in at the guest's getty. Cloud images have no console password, so set one through user data (`chpasswd`) to use it; one serial session at a time. *CloudWatch* metrics of a VM instance come from the guest, not from QEMU: the collector asks the EC2 service for a sample, which runs one `guest-exec` that reads `/proc/stat` twice a second apart (`CPUUtilization`, no state between samples), `/proc/meminfo` (`MemoryUsed` = total - available, `MemoryUtilization`), `/proc/net/dev` without `lo` (`NetworkIn/Out`), `/proc/diskstats` for whole disks (`DiskReadBytes/WriteBytes`) and the process count, published under the same `HC/EC2` namespace and `InstanceId` dimension as containers. `/proc` through `guest-exec` was chosen over `guest-get-cpustats` (new in QGA 7.1, not in every image) and QMP statistics (which only see the virtual devices). Samples run beside the collector's tick, one per instance at a time, and publish nothing while the agent is not up. `homecloud backup` still sees the VM container: a backup copies the root volume's qcow2 file, which points at the cached cloud image (the cache volume itself is left out of backups).
+
**Security groups.** Ingress and egress rules are enforced between the resources of a VPC, not only at the host boundary. Every resource that has security groups (an EC2 instance, an ECS task, an RDS or ElastiCache node, a load balancer, a Lambda environment with a VPC configuration) gets an iptables ruleset rendered from its groups and loaded into *its own network namespace*: ingress is default-deny, a packet is accepted when a rule of one of the resource's groups matches its protocol, port range (ICMP type and code) and source, and replies to accepted connections always flow back (connection tracking, so rules are stateful in both directions). A source is a CIDR or a referenced group ("from sg-app" = from every resource that has sg-app), which HomeCloud resolves to the group members' current addresses inside the VPC. A resource with no groups is in the VPC's default group, which (as in AWS) allows all inbound traffic from its own members. Egress is not filtered while a resource's groups still contain the default allow-all rule; once it is revoked, only the egress rules (plus DNS and the instance metadata service, which are always reachable) let traffic out. A load balancer is a member of its own groups, so its traffic to a target is judged by the target's groups (the target's group must allow the balancer's group), and health checks obey them too. Listener ports of internet-facing balancers, publicly accessible databases and Lambda emulator ports are published on the host whatever the groups say, so traffic from outside the VPC to them is accepted and the groups filter only what comes from inside it.
The rules are loaded by a short-lived helper container that joins the target's namespace with `NET_ADMIN` (`docker run --net container: --cap-add NET_ADMIN`). That is portable: it behaves the same on Linux Docker, Docker Desktop and OrbStack, where containers live in a VM and the host has no view of their firewall, it needs no host root, and the resource itself gets no extra capability and cannot alter its own rules. The helper image (`homecloud/sgfw`) is built locally the first time from a Dockerfile in the repository (Alpine pinned by digest plus the `iptables` package), so the first launch after an upgrade needs network access to build it. Rules live in the namespace, which Docker rebuilds whenever a container starts, so HomeCloud re-applies them on launch, on every container start (it watches Docker's start events, which covers reboot, restart policies and re-creation), when a group's rules change, when a resource's groups change, and when a resource that a group rule refers to appears or disappears; a pass every few seconds catches the rest. Each application is one atomic `iptables-restore`, so a change never opens a gap.
@@ -112,7 +137,7 @@ Published versions are immutable snapshots of `$LATEST` (configuration and a cop
## Limits and differences from AWS
-- Instances are containers, not VMs: they share the host kernel, and their "disk" is the container's writable layer. VM-backed instances (QEMU/KVM) are on the roadmap.
+- Instances are containers unless their AMI is a VM image (see **EC2 VM instances** above): container instances share the host kernel, and their "disk" is the container's writable layer. VM instances are QEMU guests with their own kernel and disk (lifecycle, run-command, the serial terminal, guest metrics, extra volumes, snapshots, images and backups are covered); attaching or detaching a volume reboots the guest, native macOS acceleration is not implemented, and they are emulated (slow) on Docker hosts without `/dev/kvm`.
- Security groups filter traffic between resources of a VPC (see Security groups above) and decide which ports are published on the host. Published ports are still fixed at container creation: an instance whose published ports no longer match its groups is recreated from a snapshot of its disk (ID, private IP, volumes and tags are kept, the same host ports are reused for ports that stay open, processes restart), while changes to filtering apply live, with no restart. Limits of the filtering:
- Covered: EC2 instances, ECS tasks, RDS and ElastiCache nodes, load balancers, and Lambda environments of functions with a VPC configuration. EFS mount targets carry security groups in the API, but a file system is a Docker volume mounted into the instance and there is no network path to filter, so they are recorded only.
- Ingress sources that can be matched are IPv4 CIDRs and groups of the same VPC. Prefix lists and IPv6 ranges are recorded but match nothing (VPC networks are IPv4 only), and groups of a peer VPC do not exist (there is no peering). Network ACLs are recorded, not enforced.
diff --git a/docs/aws-compat.md b/docs/aws-compat.md
index 44772f10..7da24972 100644
--- a/docs/aws-compat.md
+++ b/docs/aws-compat.md
@@ -96,7 +96,7 @@ that is not itself a trusted proxy is the source address, and `X-Forwarded-Proto
| EventBridge | events | awsJson 1.1 | Buses, rules with full pattern syntax, targets with transforms |
| EventBridge Scheduler | scheduler | restJson1 | Schedules and groups |
| Elastic Load Balancing v2 | elasticloadbalancing | awsQuery | Application load balancers, target groups (instance and ip), listeners (HTTP/HTTPS with ACM certificates), rules (path and host conditions; forward, redirect and fixed-response actions), attributes, tags |
-| EC2 | ec2 | ec2 Query | Instances, security groups, key pairs, volumes and snapshots, VPC networking, launch templates, Elastic IPs (see notes) |
+| EC2 | ec2 | ec2 Query | Instances (containers, or virtual machines from the `(VM)` AMIs), security groups, key pairs, volumes and snapshots, VPC networking, launch templates, Elastic IPs (see notes) |
| EC2 Auto Scaling | autoscaling | awsQuery | Groups from EC2 launch templates, target-tracking policies (average CPU), target group attachment, tags, suspend/resume, scaling activities |
| Elastic Container Registry | ecr | awsJson 1.1 | Repositories, images (list, describe, batch get/delete), `get-login-password` for `docker login` against the HomeCloud registry, lifecycle and repository policies (stored, not enforced), tag mutability and scan settings (stored), tags |
| Elastic Container Service | ecs | awsJson 1.1 | Clusters, task definitions (one container per task; images, ports, environment, Secrets Manager and SSM secrets, `awslogs` to CloudWatch Logs, task role credentials), services (Fargate/awsvpc, ELBv2 target group, rolling deployments with deployment status), RunTask/StopTask, capacity providers (FARGATE), tags |
@@ -113,6 +113,7 @@ that is not itself a trusted proxy is the source address, and `X-Forwarded-Proto
Notes:
- Terraform's S3 support prefixes the endpoint host with the account ID, so use `http://localhost:PORT`, not an IP address.
+- EC2 VM instances: the AMIs `ami-ubuntu-24-04-vm` and `ami-debian-12-vm` (named `homecloud/vm/...`, so an `aws_ami` lookup for the usual `ubuntu/images/...` names still finds the container images) boot the official cloud image as a QEMU virtual machine; `DescribeImages` and `DescribeInstances` report `VirtualizationType: hvm` and `Hypervisor: kvm` for them (`xen` for container images). `RunInstances` takes the same parameters: `KeyName` authorizes the key for the image's default user (`ubuntu`, `debian`), `UserData` goes to cloud-init unchanged (scripts, `#cloud-config`), and the root `BlockDeviceMappings` entry (`/dev/xvda`, `/dev/sda1` or `/dev/sda`) sets the root disk size (default 8 GiB, at least 4) and `DeleteOnTermination`. The root disk shows up in `DescribeVolumes` and `DescribeInstances` as an attached volume at `/dev/xvda`. `GetConsoleOutput` returns the guest's serial console. Instances stay `pending` until the guest has booted. Guests are emulated, and slow, when the Docker host has no `/dev/kvm`; the native API's `virtualization` field says `kvm` or `emulated`. Extra `BlockDeviceMappings` (for example `/dev/sdf`), `AttachVolume` and `DetachVolume` work: the volumes are virtio disks in the guest (`/dev/vdb`, `/dev/vdc`, ... in device-name order, always `/dev/disk/by-id/virtio-`), but there is no hot-plug: attaching or detaching rebuilds the VM container, so the guest reboots (the attachment is `attaching`/`detaching` until then). The root volume cannot be detached. `CreateSnapshot` of the root volume and `CreateImage` of a VM instance flatten the disk into a standalone copy (a running guest's disk is copied crash-consistently); an image made from an instance launches into a new instance on a host of the same architecture, with a root volume at least as large as the image's disk. Run-command (`ssm:SendCommand`, through qemu-guest-agent), the browser terminal (the guest's serial console: set a console password with user data to log in) and CloudWatch `HC/EC2` metrics (measured inside the guest) work as for container instances. Not supported yet, with an `UnsupportedOperation` error: file systems at launch.
- EC2 Elastic IPs (`AllocateAddress`, `DescribeAddresses`, `AssociateAddress`, `DisassociateAddress`, `ReleaseAddress`) are records, not routed addresses. An allocation (`eipalloc-...`) reserves a stable address from the pool in the `elastic_ip_pool` config setting (default `203.0.113.0/24`, a documentation range), and an association (`eipassoc-...`) makes an instance report it as its public IP in `DescribeInstances`, network interfaces and the instance metadata service. It follows the instance across stop and start and is released from it when the instance is terminated. Only `vpc` addresses, one Elastic IP per instance (a second association replaces the first) and instance or primary-interface targets are supported, and bringing your own address is not. Traffic to an instance still arrives on the host ports published by its security groups at the HomeCloud host (`public_host`), not on the Elastic IP.
- Security groups are enforced inside the VPC. Ingress rules (protocol, ports or ICMP type/code, and an IPv4 CIDR or a referenced group) decide which resources may open connections to an instance, ECS task, RDS or ElastiCache node, load balancer or VPC-attached Lambda environment; anything else is dropped, replies to allowed connections flow back, and a resource with no group is in the VPC's default group, which allows traffic from its own members. Egress rules are enforced once the default allow-all egress rule has been revoked (DNS and the metadata service always stay reachable). A load balancer's traffic to its targets, health checks included, is judged by the targets' groups. Rules are programmed live into each container's network namespace when rules or group membership change, when resources start, restart or terminate, and when the members of a referenced group change; see [architecture.md](architecture.md#limits-and-differences-from-aws) for the mechanism and its limits (prefix lists and IPv6 sources match nothing, EFS mount targets are recorded only, network ACLs are not enforced). Rules that publish host ports (`0.0.0.0/0` or `127.0.0.1/32`, TCP/UDP, up to 32 ports) still recreate an instance's container when its published ports change (processes restart, disk, volumes and IP are kept); filtering changes never restart anything. Requests use the query API's `IpPermissions.N.Groups` member (`UserIdGroupPairs` is accepted too) for group sources.
- Route 53 records are rendered into CoreDNS zone files and picked up within a few seconds; `GetChange` reports `INSYNC` immediately. Public zones answer on the host's DNS port and inside VPCs, private zones only inside their associated VPCs. Each zone has a default apex NS and SOA (shown in listings, not deletable). Alias targets are load balancer DNS names (`.elb.internal`, as returned by ELBv2) and follow the balancer's address. Not supported: routing policies (weighted, latency, failover, geolocation, multivalue; `SetIdentifier` is rejected), health checks, DNSSEC, traffic policies, delegation sets, other alias targets (CloudFront, S3 websites), and `SPF`/`NAPTR`/`DS` records. Names are absolute with or without the trailing dot; a wildcard is returned as `\052`. A public zone's name server is `ns.`.
diff --git a/docs/comparison.md b/docs/comparison.md
index b6667603..a5b939dc 100644
--- a/docs/comparison.md
+++ b/docs/comparison.md
@@ -101,9 +101,8 @@ and operate. HomeCloud is one binary on one Docker host, with AWS's managed serv
RDS, ...) that OpenStack does not offer in AWS form.
**OpenStack is better** for real infrastructure: multi-node clusters, live migration, hardware-virtualized
-VMs with strong isolation, quotas and multi-tenancy at scale. HomeCloud instances are containers today
-(VM-backed instances are in progress, [#3](https://github.com/solinode/homecloud/issues/3)), and it runs on a
-single node.
+VMs with strong isolation, quotas and multi-tenancy at scale. HomeCloud instances are containers by default
+(two VM images boot real QEMU/KVM guests, without live migration), and it runs on a single node.
## The AWS free tier
@@ -123,7 +122,7 @@ ones); anything beyond that is billed.
- **One region, one account.** Cross-region features (replication, multi-Region keys' replicas) are refused.
- **Smaller service coverage** than LocalStack Pro, and a subset of operations within each service
([aws-compat.md](aws-compat.md)).
-- **Instances are containers**, sharing the host kernel, until VM-backed instances land.
+- **Instances are containers** sharing the host kernel, except the two VM images (Ubuntu 24.04, Debian 12), which run as QEMU guests.
- **Young project.** The first release was in September 2026. Expect rough edges, and please
[report them](https://github.com/solinode/homecloud/issues/new/choose).
- **Docker socket access** is root-equivalent on the host, so HomeCloud administrators are host administrators.
diff --git a/docs/install-server.md b/docs/install-server.md
index 78060b09..3854fa92 100644
--- a/docs/install-server.md
+++ b/docs/install-server.md
@@ -21,7 +21,7 @@ is enough.
9. [Use it from your laptop, the AWS CLI and Terraform](#9-use-it-from-your-laptop-the-aws-cli-and-terraform)
10. [Backups and restore](#10-backups-and-restore)
11. [Upgrades](#11-upgrades)
-12. [KVM and VM-backed instances (upcoming)](#12-kvm-and-vm-backed-instances-upcoming)
+12. [KVM and VM instances](#12-kvm-and-vm-instances)
13. [Security notes](#13-security-notes)
14. [Troubleshooting](#14-troubleshooting)
@@ -435,23 +435,21 @@ homecloud doctor
installs a specific release. Data is migrated automatically when the new version starts. After an
upgrade, the first start may need network access to rebuild the security-group helper image.
-## 12. KVM and VM-backed instances (upcoming)
-
-> **Not available yet.** Today an EC2 instance in HomeCloud is a container that shares the host kernel.
-> VM-backed instances (QEMU/KVM) are on the roadmap; nothing in the current release uses KVM, and no
-> configuration is needed for it now.
-
-When VM-backed instances arrive they will need hardware virtualization on the machine that runs Docker,
-exposed to the containers HomeCloud starts. If you are choosing hardware or a VPS today and want to keep
-that door open:
-
-- Prefer bare metal, a home server, or a VPS that offers nested virtualization. Many plain VPS plans
- do not.
-- Check the device: `ls -l /dev/kvm`. If it is missing, `sudo apt install cpu-checker && kvm-ok` tells
- you whether the CPU and firmware support it.
-- The Docker host must be able to hand `/dev/kvm` to containers. Docker Desktop and OrbStack on macOS
- and Windows run Docker in a VM and may not expose it. The exact setup will be documented when the
- feature ships.
+## 12. KVM and VM instances
+
+The VM images (`ami-ubuntu-24-04-vm`, `ami-debian-12-vm`) boot a real virtual machine under QEMU, inside a
+container on the instance's VPC network. Container images need nothing of this.
+
+- **KVM.** With `/dev/kvm` on the Docker host, guests run hardware-accelerated; without it they are
+ emulated (works, but boots take minutes). Prefer bare metal, a home server, or a VPS with nested
+ virtualization; check with `ls -l /dev/kvm` (`sudo apt install cpu-checker && kvm-ok` tells whether the
+ CPU and firmware support it). Docker Desktop and OrbStack on macOS run guests emulated.
+- **Networking.** passt gives the guest the instance's private address. Where passt cannot sandbox
+ itself, notably Ubuntu 24.04 hosts (`kernel.apparmor_restrict_unprivileged_userns=1`), guests fall back
+ to QEMU user-mode networking: NAT, no private address of their own, only the ports the security groups
+ allow are forwarded. The instance reports `vm_network: user` and the server log says why
+ ([#90](https://github.com/solinode/homecloud/issues/90)).
+- **Disk.** Cloud images (about 600 MB each) are downloaded on first use into the `hc-vm-images` volume.
## 13. Security notes
diff --git a/pages/demo/404.html b/pages/demo/404.html
index 61a9b89d..6ee26898 100644
--- a/pages/demo/404.html
+++ b/pages/demo/404.html
@@ -1 +1 @@
-404: This page could not be found. HomeCloud Console
404
This page could not be found.
\ No newline at end of file
+404: This page could not be found. HomeCloud Console
404
This page could not be found.
\ No newline at end of file
diff --git a/pages/demo/404/index.html b/pages/demo/404/index.html
index 61a9b89d..6ee26898 100644
--- a/pages/demo/404/index.html
+++ b/pages/demo/404/index.html
@@ -1 +1 @@
-404: This page could not be found. HomeCloud Console
404
This page could not be found.
\ No newline at end of file
+404: This page could not be found. HomeCloud Console
404
This page could not be found.
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js b/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js
deleted file mode 100644
index e7309faf..00000000
--- a/pages/demo/_next/static/chunks/1002-8a7bfbc5c0cdd804.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1002],{861:(e,t,r)=>{r.d(t,{b:()=>s,s:()=>i});var n=r(12115),o=r(97602),a=r(95155),i=n.forwardRef((e,t)=>(0,a.jsx)(o.sG.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));i.displayName="VisuallyHidden";var s=i},2138:(e,t,r)=>{r.d(t,{E:()=>l,F:()=>a,I:()=>L,M:()=>s,O:()=>p,R:()=>i,S:()=>J,U:()=>f,a:()=>c,b:()=>b,c:()=>S,d:()=>q,e:()=>h,f:()=>H,g:()=>V,h:()=>d,i:()=>m,j:()=>P,k:()=>U,m:()=>g,n:()=>u,o:()=>$,p:()=>x,q:()=>K,r:()=>N,s:()=>I,t:()=>X,u:()=>j});var n=r(12115),o=Object.prototype.hasOwnProperty;let a=0,i=1,s=2,l=3,d=4,c=new WeakMap,u=()=>{},f=u(),p=Object,m=e=>e===f,h=e=>"function"==typeof e,g=(e,t)=>({...e,...t}),b=e=>h(e.then),v={},y={},w="undefined",x=typeof window!=w,E=typeof document!=w,k=x&&"Deno"in window,S=(e,t)=>{let r=c.get(e);return[()=>!m(t)&&e.get(t)||v,n=>{if(!m(t)){let o=e.get(t);t in y||(y[t]=o),r[5](t,g(o,n),o||v)}},r[6],()=>!m(t)&&t in y?y[t]:!m(t)&&e.get(t)||v]},R=!0,[C,T]=x&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[u,u],O={initFocus:e=>(E&&document.addEventListener("visibilitychange",e),C("focus",e),()=>{E&&document.removeEventListener("visibilitychange",e),T("focus",e)}),initReconnect:e=>{let t=()=>{R=!0,e()},r=()=>{R=!1};return C("online",t),C("offline",r),()=>{T("online",t),T("offline",r)}}},P=!n.useId,L=!x||k,N=e=>x&&typeof window.requestAnimationFrame!=w?window.requestAnimationFrame(e):setTimeout(e,1),j=L?n.useEffect:n.useLayoutEffect,z="undefined"!=typeof navigator&&navigator.connection,A=!L&&z&&(["slow-2g","2g"].includes(z.effectiveType)||z.saveData),D=new WeakMap,M=(e,t)=>e==="[object ".concat(t,"]"),B=0,_=e=>{let t,r,n=typeof e,o=p.prototype.toString.call(e),a=M(o,"Date"),i=M(o,"RegExp"),s=M(o,"Object");if(p(e)!==e||a||i)t=a?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=D.get(e))return t;if(t=++B+"~",D.set(e,t),Array.isArray(e)){for(r=0,t="@";r{if(h(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?_(e):"",t]},W=0,V=()=>++W;async function H(){for(var e=arguments.length,t=Array(e),r=0;r{let t=y[o];return(h(l.revalidate)?l.revalidate(i().data,e):!1!==l.revalidate)&&(delete x[o],delete E[o],t&&t[0])?t[0](s).then(()=>i().data):i().data};if(t.length<3)return k();let R=a,C=!1,T=V();w[o]=[T,0];let O=!m(p),P=i(),L=P.data,N=P._c,j=m(N)?L:N;if(O&&g({data:p=h(p)?p(j,L):p,_c:j}),h(R))try{R=R(j)}catch(e){r=e,C=!0}if(R&&b(R)){let e;if(R=await R.catch(e=>{r=e,C=!0}),T!==w[o][0]){if(C)throw r;return R}C&&O&&(e=r,"function"==typeof u?u(e):!1!==u)&&(d=!0,g({data:j,_c:f}))}if(d&&!C&&(h(d)?g({data:d(R,j),error:f,_c:f}):g({data:R,error:f,_c:f})),w[o][1]=V(),Promise.resolve(k()).then(()=>{g({_c:f})}),C){if(v)throw r;return}return R}}let F=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},Y=(e,t)=>{if(!c.has(e)){let r=g(O,t),n=Object.create(null),o=H.bind(f,e),s=u,l=Object.create(null),p=(e,t)=>{let r=l[e]||[];return l[e]=r,r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},m=(t,r,n)=>{e.set(t,r);let o=l[t];if(o)for(let e of o)e(r,n)},h=t=>{let r=c.get(e),[,o,a,i]=r,s=V();for(let e in r[8]++,a)delete a[e];for(let e in i)delete i[e];for(let e in o)o[e]=[s,s];let u={};for(let t of[...e.keys()]){let r=e.get(t);e.delete(t);let n=l[t];if(n)for(let e of n)e(u,r)}let f=!t||!1!==t.revalidate;for(let e in n){let t=n[e];for(let e=0;e{if(!c.has(e)&&(c.set(e,[n,Object.create(null),Object.create(null),Object.create(null),o,m,p,h,0]),!L)){let t=r.initFocus(setTimeout.bind(f,F.bind(f,n,a))),o=r.initReconnect(setTimeout.bind(f,F.bind(f,n,i)));s=()=>{t&&t(),o&&o(),c.delete(e)}}};return b(),[e,o,b,s,h]}let r=c.get(e);return[e,r[4],f,f,r[7]]},[$,U,,,G]=Y(new Map),q=g({onLoadingSlow:u,onSuccess:u,onError:u,onErrorRetry:(e,t,r,n,o)=>{let a=r.errorRetryCount,i=o.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(m(a)||!(i>a))&&setTimeout(n,s,o)},onDiscarded:u,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:function e(t,r){var n,a;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((a=t.length)===r.length)for(;a--&&e(t[a],r[a]););return -1===a}if(!n||"object"==typeof t){for(n in a=0,t)if(o.call(t,n)&&++a&&!o.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===a}}return t!=t&&r!=r},isPaused:()=>!1,cache:$,mutate:U,unload:G,fallback:{}},{isOnline:()=>R,isVisible:()=>{let e=E&&document.visibilityState;return m(e)||"hidden"!==e}}),X=(e,t)=>{let r=g(e,t);if(t){let{use:n,fallback:o,cacheData:a}=e,{use:i,fallback:s,cacheData:l}=t;n&&i&&(r.use=n.concat(i)),o&&s&&(r.fallback=g(o,s)),a&&l&&(r.cacheData=g(a,l))}return r},K=(0,n.createContext)({}),J=e=>{let{value:t}=e,r=(0,n.useContext)(K),o=h(t),a=(0,n.useMemo)(()=>o?t(r):t,[o,r,t]),i=(0,n.useMemo)(()=>o?a:X(r,a),[o,r,a]),s=a&&a.provider,l=(0,n.useRef)(f);s&&!l.current&&(l.current=Y(s(i.cache||$),a));let d=l.current;return d&&(i.cache=d[0],i.mutate=d[1],i.unload=d[4]),j(()=>{if(d)return d[2]&&d[2](),d[3]},[]),(0,n.createElement)(K.Provider,g(e,{value:i}))}},2821:(e,t,r)=>{function n(){for(var e,t,r=0,n="",o=arguments.length;rn,A:()=>o});let o=n},3468:(e,t,r)=>{r.d(t,{A:()=>i,q:()=>a});var n=r(12115),o=r(95155);function a(e,t){let r=n.createContext(t),a=e=>{let{children:t,...a}=e,i=n.useMemo(()=>a,Object.values(a));return(0,o.jsx)(r.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(o){let a=n.useContext(r);if(a)return a;if(void 0!==t)return t;throw Error(`\`${o}\` must be used within \`${e}\``)}]}function i(e,t=[]){let r=[],a=()=>{let t=r.map(e=>n.createContext(e));return function(r){let o=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return a.scopeName=e,[function(t,a){let i=n.createContext(a),s=r.length;r=[...r,a];let l=t=>{let{scope:r,children:a,...l}=t,d=r?.[e]?.[s]||i,c=n.useMemo(()=>l,Object.values(l));return(0,o.jsx)(d.Provider,{value:c,children:a})};return l.displayName=t+"Provider",[l,function(r,o){let l=o?.[e]?.[s]||i,d=n.useContext(l);if(d)return d;if(void 0!==a)return a;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let o=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}(a,...t)]}},4129:(e,t,r)=>{r.d(t,{N:()=>o});var n=r(12115),o=globalThis?.document?n.useLayoutEffect:()=>{}},14806:(e,t,r)=>{e.exports=r(30125)},18720:(e,t,r)=>{r.d(t,{l$:()=>w,oR:()=>h});var n=r(12115),o=r(47650),a=Array(12).fill(0),i=e=>{let{visible:t,className:r}=e;return n.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":t},n.createElement("div",{className:"sonner-spinner"},a.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},s=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f=1,p=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:f++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o=e instanceof Promise?e:e(),a=void 0!==r,i,s=o.then(async e=>{if(i=["resolve",e],n.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(m(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,o="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(i=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===i[0]?t(i[1]):e(i[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||f++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},m=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,h=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||f++;return p.addToast({title:e,...t,id:r}),r},{success:p.success,info:p.info,warning:p.warning,error:p.error,custom:p.custom,message:p.message,promise:p.promise,dismiss:p.dismiss,loading:p.loading},{getHistory:()=>p.toasts,getToasts:()=>p.getActiveToasts()});function g(e){return void 0!==e.label}function b(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"undefined"==typeof document)return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var v=e=>{var t,r,o,a,f,p,m,h,v,y,w;let{invert:x,toast:E,unstyled:k,interacting:S,setHeights:R,visibleToasts:C,heights:T,index:O,toasts:P,expanded:L,removeToast:N,defaultRichColors:j,closeButton:z,style:A,cancelButtonStyle:D,actionButtonStyle:M,className:B="",descriptionClassName:_="",duration:I,position:W,gap:V,loadingIcon:H,expandByDefault:F,classNames:Y,icons:$,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:G}=e,[q,X]=n.useState(null),[K,J]=n.useState(null),[Z,Q]=n.useState(!1),[ee,et]=n.useState(!1),[er,en]=n.useState(!1),[eo,ea]=n.useState(!1),[ei,es]=n.useState(!1),[el,ed]=n.useState(0),[ec,eu]=n.useState(0),ef=n.useRef(E.duration||I||4e3),ep=n.useRef(null),em=n.useRef(null),eh=0===O,eg=O+1<=C,eb=E.type,ev=!1!==E.dismissible,ey=E.className||"",ew=E.descriptionClassName||"",ex=n.useMemo(()=>T.findIndex(e=>e.toastId===E.id)||0,[T,E.id]),eE=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:z},[E.closeButton,z]),ek=n.useMemo(()=>E.duration||I||4e3,[E.duration,I]),eS=n.useRef(0),eR=n.useRef(0),eC=n.useRef(0),eT=n.useRef(null),[eO,eP]=W.split("-"),eL=n.useMemo(()=>T.reduce((e,t,r)=>r>=ex?e:e+t.height,0),[T,ex]),eN=(()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),ej=E.invert||x,ez="loading"===eb;eR.current=n.useMemo(()=>ex*V+eL,[ex,eL]),n.useEffect(()=>{ef.current=ek},[ek]),n.useEffect(()=>{Q(!0)},[]),n.useEffect(()=>{let e=em.current;if(e){let t=e.getBoundingClientRect().height;return eu(t),R(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>R(e=>e.filter(e=>e.toastId!==E.id))}},[R,E.id]),n.useLayoutEffect(()=>{if(!Z)return;let e=em.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,eu(r),R(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[Z,E.title,E.description,R,E.id]);let eA=n.useCallback(()=>{et(!0),ed(eR.current),R(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{N(E)},200)},[E,N,R,eR]);return n.useEffect(()=>{let e;if((!E.promise||"loading"!==eb)&&E.duration!==1/0&&"loading"!==E.type)return L||S||G&&eN?(()=>{if(eC.current{var e;null==(e=E.onAutoClose)||e.call(E,E),eA()},ef.current)),()=>clearTimeout(e)},[L,S,E,eb,G,eN,eA]),n.useEffect(()=>{E.delete&&eA()},[eA,E.delete]),n.createElement("li",{tabIndex:0,ref:em,className:b(B,ey,null==Y?void 0:Y.toast,null==(t=null==E?void 0:E.classNames)?void 0:t.toast,null==Y?void 0:Y.default,null==Y?void 0:Y[eb],null==(r=null==E?void 0:E.classNames)?void 0:r[eb]),"data-sonner-toast":"","data-rich-colors":null!=(o=E.richColors)?o:j,"data-styled":!(E.jsx||E.unstyled||k),"data-mounted":Z,"data-promise":!!E.promise,"data-swiped":ei,"data-removed":ee,"data-visible":eg,"data-y-position":eO,"data-x-position":eP,"data-index":O,"data-front":eh,"data-swiping":er,"data-dismissible":ev,"data-type":eb,"data-invert":ej,"data-swipe-out":eo,"data-swipe-direction":K,"data-expanded":!!(L||F&&Z),style:{"--index":O,"--toasts-before":O,"--z-index":P.length-O,"--offset":"".concat(ee?el:eR.current,"px"),"--initial-height":F?"auto":"".concat(ec,"px"),...A,...E.style},onDragEnd:()=>{en(!1),X(null),eT.current=null},onPointerDown:e=>{ez||!ev||(ep.current=new Date,ed(eR.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(en(!0),eT.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(eo||!ev)return;eT.current=null;let o=Number((null==(e=em.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=em.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=new Date().getTime()-(null==(r=ep.current)?void 0:r.getTime()),s="x"===q?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11){ed(eR.current),null==(n=E.onDismiss)||n.call(E,E),J("x"===q?o>0?"right":"left":a>0?"down":"up"),eA(),ea(!0),es(!1);return}en(!1),X(null)},onPointerMove:t=>{var r,n,o,a;if(!eT.current||!ev||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-eT.current.y,s=t.clientX-eT.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(W);!q&&(Math.abs(s)>1||Math.abs(i)>1)&&X(Math.abs(s)>Math.abs(i)?"x":"y");let d={x:0,y:0};"y"===q?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(d.y=i):"x"===q&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(d.x=s),(Math.abs(d.x)>0||Math.abs(d.y)>0)&&es(!0),null==(o=em.current)||o.style.setProperty("--swipe-amount-x","".concat(d.x,"px")),null==(a=em.current)||a.style.setProperty("--swipe-amount-y","".concat(d.y,"px"))}},eE&&!E.jsx?n.createElement("button",{"aria-label":U,"data-disabled":ez,"data-close-button":!0,onClick:ez||!ev?()=>{}:()=>{var e;eA(),null==(e=E.onDismiss)||e.call(E,E)},className:b(null==Y?void 0:Y.closeButton,null==(a=null==E?void 0:E.classNames)?void 0:a.closeButton)},null!=(f=null==$?void 0:$.close)?f:u):null,E.jsx||(0,n.isValidElement)(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:n.createElement(n.Fragment,null,eb||E.icon||E.promise?n.createElement("div",{"data-icon":"",className:b(null==Y?void 0:Y.icon,null==(p=null==E?void 0:E.classNames)?void 0:p.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var e,t,r;return null!=$&&$.loading?n.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(e=null==E?void 0:E.classNames)?void 0:e.loader,"sonner-loader"),"data-visible":"loading"===eb},$.loading):H?n.createElement("div",{className:b(null==Y?void 0:Y.loader,null==(t=null==E?void 0:E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===eb},H):n.createElement(i,{className:b(null==Y?void 0:Y.loader,null==(r=null==E?void 0:E.classNames)?void 0:r.loader),visible:"loading"===eb})}():null,"loading"!==E.type?E.icon||(null==$?void 0:$[eb])||(e=>{switch(e){case"success":return s;case"info":return d;case"warning":return l;case"error":return c;default:return null}})(eb):null):null,n.createElement("div",{"data-content":"",className:b(null==Y?void 0:Y.content,null==(m=null==E?void 0:E.classNames)?void 0:m.content)},n.createElement("div",{"data-title":"",className:b(null==Y?void 0:Y.title,null==(h=null==E?void 0:E.classNames)?void 0:h.title)},"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:b(_,ew,null==Y?void 0:Y.description,null==(v=null==E?void 0:E.classNames)?void 0:v.description)},"function"==typeof E.description?E.description():E.description):null),(0,n.isValidElement)(E.cancel)?E.cancel:E.cancel&&g(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||D,onClick:e=>{var t,r;g(E.cancel)&&ev&&(null==(r=(t=E.cancel).onClick)||r.call(t,e),eA())},className:b(null==Y?void 0:Y.cancelButton,null==(y=null==E?void 0:E.classNames)?void 0:y.cancelButton)},E.cancel.label):null,(0,n.isValidElement)(E.action)?E.action:E.action&&g(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||M,onClick:e=>{var t,r;g(E.action)&&(null==(r=(t=E.action).onClick)||r.call(t,e),e.defaultPrevented||eA())},className:b(null==Y?void 0:Y.actionButton,null==(w=null==E?void 0:E.classNames)?void 0:w.actionButton)},E.action.label):null))};function y(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var w=(0,n.forwardRef)(function(e,t){let{invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:l,className:d,offset:c,mobileOffset:u,theme:f="light",richColors:m,duration:h,style:g,visibleToasts:b=3,toastOptions:w,dir:x=y(),gap:E=14,loadingIcon:k,icons:S,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[T,O]=n.useState([]),P=n.useMemo(()=>Array.from(new Set([a].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,a]),[L,N]=n.useState([]),[j,z]=n.useState(!1),[A,D]=n.useState(!1),[M,B]=n.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),_=n.useRef(null),I=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=n.useRef(null),V=n.useRef(!1),H=n.useCallback(e=>{O(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||p.dismiss(e.id),t.filter(t=>{let{id:r}=t;return r!==e.id})})},[]);return n.useEffect(()=>p.subscribe(e=>{if(e.dismiss)return void O(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));setTimeout(()=>{o.flushSync(()=>{O(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),n.useEffect(()=>{if("system"!==f)return void B(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",e=>{let{matches:t}=e;B(t?"dark":"light")})}catch(t){e.addListener(e=>{let{matches:t}=e;try{B(t?"dark":"light")}catch(e){console.error(e)}})}},[f]),n.useEffect(()=>{T.length<=1&&z(!1)},[T]),n.useEffect(()=>{let e=e=>{var t,r;i.every(t=>e[t]||e.code===t)&&(z(!0),null==(t=_.current)||t.focus()),"Escape"===e.code&&(document.activeElement===_.current||null!=(r=_.current)&&r.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),n.useEffect(()=>{if(_.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,V.current=!1)}},[_.current]),n.createElement("section",{ref:t,"aria-label":"".concat(R," ").concat(I),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((t,o)=>{var a;let i,[f,p]=t.split("-");return T.length?n.createElement("ol",{key:t,dir:"auto"===x?y():x,tabIndex:-1,ref:_,className:d,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":f,"data-lifted":j&&T.length>1&&!s,"data-x-position":p,style:{"--front-toast-height":"".concat((null==(a=L[0])?void 0:a.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(E,"px"),...g,...(i={},[c,u].forEach((e,t)=>{let r=1===t,n=r?"--mobile-offset":"--offset",o=r?"16px":"32px";function a(e){["top","right","bottom","left"].forEach(t=>{i["".concat(n,"-").concat(t)]="number"==typeof e?"".concat(e,"px"):e})}"number"==typeof e||"string"==typeof e?a(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?i["".concat(n,"-").concat(t)]=o:i["".concat(n,"-").concat(t)]="number"==typeof e[t]?"".concat(e[t],"px"):e[t]}):a(o)}),i)},onBlur:e=>{V.current&&!e.currentTarget.contains(e.relatedTarget)&&(V.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||V.current||(V.current=!0,W.current=e.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{A||z(!1)},onDragEnd:()=>z(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||D(!0)},onPointerUp:()=>D(!1)},T.filter(e=>!e.position&&0===o||e.position===t).map((o,a)=>{var i,d;return n.createElement(v,{key:o.id,icons:S,index:a,toast:o,defaultRichColors:m,duration:null!=(i=null==w?void 0:w.duration)?i:h,className:null==w?void 0:w.className,descriptionClassName:null==w?void 0:w.descriptionClassName,invert:r,visibleToasts:b,closeButton:null!=(d=null==w?void 0:w.closeButton)?d:l,interacting:A,position:t,style:null==w?void 0:w.style,unstyled:null==w?void 0:w.unstyled,classNames:null==w?void 0:w.classNames,cancelButtonStyle:null==w?void 0:w.cancelButtonStyle,actionButtonStyle:null==w?void 0:w.actionButtonStyle,removeToast:H,toasts:T.filter(e=>e.position==o.position),heights:L.filter(e=>e.position==o.position),setHeights:N,expandByDefault:s,gap:E,loadingIcon:k,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))})},20063:(e,t,r)=>{var n=r(47260);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},27811:(e,t,r)=>{let n;r.d(t,{S:()=>h,u:()=>g});var o=r(12115),a=r(14806),i=r(2138);let s=i.p&&window.__SWR_DEVTOOLS_USE__,l=(s?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,n)=>{let o=r&&((...e)=>{let[n]=(0,i.s)(t),[,,,o]=i.a.get(i.o);if(n.startsWith("$inf$"))return r(...e);let a=o[n];return(0,i.i)(a)?r(...e):(delete o[n],a)});return e(t,o,n)});s&&(window.__SWR_DEVTOOLS_REACT__=o);let d=o.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),c={dedupe:!0},u=(e,t,r)=>{var n;return!!t&&(null==(n=e.get(t))?void 0:n.has(r))===!0},f=(e,t,r)=>{if(!t)return;let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(r)},p=Promise.resolve(i.U);p.status="fulfilled",p.value=i.U;let m=()=>i.n,h=i.O.defineProperty(i.S,"defaultValue",{value:i.d}),g=(n=(e,t,r)=>{let{cache:n,compare:s,suspense:l,fallbackData:h,revalidateOnMount:g,revalidateIfStale:b,refreshInterval:v,refreshWhenHidden:y,refreshWhenOffline:w,keepPreviousData:x,strictServerPrefetchWarning:E}=r,[k,S,R,C]=i.a.get(n),[T,O]=(0,i.s)(e),P=(0,o.useRef)(!1),L=(0,o.useRef)(!1),N=(0,o.useRef)(T),j=(0,o.useRef)(t),z=(0,o.useRef)(r),A=()=>z.current.isVisible()&&z.current.isOnline(),[D,M,B,_]=(0,i.c)(n,T),I=(0,o.useRef)({}).current,W=(0,i.i)(h)?(0,i.i)(r.fallback)?i.U:r.fallback[T]:h,V=r.cacheData,H=T?null==V?void 0:V[T]:i.U,F=T?C[T]:i.U,Y=(0,i.i)(F)&&!(0,i.i)(H),$=Y?H:F,U=(e,t)=>{for(let r in I)if("data"===r){if(!s(e[r],t[r])&&(!(0,i.i)(e[r])||!s(eo,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},G=!P.current,q=(0,o.useMemo)(()=>{let e=D(),r=_(),n=e=>{let r=(0,i.m)(e);return(delete r._k,(()=>{if(!T||!t||z.current.isPaused())return!1;if(G&&!(0,i.i)(g))return g;let e=(0,i.i)(W)?r.data:W;return!(l&&Y&&(0,i.i)(e))&&((0,i.i)(e)||b)})())?{isValidating:!0,isLoading:!0,...r}:r},o=n(e),a=e===r?o:n(r),s=o;return[()=>{let e=n(D());return U(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>a]},[n,T]),X=(0,a.useSyncExternalStore)((0,o.useCallback)(e=>B(T,(t,r)=>{U(r,t)||e()}),[n,T]),q[0],q[1]),K=k[T]&&k[T].length>0,J=X.data,Z=(0,i.i)(J)?W&&(0,i.b)(W)?d(W):W:J,Q=X.error,ee=(0,o.useRef)(Z),et=(0,o.useRef)(i.U),er=et.current;er||(et.current=er=new WeakMap);let en=(0,o.useRef)(null),eo=x?(0,i.i)(J)?(0,i.i)(ee.current)?Z:ee.current:J:Z,ea=T&&(0,i.i)(Z),ei=(0,o.useRef)(null);i.I||(0,a.useSyncExternalStore)(m,()=>(ei.current=!1,ei),()=>(ei.current=!0,ei));let es=ei.current;E&&es&&!l&&ea&&console.warn(`Missing pre-initiated data for serialized key "${T}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let el=!(!T||!t||z.current.isPaused())&&(!K||!!(0,i.i)(Q))&&(G&&!(0,i.i)(g)?g:(!l||!Y||!ea)&&(l?!(0,i.i)(Z)&&b:(0,i.i)(Z)||b)),ed=G&&el,ec=(0,i.i)(X.isValidating)?ed:X.isValidating,eu=(0,i.i)(X.isLoading)?ed:X.isLoading,ef=(0,o.useCallback)(async e=>{let t,n,o=j.current;if(!T||!o||L.current||z.current.isPaused())return!1;let a=!0,l=e||{},d=!R[T]||!l.dedupe,c=Y&&!u(er,V,T)&&!(0,i.i)($)&&(0,i.i)(D().data),p=()=>i.j?!L.current&&T===N.current&&P.current:T===N.current,m={isValidating:!1,isLoading:!1},h=()=>{M(m)},g=()=>{let e=R[T];e&&e[1]===n&&delete R[T]},b={isValidating:!0};(0,i.i)(D().data)&&(b.isLoading=!0);try{if(d&&(M(b),r.loadingTimeout&&(0,i.i)(D().data)&&setTimeout(()=>{a&&p()&&z.current.onLoadingSlow(T,r)},r.loadingTimeout),c&&f(er,V,T),R[T]=[c?$:o(O),(0,i.g)()],c&&C[T]&&delete C[T]),[t,n]=R[T],t=await t,d&&setTimeout(g,r.dedupingInterval),!R[T]||R[T][1]!==n)return d&&p()&&z.current.onDiscarded(T),!1;m.error=i.U;let e=S[T];if(!(0,i.i)(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return h(),d&&p()&&z.current.onDiscarded(T),!1;let l=D().data;m.data=s(l,t)?l:t,d&&p()&&z.current.onSuccess(t,T,r)}catch(r){g();let e=z.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(m.error=r,d&&p()&&(e.onError(r,T,e),(!0===t||(0,i.e)(t)&&t(r))&&(!z.current.revalidateOnFocus||!z.current.revalidateOnReconnect||A())&&e.onErrorRetry(r,T,e,e=>{let t=k[T];t&&t[0]&&t[0](i.E,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,h(),!0},[T,n]),ep=(0,o.useCallback)((...e)=>(0,i.f)(n,N.current,...e),[]);if((0,i.u)(()=>{let e=en.current;e&&(en.current=null,f(er,e.cacheData,e.key),(0,i.i)(D().data)&&M({data:e.data,error:i.U,_k:e._k}),C[e.key]&&delete C[e.key])}),(0,i.u)(()=>{j.current=t,z.current=r,(0,i.i)(J)||(ee.current=J)}),(0,i.u)(()=>{if(t||!Y||(0,i.i)($)||u(er,V,T)||!(0,i.i)(D().data))return;f(er,V,T);let e=S[T];(({value:e,getCacheData:t,canCommit:r,setCache:n})=>{let o=e=>{r()&&(0,i.i)(t())&&n(e)};Promise.resolve(e).then(e=>{o({data:e,error:i.U})},e=>{o({error:e})})})({value:$,getCacheData:()=>D().data,canCommit:()=>!L.current&&T===N.current&&S[T]===e,setCache:e=>M({...e,_k:O})})}),(0,i.u)(()=>{if(!T)return;let e=ef.bind(i.U,c),t=0;z.current.revalidateOnFocus&&(t=Date.now()+z.current.focusThrottleInterval);let r=((e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}})(T,k,(r,n={})=>{if(r==i.F){let r=Date.now();z.current.revalidateOnFocus&&r>t&&A()&&(t=r+z.current.focusThrottleInterval,e())}else if(r==i.R)z.current.revalidateOnReconnect&&A()&&e();else if(r==i.M)return ef();else if(r==i.E)return ef(n);else if(r==i.h&&(ee.current=i.U,n.revalidate))return ef()});return L.current=!1,N.current=T,P.current=!0,M({_k:O}),el&&!R[T]&&((0,i.i)(Z)||i.I?e():(0,i.r)(e)),()=>{L.current=!0,r()}},[T]),(0,i.u)(()=>{let e;function t(){let t=(0,i.e)(v)?v(D().data):v;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!D().error&&(y||z.current.isVisible())&&(w||z.current.isOnline())?ef(c).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[v,y,w,T]),(0,o.useDebugValue)(eo),l){if(!i.j&&i.I&&ea&&(0,i.i)($))throw Error("Fallback data is required when using Suspense in SSR.");ea&&(j.current=t,z.current=r,L.current=!1);let e=!(0,i.i)($)&&ea,n=i.U;if(e&&Y?(Z=n=$&&(0,i.b)($)?d($):$,eo=n,i.I||(en.current={data:n,_k:O,key:T,cacheData:V})):d(e?ep($):p),!(0,i.i)(Q)&&ea)throw Q;let o=ea&&(0,i.i)(n)?ef(c):p;!(0,i.i)(eo)&&ea&&(o.status="fulfilled",o.value=!0),d(o)}return{mutate:ep,get data(){return I.data=!0,eo},get error(){return I.error=!0,Q},get isValidating(){return I.isValidating=!0,ec},get isLoading(){return I.isLoading=!0,eu}}},function(...e){let t=(()=>{let e=(0,o.useContext)(i.q);return(0,o.useMemo)(()=>(0,i.m)(i.d,e),[e])})(),[r,a,s]=(0,i.e)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],d=(0,i.t)(t,s),c=n,{use:u}=d,f=(u||[]).concat(l);for(let e=f.length;e--;)c=f[e](c);return c(r,a||d.fetcher||null,d)})},30125:(e,t,r)=>{var n=r(12115),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=n.useState,i=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=a({inst:{value:r,getSnapshot:t}}),o=n[0].inst,c=n[1];return s(function(){o.value=r,o.getSnapshot=t,d(o)&&c({inst:o})},[e,r,t]),i(function(){return d(o)&&c({inst:o}),e(function(){d(o)&&c({inst:o})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},32467:(e,t,r)=>{r.d(t,{DX:()=>i,xV:()=>l});var n=r(12115),o=r(94446),a=r(95155),i=n.forwardRef((e,t)=>{let{children:r,...o}=e,i=n.Children.toArray(r),l=i.find(d);if(l){let e=l.props.children,r=i.map(t=>t!==l?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,a.jsx)(s,{...o,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,a.jsx)(s,{...o,ref:t,children:r})});i.displayName="Slot";var s=n.forwardRef((e,t)=>{let{children:r,...a}=e;if(n.isValidElement(r)){let e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(r);return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props),ref:t?(0,o.t)(t,e):e})}return n.Children.count(r)>1?n.Children.only(null):null});s.displayName="SlotClone";var l=({children:e})=>(0,a.jsx)(a.Fragment,{children:e});function d(e){return n.isValidElement(e)&&e.type===l}},44831:(e,t,r)=>{r.d(t,{qW:()=>f});var n,o=r(12115),a=r(92556),i=r(97602),s=r(94446),l=r(70222),d=r(95155),c="dismissableLayer.update",u=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),f=o.forwardRef((e,t)=>{var r,f;let{disableOutsidePointerEvents:h=!1,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:v,onInteractOutside:y,onDismiss:w,...x}=e,E=o.useContext(u),[k,S]=o.useState(null),R=null!=(f=null==k?void 0:k.ownerDocument)?f:null==(r=globalThis)?void 0:r.document,[,C]=o.useState({}),T=(0,s.s)(t,e=>S(e)),O=Array.from(E.layers),[P]=[...E.layersWithOutsidePointerEventsDisabled].slice(-1),L=O.indexOf(P),N=k?O.indexOf(k):-1,j=E.layersWithOutsidePointerEventsDisabled.size>0,z=N>=L,A=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,l.c)(e),a=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!a.current){let t=function(){m("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",i.current),i.current=t,r.addEventListener("click",i.current,{once:!0})):t()}else r.removeEventListener("click",i.current);a.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",i.current)}},[r,n]),{onPointerDownCapture:()=>a.current=!0}}(e=>{let t=e.target,r=[...E.branches].some(e=>e.contains(t));z&&!r&&(null==b||b(e),null==y||y(e),e.defaultPrevented||null==w||w())},R),D=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,l.c)(e),a=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!a.current&&m("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{let t=e.target;![...E.branches].some(e=>e.contains(t))&&(null==v||v(e),null==y||y(e),e.defaultPrevented||null==w||w())},R);return!function(e,t=globalThis?.document){let r=(0,l.c)(e);o.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{N===E.layers.size-1&&(null==g||g(e),!e.defaultPrevented&&w&&(e.preventDefault(),w()))},R),o.useEffect(()=>{if(k)return h&&(0===E.layersWithOutsidePointerEventsDisabled.size&&(n=R.body.style.pointerEvents,R.body.style.pointerEvents="none"),E.layersWithOutsidePointerEventsDisabled.add(k)),E.layers.add(k),p(),()=>{h&&1===E.layersWithOutsidePointerEventsDisabled.size&&(R.body.style.pointerEvents=n)}},[k,R,h,E]),o.useEffect(()=>()=>{k&&(E.layers.delete(k),E.layersWithOutsidePointerEventsDisabled.delete(k),p())},[k,E]),o.useEffect(()=>{let e=()=>C({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),(0,d.jsx)(i.sG.div,{...x,ref:T,style:{pointerEvents:j?z?"auto":"none":void 0,...e.style},onFocusCapture:(0,a.m)(e.onFocusCapture,D.onFocusCapture),onBlurCapture:(0,a.m)(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:(0,a.m)(e.onPointerDownCapture,A.onPointerDownCapture)})});function p(){let e=new CustomEvent(c);document.dispatchEvent(e)}function m(e,t,r,n){let{discrete:o}=n,a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?(0,i.hO)(a,s):a.dispatchEvent(s)}f.displayName="DismissableLayer",o.forwardRef((e,t)=>{let r=o.useContext(u),n=o.useRef(null),a=(0,s.s)(t,n);return o.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,d.jsx)(i.sG.div,{...e,ref:a})}).displayName="DismissableLayerBranch"},53345:(e,t,r)=>{let n;r.d(t,{Mz:()=>eq,i3:()=>eK,UC:()=>eX,bL:()=>eG,Bk:()=>eN});var o=r(12115);let a=["top","right","bottom","left"],i=Math.min,s=Math.max,l=Math.round,d=Math.floor,c=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function f(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return"x"===e?"y":"x"}function g(e){return"y"===e?"height":"width"}function b(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function v(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let y=["left","right"],w=["right","left"],x=["top","bottom"],E=["bottom","top"];function k(e){let t=p(e);return u[t]+e.slice(t.length)}function S(e){var t,r,n,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(r=e.right)?r:0,bottom:null!=(n=e.bottom)?n:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function R(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function C(e,t,r){let n,{reference:o,floating:a}=e,i=b(t),s=h(b(t)),l=g(s),d=p(t),c=o.x+o.width/2-a.width/2,u=o.y+o.height/2-a.height/2,f=o[l]/2-a[l]/2;switch(d){case"top":n={x:c,y:o.y-a.height};break;case"bottom":n={x:c,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:u};break;case"left":n={x:o.x-a.width,y:u};break;default:n={x:o.x,y:o.y}}let v=m(t);return v&&(n[s]+=f*("end"===v?1:-1)*(r&&"y"===i?-1:1)),n}async function T(e,t){var r;void 0===t&&(t={});let{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=f(t,e),h=S(m),g=s[p?"floating"===u?"reference":"floating":u],b=R(await a.getClippingRect({element:null==(r=await (null==a.isElement?void 0:a.isElement(g)))||r?g:g.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),v="floating"===u?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),w=await (null==a.isElement?void 0:a.isElement(y))&&await (null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},x=R(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-x.top+h.top)/w.y,bottom:(x.bottom-b.bottom+h.bottom)/w.y,left:(b.left-x.left+h.left)/w.x,right:(x.right-b.right+h.right)/w.x}}let O=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=i.detectOverflow?i:{...i,detectOverflow:T},l=await (null==i.isRTL?void 0:i.isRTL(t)),d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:u}=C(d,n,l),f=n,p=0,m={};for(let r=0;re[t]>=0)}let N=new Set(["left","top"]);async function j(e,t){let{placement:r,platform:n,elements:o}=e,a=await (null==n.isRTL?void 0:n.isRTL(o.floating)),i=p(r),s=m(r),l="y"===b(r),d=N.has(i)?-1:1,c=a&&l?-1:1,u=f(t,e),{mainAxis:h,crossAxis:g,alignmentAxis:v}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof v&&(g="end"===s?-1*v:v),l?{x:g*c,y:h*d}:{x:h*d,y:g*c}}function z(){return"undefined"!=typeof window}function A(e){return B(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function M(e){var t;return null==(t=(B(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function B(e){return!!z()&&(e instanceof Node||e instanceof D(e).Node)}function _(e){return!!z()&&(e instanceof Element||e instanceof D(e).Element)}function I(e){return!!z()&&(e instanceof HTMLElement||e instanceof D(e).HTMLElement)}function W(e){return!!z()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof D(e).ShadowRoot)}function V(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function H(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let F=/transform|translate|scale|rotate|perspective|filter/,Y=/paint|layout|strict|content/,$=e=>!!e&&"none"!==e;function U(e){let t=_(e)?X(e):e;return $(t.transform)||$(t.translate)||$(t.scale)||$(t.rotate)||$(t.perspective)||!G()&&($(t.backdropFilter)||$(t.filter))||F.test(t.willChange||"")||Y.test(t.contain||"")}function G(){return null==n&&(n="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n}function q(e){return/^(html|body|#document)$/.test(A(e))}function X(e){return D(e).getComputedStyle(e)}function K(e){return _(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if("html"===A(e))return e;let t=e.assignedSlot||e.parentNode||W(e)&&e.host||M(e);return W(t)?t.host:t}function Z(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=J(t);return q(r)?(t.ownerDocument||t).body:I(r)&&V(r)?r:e(r)}(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=D(o);if(!a)return t.concat(o,Z(o,[],r));{let e=Q(i);return t.concat(i,i.visualViewport||[],V(o)?o:[],e&&r?Z(e):[])}}function Q(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ee(e){let t=X(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=I(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=l(r)!==a||l(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function et(e){return _(e)?e:e.contextElement}function er(e){let t=et(e);if(!I(t))return c(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:a}=ee(t),i=(a?l(r.width):r.width)/n,s=(a?l(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}let en=c(0);function eo(e){let t=D(e);return G()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:en}function ea(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let a=e.getBoundingClientRect(),i=et(e),s=c(1);t&&(n?_(n)&&(s=er(n)):s=er(e));let l=(void 0===(o=r)&&(o=!1),n&&o&&n===D(i))?eo(i):c(0),d=(a.left+l.x)/s.x,u=(a.top+l.y)/s.y,f=a.width/s.x,p=a.height/s.y;if(i&&n){let e=D(i),t=_(n)?D(n):n,r=e,o=Q(r);for(;o&&t!==r;){let e=er(o),t=o.getBoundingClientRect(),n=X(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;d*=e.x,u*=e.y,f*=e.x,p*=e.y,d+=a,u+=i,o=Q(r=D(o))}}return R({width:f,height:p,x:d,y:u})}function ei(e,t){let r=K(e).scrollLeft;return t?t.left+r:ea(M(e)).left+r}function es(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-ei(e,r),y:r.top+t.scrollTop}}function el(e,t,r){let n;if("viewport"===t||"layoutViewport"===t)n=function(e,t,r){void 0===r&&(r="viewport");let n="layoutViewport"===r,o=D(e),a=M(e),i=o.visualViewport,s=a.clientWidth,l=a.clientHeight,d=0,c=0;if(i){let e=!G()||"fixed"===t;n?e||(d=-i.offsetLeft,c=-i.offsetTop):(s=i.width,l=i.height,e&&(d=i.offsetLeft,c=i.offsetTop))}if(0>=ei(a)){let e=a.ownerDocument,t=e.body,r=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-n),i="stable both-edges"===getComputedStyle(a).scrollbarGutter?o/2:o;i<=25&&(s-=i)}return{width:s,height:l,x:d,y:c}}(e,r,t);else if("document"===t)n=function(e){let t=K(e),r=e.ownerDocument.body,n=s(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=s(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),a=-t.scrollLeft+ei(e),i=-t.scrollTop;return"rtl"===X(r).direction&&(a+=s(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:a,y:i}}(M(e));else if(_(t))n=function(e,t){let r=ea(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=er(e),i=e.clientWidth*a.x,s=e.clientHeight*a.y;return{width:i,height:s,x:o*a.x,y:n*a.y}}(t,r);else{let r=eo(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return R(n)}function ed(e){return"static"===X(e).position}function ec(e,t){if(!I(e)||"fixed"===X(e).position)return null;if(t)return t(e);let r=e.offsetParent;return M(e)===r&&(r=r.ownerDocument.body),r}function eu(e,t){var r;let n=D(e);if(H(e))return n;if(!I(e)){let t=J(e);for(;t&&!q(t);){if(_(t)&&!ed(t))return t;t=J(t)}return n}let o=ec(e,t);for(;o&&(r=o,/^(table|td|th)$/.test(A(r)))&&ed(o);)o=ec(o,t);return o&&q(o)&&ed(o)&&!U(o)?n:o||function(e){let t=J(e);for(;I(t)&&!q(t);){if(U(t))return t;if(H(t))break;t=J(t)}return null}(e)||n}let ef=async function(e){let t=this.getOffsetParent||eu,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=I(t),o=M(t),a="fixed"===r,i=ea(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=c(0);if((n||!a)&&(("body"!==A(t)||V(o))&&(s=K(t)),n)){let e=ea(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!n&&o&&(l.x=ei(o));let d=!o||n||a?c(0):es(o,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ep={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,a="fixed"===o,i=M(n),s=!!t&&H(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},d=c(1),u=c(0),f=I(n);if((f||!a)&&(("body"!==A(n)||V(i))&&(l=K(n)),f)){let e=ea(n);d=er(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let p=!i||f||a?c(0):es(i,l);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+p.x,y:r.y*d.y-l.scrollTop*d.y+u.y+p.y}},getDocumentElement:M,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,a=[..."clippingAncestors"===r?H(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=Z(e,[],!1).filter(e=>_(e)&&"body"!==A(e)),o=null,a="fixed"===X(e).position,i=a?J(e):e;for(;_(i)&&!q(i);){let e=X(i),t=U(i),r=o?o.position:a?"fixed":"";t||"fixed"!==r&&("absolute"!==r||"static"!==e.position)?o=e:n=n.filter(e=>e!==i),i=J(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],l=el(t,a[0],o),d=l.top,c=l.right,u=l.bottom,f=l.left;for(let e=1;e({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:a,platform:l,elements:d,middlewareData:c}=t,{element:u,padding:p=0}=f(e,t)||{};if(null==u)return{};let v=S(p),y={x:r,y:n},w=h(b(o)),x=g(w),E=await l.getDimensions(u),k="y"===w,R=k?"clientHeight":"clientWidth",C=a.reference[x]+a.reference[w]-y[w]-a.floating[x],T=y[w]-a.reference[w],O=await (null==l.getOffsetParent?void 0:l.getOffsetParent(u)),P=O?O[R]:0;P&&await (null==l.isElement?void 0:l.isElement(O))||(P=d.floating[R]||a.floating[x]);let L=P/2-E[x]/2-1,N=i(v[k?"top":"left"],L),j=i(v[k?"bottom":"right"],L),z=P-E[x]-j,A=P/2-E[x]/2+(C/2-T/2),D=s(N,i(A,z)),M=!c.arrow&&null!=m(o)&&A!==D&&a.reference[x]/2-(A{t.current=e}),t}var eE=r(97602),ek=r(95155),eS=o.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,ek.jsx)(eE.sG.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,ek.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eS.displayName="Arrow";var eR=r(94446),eC=r(3468),eT=r(70222),eO=r(4129),eP="Popper",[eL,eN]=(0,eC.A)(eP),[ej,ez]=eL(eP),eA=e=>{let{__scopePopper:t,children:r}=e,[n,a]=o.useState(null);return(0,ek.jsx)(ej,{scope:t,anchor:n,onAnchorChange:a,children:r})};eA.displayName=eP;var eD="PopperAnchor",eM=o.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...a}=e,i=ez(eD,r),s=o.useRef(null),l=(0,eR.s)(t,s);return o.useEffect(()=>{i.onAnchorChange((null==n?void 0:n.current)||s.current)}),n?null:(0,ek.jsx)(eE.sG.div,{...a,ref:l})});eM.displayName=eD;var eB="PopperContent",[e_,eI]=eL(eB),eW=o.forwardRef((e,t)=>{var r,n,a,l,c,u,S,R;let{__scopePopper:C,side:T="bottom",sideOffset:z=0,align:A="center",alignOffset:B=0,arrowPadding:_=0,avoidCollisions:I=!0,collisionBoundary:W=[],collisionPadding:V=0,sticky:H="partial",hideWhenDetached:F=!1,updatePositionStrategy:Y="optimized",onPlaced:$,...U}=e,G=ez(eB,C),[q,X]=o.useState(null),K=(0,eR.s)(t,e=>X(e)),[J,Q]=o.useState(null),ee=function(e){let[t,r]=o.useState(void 0);return(0,eO.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(J),er=null!=(S=null==ee?void 0:ee.width)?S:0,en=null!=(R=null==ee?void 0:ee.height)?R:0,eo="number"==typeof V?V:{top:0,right:0,bottom:0,left:0,...V},ei=Array.isArray(W)?W:[W],es=ei.length>0,el={padding:eo,boundary:ei.filter(eY),altBoundary:es},{refs:ed,floatingStyles:ec,placement:eu,isPositioned:ef,middlewareData:eS}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,f]=o.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=o.useState(n);ev(p,n)||m(n);let[h,g]=o.useState(null),[b,v]=o.useState(null),y=o.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),x=i||h,E=s||b,k=o.useRef(null),S=o.useRef(null),R=o.useRef(u),C=null!=d,T=ex(d),P=ex(a),L=ex(c),N=o.useCallback(()=>{if(!k.current||!S.current)return;let e={placement:t,strategy:r,middleware:p};P.current&&(e.platform=P.current),((e,t,r)=>{let n=new Map,o=null!=r?r:{},a={...ep,...o.platform,_c:n};return O(e,t,{...o,platform:a})})(k.current,S.current,e).then(e=>{let t={...e,isPositioned:!1!==L.current};j.current&&!ev(R.current,t)&&(R.current=t,eg.flushSync(()=>{f(t)}))})},[p,t,r,P,L]);eb(()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[c]);let j=o.useRef(!1);eb(()=>(j.current=!0,()=>{j.current=!1}),[]),eb(()=>{if(x&&(k.current=x),E&&(S.current=E),x&&E){if(T.current)return T.current(x,E,N);N()}},[x,E,N,T,C]);let z=o.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:w}),[y,w]),A=o.useMemo(()=>({reference:x,floating:E}),[x,E]),D=o.useMemo(()=>{let e={position:r,left:0,top:0};if(!A.floating)return e;let t=ew(A.floating,u.x),n=ew(A.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...ey(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,A.floating,u.x,u.y]);return o.useMemo(()=>({...u,update:N,refs:z,elements:A,floatingStyles:D}),[u,N,z,A,D])}({strategy:"fixed",placement:T+("center"!==A?"-"+A:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r{a&&e.addEventListener("scroll",r),l&&e.addEventListener("resize",r)});let h=p&&u?function(e,t,r){let n,o=null,a=M(e);function l(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}function c(r,u){void 0===r&&(r=!1),void 0===u&&(u=1),l();let f=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(r||t(),!h||!g)return;let b=d(m),v=d(a.clientWidth-(p+h)),y={rootMargin:-b+"px "+-v+"px "+-d(a.clientHeight-(m+g))+"px "+-d(p)+"px",threshold:s(0,i(1,u))||1},w=!0;function x(t){let r=t[0].intersectionRatio;if(!em(f,e.getBoundingClientRect()))return c();if(r!==u){if(!w)return c();r?c(!1,r):n=setTimeout(()=>{c(!1,1e-7)},1e3)}w=!1}try{o=new IntersectionObserver(x,{...y,root:a.ownerDocument})}catch(e){o=new IntersectionObserver(x,y)}o.observe(e)}let u=D(e),f=()=>c(r);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),l()}}(p,r,l):null,g=-1,b=null;c&&(b=new ResizeObserver(e=>{let[n]=e;n&&n.target===p&&b&&t&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=b)||e.observe(t)})),r()}),p&&!f&&b.observe(p),t&&b.observe(t));let v=f?ea(e):null;return f&&function t(){let n=ea(e);v&&!em(v,n)&&r(),v=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;m.forEach(e=>{a&&e.removeEventListener("scroll",r),l&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=b)||e.disconnect(),b=null,f&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===Y})},elements:{reference:G.anchor},middleware:[((e,t)=>{let r=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:o,y:a,placement:i,middlewareData:s}=t,l=await j(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({mainAxis:z+en,alignmentAxis:B}),I&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=f(e,t),p={x:r,y:n},m=await a.detectOverflow(t,u),g=b(o),v=h(g),y=p[v],w=p[g],x=(e,t)=>s(t+m["y"===e?"top":"left"],i(t,t-m["y"===e?"bottom":"right"]));l&&(y=x(v,y)),d&&(w=x(g,w));let E=c.fn({...t,[v]:y,[g]:w});return{...E,data:{x:E.x-r,y:E.y-n,enabled:{[v]:l,[g]:d}}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?((e,t)=>({fn:function(e){return void 0===e&&(e={}),{options:e,fn(t){var r,n,o,a;let{x:i,y:s,placement:l,rects:d,middlewareData:c}=t,{offset:u=0,mainAxis:m=!0,crossAxis:g=!0}=f(e,t),v={x:i,y:s},y=b(l),w=h(y),x=v[w],E=v[y],k=f(u,t),S="number"==typeof k?{mainAxis:k,crossAxis:0}:{mainAxis:null!=(r=k.mainAxis)?r:0,crossAxis:null!=(n=k.crossAxis)?n:0};if(m){let e="y"===w?"height":"width",t=d.reference[w]-d.floating[e]+S.mainAxis,r=d.reference[w]+d.reference[e]-S.mainAxis;xr&&(x=r)}if(g){let e="y"===w?"width":"height",t=N.has(p(l)),r=d.reference[y]-d.floating[e]+(t&&(null==(o=c.offset)?void 0:o[y])||0)+(t?0:S.crossAxis),n=d.reference[y]+d.reference[e]+(t?0:(null==(a=c.offset)?void 0:a[y])||0)-(t?S.crossAxis:0);En&&(E=n)}return{[w]:x,[y]:E}}}}(e).fn,options:[e,t]}))():void 0,...el}),I&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,o,a,i;let{placement:s,middlewareData:l,rects:d,initialPlacement:c,platform:u,elements:S}=t,{mainAxis:R=!0,crossAxis:C=!0,fallbackPlacements:T,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:P="none",flipAlignment:L=!0,...N}=f(e,t);if(null!=(r=l.arrow)&&r.alignmentOffset)return{};let j=p(s),z=b(c),A=p(c)===c,D=await (null==u.isRTL?void 0:u.isRTL(S.floating)),M=T||(A||!L?[k(c)]:function(e){let t=k(e);return[v(e),t,v(t)]}(c)),B="none"!==P;!T&&B&&M.push(...function(e,t,r,n){let o=m(e),a=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?w:y;return t?y:w;case"left":case"right":return t?x:E;default:return[]}}(p(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(v)))),a}(c,L,P,D));let _=[c,...M],I=await u.detectOverflow(t,N),W=[],V=(null==(n=l.flip)?void 0:n.overflows)||[];if(R&&W.push(I[j]),C){let e=function(e,t,r){void 0===r&&(r=!1);let n=m(e),o=h(b(e)),a=g(o),i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=k(i)),[i,k(i)]}(s,d,D);W.push(I[e[0]],I[e[1]])}if(V=[...V,{placement:s,overflows:W}],!W.every(e=>e<=0)){let e=((null==(o=l.flip)?void 0:o.index)||0)+1,t=_[e];if(t&&("alignment"!==C||z===b(t)||V.every(e=>b(e.placement)!==z||e.overflows[0]>0)))return{data:{index:e,overflows:V},reset:{placement:t}};let r=null==(a=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:a.placement;if(!r)switch(O){case"bestFit":{let e=null==(i=V.filter(e=>{if(B){let t=b(e.placement);return t===z||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(r=e);break}case"initialPlacement":r=c}if(s!==r)return{reset:{placement:r}}}return{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({...el}),((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let r,n,{placement:o,rects:a,platform:l,elements:d}=t,{apply:c=()=>{},...u}=f(e,t),h=await l.detectOverflow(t,u),g=p(o),v=m(o),y="y"===b(o),{width:w,height:x}=a.floating;"top"===g||"bottom"===g?(r=g,n=v===(await (null==l.isRTL?void 0:l.isRTL(d.floating))?"start":"end")?"left":"right"):(n=g,r="end"===v?"top":"bottom");let E=x-h.top-h.bottom,k=w-h.left-h.right,S=i(x-h[r],E),R=i(w-h[n],k),C=t.middlewareData.shift,T=!C,O=S,P=R;null!=C&&C.enabled.x&&(P=k),null!=C&&C.enabled.y&&(O=E),T&&!v&&(y?P=w-2*s(h.left,h.right):O=x-2*s(h.top,h.bottom)),await c({...t,availableWidth:P,availableHeight:O});let L=await l.getDimensions(d.floating);return w!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({...el,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:a,height:i}=r.reference,s=t.floating.style;s.setProperty("--radix-popper-available-width","".concat(n,"px")),s.setProperty("--radix-popper-available-height","".concat(o,"px")),s.setProperty("--radix-popper-anchor-width","".concat(a,"px")),s.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),J&&((e,t)=>{let r=(e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eh({element:r.current,padding:n}).fn(t):{}:r?eh({element:r,padding:n}).fn(t):{}}}))(e);return{name:r.name,fn:r.fn,options:[e,t]}})({element:J,padding:_}),e$({arrowWidth:er,arrowHeight:en}),F&&((e,t)=>{let r=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=f(e,t);switch(o){case"referenceHidden":{let e=P(await n.detectOverflow(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:L(e)}}}case"escaped":{let e=P(await n.detectOverflow(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:L(e)}}}default:return{}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}})({strategy:"referenceHidden",...el})]}),[eC,eP]=eU(eu),eL=(0,eT.c)($);(0,eO.N)(()=>{ef&&(null==eL||eL())},[ef,eL]);let eN=null==(r=eS.arrow)?void 0:r.x,ej=null==(n=eS.arrow)?void 0:n.y,eA=(null==(a=eS.arrow)?void 0:a.centerOffset)!==0,[eD,eM]=o.useState();return(0,eO.N)(()=>{q&&eM(window.getComputedStyle(q).zIndex)},[q]),(0,ek.jsx)("div",{ref:ed.setFloating,"data-radix-popper-content-wrapper":"",style:{...ec,transform:ef?ec.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eD,"--radix-popper-transform-origin":[null==(l=eS.transformOrigin)?void 0:l.x,null==(c=eS.transformOrigin)?void 0:c.y].join(" "),...(null==(u=eS.hide)?void 0:u.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,ek.jsx)(e_,{scope:C,placedSide:eC,onArrowChange:Q,arrowX:eN,arrowY:ej,shouldHideArrow:eA,children:(0,ek.jsx)(eE.sG.div,{"data-side":eC,"data-align":eP,...U,ref:K,style:{...U.style,animation:ef?void 0:"none"}})})})});eW.displayName=eB;var eV="PopperArrow",eH={top:"bottom",right:"left",bottom:"top",left:"right"},eF=o.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=eI(eV,r),a=eH[o.placedSide];return(0,ek.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,ek.jsx)(eS,{...n,ref:t,style:{...n.style,display:"block"}})})});function eY(e){return null!==e}eF.displayName=eV;var e$=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,a,i;let{placement:s,rects:l,middlewareData:d}=t,c=(null==(r=d.arrow)?void 0:r.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,m]=eU(s),h={start:"0%",center:"50%",end:"100%"}[m],g=(null!=(a=null==(n=d.arrow)?void 0:n.x)?a:0)+u/2,b=(null!=(i=null==(o=d.arrow)?void 0:o.y)?i:0)+f/2,v="",y="";return"bottom"===p?(v=c?h:"".concat(g,"px"),y="".concat(-f,"px")):"top"===p?(v=c?h:"".concat(g,"px"),y="".concat(l.floating.height+f,"px")):"right"===p?(v="".concat(-f,"px"),y=c?h:"".concat(b,"px")):"left"===p&&(v="".concat(l.floating.width+f,"px"),y=c?h:"".concat(b,"px")),{data:{x:v,y}}}});function eU(e){let[t,r="center"]=e.split("-");return[t,r]}var eG=eA,eq=eM,eX=eW,eK=eF},68946:(e,t,r)=>{r.d(t,{B:()=>l});var n,o=r(12115),a=r(4129),i=(n||(n=r.t(o,2)))["useId".toString()]||(()=>void 0),s=0;function l(e){let[t,r]=o.useState(i());return(0,a.N)(()=>{e||r(e=>e??String(s++))},[e]),e||(t?`radix-${t}`:"")}},70222:(e,t,r)=>{r.d(t,{c:()=>o});var n=r(12115);function o(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}},75433:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(12115),o=r(47650),a=r(97602),i=r(4129),s=r(95155),l=n.forwardRef((e,t)=>{var r,l;let{container:d,...c}=e,[u,f]=n.useState(!1);(0,i.N)(()=>f(!0),[]);let p=d||u&&(null==(l=globalThis)||null==(r=l.document)?void 0:r.body);return p?o.createPortal((0,s.jsx)(a.sG.div,{...c,ref:t}),p):null});l.displayName="Portal"},75889:(e,t,r)=>{r.d(t,{QP:()=>H});let n=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),a=o?n(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;let i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},o=/^\[(.+)\]$/,a=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:i(t,e)).classGroupId=r;return}if("function"==typeof e)return s(e)?void a(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{a(o,i(t,e),r,n)})})},i=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},s=e=>e.isThemeGetter,l=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,d=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},c=/\s+/;function u(){let e,t,r=0,n="";for(;r{let t;if("string"==typeof e)return e;let r="";for(let n=0;n{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},m=/^\[(?:([a-z-]+):)?(.+)\]$/i,h=/^\d+\/\d+$/,g=new Set(["px","full","screen"]),b=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,y=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E=e=>S(e)||g.has(e)||h.test(e),k=e=>B(e,"length",_),S=e=>!!e&&!Number.isNaN(Number(e)),R=e=>B(e,"number",S),C=e=>!!e&&Number.isInteger(Number(e)),T=e=>e.endsWith("%")&&S(e.slice(0,-1)),O=e=>m.test(e),P=e=>b.test(e),L=new Set(["length","size","percentage"]),N=e=>B(e,L,I),j=e=>B(e,"position",I),z=new Set(["image","url"]),A=e=>B(e,z,V),D=e=>B(e,"",W),M=()=>!0,B=(e,t,r)=>{let n=m.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},_=e=>v.test(e)&&!y.test(e),I=()=>!1,W=e=>w.test(e),V=e=>x.test(e);Symbol.toStringTag;let H=function(e,...t){let r,i,s,f=function(d){let c;return i=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,o=(o,a)=>{r.set(o,a),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}})((c=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{let r,i=[],s=0,l=0;for(let d=0;dl?r-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i})(c),...(e=>{let t=(e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return l(Object.entries(e.classGroups),r).forEach(([e,r])=>{a(r,n,e,t)}),n})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),n(r,t)||(e=>{if(o.test(e)){let t=o.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}})(e)},getConflictingClassGroupIds:(e,t)=>{let n=r[e]||[];return t&&i[e]?[...n,...i[e]]:n}}})(c)}).cache.get,s=r.cache.set,f=p,p(d)};function p(e){let t=i(e);if(t)return t;let n=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(c),s="";for(let e=i.length-1;e>=0;e-=1){let t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:f}=r(t),p=!!f,m=n(p?u.substring(0,f):u);if(!m){if(!p||!(m=n(u))){s=t+(s.length>0?" "+s:s);continue}p=!1}let h=d(l).join(":"),g=c?h+"!":h,b=g+m;if(a.includes(b))continue;a.push(b);let v=o(m,p);for(let e=0;e0?" "+s:s)}return s})(e,r);return s(e,n),n}return function(){return f(u.apply(null,arguments))}}(()=>{let e=p("colors"),t=p("spacing"),r=p("blur"),n=p("brightness"),o=p("borderColor"),a=p("borderRadius"),i=p("borderSpacing"),s=p("borderWidth"),l=p("contrast"),d=p("grayscale"),c=p("hueRotate"),u=p("invert"),f=p("gap"),m=p("gradientColorStops"),h=p("gradientColorStopPositions"),g=p("inset"),b=p("margin"),v=p("opacity"),y=p("padding"),w=p("saturate"),x=p("scale"),L=p("sepia"),z=p("skew"),B=p("space"),_=p("translate"),I=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",O,t],H=()=>[O,t],F=()=>["",E,k],Y=()=>["auto",S,O],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",O],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[S,O];return{cacheSize:500,separator:":",theme:{colors:[M],spacing:[E,k],blur:["none","",P,O],brightness:J(),borderColor:[e],borderRadius:["none","","full",P,O],borderSpacing:H(),borderWidth:F(),contrast:J(),grayscale:X(),hueRotate:J(),invert:X(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[T,k],inset:V(),margin:V(),opacity:J(),padding:H(),saturate:J(),scale:J(),sepia:X(),skew:J(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[P]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),O]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",C,O]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",C,O]}],"grid-cols":[{"grid-cols":[M]}],"col-start-end":[{col:["auto",{span:["full",C,O]},O]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[M]}],"row-start-end":[{row:["auto",{span:[C,O]},O]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,t]}],"min-w":[{"min-w":[O,t,"min","max","fit"]}],"max-w":[{"max-w":[O,t,"none","full","min","max","fit","prose",{screen:[P]},P]}],h:[{h:[O,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,t,"auto","min","max","fit"]}],"font-size":[{text:["base",P,k]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",R]}],"font-family":[{font:[M]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",O]}],"line-clamp":[{"line-clamp":["none",S,R]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",E,k]}],"underline-offset":[{"underline-offset":["auto",E,O]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),j]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[E,O]}],"outline-w":[{outline:[E,k]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[E,k]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",P,D]}],"shadow-color":[{shadow:[M]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",P,O]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",O]}],duration:[{duration:J()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:J()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[C,O]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[E,k,R]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})},92556:(e,t,r)=>{r.d(t,{m:()=>n});function n(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}},94446:(e,t,r)=>{r.d(t,{s:()=>i,t:()=>a});var n=r(12115);function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){return t=>{let r=!1,n=e.map(e=>{let n=o(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t{r.d(t,{hO:()=>l,sG:()=>s});var n=r(12115),o=r(47650),a=r(32467),i=r(95155),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...o}=e,s=n?a.DX:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(s,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js b/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js
deleted file mode 100644
index 729f0c32..00000000
--- a/pages/demo/_next/static/chunks/1095-ae659394aacc73ae.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1095],{17705:(e,t,n)=>{n.d(t,{z:()=>c});var r=n(95155),a=n(52619),o=n.n(a),s=n(27937),i=n(25016);function l(e){let{items:t,className:n}=e;return(0,r.jsx)("nav",{"aria-label":"Breadcrumb",className:(0,i.cn)("text-muted-foreground flex min-w-0 flex-wrap items-center gap-1 text-sm",n),children:t.map((e,n)=>(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[n>0&&(0,r.jsx)(s.A,{className:"size-3.5 shrink-0 opacity-60"}),e.href&&n0&&(0,r.jsx)(l,{items:a}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("h1",{className:"truncate text-xl font-semibold tracking-tight sm:text-2xl",children:t}),s]}),n&&(0,r.jsx)("p",{className:"text-muted-foreground mt-1 max-w-3xl text-sm",children:n})]}),o&&(0,r.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:o})]})]})}},25016:(e,t,n)=>{n.d(t,{cn:()=>o});var r=n(2821),a=n(75889);function o(){for(var e=arguments.length,t=Array(e),n=0;n{var r;n.d(t,{Em:()=>E,FH:()=>P,GC:()=>y,Ht:()=>h,Ms:()=>i,Se:()=>j,Zq:()=>b,_W:()=>p,aJ:()=>N,gJ:()=>d,hD:()=>u,iD:()=>A,jj:()=>l,o2:()=>s,ri:()=>D,sk:()=>S,tE:()=>a,y0:()=>x,yq:()=>k});let a=(null!=(r=n(95704).env.NEXT_PUBLIC_API_URL)?r:"").replace(/\/+$/,""),o="homecloud.session",s="/demo",i=!0,l="#demo-unavailable",c={token:"demo-token",expires:"2099-01-01T00:00:00Z",account_id:"123456789012",user:{name:"demo-admin",id:"AIDADEMOADMIN000000",arn:"arn:aws:iam::123456789012:user/demo-admin",root:!1,console_access:!0}};class u extends Error{constructor(e,t,n){super(n),this.name="ApiError",this.status=e,this.code=t}}function d(e){return e instanceof u?e.message||e.code:e instanceof Error?e.message:String(e)}let f=new Set;function h(){if(i)return c;try{let e=window.localStorage.getItem(o);if(!e)return null;let t=JSON.parse(e);if(!t.token||t.expires&&new Date(t.expires).getTime()t(e))}function p(e){return f.add(e),()=>f.delete(e)}function g(){var e,t;return null!=(t=null==(e=h())?void 0:e.token)?t:null}let v=!1;function w(){if(m(null),v||window.location.pathname.startsWith("/login"))return;v=!0;let e=window.location.pathname+window.location.search;window.location.href="/login/?next=".concat(encodeURIComponent(e))}function b(e){if(!e)return"";let t=new URLSearchParams;for(let[n,r]of Object.entries(e))null!=r&&""!==r&&t.set(n,String(r));let n=t.toString();return n?"?".concat(n):""}function x(e,t){return"".concat(a).concat(e).concat(b(t))}function y(e,t){var n;return i?l:x(e,{...t,access_token:null!=(n=g())?n:""})}function k(e,t){if(i)throw new u(501,"NotAvailableInDemo","Live connections are not available in the demo.");let n=a||window.location.origin,r=new URL(y(e,t),n);return r.protocol="https:"===r.protocol?"wss:":"ws:",r.toString()}let N=e=>encodeURIComponent(e);function S(){return n.e(4274).then(n.bind(n,54274))}async function T(e,t,n){var r;let a,o=await S(),s=n.body;if(n.body instanceof Blob)s=a=n.body.size<=524288?await n.body.text():void 0;else if("string"==typeof n.body){a=n.body;try{s=JSON.parse(n.body)}catch(e){s=n.body}}let i={};for(let[e,t]of Object.entries(null!=(r=n.query)?r:{}))null!=t&&""!==t&&(i[e]=String(t));try{return await o.demoRequest({method:e,path:t,query:i,body:s,raw:a,headers:n.headers})}catch(e){if(e instanceof o.DemoError)throw new u(e.status,e.code,e.message);throw e}}async function E(e,t){let n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i)return T(e,t,o);let s={Accept:"application/json",...o.headers},l=g();l&&(s.Authorization="Bearer ".concat(l)),void 0!==o.body&&(o.body instanceof Blob||o.body instanceof FormData||"string"==typeof o.body?r=o.body:(s["Content-Type"]="application/json",r=JSON.stringify(o.body)));try{a=await fetch(x(t,o.query),{method:e,headers:s,body:r,signal:o.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw e;throw new u(0,"NetworkError","Cannot reach the HomeCloud API. Is the server running?")}let c=await a.text();if(c)try{n=JSON.parse(c)}catch(e){n=c}if(!a.ok){var d,f;let e=null==n?void 0:n.error,t=new u(a.status,null!=(d=null==e?void 0:e.code)?d:"HTTP".concat(a.status),null!=(f=null==e?void 0:e.message)?f:"string"==typeof n&&n?n:a.statusText);throw 401!==a.status||o.noAuthRedirect||w(),t}return n}let P={get:(e,t,n)=>E("GET",e,{query:t,signal:n}),post:(e,t,n)=>E("POST",e,{body:t,query:n}),put:(e,t,n)=>E("PUT",e,{body:t,query:n}),patch:(e,t,n)=>E("PATCH",e,{body:t,query:n}),del:(e,t)=>E("DELETE",e,{query:t})};function j(e,t,n,r,a){if(i)return{promise:(async()=>{if(n.size>262144)throw new u(501,"NotAvailableInDemo","Uploads larger than 256 KB are not available in the demo.");return await new Promise(e=>setTimeout(e,300)),null==r||r(n.size,n.size),T("PUT",e,{query:t,body:n,headers:{"Content-Type":a||n.type||"application/octet-stream"}})})(),abort:()=>{}};let o=new XMLHttpRequest;return{promise:new Promise((s,i)=>{o.open("PUT",x(e,t));let l=g();l&&o.setRequestHeader("Authorization","Bearer ".concat(l)),o.setRequestHeader("Content-Type",a||n.type||"application/octet-stream"),o.upload.onprogress=e=>{e.lengthComputable&&(null==r||r(e.loaded,e.total))},o.onload=()=>{var e,t;let n;try{n=o.responseText?JSON.parse(o.responseText):void 0}catch(e){n=o.responseText}if(o.status>=200&&o.status<300)return void s(n);let r=null==n?void 0:n.error;401===o.status&&w(),i(new u(o.status,null!=(e=null==r?void 0:r.code)?e:"HTTP".concat(o.status),null!=(t=null==r?void 0:r.message)?t:o.statusText))},o.onerror=()=>i(new u(0,"NetworkError","Upload failed: cannot reach the HomeCloud API")),o.onabort=()=>i(new u(0,"Aborted","Upload cancelled")),o.send(n)}),abort:()=>o.abort()}}async function A(e,t){if(i)return c;let n=await E("POST","/api/v1/auth/login",{body:{username:e,password:t},noAuthRedirect:!0});return m(n),n}async function D(){if(!i){try{await E("POST","/api/v1/auth/logout",{noAuthRedirect:!0})}catch(e){}m(null)}}},73697:(e,t,n)=>{n.d(t,{DB:()=>f,Yi:()=>d,bN:()=>p,cB:()=>g,gf:()=>u,pE:()=>m,y3:()=>h});var r=n(12115),a=n(27811),o=n(2138),s=n(20063),i=n(18720),l=n(37621);let c=e=>(0,l.Em)("GET",e);function u(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e?e+(0,l.Zq)(r.query):null,s={refreshInterval:r.refreshInterval,keepPreviousData:null==(t=r.keepPreviousData)||t,revalidateOnFocus:null==(n=r.revalidateOnFocus)||n};return(0,a.u)(o,c,s)}function d(e){return(0,o.k)(t=>"string"==typeof t&&t.startsWith(e))}let f={fetcher:c,dedupingInterval:1500,errorRetryCount:2,shouldRetryOnError:e=>!(e instanceof l.hD)||0===e.status||e.status>=500};function h(){let[e,t]=(0,r.useState)(!1);return{pending:e,run:(0,r.useCallback)(async(e,n)=>{t(!0);try{let t=await e();return n&&i.oR.success("function"==typeof n?n(t):n),t}catch(e){i.oR.error((0,l.gJ)(e));return}finally{t(!1)}},[])}}function m(e){var t;return null!=(t=(0,s.useSearchParams)().get(e))?t:""}function p(){let e=(0,s.useRouter)(),t=(0,s.usePathname)(),n=(0,s.useSearchParams)();return(0,r.useCallback)((r,a)=>{let o=new URLSearchParams(n.toString());null===a||""===a?o.delete(r):o.set(r,a);let s=o.toString();e.replace("".concat(t).concat(s?"?".concat(s):""),{scroll:!1})},[e,t,n])}function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,[t,n]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}},97003:(e,t,n)=>{n.d(t,{$:()=>l});var r=n(95155);n(12115);var a=n(32467),o=n(83101),s=n(25016);let i=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:o,asChild:l=!1,...c}=e,u=l?a.DX:"button";return(0,r.jsx)(u,{"data-slot":"button",className:(0,s.cn)(i({variant:n,size:o,className:t})),...c})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js b/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js
new file mode 100644
index 00000000..9866a67a
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1113-4fa3c21659063672.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1113],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},15410:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42730:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),d=r(79225),c=r(96886),p=r(12377),s=r(26276),u="Switch",[y,f]=(0,i.A)(u),[h,k]=y(u),b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:d,defaultChecked:c,required:u,disabled:y,value:f="on",onCheckedChange:k,form:b,...m}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),M=l.useRef(!1),S=!v||b||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,d=i?e:n,c=(0,o.c)(r);return[d,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else a(t)},[i,e,a,c])]}({prop:d,defaultProp:c,onChange:k});return(0,s.jsxs)(h,{scope:r,checked:E,disabled:y,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":g(E),"data-disabled":y?"":void 0,disabled:y,value:f,...m,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(A,{control:v,bubbles:!M.current,name:i,value:f,checked:E,required:u,disabled:y,form:b,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var m="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(m,r);return(0,s.jsx)(p.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=m;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,d.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,c.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var x=b,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},78341:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},79092:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let r=!1,l=e.map(e=>{let l=d(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function y(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,d=[];A(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(m(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof M&&(t=M(t._payload)),i=h(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=l.cloneElement(i,void 0,d):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let c=i?b(i):void 0,s=p(r,c);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:c),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(y,"createSlot");var f=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=f,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function m(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}u(k,"mergeProps"),u(b,"getElementRef"),u(m,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(g,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=y(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js b/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js
deleted file mode 100644
index 141e65ec..00000000
--- a/pages/demo/_next/static/chunks/1183-0fabc0cb94ae6718.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1183],{17982:(e,t,s)=>{s.d(t,{C:()=>o,z:()=>i});var n=s(95155),a=s(12115),r=s(53789),l=s(99051),c=s(25016);let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.bL,{className:(0,c.cn)("grid gap-2",s),...a,ref:t})});i.displayName=r.bL.displayName;let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.q7,{ref:t,className:(0,c.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...a,children:(0,n.jsx)(r.C1,{className:"flex items-center justify-center",children:(0,n.jsx)(l.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});o.displayName=r.q7.displayName},41183:(e,t,s)=>{s.d(t,{CN:()=>C,DD:()=>V,Fd:()=>Q,GL:()=>I,GX:()=>P,L0:()=>v,MQ:()=>B,Oe:()=>J,Pg:()=>q,Q5:()=>K,U3:()=>X,V5:()=>H,Wr:()=>A,ZA:()=>_,bQ:()=>T,bY:()=>G,cR:()=>R,d_:()=>ee,dc:()=>$,eA:()=>S,hK:()=>et,iJ:()=>Z,jR:()=>Y,jV:()=>w,mP:()=>y,mR:()=>U,nF:()=>z,ps:()=>k,tE:()=>M,xx:()=>W,zT:()=>D});var n=s(95155),a=s(12115),r=s(27811),l=s(86651),c=s(70532),i=s(57828),o=s(89559),d=s(97003),u=s(84916),m=s(33789),x=s(90235),p=s(17982),f=s(68122),g=s(99116),h=s(73864),b=s(37621),j=s(25016);let y="/api/v1/iam",N=/^[\w+=,.@-]{1,64}$/,v=e=>"/iam/user/?name=".concat(encodeURIComponent(e)),w=e=>"/iam/group/?name=".concat(encodeURIComponent(e)),A=e=>"/iam/policy/?name=".concat(encodeURIComponent(e)),C=e=>"/iam/instance-profile/?name=".concat(encodeURIComponent(e)),k="text-primary font-medium hover:underline";function S(e,t){return t?N.test(t)?null:"Use 1-64 letters, digits or + = , . @ _ - characters.":"Enter a ".concat(e," name.")}function R(){return"".concat(window.location.origin,"/login/")}function L(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=["ABCDEFGHJKLMNPQRSTUVWXYZ","abcdefghijkmnopqrstuvwxyz","23456789","!@#$%^&*-_=+"],s=t.join(""),n=e=>{let t=new Uint32Array(1);return crypto.getRandomValues(t),t[0]%e},a=t.map(e=>e[n(e.length)]);for(;a.length0;e--){let t=n(e+1);[a[e],a[t]]=[a[t],a[e]]}return a.join("")}let E=e=>/[",\n]/.test(e)?'"'.concat(e.replace(/"/g,'""'),'"'):e;function D(e){return e.map(E).join(",")}function U(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"text/csv",n=URL.createObjectURL(new Blob([t],{type:s})),a=document.createElement("a");a.href=n,a.download=e,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}let I={Version:"2012-10-17",Statement:[{Effect:"Allow",Action:["s3:GetObject"],Resource:["*"]}]},z=e=>JSON.stringify(e,null,2),O=e=>"string"==typeof e&&e.length>0||Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e&&e.length>0);function P(e){let t=null==e?void 0:e.Statement;return null==t?[]:Array.isArray(t)?t:[t]}let _=e=>P(e).length;function M(e){if(!e||"object"!=typeof e||Array.isArray(e))return"The policy must be a JSON object";if(void 0!==e.Version&&"2012-10-17"!==e.Version&&"2008-10-17"!==e.Version)return'Version must be "2012-10-17" or "2008-10-17"';let t=e.Statement;if(null==t)return"Statement is required";let s=Array.isArray(t)?t:[t];if(0===s.length)return"Statement must not be empty";for(let e=0;e"*"!==e&&!e.includes(":"));if(a)return"Statement[".concat(e,"].").concat(n,' "').concat(a,'" must be :');if(void 0!==t.Resource&&void 0!==t.NotResource)return"Statement[".concat(e,"] cannot have both Resource and NotResource");if(void 0===t.Resource&&void 0===t.NotResource)return"Statement[".concat(e,"] needs a Resource or NotResource");let r=void 0!==t.Resource?"Resource":"NotResource";if(!O(t[r]))return"Statement[".concat(e,"].").concat(r," must be a string or a non-empty array of strings");if(void 0!==t.Principal)return"Statement[".concat(e,"]: Principal is only allowed in role trust policies");if(void 0!==t.Condition&&(!t.Condition||"object"!=typeof t.Condition||Array.isArray(t.Condition)))return"Statement[".concat(e,"].Condition must be an object of {operator: {key: value}}")}return null}let V=e=>null==e?[]:Array.isArray(e)?e:[e];function F(e){let t=[];if(!e||"object"!=typeof e)return t;for(let[s,n]of Object.entries(e))if(n&&"object"==typeof n)for(let[e,a]of Object.entries(n))t.push({op:s,key:e,values:(Array.isArray(a)?a:[a]).map(e=>String(e))});return t}function G(e){let{doc:t}=e,s=P(t).filter(e=>e&&"object"==typeof e);if(!s.length)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:"This policy has no statements."});let a=s.some(e=>F(e.Condition).length>0);return(0,n.jsx)("div",{className:"overflow-x-auto rounded-md border",children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"bg-muted/40 text-muted-foreground border-b text-left text-xs",children:[(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Effect"}),(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Actions"}),(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Resources"}),a&&(0,n.jsx)("th",{className:"px-3 py-2 font-semibold",children:"Conditions"})]})}),(0,n.jsx)("tbody",{children:s.map((e,t)=>{let s=void 0===e.Action&&void 0!==e.NotAction,r=void 0===e.Resource&&void 0!==e.NotResource,l=F(e.Condition);return(0,n.jsxs)("tr",{className:"border-b align-top last:border-0",children:[(0,n.jsxs)("td",{className:"px-3 py-2",children:[(0,n.jsx)(h.Wh,{status:"Allow"===e.Effect?"allowed":"explicitDeny",label:e.Effect}),e.Sid&&(0,n.jsx)("div",{className:"text-muted-foreground mt-1 text-xs",children:e.Sid})]}),(0,n.jsxs)("td",{className:"px-3 py-2",children:[s&&(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-amber-700 dark:text-amber-300",children:"All actions except (NotAction)"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:V(s?e.NotAction:e.Action).map(e=>(0,n.jsx)("code",{className:"bg-muted rounded px-1.5 py-0.5 text-xs",children:"*"===e?"* (all actions)":e},e))})]}),(0,n.jsxs)("td",{className:"px-3 py-2",children:[r&&(0,n.jsx)("div",{className:"mb-1 text-xs font-medium text-amber-700 dark:text-amber-300",children:"All resources except (NotResource)"}),(0,n.jsx)("div",{className:"flex flex-col gap-0.5",children:V(r?e.NotResource:e.Resource).map(e=>(0,n.jsx)("span",{className:"font-mono text-xs break-all",children:"*"===e?"* (all resources)":e},e))})]}),a&&(0,n.jsx)("td",{className:"px-3 py-2",children:l.length?(0,n.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>(0,n.jsxs)("span",{className:"font-mono text-xs break-all",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:e.op})," ",e.key,": ",e.values.join(", ")]},"".concat(e.op,":").concat(e.key)))}):(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"None"})})]},t)})})]})})}let T=e=>e?"AWS managed":"Customer managed",W=e=>e.slice(e.lastIndexOf("/")+1);function B(e){let{managed:t}=e;return t?(0,n.jsx)(h.Wh,{status:"managed",tone:"info",label:"AWS managed"}):(0,n.jsx)(h.Wh,{status:"customer",tone:"neutral",label:"Customer managed"})}let J=[{service:"s3",actions:["s3:ListAllMyBuckets","s3:ListBucket","s3:GetObject","s3:PutObject","s3:DeleteObject","s3:CreateBucket","s3:DeleteBucket"]},{service:"ec2",actions:["ec2:DescribeInstances","ec2:RunInstances","ec2:StartInstances","ec2:StopInstances","ec2:TerminateInstances","ec2:DescribeVpcs"]},{service:"iam",actions:["iam:ListUsers","iam:GetUser","iam:CreateUser","iam:DeleteUser","iam:AttachUserPolicy","iam:CreateAccessKey","iam:ListPolicies"]},{service:"secretsmanager",actions:["secretsmanager:ListSecrets","secretsmanager:GetSecretValue","secretsmanager:CreateSecret","secretsmanager:DeleteSecret"]},{service:"cloudwatch",actions:["cloudwatch:ListMetrics","cloudwatch:GetMetricStatistics","cloudwatch:PutMetricAlarm","logs:DescribeLogGroups","logs:FilterLogEvents"]},{service:"other",actions:["cloudtrail:LookupEvents","lambda:InvokeFunction","dynamodb:GetItem","sqs:SendMessage","sns:Publish","rds:DescribeDBInstances"]}];function $(e){let{policies:t,loading:s,selected:r,onChange:c,exclude:i=[],maxHeight:o="max-h-72"}=e,[d,x]=(0,a.useState)(""),[p,g]=(0,a.useState)("all"),h=(0,a.useMemo)(()=>{let e=d.trim().toLowerCase();return(null!=t?t:[]).filter(e=>!i.includes(e.name)).filter(e=>"all"===p||("managed"===p?e.managed:!e.managed)).filter(t=>!e||t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)).sort((e,t)=>e.name.localeCompare(t.name))},[t,d,p,i]);return(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("div",{className:"relative min-w-48 flex-1",children:[(0,n.jsx)(l.A,{className:"text-muted-foreground absolute top-1/2 left-2.5 size-4 -translate-y-1/2"}),(0,n.jsx)(m.p,{value:d,onChange:e=>x(e.target.value),placeholder:"Filter policies by name or description",className:"h-8 pl-8"})]}),(0,n.jsx)("div",{className:"flex rounded-md border p-0.5 text-xs",children:[["all","All types"],["managed","AWS managed"],["local","Customer managed"]].map(e=>{let[t,s]=e;return(0,n.jsx)("button",{type:"button",onClick:()=>g(t),className:(0,j.cn)("rounded px-2 py-1",p===t?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"),children:s},t)})})]}),(0,n.jsx)("div",{className:(0,j.cn)("overflow-y-auto rounded-md border",o),children:s?(0,n.jsx)("div",{className:"flex flex-col gap-2 p-3",children:Array.from({length:4},(e,t)=>(0,n.jsx)(f.E,{className:"h-8 w-full"},t))}):h.length?h.map(e=>{let t=r.includes(e.name);return(0,n.jsxs)("label",{className:(0,j.cn)("hover:bg-accent/50 flex cursor-pointer items-start gap-3 border-b px-3 py-2 last:border-0",t&&"bg-primary/5"),children:[(0,n.jsx)(u.S,{checked:t,onCheckedChange:t=>{let s;return s=e.name,c(!0===t?[...r,s]:r.filter(e=>e!==s))},className:"mt-0.5"}),(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,n.jsxs)("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[e.name," ",(0,n.jsx)(B,{managed:e.managed})]}),e.description&&(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]})]},e.name)}):(0,n.jsx)("p",{className:"text-muted-foreground p-6 text-center text-sm",children:"No policies match."})}),(0,n.jsxs)("p",{className:"text-muted-foreground text-xs",children:[r.length," selected"]})]})}function q(e){let{items:t,selected:s,onChange:a,empty:r,loading:l}=e;return l?(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(f.E,{className:"h-8 w-full"}),(0,n.jsx)(f.E,{className:"h-8 w-full"})]}):t.length?(0,n.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:t.map(e=>{let t=s.includes(e.id);return(0,n.jsxs)("label",{className:(0,j.cn)("hover:bg-accent/50 flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0",t&&"bg-primary/5"),children:[(0,n.jsx)(u.S,{checked:t,onCheckedChange:t=>a(!0===t?[...s,e.id]:s.filter(t=>t!==e.id))}),(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-2 text-sm",children:[(0,n.jsx)("span",{className:"font-medium",children:e.label}),e.sub&&(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:e.sub})]})]},e.id)})}):(0,n.jsx)("p",{className:"text-muted-foreground rounded-md border border-dashed p-4 text-center text-sm",children:r})}let H=()=>({mode:"auto",custom:"",generated:L()}),Q=e=>"auto"===e.mode?e.generated:e.custom,K=e=>"custom"===e.mode&&e.custom.length<8?"The password must be at least 8 characters.":null;function Y(e){let{value:t,onChange:s,showErrors:r}=e,[l,u]=(0,a.useState)(!1),f=K(t);return(0,n.jsxs)(p.z,{value:t.mode,onValueChange:e=>s({...t,mode:e}),className:"gap-3",children:[(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(p.C,{value:"auto",id:"pw-auto",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,n.jsx)(x.J,{htmlFor:"pw-auto",children:"Autogenerated password"}),(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"You can view the password after you create the user."}),"auto"===t.mode&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"bg-muted rounded px-2 py-1 text-xs",children:l?t.generated:"•".repeat(t.generated.length)}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-7",onClick:()=>u(!l),"aria-label":l?"Hide password":"Show password",children:l?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-7",onClick:()=>s({...t,generated:L()}),"aria-label":"Regenerate",children:(0,n.jsx)(o.A,{})})]})]})]}),(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)(p.C,{value:"custom",id:"pw-custom",className:"mt-0.5"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,n.jsx)(x.J,{htmlFor:"pw-custom",children:"Custom password"}),"custom"===t.mode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"relative max-w-sm",children:[(0,n.jsx)(m.p,{type:l?"text":"password",autoComplete:"new-password",value:t.custom,onChange:e=>s({...t,custom:e.target.value}),placeholder:"At least 8 characters","aria-invalid":r&&!!f,className:"pr-9"}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-0.5 right-0.5 size-8",onClick:()=>u(!l),"aria-label":l?"Hide password":"Show password",children:l?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})})]}),r&&f?(0,n.jsx)("span",{className:"text-destructive text-xs",children:f}):(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"Must be at least 8 characters."})]})]})]})]})}function Z(e){let{value:t,label:s}=e,[r,l]=(0,a.useState)(!1);return(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,n.jsx)("code",{className:"bg-muted min-w-0 flex-1 rounded px-2 py-1 font-mono text-[13px] break-all",children:r?t:"•".repeat(Math.min(t.length,24))}),(0,n.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",className:"size-8 shrink-0",onClick:()=>l(!r),"aria-label":r?"Hide ".concat(s):"Show ".concat(s),children:r?(0,n.jsx)(c.A,{}):(0,n.jsx)(i.A,{})}),(0,n.jsx)(g.i8,{value:t,toastMessage:"".concat(s," copied")})]})}function X(e){let t=e?"".concat(y,"/users?access-keys=").concat([...e].sort().join(",")):null;return(0,r.u)(t,async()=>Object.fromEntries(await Promise.all((null!=e?e:[]).map(async e=>{try{return[e,await b.FH.get("".concat(y,"/users/").concat((0,b.aJ)(e),"/access-keys"))]}catch(t){return[e,[]]}}))),{keepPreviousData:!0})}let ee=864e5;function et(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return Math.floor((s-new Date(null!=(t=e.last_used)?t:e.created_at).getTime())/ee)}},73864:(e,t,s)=>{s.d(t,{Rh:()=>g,Wh:()=>b});var n=s(95155),a=s(35299),r=s(61362),l=s(78874),c=s(52056),i=s(99051),o=s(32978),d=s(36835),u=s(25016);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},x={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},p=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),f={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function g(e){let t=f[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let s=e.toLowerCase().replace(/[_]+/g," ").trim();return s.charAt(0).toUpperCase()+s.slice(1)}function h(e){let{tone:t,spinning:s}=e,m="size-3.5 shrink-0";if(s)return(0,n.jsx)(a.A,{className:(0,u.cn)(m,"animate-spin")});switch(t){case"success":return(0,n.jsx)(r.A,{className:m});case"danger":return(0,n.jsx)(l.A,{className:m});case"warning":return(0,n.jsx)(c.A,{className:m});case"info":return(0,n.jsx)(i.A,{className:(0,u.cn)(m,"fill-current")});default:return"neutral"===t?(0,n.jsx)(o.A,{className:m}):(0,n.jsx)(d.A,{className:m})}}function b(e){var t;let{status:s,label:a,tone:r,className:l}=e,c=null!=r?r:null!=(t=x[s.toLowerCase()])?t:"neutral",i=null!=a?a:g(s);return(0,n.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[c],l),children:[(0,n.jsx)(h,{tone:c,spinning:p.has(s.toLowerCase())}),(0,n.jsx)("span",{children:i})]})}},90235:(e,t,s)=>{s.d(t,{J:()=>o});var n=s(95155),a=s(12115),r=s(43991),l=s(83101),c=s(25016);let i=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(r.b,{ref:t,className:(0,c.cn)(i(),s),...a})});o.displayName=r.b.displayName},99116:(e,t,s)=>{s.d(t,{Dk:()=>u,i8:()=>m,xh:()=>x});var n=s(95155),a=s(12115),r=s(5917),l=s(75426),c=s(18720),i=s(97003),o=s(82180),d=s(25016);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(n){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}}function m(e){let{value:t,label:s,className:m,size:x="icon",toastMessage:p}=e,[f,g]=(0,a.useState)(!1),h=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(g(!0),p&&c.oR.success(p),setTimeout(()=>g(!1),1500)):c.oR.error("Could not copy to the clipboard")},b=f?r.A:l.A;return"sm"===x?(0,n.jsxs)(i.$,{type:"button",variant:"outline",size:"sm",onClick:h,className:m,children:[(0,n.jsx)(b,{className:(0,d.cn)(f&&"text-emerald-600")}),null!=s?s:"Copy"]}):(0,n.jsxs)(o.m_,{children:[(0,n.jsx)(o.k$,{asChild:!0,children:(0,n.jsx)("button",{type:"button",onClick:h,"aria-label":null!=s?s:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,n.jsx)(b,{className:(0,d.cn)("size-3.5",f&&"text-emerald-600")})})}),(0,n.jsx)(o.ZI,{children:f?"Copied":null!=s?s:"Copy"})]})}function x(e){let{value:t,mono:s=!0,className:a,display:r}=e;return t?(0,n.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",a),children:[(0,n.jsx)("span",{className:(0,d.cn)("truncate",s&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,n.jsx)(m,{value:t})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js b/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js
new file mode 100644
index 00000000..b7efe0ad
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1208-631c5c15bd4f82c5.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1208],{4089:(e,t,r)=>{r.d(t,{Xi:()=>o,av:()=>c,j7:()=>n,tU:()=>i});var a=r(26276);r(29320);var s=r(33359),l=r(88674);function i(e){let{className:t,...r}=e;return(0,a.jsx)(s.bL,{"data-slot":"tabs",className:(0,l.cn)("flex flex-col gap-4",t),...r})}function n(e){let{className:t,...r}=e;return(0,a.jsx)(s.B8,{"data-slot":"tabs-list",className:(0,l.cn)("text-muted-foreground flex h-10 w-full items-end justify-start gap-1 overflow-x-auto border-b",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)(s.l9,{"data-slot":"tabs-trigger",className:(0,l.cn)("relative -mb-px inline-flex h-10 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 text-sm font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)(s.UC,{"data-slot":"tabs-content",className:(0,l.cn)("flex-1 outline-none",t),...r})}},20960:(e,t,r)=>{r.d(t,{U:()=>x,q:()=>v});var a=r(26276),s=r(29320),l=r(91052),i=r.n(l),n=r(43036),o=r(35833),c=r(61561),d=r(89839);let u=[{v:"60",label:"1 hour"},{v:"180",label:"3 hours"},{v:"720",label:"12 hours"},{v:"1440",label:"24 hours"}],m=[{v:"60",label:"1 minute"},{v:"300",label:"5 minutes"}];function v(e){let{namespace:t,dimensions:r,charts:l,note:v}=e,[x,g]=(0,s.useState)("60"),[h,p]=(0,s.useState)("60");return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(o.l6,{value:x,onValueChange:g,children:[(0,a.jsx)(o.bq,{size:"sm",className:"w-36","aria-label":"Time range",children:(0,a.jsx)(o.yv,{})}),(0,a.jsx)(o.gC,{children:u.map(e=>(0,a.jsxs)(o.eb,{value:e.v,children:["Last ",e.label]},e.v))})]}),(0,a.jsxs)(o.l6,{value:h,onValueChange:p,children:[(0,a.jsx)(o.bq,{size:"sm",className:"w-40","aria-label":"Period",children:(0,a.jsx)(o.yv,{})}),(0,a.jsx)(o.gC,{children:m.map(e=>(0,a.jsxs)(o.eb,{value:e.v,children:["Period: ",e.label]},e.v))})]}),(0,a.jsxs)(i(),{href:"/cloudwatch/metrics/?namespace=".concat(encodeURIComponent(t)),className:"text-primary ml-auto inline-flex items-center gap-1 text-sm hover:underline",children:["View in CloudWatch ",(0,a.jsx)(n.A,{className:"size-3.5"})]})]}),v,(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:l.map(e=>{var s;let l=e.metrics.map(e=>({namespace:t,name:e.name,dimensions:r,label:e.label}));return(0,a.jsx)(d.w,{title:e.title,description:e.description,children:(0,a.jsx)(c.B$,{queries:l,rangeMinutes:Number(x),period:Number(h),stat:null!=(s=e.stat)?s:"Average",height:220,refreshMs:3e4})},e.title)})})]})}let x=[{title:"CPU utilization",description:"Percent",metrics:[{name:"CPUUtilization"}]},{title:"Memory utilization",description:"Percent",metrics:[{name:"MemoryUtilization"}]},{title:"Network",description:"Bytes per period",metrics:[{name:"NetworkIn",label:"Network in"},{name:"NetworkOut",label:"Network out"}]},{title:"Disk I/O",description:"Bytes per period",metrics:[{name:"DiskReadBytes",label:"Disk read"},{name:"DiskWriteBytes",label:"Disk write"}]}]},53023:(e,t,r)=>{r.d(t,{v:()=>l});var a=r(26276),s=r(88674);function l(e){let{items:t,columns:r=3,className:l}=e;return(0,a.jsx)("dl",{className:(0,s.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[r],l),children:t.map(e=>(0,a.jsxs)("div",{className:(0,s.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,a.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,a.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},61561:(e,t,r)=>{r.d(t,{B$:()=>N,hg:()=>b});var a=r(26276),s=r(29320),l=r(60228),i=r(89658),n=r(67524),o=r(17728),c=r(57475),d=r(77264),u=r(8847),m=r(56357),v=r(45773),x=r(11452),g=r(60528),h=r(28971),p=r(73062),f=r(88674);let b=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],j={Average:"average",Sum:"sum",Minimum:"minimum",Maximum:"maximum",SampleCount:"sample_count"};function N(e){var t;let{queries:r,rangeMinutes:N=60,period:k=60,stat:y="Average",height:w=220,threshold:D,className:S,refreshMs:z}=e,{data:C,error:M,isLoading:_}=function(e,t,r,a){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3e4,i=e.length?["metrics",JSON.stringify(e.map(e=>{let{label:t,...r}=e;return r})),t,r,a]:null;return(0,l.u)(i,()=>{let s=new Date,l=new Date(s.getTime()-6e4*t);return h.FH.post("/api/v1/cloudwatch/metrics/query",{queries:e.map(e=>{let{label:t,...i}=e;return{...i,start:l.toISOString(),end:s.toISOString(),period:r,stat:a}})})},{refreshInterval:s,keepPreviousData:!0})}(r,N,k,y,z),U=null!=(t=j[y])?t:"average",{rows:I,unit:P,hasData:A}=(0,s.useMemo)(()=>{let e=new Map,t="",r=!1;return(null!=C?C:[]).forEach((a,s)=>{var l,i;for(let n of(a.unit&&(t=a.unit),null!=(l=a.datapoints)?l:[])){r=!0;let t=new Date(n.timestamp).getTime(),a=null!=(i=e.get(t))?i:{t};a["s".concat(s)]=n[U],e.set(t,a)}}),{rows:[...e.values()].sort((e,t)=>e.t-t.t),unit:t,hasData:r}},[C,U]);if(_&&!C)return(0,a.jsx)(g.E,{className:(0,f.cn)("w-full rounded-md",S),style:{height:w}});if(M)return(0,a.jsx)("div",{className:(0,f.cn)("text-destructive flex items-center justify-center text-sm",S),style:{height:w},children:M.message});if(!A)return(0,a.jsxs)("div",{className:(0,f.cn)("text-muted-foreground flex flex-col items-center justify-center gap-1 rounded-md border border-dashed text-sm",S),style:{height:w},children:[(0,a.jsx)("span",{children:"No datapoints in this time range"}),(0,a.jsx)("span",{className:"text-xs",children:"Metrics are sampled every 30 seconds while a resource is running."})]});let B=r.map(e=>{var t;return null!=(t=e.label)?t:e.name}),L=Date.now();return(0,a.jsx)("div",{className:(0,f.cn)("w-full",S),style:{height:w},children:(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(n.b,{data:I,margin:{top:8,right:12,bottom:0,left:0},children:[(0,a.jsx)(o.d,{stroke:"var(--border)",strokeDasharray:"3 3",vertical:!1}),(0,a.jsx)(c.W,{dataKey:"t",type:"number",scale:"time",domain:[L-6e4*N,L],tickFormatter:e=>(0,p.fU)(e).slice(0,5),stroke:"var(--muted-foreground)",fontSize:11,tickLine:!1,axisLine:{stroke:"var(--border)"},minTickGap:40}),(0,a.jsx)(d.h,{stroke:"var(--muted-foreground)",fontSize:11,tickLine:!1,axisLine:!1,width:64,tickFormatter:e=>(0,p.YI)(e,P),domain:"Percent"===P?[0,e=>Math.max(10,10*Math.ceil(e/10))]:[0,"auto"]}),(0,a.jsx)(u.m,{cursor:{stroke:"var(--muted-foreground)",strokeDasharray:"3 3"},contentStyle:{background:"var(--popover)",border:"1px solid var(--border)",borderRadius:8,fontSize:12,color:"var(--popover-foreground)"},labelFormatter:e=>(0,p.fU)(Number(e)),formatter:(e,t)=>{var r;let a=Number(String(t).slice(1));return[(0,p.YI)(Number(e),P),null!=(r=B[a])?r:String(t)]}}),r.length>1&&(0,a.jsx)(m.s,{verticalAlign:"bottom",height:24,iconType:"plainline",formatter:e=>{var t;return(0,a.jsx)("span",{className:"text-foreground text-xs",children:null!=(t=B[Number(e.slice(1))])?t:e})}}),void 0!==D&&(0,a.jsx)(v.e,{y:D,stroke:"var(--destructive)",strokeDasharray:"4 4"}),r.map((e,t)=>(0,a.jsx)(x.N,{dataKey:"s".concat(t),type:"monotone",stroke:b[t%b.length],strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:2,stroke:"var(--card)"},connectNulls:!0,isAnimationActive:!1},t))]})})})}},68157:(e,t,r)=>{r.d(t,{Fc:()=>n,TN:()=>c,XL:()=>o});var a=r(26276);r(29320);var s=r(5820),l=r(88674);let i=(0,s.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function n(e){let{className:t,variant:r,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,l.cn)(i({variant:r}),t),...s})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,l.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,l.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...r})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js b/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js
new file mode 100644
index 00000000..3aafa093
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1226-6d3b4c4c19ad6645.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1226],{17286:(e,n,t)=>{t.d(n,{Rh:()=>f,Wh:()=>b});var a=t(26276),s=t(40688),r=t(48947),l=t(31935),i=t(64761),o=t(64206),c=t(46319),u=t(42812),d=t(88674);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},p={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),g={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let n=g[e.toLowerCase()];if(n)return n;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let t=e.toLowerCase().replace(/[_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function x(e){let{tone:n,spinning:t}=e,m="size-3.5 shrink-0";if(t)return(0,a.jsx)(s.A,{className:(0,d.cn)(m,"animate-spin")});switch(n){case"success":return(0,a.jsx)(r.A,{className:m});case"danger":return(0,a.jsx)(l.A,{className:m});case"warning":return(0,a.jsx)(i.A,{className:m});case"info":return(0,a.jsx)(o.A,{className:(0,d.cn)(m,"fill-current")});default:return"neutral"===n?(0,a.jsx)(c.A,{className:m}):(0,a.jsx)(u.A,{className:m})}}function b(e){var n;let{status:t,label:s,tone:r,className:l}=e,i=null!=r?r:null!=(n=p[t.toLowerCase()])?n:"neutral",o=null!=s?s:f(t);return(0,a.jsxs)("span",{className:(0,d.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[i],l),children:[(0,a.jsx)(x,{tone:i,spinning:h.has(t.toLowerCase())}),(0,a.jsx)("span",{children:o})]})}},36337:(e,n,t)=>{t.d(n,{f:()=>i});var a=t(26276),s=t(47006),r=t(73062),l=t(22927);function i(e){let{value:n,className:t}=e,i=(0,l.cB)(3e4);return n?(0,a.jsxs)(s.m_,{children:[(0,a.jsx)(s.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=t?t:"whitespace-nowrap",children:(0,r.fF)(n,i)})}),(0,a.jsx)(s.ZI,{children:(0,r.Yq)(n)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50565:(e,n,t)=>{t.d(n,{d:()=>l});var a=t(26276);t(29320);var s=t(63240),r=t(88674);function l(e){let{className:n,...t}=e;return(0,a.jsx)(s.bL,{"data-slot":"switch",className:(0,r.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...t,children:(0,a.jsx)(s.zi,{"data-slot":"switch-thumb",className:(0,r.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,n,t)=>{t.d(n,{J:()=>c});var a=t(26276),s=t(29320),r=t(95774),l=t(5820),i=t(88674);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,n)=>{let{className:t,...s}=e;return(0,a.jsx)(r.b,{ref:n,className:(0,i.cn)(o(),t),...s})});c.displayName=r.b.displayName},70903:(e,n,t)=>{t.d(n,{Am:()=>m,Cv:()=>p,GA:()=>h,IO:()=>g,Pk:()=>v,Tw:()=>f,YN:()=>w,eF:()=>x,fi:()=>k,jZ:()=>j,jj:()=>y,p9:()=>_,z_:()=>C,zj:()=>b});var a=t(26276),s=t(10646),r=t(81155),l=t(50985),i=t(50565),o=t(74875),c=t(17286),u=t(28971),d=t(22927);let m="/api/v1/cognito",p="".concat(m,"/user-pools"),h=e=>"".concat(p,"/").concat((0,u.aJ)(e)),g=(e,n)=>"/cognito/pool/?id=".concat(encodeURIComponent(e)).concat(n?"&tab=".concat(n):"");function f(){return(0,d.gf)(p,{refreshInterval:3e4})}let x=/^[\w\s+=,.@-]{1,128}$/,b={min_length:8,require_uppercase:!1,require_lowercase:!0,require_numbers:!0,require_symbols:!1};function j(e){let n=[e.require_uppercase&&"uppercase",e.require_lowercase&&"lowercase",e.require_numbers&&"numbers",e.require_symbols&&"symbols"].filter(Boolean);return"At least ".concat(e.min_length," characters").concat(n.length?", with ".concat(n.join(", ")):"")}function w(e,n){let t=[];return[...e].lengtht({...n,min_length:""===e.target.value?NaN:Number(e.target.value)}),className:"w-28"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Require"}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["require_uppercase","Uppercase letters"],["require_lowercase","Lowercase letters"],["require_numbers","Numbers"],["require_symbols","Symbols"]].map(e=>{let[r,l]=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(s.S,{checked:!!n[r],onCheckedChange:e=>t({...n,[r]:!!e})}),l]},r)})})]})]})}let k=e=>!Number.isInteger(e)||e<6||e>99?"Enter a whole number from 6 to 99":void 0;function _(e){let{id:n,label:t,description:s,checked:r,onChange:o,disabled:c}=e;return(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.J,{htmlFor:n,className:"font-medium",children:t}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:s})]}),(0,a.jsx)(i.d,{id:n,checked:r,onCheckedChange:o,disabled:c})]})}},73062:(e,n,t)=>{t.d(n,{Fl:()=>h,YI:()=>i,Yq:()=>c,ZV:()=>l,a3:()=>m,fF:()=>d,fU:()=>u,qt:()=>r,td:()=>p,z3:()=>s});let a=["B","KB","MB","GB","TB","PB"];function s(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let t=Math.abs(e),s=0;for(;t>=1024&&s=100?0:n);return"".concat(e<0?"-":"").concat(r," ").concat(a[s])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let n=e/1024;return"".concat(Number.isInteger(n)?n:n.toFixed(1)," GiB")}function l(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:n})}function i(e,n){if(null==e||Number.isNaN(e))return"-";switch(n){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())||1971>n.getFullYear()?null:n}function c(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=o(e);return t?t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:n?"2-digit":void 0,hour12:!1}):"-"}function u(e){let n=o(e);return n?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function d(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),t=o(e);if(!t)return"-";let a=(t.getTime()-n)/1e3,s=Math.abs(a),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||a>0&&a<60)return"just now";let l=a;for(let[e,n]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(n,"s");return"".concat(e," ").concat(1===e?n:t)}function h(e){let n=e.endsWith("/")?e.slice(0,-1):e,t=n.lastIndexOf("/");return t>=0?n.slice(t+1):n}},74875:(e,n,t)=>{t.d(n,{D:()=>l});var a=t(26276),s=t(50985),r=t(88674);function l(e){let{label:n,htmlFor:t,help:l,error:i,optional:o,children:c,className:u}=e;return(0,a.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",u),children:[(0,a.jsxs)(s.J,{htmlFor:t,className:"text-sm font-medium",children:[n,o&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},76962:(e,n,t)=>{t.d(n,{Dk:()=>d,i8:()=>m,xh:()=>p});var a=t(26276),s=t(29320),r=t(72538),l=t(37995),i=t(34993),o=t(47045),c=t(47006),u=t(88674);async function d(e){try{return await navigator.clipboard.writeText(e),!0}catch(a){let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();let t=document.execCommand("copy");return document.body.removeChild(n),t}}function m(e){let{value:n,label:t,className:m,size:p="icon",toastMessage:h}=e,[g,f]=(0,s.useState)(!1),x=async e=>{e.stopPropagation(),e.preventDefault(),await d(n)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},b=g?r.A:l.A;return"sm"===p?(0,a.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:x,className:m,children:[(0,a.jsx)(b,{className:(0,u.cn)(g&&"text-emerald-600")}),null!=t?t:"Copy"]}):(0,a.jsxs)(c.m_,{children:[(0,a.jsx)(c.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:x,"aria-label":null!=t?t:"Copy",className:(0,u.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,a.jsx)(b,{className:(0,u.cn)("size-3.5",g&&"text-emerald-600")})})}),(0,a.jsx)(c.ZI,{children:g?"Copied":null!=t?t:"Copy"})]})}function p(e){let{value:n,mono:t=!0,className:s,display:r}=e;return n?(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex max-w-full items-center gap-1",s),children:[(0,a.jsx)("span",{className:(0,u.cn)("truncate",t&&"font-mono text-[0.8125rem]"),title:n,children:null!=r?r:n}),(0,a.jsx)(m,{value:n})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},91226:(e,n,t)=>{t.d(n,{PoolsList:()=>S,y:()=>A});var a=t(26276),s=t(29320),r=t(91052),l=t.n(r),i=t(78113),o=t(10002),c=t(50123),u=t(40688),d=t(34993),m=t(47045),p=t(64573),h=t(81155),g=t(47353),f=t(62083),x=t(76962),b=t(79181),j=t(12373),w=t(74875),N=t(21195),v=t(36337),y=t(28971),C=t(73062),k=t(22927),_=t(70903);function S(){var e;let n=(0,i.useRouter)(),{data:t,error:r,isLoading:u,isValidating:d,mutate:p}=(0,_.Tw)(),[h,f]=(0,s.useState)([]),[w,y]=(0,s.useState)("1"===(0,k.pE)("create")),[C,S]=(0,s.useState)(null),F=null!=(e=(null!=t?t:[]).find(e=>h.includes(e.id)))?e:null,R=[{id:"name",header:"User pool name",cell:e=>(0,a.jsx)(l(),{href:(0,_.IO)(e.id),onClick:e=>e.stopPropagation(),className:(0,b.V)(),children:e.name}),value:e=>e.name},{id:"id",header:"User pool ID",cell:e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[13px] whitespace-nowrap",children:[e.id,(0,a.jsx)(x.i8,{value:e.id,label:"Copy pool ID"})]}),value:e=>e.id},{id:"users",header:"Users",cell:e=>(0,a.jsx)("span",{className:"tabular-nums",children:e.users}),value:e=>e.users},{id:"clients",header:"App clients",cell:e=>(0,a.jsx)("span",{className:"tabular-nums",children:e.clients}),value:e=>e.clients,hideBelow:"sm"},{id:"signup",header:"Self sign-up",cell:e=>(0,a.jsx)("span",{className:"whitespace-nowrap",children:e.self_sign_up?e.auto_confirm?"Auto-confirmed":"Needs confirmation":(0,a.jsx)("span",{className:"text-muted-foreground",children:"Disabled"})}),value:e=>+!!e.self_sign_up,hideBelow:"md"},{id:"created",header:"Created",cell:e=>(0,a.jsx)(v.f,{value:e.created_at}),value:e=>e.created_at,hideBelow:"sm"}],D=[{label:"View details",onSelect:()=>F&&n.push((0,_.IO)(F.id)),disabled:!F},{label:"Integration",onSelect:()=>F&&n.push((0,_.IO)(F.id,"integration")),disabled:!F},{separator:!0},{label:"Delete user pool",destructive:!0,onSelect:()=>F&&S(F),disabled:!F}];return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(N.z,{title:"User pools",description:"User directories for your applications: sign-up and sign-in, groups, and signed JWTs that your code and API Gateway routes can verify.",breadcrumbs:[{label:"Cognito",href:"/cognito/"},{label:"User pools"}]}),(0,a.jsx)(b.b,{title:"User pools",data:t,columns:R,rowId:e=>e.id,loading:u,error:r,onRefresh:()=>p(),refreshing:d,selection:"single",selected:h,onSelectedChange:f,searchPlaceholder:"Filter by name or ID",defaultSort:{id:"name"},actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.$,{items:D,disabled:!F}),(0,a.jsxs)(m.$,{size:"sm",onClick:()=>y(!0),children:[(0,a.jsx)(o.A,{})," Create user pool"]})]}),empty:(0,a.jsx)(j.p,{icon:c.A,title:"No user pools",description:"Create a user pool, add an app client, and your application can sign users up and in with a couple of HTTP calls.",action:(0,a.jsxs)(m.$,{size:"sm",onClick:()=>y(!0),children:[(0,a.jsx)(o.A,{})," Create user pool"]})})}),(0,a.jsx)(I,{open:w,onOpenChange:y}),(0,a.jsx)(A,{pool:C,onClose:()=>S(null)})]})}function A(e){var n,t,s;let{pool:r,onClose:l,redirect:o}=e,c=(0,i.useRouter)();return(0,a.jsx)(f.T,{open:!!r,onOpenChange:e=>!e&&l(),title:"Delete user pool ".concat(null!=(n=null==r?void 0:r.name)?n:""),confirmText:null==r?void 0:r.name,description:(0,a.jsxs)("p",{children:["The pool is deleted with its ",(0,C.td)(null!=(t=null==r?void 0:r.users)?t:0,"user"),", ",(0,C.td)(null!=(s=null==r?void 0:r.clients)?s:0,"app client")," and signing key. Tokens it issued stop verifying, and API routes that use it as their authorizer return 401."]}),onConfirm:async()=>{r&&(await y.FH.del((0,_.GA)(r.id)),d.oR.success("Deleted user pool ".concat(r.name)),o&&c.push("/cognito/"),await (0,k.Yi)(_.Am))}})}function I(e){let{open:n,onOpenChange:t}=e,r=(0,i.useRouter)(),[l,o]=(0,s.useState)(""),[c,g]=(0,s.useState)(_.zj),[f,x]=(0,s.useState)(!0),[b,j]=(0,s.useState)(!0),[N,v]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{n&&(o(""),g(_.zj),x(!0),j(!0),v(!1))},[n]);let A=l.trim()?_.eF.test(l.trim())?void 0:"1-128 letters, digits, spaces and + = , . @ _ -":"Enter a name",I=(0,_.fi)(c.min_length),F=async e=>{if(e.preventDefault(),v(!0),A||I)return;let n={name:l.trim(),password_policy:c,auto_confirm:f,self_sign_up:b};S(!0);try{let e=await y.FH.post(_.Cv,n);d.oR.success("Created user pool ".concat(e.name)),await (0,k.Yi)(_.Am),t(!1),r.push((0,_.IO)(e.id))}catch(e){d.oR.error((0,y.gJ)(e))}finally{S(!1)}};return(0,a.jsx)(p.lG,{open:n,onOpenChange:e=>!C&&t(e),children:(0,a.jsx)(p.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-5",children:[(0,a.jsxs)(p.c7,{children:[(0,a.jsx)(p.L3,{children:"Create user pool"}),(0,a.jsx)(p.rr,{children:"Each pool has its own users, groups, app clients and RS256 signing key."})]}),(0,a.jsx)(w.D,{label:"User pool name",htmlFor:"pool-name",error:N?A:void 0,children:(0,a.jsx)(h.p,{id:"pool-name",autoFocus:!0,value:l,onChange:e=>o(e.target.value),placeholder:"shop-users",autoComplete:"off"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Password policy"}),(0,a.jsx)(_.z_,{value:c,onChange:g,idPrefix:"pool-pp",error:N?I:void 0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:"Sign-up"}),(0,a.jsx)(_.p9,{id:"pool-self",label:"Self sign-up",description:"Let anyone create an account through the public sign-up endpoint. Turn off to create users only from the console or API.",checked:b,onChange:j}),(0,a.jsx)(_.p9,{id:"pool-auto",label:"Auto-confirm new users",description:"Self-registered users can sign in immediately. Otherwise they stay unconfirmed until an administrator confirms them.",checked:f,onChange:x})]}),(0,a.jsxs)(p.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:C,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:C,children:[C&&(0,a.jsx)(u.A,{className:"animate-spin"}),"Create user pool"]})]})]})})})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js b/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js
deleted file mode 100644
index 8549c38e..00000000
--- a/pages/demo/_next/static/chunks/1255-b45d400a656668f9.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1255],{307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderParamsFromClient",{enumerable:!0,get:function(){return n}});let n=r(77370).createRenderParamsFromClient;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,r,o){let l=o.length<=2,[a,i]=o,c=(0,u.createRouterCacheKey)(i),s=r.parallelRoutes.get(a),f=t.parallelRoutes.get(a);f&&f!==s||(f=new Map(s),t.parallelRoutes.set(a,f));let d=null==s?void 0:s.get(c),p=f.get(c);if(l){p&&p.lazyData&&p!==d||f.set(c,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1});return}if(!p||!d){p||f.set(c,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1});return}return p===d&&(p={lazyData:p.lazyData,rsc:p.rsc,prefetchRsc:p.prefetchRsc,head:p.head,prefetchHead:p.prefetchHead,parallelRoutes:new Map(p.parallelRoutes),loading:p.loading},f.set(c,p)),e(p,d,(0,n.getNextFlightSegmentPath)(o))}}});let n=r(16378),u=r(69190);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(28110);let n=r(53663),u=r(71923);(0,n.appBootstrap)(()=>{let{hydrate:e}=r(49781);r(17297),r(9766),e(u)}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return u}});let n=r(5240);function u(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},3201:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getAppBuildId:function(){return u},setAppBuildId:function(){return n}});let r="";function n(e){r=e}function u(){return r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reportGlobalError",{enumerable:!0,get:function(){return r}});let r="function"==typeof reportError?reportError:e=>{globalThis.console.error(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isRecoverableError:function(){return i},onRecoverableError:function(){return c}});let n=r(28140),u=r(24553),o=n._(r(42444)),l=r(3463),a=new WeakSet;function i(e){return a.has(e)}let c=e=>{let t=(0,o.default)(e)&&"cause"in e?e.cause:e;(0,u.isBailoutToCSRError)(t)||(0,l.reportGlobalError)(t)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return n}});let n=r(67858).unstable_rethrow;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return o},SearchParamsContext:function(){return u}});let n=r(12115),u=(0,n.createContext)(null),o=(0,n.createContext)(null),l=(0,n.createContext)(null)},5240:(e,t)=>{"use strict";function r(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return r}})},5829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return o}});let n=r(37099),u=r(86437);function o(e){return(0,u.isRedirectError)(e)||(0,n.isHTTPAccessFallbackError)(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6640:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unauthorized",{enumerable:!0,get:function(){return n}}),r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7460:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"matchSegment",{enumerable:!0,get:function(){return r}});let r=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return M}});let n=r(28140),u=r(49417),o=r(95155),l=r(86871),a=u._(r(12115)),i=n._(r(47650)),c=r(46752),s=r(32753),f=r(48359),d=r(88785),p=r(7460),h=r(84170),_=r(10531),y=r(63886),b=r(69190),v=r(48915),g=r(76248),m=r(39684);r(74061);let E=i.default.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=["bottom","height","left","right","top","width","x","y"];function O(e,t){let r=e.getBoundingClientRect();return r.top>=0&&r.top<=t}class P extends a.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,r)=>(0,p.matchSegment)(t,e[r]))))return;let r=null,n=e.hashFragment;if(n&&(r=function(e){var t;return"top"===e?document.body:null!=(t=document.getElementById(e))?t:document.getElementsByName(e)[0]}(n)),r||(r=(0,E.findDOMNode)(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return R.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,h.disableSmoothScrollDuringRouteTransition)(()=>{if(n)return void r.scrollIntoView();let e=document.documentElement,t=e.clientHeight;!O(r,t)&&(e.scrollTop=0,O(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function j(e){let{segmentPath:t,children:r}=e,n=(0,a.useContext)(c.GlobalLayoutRouterContext);if(!n)throw Object.defineProperty(Error("invariant global layout router not mounted"),"__NEXT_ERROR_CODE",{value:"E473",enumerable:!1,configurable:!0});return(0,o.jsx)(P,{segmentPath:t,focusAndScrollRef:n.focusAndScrollRef,children:r})}function T(e){let{tree:t,segmentPath:r,cacheNode:n,url:u}=e,i=(0,a.useContext)(c.GlobalLayoutRouterContext);if(!i)throw Object.defineProperty(Error("invariant global layout router not mounted"),"__NEXT_ERROR_CODE",{value:"E473",enumerable:!1,configurable:!0});let{tree:d}=i,h=null!==n.prefetchRsc?n.prefetchRsc:n.rsc,_=(0,a.useDeferredValue)(n.rsc,h),y="object"==typeof _&&null!==_&&"function"==typeof _.then?(0,a.use)(_):_;if(!y){let e=n.lazyData;if(null===e){let t=function e(t,r){if(t){let[n,u]=t,o=2===t.length;if((0,p.matchSegment)(r[0],n)&&r[1].hasOwnProperty(u)){if(o){let t=e(void 0,r[1][u]);return[r[0],{...r[1],[u]:[t[0],t[1],t[2],"refetch"]}]}return[r[0],{...r[1],[u]:e(t.slice(2),r[1][u])}]}}return r}(["",...r],d),o=(0,v.hasInterceptionRouteInCurrentTree)(d),c=Date.now();n.lazyData=e=(0,s.fetchServerResponse)(new URL(u,location.origin),{flightRouterState:t,nextUrl:o?i.nextUrl:null}).then(e=>((0,a.startTransition)(()=>{(0,g.dispatchAppRouterAction)({type:l.ACTION_SERVER_PATCH,previousTree:d,serverResponse:e,navigatedAt:c})}),e)),(0,a.use)(e)}(0,a.use)(f.unresolvedThenable)}return(0,o.jsx)(c.LayoutRouterContext.Provider,{value:{parentTree:t,parentCacheNode:n,parentSegmentPath:r,url:u},children:y})}function S(e){let t,{loading:r,children:n}=e;if(t="object"==typeof r&&null!==r&&"function"==typeof r.then?(0,a.use)(r):r){let e=t[0],r=t[1],u=t[2];return(0,o.jsx)(a.Suspense,{fallback:(0,o.jsxs)(o.Fragment,{children:[r,u,e]}),children:n})}return(0,o.jsx)(o.Fragment,{children:n})}function M(e){let{parallelRouterKey:t,error:r,errorStyles:n,errorScripts:u,templateStyles:l,templateScripts:i,template:s,notFound:f,forbidden:p,unauthorized:h,segmentViewBoundaries:v}=e,g=(0,a.useContext)(c.LayoutRouterContext);if(!g)throw Object.defineProperty(Error("invariant expected layout router to be mounted"),"__NEXT_ERROR_CODE",{value:"E56",enumerable:!1,configurable:!0});let{parentTree:E,parentCacheNode:R,parentSegmentPath:O,url:P}=g,M=R.parallelRoutes,w=M.get(t);w||(w=new Map,M.set(t,w));let A=E[0],C=null===O?[t]:O.concat([A,t]),x=E[1][t],N=x[0],U=(0,b.createRouterCacheKey)(N,!0),D=(0,m.useRouterBFCache)(x,U),L=[];do{let e=D.tree,t=D.stateKey,a=e[0],v=(0,b.createRouterCacheKey)(a),g=w.get(v);if(void 0===g){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1};g=e,w.set(v,e)}let m=R.loading,E=(0,o.jsxs)(c.TemplateContext.Provider,{value:(0,o.jsxs)(j,{segmentPath:C,children:[(0,o.jsx)(d.ErrorBoundary,{errorComponent:r,errorStyles:n,errorScripts:u,children:(0,o.jsx)(S,{loading:m,children:(0,o.jsx)(y.HTTPAccessFallbackBoundary,{notFound:f,forbidden:p,unauthorized:h,children:(0,o.jsxs)(_.RedirectBoundary,{children:[(0,o.jsx)(T,{url:P,tree:e,cacheNode:g,segmentPath:C}),null]})})})}),null]}),children:[l,i,s]},t);L.push(E),D=D.next}while(null!==D);return L}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10531:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectBoundary:function(){return f},RedirectErrorBoundary:function(){return s}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(47260),a=r(86542),i=r(86437);function c(e){let{redirect:t,reset:r,redirectType:n}=e,u=(0,l.useRouter)();return(0,o.useEffect)(()=>{o.default.startTransition(()=>{n===i.RedirectType.push?u.push(t,{}):u.replace(t,{}),r()})},[t,n,r,u]),null}class s extends o.default.Component{static getDerivedStateFromError(e){if((0,i.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,u.jsx)(c,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function f(e){let{children:t}=e,r=(0,l.useRouter)();return(0,u.jsx)(s,{router:r,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findHeadInCache",{enumerable:!0,get:function(){return o}});let n=r(65360),u=r(69190);function o(e,t){return function e(t,r,o,l){if(0===Object.keys(r).length)return[t,o,l];let a=Object.keys(r).filter(e=>"children"!==e);for(let l of("children"in r&&a.unshift("children"),a)){let[a,i]=r[l];if(a===n.DEFAULT_SEGMENT_KEY)continue;let c=t.parallelRoutes.get(l);if(!c)continue;let s=(0,u.createRouterCacheKey)(a),f=(0,u.createRouterCacheKey)(a,!0),d=c.get(s);if(!d)continue;let p=e(d,i,o+"/"+s,o+"/"+f);if(p)return p}return null}(e,t,"","")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return o}});let n=r(86343);function u(e){return void 0!==e}function o(e,t){var r,o;let l=null==(r=t.shouldScroll)||r,a=e.nextUrl;if(u(t.patchedTree)){let r=(0,n.computeChangedPath)(e.tree,t.patchedTree);r?a=r:a||(a=e.canonicalUrl)}return{canonicalUrl:u(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:u(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:u(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:u(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!l&&(!!u(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:t.onlyHashChange||!1,hashFragment:l?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:l?null!=(o=null==t?void 0:t.scrollableSegments)?o:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:u(t.patchedTree)?t.patchedTree:e.tree,nextUrl:a}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createMutableActionQueue:function(){return _},dispatchNavigateAction:function(){return v},dispatchTraverseAction:function(){return g},getCurrentAppRouterState:function(){return y},publicAppRouterInstance:function(){return m}});let n=r(86871),u=r(68451),o=r(12115),l=r(54089);r(66048);let a=r(76248),i=r(96058),c=r(17297),s=r(43933),f=r(63499);function d(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?p({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:n.ACTION_REFRESH,origin:window.location.origin},t)))}async function p(e){let{actionQueue:t,action:r,setState:n}=e,u=t.state;t.pending=r;let o=r.payload,a=t.action(u,o);function i(e){r.discarded||(t.state=e,d(t,n),r.resolve(e))}(0,l.isThenable)(a)?a.then(i,e=>{d(t,n),r.reject(e)}):i(a)}let h=null;function _(e,t){let r={state:e,dispatch:(e,t)=>(function(e,t,r){let u={resolve:r,reject:()=>{}};if(t.type!==n.ACTION_RESTORE){let e=new Promise((e,t)=>{u={resolve:e,reject:t}});(0,o.startTransition)(()=>{r(e)})}let l={payload:t,next:null,resolve:u.resolve,reject:u.reject};null===e.pending?(e.last=l,p({actionQueue:e,action:l,setState:r})):t.type===n.ACTION_NAVIGATE||t.type===n.ACTION_RESTORE?(e.pending.discarded=!0,l.next=e.pending.next,e.pending.payload.type===n.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),p({actionQueue:e,action:l,setState:r})):(null!==e.last&&(e.last.next=l),e.last=l)})(r,e,t),action:async(e,t)=>(0,u.reducer)(e,t),pending:null,last:null,onRouterTransitionStart:null!==t&&"function"==typeof t.onRouterTransitionStart?t.onRouterTransitionStart:null};if(null!==h)throw Object.defineProperty(Error("Internal Next.js Error: createMutableActionQueue was called more than once"),"__NEXT_ERROR_CODE",{value:"E624",enumerable:!1,configurable:!0});return h=r,r}function y(){return null!==h?h.state:null}function b(){return null!==h?h.onRouterTransitionStart:null}function v(e,t,r,u){let o=new URL((0,i.addBasePath)(e),location.href);(0,f.setLinkForCurrentNavigation)(u);let l=b();null!==l&&l(e,t),(0,a.dispatchAppRouterAction)({type:n.ACTION_NAVIGATE,url:o,isExternalUrl:(0,c.isExternalURL)(o),locationSearch:location.search,shouldScroll:r,navigateType:t,allowAliasing:!0})}function g(e,t){let r=b();null!==r&&r(e,"traverse"),(0,a.dispatchAppRouterAction)({type:n.ACTION_RESTORE,url:new URL(e),tree:t})}let m={back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let r=function(){if(null===h)throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0});return h}(),u=(0,c.createPrefetchURL)(e);if(null!==u){var o;(0,s.prefetchReducer)(r.state,{type:n.ACTION_PREFETCH,url:u,kind:null!=(o=null==t?void 0:t.kind)?o:n.PrefetchKind.FULL})}},replace:(e,t)=>{(0,o.startTransition)(()=>{var r;v(e,"replace",null==(r=null==t?void 0:t.scroll)||r,null)})},push:(e,t)=>{(0,o.startTransition)(()=>{var r;v(e,"push",null==(r=null==t?void 0:t.scroll)||r,null)})},refresh:()=>{(0,o.startTransition)(()=>{(0,a.dispatchAppRouterAction)({type:n.ACTION_REFRESH,origin:window.location.origin})})},hmrRefresh:()=>{throw Object.defineProperty(Error("hmrRefresh can only be used in development mode. Please use refresh instead."),"__NEXT_ERROR_CODE",{value:"E485",enumerable:!1,configurable:!0})}};window.next&&(window.next.router=m),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12115:(e,t,r)=>{"use strict";e.exports=r(61426)},12669:(e,t,r)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(59248)},12845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{UnrecognizedActionError:function(){return r},unstable_isUnrecognizedActionError:function(){return n}});class r extends Error{constructor(...e){super(...e),this.name="UnrecognizedActionError"}}function n(e){return!!(e&&"object"==typeof e&&e instanceof r)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13485:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{computeCacheBustingSearchParam:function(){return i},computeLegacyCacheBustingSearchParam:function(){return c}});let n=r(60075),u=new TextEncoder;function o(e){return void 0===e?"0":Array.isArray(e)?e.join(","):e}function l(e,t,r,n){return(void 0===e||"0"===e)&&void 0===t&&void 0===r&&void 0===n?null:[null!=e?e:"0",o(t),o(r),o(n)].join(",")}async function a(e){var t=new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",u.encode(e))).subarray(0,12);let r="";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTML_LIMITED_BOT_UA_RE",{enumerable:!0,get:function(){return r}});let r=/[\w-]+-Google|Google-[\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i},15278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AsyncMetadataOutlet",{enumerable:!0,get:function(){return l}});let n=r(95155),u=r(12115);function o(e){let{promise:t}=e,{error:r,digest:n}=(0,u.use)(t);if(r)throw n&&(r.digest=n),r;return null}function l(e){let{promise:t}=e;return(0,n.jsx)(u.Suspense,{fallback:null,children:(0,n.jsx)(o,{promise:t})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},15860:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HandleISRError",{enumerable:!0,get:function(){return n}});let r=void 0;function n(e){let{error:t}=e;if(r){let e=r.getStore();if((null==e?void 0:e.isRevalidate)||(null==e?void 0:e.isStaticGeneration))throw console.error(t),t}return null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},15903:(e,t,r)=>{"use strict";function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}r.r(t),r.d(t,{_:()=>n})},16378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getFlightDataPartsFromPath:function(){return u},getNextFlightSegmentPath:function(){return o},normalizeFlightData:function(){return l},prepareFlightRouterStateForRequest:function(){return a}});let n=r(65360);function u(e){var t;let[r,n,u,o]=e.slice(-4),l=e.slice(0,-4);return{pathToSegment:l.slice(0,-1),segmentPath:l,segment:null!=(t=l[l.length-1])?t:"",tree:r,seedData:n,head:u,isHeadPartial:o,isRootRender:4===e.length}}function o(e){return e.slice(2)}function l(e){return"string"==typeof e?e:e.map(e=>u(e))}function a(e,t){return t?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(JSON.stringify(function e(t){var r,u;let[o,l,a,i,c,s]=t,f="string"==typeof(r=o)&&r.startsWith(n.PAGE_SEGMENT_KEY+"?")?n.PAGE_SEGMENT_KEY:r,d={};for(let[t,r]of Object.entries(l))d[t]=e(r);let p=[f,d,null,(u=i)&&"refresh"!==u?i:null];return void 0!==c&&(p[4]=c),void 0!==s&&(p[5]=s),p}(e)))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16486:(e,t)=>{"use strict";function r(e){return Object.prototype.toString.call(e)}function n(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getObjectClassLabel:function(){return r},isPlainObject:function(){return n}})},17297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createEmptyCacheNode:function(){return x},createPrefetchURL:function(){return A},default:function(){return L},isExternalURL:function(){return w}});let n=r(28140),u=r(49417),o=r(95155),l=u._(r(12115)),a=r(46752),i=r(86871),c=r(29658),s=r(3865),f=r(76248),d=r(93913),p=r(96058),h=r(43443),_=r(10531),y=r(10836),b=r(48359),v=r(51755),g=r(92929),m=r(86343),E=r(61489),R=r(11807),O=r(86542),P=r(86437);r(63499);let j=n._(r(28890)),T=n._(r(57150)),S=r(24431),M={};function w(e){return e.origin!==window.location.origin}function A(e){let t;if((0,d.isBot)(window.navigator.userAgent))return null;try{t=new URL((0,p.addBasePath)(e),window.location.href)}catch(t){throw Object.defineProperty(Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL."),"__NEXT_ERROR_CODE",{value:"E234",enumerable:!1,configurable:!0})}return w(t)?null:t}function C(e){let{appRouterState:t}=e;return(0,l.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:n}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,c.createHrefFromUrl)(new URL(window.location.href))!==n?(r.pendingPush=!1,window.history.pushState(u,"",n)):window.history.replaceState(u,"",n)},[t]),(0,l.useEffect)(()=>{},[t.nextUrl,t.tree]),null}function x(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1}}function N(e){null==e&&(e={});let t=window.history.state,r=null==t?void 0:t.__NA;r&&(e.__NA=r);let n=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return n&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=n),e}function U(e){let{headCacheNode:t}=e,r=null!==t?t.head:null,n=null!==t?t.prefetchHead:null,u=null!==n?n:r;return(0,l.useDeferredValue)(r,u)}function D(e){let t,{actionQueue:r,assetPrefix:n,globalError:u}=e,c=(0,f.useActionQueue)(r),{canonicalUrl:d}=c,{searchParams:p,pathname:E}=(0,l.useMemo)(()=>{let e=new URL(d,window.location.href);return{searchParams:e.searchParams,pathname:(0,g.hasBasePath)(e.pathname)?(0,v.removeBasePath)(e.pathname):e.pathname}},[d]);(0,l.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(M.pendingMpaPath=void 0,(0,f.dispatchAppRouterAction)({type:i.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[]),(0,l.useEffect)(()=>{function e(e){let t="reason"in e?e.reason:e.error;if((0,P.isRedirectError)(t)){e.preventDefault();let r=(0,O.getURLFromRedirectError)(t);(0,O.getRedirectTypeFromError)(t)===P.RedirectType.push?R.publicAppRouterInstance.push(r,{}):R.publicAppRouterInstance.replace(r,{})}}return window.addEventListener("error",e),window.addEventListener("unhandledrejection",e),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",e)}},[]);let{pushRef:T}=c;if(T.mpaNavigation){if(M.pendingMpaPath!==d){let e=window.location;T.pendingPush?e.assign(d):e.replace(d),M.pendingMpaPath=d}throw b.unresolvedThenable}(0,l.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),r=e=>{var t;let r=window.location.href,n=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,l.startTransition)(()=>{(0,f.dispatchAppRouterAction)({type:i.ACTION_RESTORE,url:new URL(null!=e?e:r,r),tree:n})})};window.history.pushState=function(t,n,u){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=N(t),u&&r(u)),e(t,n,u)},window.history.replaceState=function(e,n,u){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=N(e),u&&r(u)),t(e,n,u)};let n=e=>{if(e.state){if(!e.state.__NA)return void window.location.reload();(0,l.startTransition)(()=>{(0,R.dispatchTraverseAction)(window.location.href,e.state.__PRIVATE_NEXTJS_INTERNALS_TREE)})}};return window.addEventListener("popstate",n),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",n)}},[]);let{cache:w,tree:A,nextUrl:x,focusAndScrollRef:D}=c,L=(0,l.useMemo)(()=>(0,y.findHeadInCache)(w,A[1]),[w,A]),I=(0,l.useMemo)(()=>(0,m.getSelectedParams)(A),[A]),k=(0,l.useMemo)(()=>({parentTree:A,parentCacheNode:w,parentSegmentPath:null,url:d}),[A,w,d]),H=(0,l.useMemo)(()=>({tree:A,focusAndScrollRef:D,nextUrl:x}),[A,D,x]);if(null!==L){let[e,r,n]=L;t=(0,o.jsx)(U,{headCacheNode:e},r)}else t=null;let B=(0,o.jsxs)(_.RedirectBoundary,{children:[t,(0,o.jsx)(S.RootLayoutBoundary,{children:w.rsc}),(0,o.jsx)(h.AppRouterAnnouncer,{tree:A})]});return B=(0,o.jsx)(j.default,{errorComponent:u[0],errorStyles:u[1],children:B}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(C,{appRouterState:c}),(0,o.jsx)(F,{}),(0,o.jsx)(s.PathParamsContext.Provider,{value:I,children:(0,o.jsx)(s.PathnameContext.Provider,{value:E,children:(0,o.jsx)(s.SearchParamsContext.Provider,{value:p,children:(0,o.jsx)(a.GlobalLayoutRouterContext.Provider,{value:H,children:(0,o.jsx)(a.AppRouterContext.Provider,{value:R.publicAppRouterInstance,children:(0,o.jsx)(a.LayoutRouterContext.Provider,{value:k,children:B})})})})})})]})}function L(e){let{actionQueue:t,globalErrorState:r,assetPrefix:n}=e;(0,E.useNavFailureHandler)();let u=(0,o.jsx)(D,{actionQueue:t,assetPrefix:n,globalError:r});return(0,o.jsx)(j.default,{errorComponent:T.default,children:u})}let I=new Set,k=new Set;function F(){let[,e]=l.default.useState(0),t=I.size;return(0,l.useEffect)(()=>{let r=()=>e(e=>e+1);return k.add(r),t!==I.size&&r(),()=>{k.delete(r)}},[t,e]),[...I].map((e,t)=>(0,o.jsx)("link",{rel:"stylesheet",href:""+e,precedence:"next"},t))}globalThis._N_E_STYLE_LOAD=function(e){let t=I.size;return I.add(e),I.size!==t&&k.forEach(e=>e()),Promise.resolve()},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17797:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_:()=>u});var n=0;function u(e){return"__private_"+n+++"_"+e}},17989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientSegmentRoot",{enumerable:!0,get:function(){return u}});let n=r(95155);function u(e){let{Component:t,slots:u,params:o,promise:l}=e;{let{createRenderParamsFromClient:e}=r(307),l=e(o);return(0,n.jsx)(t,{...u,params:l})}}r(48302),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{setCacheBustingSearchParam:function(){return l},setCacheBustingSearchParamWithHash:function(){return a}});let n=r(13485),u=r(52486);async function o(e){var t,r;return"function"==typeof(null==(r=globalThis.crypto)||null==(t=r.subtle)?void 0:t.digest)?(0,n.computeCacheBustingSearchParam)(e[u.NEXT_ROUTER_PREFETCH_HEADER],e[u.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER],e[u.NEXT_ROUTER_STATE_TREE_HEADER],e[u.NEXT_URL]):(0,n.computeLegacyCacheBustingSearchParam)(e[u.NEXT_ROUTER_PREFETCH_HEADER],e[u.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER],e[u.NEXT_ROUTER_STATE_TREE_HEADER],e[u.NEXT_URL])}let l=async(e,t)=>{a(e,await o(t))},a=(e,t)=>{let r=e.search,n=(r.startsWith("?")?r.slice(1):r).split("&").filter(e=>e&&!e.startsWith(""+u.NEXT_RSC_UNION_QUERY+"="));t.length>0?n.push(u.NEXT_RSC_UNION_QUERY+"="+t):n.push(""+u.NEXT_RSC_UNION_QUERY),e.search=n.length?"?"+n.join("&"):""};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{addSearchParamsToPageSegments:function(){return d},handleAliasedPrefetchEntry:function(){return f}});let n=r(65360),u=r(17297),o=r(60895),l=r(29658),a=r(69190),i=r(60543),c=r(11126),s=r(35737);function f(e,t,r,f,p){let h,_=t.tree,y=t.cache,b=(0,l.createHrefFromUrl)(f),v=[];if("string"==typeof r)return!1;for(let t of r){if(!function e(t){if(!t)return!1;let r=t[2];if(t[3])return!0;for(let t in r)if(e(r[t]))return!0;return!1}(t.seedData))continue;let r=t.tree;r=d(r,Object.fromEntries(f.searchParams));let{seedData:l,isRootRender:c,pathToSegment:p}=t,g=["",...p];r=d(r,Object.fromEntries(f.searchParams));let m=(0,o.applyRouterStatePatchToTree)(g,_,r,b),E=(0,u.createEmptyCacheNode)();if(c&&l){let t=l[1];E.loading=l[3],E.rsc=t,function e(t,r,u,o,l){if(0!==Object.keys(o[1]).length)for(let i in o[1]){let c,s=o[1][i],f=s[0],d=(0,a.createRouterCacheKey)(f),p=null!==l&&void 0!==l[2][i]?l[2][i]:null;if(null!==p){let e=p[1],r=p[3];c={lazyData:null,rsc:f.includes(n.PAGE_SEGMENT_KEY)?null:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:r,navigatedAt:t}}else c={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:-1};let h=r.parallelRoutes.get(i);h?h.set(d,c):r.parallelRoutes.set(i,new Map([[d,c]])),e(t,c,u,s,p)}}(e,E,y,r,l)}else E.rsc=y.rsc,E.prefetchRsc=y.prefetchRsc,E.loading=y.loading,E.parallelRoutes=new Map(y.parallelRoutes),(0,i.fillCacheWithNewSubTreeDataButOnlyLoading)(e,E,y,t);for(let e of(m&&(_=m,y=E,h=!0),(0,s.generateSegmentsFromPatch)(r))){let r=[...t.pathToSegment,...e];r[r.length-1]!==n.DEFAULT_SEGMENT_KEY&&v.push(r)}}return!!h&&(p.patchedTree=_,p.cache=y,p.canonicalUrl=b,p.hashFragment=f.hash,p.scrollableSegments=v,(0,c.handleMutable)(t,p))}function d(e,t){let[r,u,...o]=e;if(r.includes(n.PAGE_SEGMENT_KEY))return[(0,n.addSearchParamsIfPageSegment)(r,t),u,...o];let l={};for(let[e,r]of Object.entries(u))l[e]=d(r,t);return[r,l,...o]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,r){let[n,u,,l]=t;for(let a in n.includes(o.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=r,t[3]="refresh"),u)e(u[a],r)}},refreshInactiveParallelSegments:function(){return l}});let n=r(77609),u=r(32753),o=r(65360);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{navigatedAt:t,state:r,updatedTree:o,updatedCache:l,includeNextUrl:i,fetchedSegments:c,rootTree:s=o,canonicalUrl:f}=e,[,d,p,h]=o,_=[];if(p&&p!==f&&"refresh"===h&&!c.has(p)){c.add(p);let e=(0,u.fetchServerResponse)(new URL(p,location.origin),{flightRouterState:[s[0],s[1],s[2],"refetch"],nextUrl:i?r.nextUrl:null}).then(e=>{let{flightData:r}=e;if("string"!=typeof r)for(let e of r)(0,n.applyFlightData)(t,l,l,e)});_.push(e)}for(let e in d){let n=a({navigatedAt:t,state:r,updatedTree:d[e],updatedCache:l,includeNextUrl:i,fetchedSegments:c,rootTree:s,canonicalUrl:f});_.push(n)}await Promise.all(_)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},23982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{describeHasCheckingStringProperty:function(){return u},describeStringPropertyAccess:function(){return n},wellKnownProperties:function(){return o}});let r=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function n(e,t){return r.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function u(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule","@@iterator"])},24431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MetadataBoundary:function(){return o},OutletBoundary:function(){return a},RootLayoutBoundary:function(){return i},ViewportBoundary:function(){return l}});let n=r(68440),u={[n.METADATA_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.VIEWPORT_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.OUTLET_BOUNDARY_NAME]:function(e){let{children:t}=e;return t},[n.ROOT_LAYOUT_BOUNDARY_NAME]:function(e){let{children:t}=e;return t}},o=u[n.METADATA_BOUNDARY_NAME.slice(0)],l=u[n.VIEWPORT_BOUNDARY_NAME.slice(0)],a=u[n.OUTLET_BOUNDARY_NAME.slice(0)],i=u[n.ROOT_LAYOUT_BOUNDARY_NAME.slice(0)]},24553:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{BailoutToCSRError:function(){return n},isBailoutToCSRError:function(){return u}});let r="BAILOUT_TO_CLIENT_SIDE_RENDERING";class n extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=r}}function u(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}},26381:(e,t)=>{"use strict";function r(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(98301);let n=r(77278);{let e=r.u;r.u=function(){for(var t=arguments.length,r=Array(t),u=0;u{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:()=>n})},28890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(28140),u=r(95155);r(12115);let o=n._(r(77759)),l=r(88785),a=(0,r(93913).isBot)(window.navigator.userAgent);function i(e){let{children:t,errorComponent:r,errorStyles:n,errorScripts:i}=e;return a?(0,u.jsx)(o.default,{children:t}):(0,u.jsx)(l.ErrorBoundary,{errorComponent:r,errorStyles:n,errorScripts:i,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29658:(e,t)=>{"use strict";function r(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,r,o,l,a,i,c){if(0===Object.keys(l[1]).length){r.head=i;return}for(let s in l[1]){let f,d=l[1][s],p=d[0],h=(0,n.createRouterCacheKey)(p),_=null!==a&&void 0!==a[2][s]?a[2][s]:null;if(o){let n=o.parallelRoutes.get(s);if(n){let o,l=(null==c?void 0:c.kind)==="auto"&&c.status===u.PrefetchCacheEntryStatus.reusable,a=new Map(n),f=a.get(h);o=null!==_?{lazyData:null,rsc:_[1],prefetchRsc:null,head:null,prefetchHead:null,loading:_[3],parallelRoutes:new Map(null==f?void 0:f.parallelRoutes),navigatedAt:t}:l&&f?{lazyData:f.lazyData,rsc:f.rsc,prefetchRsc:f.prefetchRsc,head:f.head,prefetchHead:f.prefetchHead,parallelRoutes:new Map(f.parallelRoutes),loading:f.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==f?void 0:f.parallelRoutes),loading:null,navigatedAt:t},a.set(h,o),e(t,o,f,d,_||null,i,c),r.parallelRoutes.set(s,a);continue}}if(null!==_){let e=_[1],r=_[3];f={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:r,navigatedAt:t}}else f={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,loading:null,navigatedAt:t};let y=r.parallelRoutes.get(s);y?y.set(h,f):r.parallelRoutes.set(s,new Map([[h,f]])),e(t,f,void 0,d,_,i,c)}}}});let n=r(69190),u=r(86871);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},32753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createFetch:function(){return y},createFromNextReadableStream:function(){return b},fetchServerResponse:function(){return _}});let n=r(77197),u=r(52486),o=r(41209),l=r(85153),a=r(86871),i=r(16378),c=r(3201),s=r(20396),f=r(93223),d=n.createFromReadableStream;function p(e){return{flightData:(0,f.urlToUrlWithoutFlightMarker)(new URL(e,location.origin)).toString(),canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1}}let h=new AbortController;async function _(e,t){let{flightRouterState:r,nextUrl:n,prefetchKind:o}=t,l={[u.RSC_HEADER]:"1",[u.NEXT_ROUTER_STATE_TREE_HEADER]:(0,i.prepareFlightRouterStateForRequest)(r,t.isHmrRefresh)};o===a.PrefetchKind.AUTO&&(l[u.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(l[u.NEXT_URL]=n);try{var s;let t=o?o===a.PrefetchKind.TEMPORARY?"high":"low":"auto";(e=new URL(e)).pathname.endsWith("/")?e.pathname+="index.txt":e.pathname+=".txt";let r=await y(e,l,t,h.signal),n=(0,f.urlToUrlWithoutFlightMarker)(new URL(r.url)),d=r.redirected?n:void 0,_=r.headers.get("content-type")||"",v=!!(null==(s=r.headers.get("vary"))?void 0:s.includes(u.NEXT_URL)),g=!!r.headers.get(u.NEXT_DID_POSTPONE_HEADER),m=r.headers.get(u.NEXT_ROUTER_STALE_TIME_HEADER),E=null!==m?1e3*parseInt(m,10):-1,R=_.startsWith(u.RSC_CONTENT_TYPE_HEADER);if(R||(R=_.startsWith("text/plain")),!R||!r.ok||!r.body)return e.hash&&(n.hash=e.hash),p(n.toString());let O=g?function(e){let t=e.getReader();return new ReadableStream({async pull(e){for(;;){let{done:r,value:n}=await t.read();if(!r){e.enqueue(n);continue}return}}})}(r.body):r.body,P=await b(O);if((0,c.getAppBuildId)()!==P.b)return p(r.url);return{flightData:(0,i.normalizeFlightData)(P.f),canonicalUrl:d,couldBeIntercepted:v,prerendered:P.S,postponed:g,staleTime:E}}catch(t){return h.signal.aborted||console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),{flightData:e.toString(),canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1}}}async function y(e,t,r,n){let o=new URL(e);await (0,s.setCacheBustingSearchParam)(o,t);let l=await fetch(o,{credentials:"same-origin",headers:t,priority:r||void 0,signal:n}),a=l.redirected,i=new URL(l.url,o);return i.searchParams.delete(u.NEXT_RSC_UNION_QUERY),{url:i.href,redirected:a,ok:l.ok,headers:l.headers,body:l.body,status:l.status}}function b(e){return d(e,{callServer:o.callServer,findSourceMapURL:l.findSourceMapURL})}window.addEventListener("pagehide",()=>{h.abort()}),window.addEventListener("pageshow",()=>{h=new AbortController}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return s},RedirectType:function(){return u.RedirectType},forbidden:function(){return l.forbidden},notFound:function(){return o.notFound},permanentRedirect:function(){return n.permanentRedirect},redirect:function(){return n.redirect},unauthorized:function(){return a.unauthorized},unstable_isUnrecognizedActionError:function(){return f},unstable_rethrow:function(){return i.unstable_rethrow}});let n=r(86542),u=r(86437),o=r(42542),l=r(71099),a=r(6640),i=r(3860);class c extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class s extends URLSearchParams{append(){throw new c}delete(){throw new c}set(){throw new c}sort(){throw new c}}function f(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{generateSegmentsFromPatch:function(){return m},handleExternalUrl:function(){return g},navigateReducer:function(){return function e(t,r){let{url:E,isExternalUrl:R,navigateType:O,shouldScroll:P,allowAliasing:j}=r,T={},{hash:S}=E,M=(0,u.createHrefFromUrl)(E),w="push"===O;if((0,y.prunePrefetchCache)(t.prefetchCache),T.preserveCustomHistoryState=!1,T.pendingPush=w,R)return g(t,T,E.toString(),w);if(document.getElementById("__next-page-redirect"))return g(t,T,M,w);let A=(0,y.getOrCreatePrefetchCacheEntry)({url:E,nextUrl:t.nextUrl,tree:t.tree,prefetchCache:t.prefetchCache,allowAliasing:j}),{treeAtTimeOfPrefetch:C,data:x}=A;return d.prefetchQueue.bump(x),x.then(d=>{let{flightData:y,canonicalUrl:R,postponed:O}=d,j=Date.now(),x=!1;if(A.lastUsedTime||(A.lastUsedTime=j,x=!0),A.aliased){let n=new URL(E.href);R&&(n.pathname=R.pathname);let u=(0,v.handleAliasedPrefetchEntry)(j,t,y,n,T);return!1===u?e(t,{...r,allowAliasing:!1}):u}if("string"==typeof y)return g(t,T,y,w);let N=R?(0,u.createHrefFromUrl)(R):M;if(S&&t.canonicalUrl.split("#",1)[0]===N.split("#",1)[0])return T.onlyHashChange=!0,T.canonicalUrl=N,T.shouldScroll=P,T.hashFragment=S,T.scrollableSegments=[],(0,s.handleMutable)(t,T);let U=t.tree,D=t.cache,L=[];for(let e of y){let{pathToSegment:r,seedData:u,head:s,isHeadPartial:d,isRootRender:y}=e,v=e.tree,R=["",...r],P=(0,l.applyRouterStatePatchToTree)(R,U,v,M);if(null===P&&(P=(0,l.applyRouterStatePatchToTree)(R,C,v,M)),null!==P){if(u&&y&&O){let e=(0,_.startPPRNavigation)(j,D,U,v,u,s,d,!1,L);if(null!==e){if(null===e.route)return g(t,T,M,w);P=e.route;let r=e.node;null!==r&&(T.cache=r);let u=e.dynamicRequestTree;if(null!==u){let r=(0,n.fetchServerResponse)(new URL(N,E.origin),{flightRouterState:u,nextUrl:t.nextUrl});(0,_.listenForDynamicRequest)(e,r)}}else P=v}else{if((0,i.isNavigatingToNewRootLayout)(U,P))return g(t,T,M,w);let n=(0,p.createEmptyCacheNode)(),u=!1;for(let t of(A.status!==c.PrefetchCacheEntryStatus.stale||x?u=(0,f.applyFlightData)(j,D,n,e,A):(u=function(e,t,r,n){let u=!1;for(let o of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),m(n).map(e=>[...r,...e])))(0,b.clearCacheNodeDataForSegmentPath)(e,t,o),u=!0;return u}(n,D,r,v),A.lastUsedTime=j),(0,a.shouldHardNavigate)(R,U)?(n.rsc=D.rsc,n.prefetchRsc=D.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(n,D,r),T.cache=n):u&&(T.cache=n,D=n),m(v))){let e=[...r,...t];e[e.length-1]!==h.DEFAULT_SEGMENT_KEY&&L.push(e)}}U=P}}return T.patchedTree=U,T.canonicalUrl=N,T.scrollableSegments=L,T.hashFragment=S,T.shouldScroll=P,(0,s.handleMutable)(t,T)},()=>t)}}});let n=r(32753),u=r(29658),o=r(75597),l=r(60895),a=r(58130),i=r(44707),c=r(86871),s=r(11126),f=r(77609),d=r(43933),p=r(17297),h=r(65360),_=r(87317),y=r(83571),b=r(1281),v=r(21854);function g(e,t,r,n){return t.mpaNavigation=!0,t.canonicalUrl=r,t.pendingPush=n,t.scrollableSegments=void 0,(0,s.handleMutable)(e,t)}function m(e){let t=[],[r,n]=e;if(0===Object.keys(n).length)return[[r]];for(let[e,u]of Object.entries(n))for(let n of m(u))""===r?t.push([e,...n]):t.push([r,e,...n]);return t}r(66048),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return n}});let n=r(64869).createRenderSearchParamsFromClient;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return s}});let n=r(29658),u=r(60895),o=r(44707),l=r(35737),a=r(77609),i=r(11126),c=r(17297);function s(e,t){let{serverResponse:{flightData:r,canonicalUrl:s},navigatedAt:f}=t,d={};if(d.preserveCustomHistoryState=!1,"string"==typeof r)return(0,l.handleExternalUrl)(e,d,r,e.pushRef.pendingPush);let p=e.tree,h=e.cache;for(let t of r){let{segmentPath:r,tree:i}=t,_=(0,u.applyRouterStatePatchToTree)(["",...r],p,i,e.canonicalUrl);if(null===_)return e;if((0,o.isNavigatingToNewRootLayout)(p,_))return(0,l.handleExternalUrl)(e,d,e.canonicalUrl,e.pushRef.pendingPush);let y=s?(0,n.createHrefFromUrl)(s):void 0;y&&(d.canonicalUrl=y);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(f,h,b,t),d.patchedTree=_,d.cache=b,h=b,p=_}return(0,i.handleMutable)(e,d)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HTTPAccessErrorStatus:function(){return r},HTTP_ERROR_FALLBACK_ERROR_CODE:function(){return u},getAccessFallbackErrorTypeByStatus:function(){return a},getAccessFallbackHTTPStatus:function(){return l},isHTTPAccessFallbackError:function(){return o}});let r={NOT_FOUND:404,FORBIDDEN:403,UNAUTHORIZED:401},n=new Set(Object.values(r)),u="NEXT_HTTP_ERROR_FALLBACK";function o(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,r]=e.digest.split(";");return t===u&&n.has(Number(r))}function l(e){return Number(e.digest.split(";")[1])}function a(e){switch(e){case 401:return"unauthorized";case 403:return"forbidden";case 404:return"not-found";default:return}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return o}});let n=r(29658),u=r(86343);function o(e,t){var r;let{url:o,tree:l}=t,a=(0,n.createHrefFromUrl)(o),i=l||e.tree,c=e.cache;return{canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(r=(0,u.extractPathFromFlightRouterState)(i))?r:o.pathname}}r(87317),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let n=r(32753),u=r(29658),o=r(60895),l=r(44707),a=r(35737),i=r(11126),c=r(30637),s=r(17297),f=r(97332),d=r(48915),p=r(23597);function h(e,t){let{origin:r}=t,h={},_=e.canonicalUrl,y=e.tree;h.preserveCustomHistoryState=!1;let b=(0,s.createEmptyCacheNode)(),v=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);b.lazyData=(0,n.fetchServerResponse)(new URL(_,r),{flightRouterState:[y[0],y[1],y[2],"refetch"],nextUrl:v?e.nextUrl:null});let g=Date.now();return b.lazyData.then(async r=>{let{flightData:n,canonicalUrl:s}=r;if("string"==typeof n)return(0,a.handleExternalUrl)(e,h,n,e.pushRef.pendingPush);for(let r of(b.lazyData=null,n)){let{tree:n,seedData:i,head:d,isRootRender:m}=r;if(!m)return console.log("REFRESH FAILED"),e;let E=(0,o.applyRouterStatePatchToTree)([""],y,n,e.canonicalUrl);if(null===E)return(0,f.handleSegmentMismatch)(e,t,n);if((0,l.isNavigatingToNewRootLayout)(y,E))return(0,a.handleExternalUrl)(e,h,_,e.pushRef.pendingPush);let R=s?(0,u.createHrefFromUrl)(s):void 0;if(s&&(h.canonicalUrl=R),null!==i){let e=i[1],t=i[3];b.rsc=e,b.prefetchRsc=null,b.loading=t,(0,c.fillLazyItemsTillLeafWithHead)(g,b,void 0,n,i,d,void 0),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({navigatedAt:g,state:e,updatedTree:E,updatedCache:b,includeNextUrl:v,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=b,h.patchedTree=E,y=E}return(0,i.handleMutable)(e,h)},()=>e)}r(66048),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},39684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useRouterBFCache",{enumerable:!0,get:function(){return u}});let n=r(12115);function u(e,t){let[r,u]=(0,n.useState)(()=>({tree:e,stateKey:t,next:null}));if(r.tree===e)return r;let o={tree:e,stateKey:t,next:null},l=1,a=r,i=o;for(;null!==a&&l<1;){if(a.stateKey===t){i.next=a.next;break}{l++;let e={tree:a.tree,stateKey:a.stateKey,next:null};i.next=e,i=e}a=a.next}return u(o),o}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return l}});let n=r(12115),u=r(86871),o=r(76248);async function l(e,t){return new Promise((r,l)=>{(0,n.startTransition)(()=>{(0,o.dispatchAppRouterAction)({type:u.ACTION_SERVER_ACTION,actionId:e,actionArgs:t,resolve:r,reject:l})})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},42444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return u},getProperError:function(){return o}});let n=r(16486);function u(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function o(e){return u(e)?e:Object.defineProperty(Error((0,n.isPlainObject)(e)?function(e){let t=new WeakSet;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return r})}(e):e+""),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}},42542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"notFound",{enumerable:!0,get:function(){return u}});let n=""+r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE+";404";function u(){let e=Object.defineProperty(Error(n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw e.digest=n,e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AppRouterAnnouncer",{enumerable:!0,get:function(){return l}});let n=r(12115),u=r(47650),o="next-route-announcer";function l(e){let{tree:t}=e,[r,l]=(0,n.useState)(null);(0,n.useEffect)(()=>(l(function(){var e;let t=document.getElementsByName(o)[0];if(null==t||null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(o);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(o)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,n.useState)(""),c=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),r?(0,u.createPortal)(a,r):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{prefetchQueue:function(){return o},prefetchReducer:function(){return l}});let n=r(79889),u=r(83571),o=new n.PromiseQueue(5),l=function(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:r}=t;return(0,u.getOrCreatePrefetchCacheEntry)({url:r,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,allowAliasing:!0}),e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,r){let n=t[0],u=r[0];if(Array.isArray(n)&&Array.isArray(u)){if(n[0]!==u[0]||n[2]!==u[2])return!0}else if(n!==u)return!0;if(t[4])return!r[4];if(r[4])return!0;let o=Object.values(t[1])[0],l=Object.values(r[1])[0];return!o||!l||e(o,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},45009:(e,t,r)=>{"use strict";e.exports=r(47362)},46752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{AppRouterContext:function(){return u},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return o},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let n=r(28140)._(r(12115)),u=n.default.createContext(null),o=n.default.createContext(null),l=n.default.createContext(null),a=n.default.createContext(null),i=n.default.createContext(new Set)},47260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},forbidden:function(){return i.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},unauthorized:function(){return i.unauthorized},unstable_isUnrecognizedActionError:function(){return s.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return i.unstable_rethrow},useParams:function(){return _},usePathname:function(){return p},useRouter:function(){return h},useSearchParams:function(){return d},useSelectedLayoutSegment:function(){return b},useSelectedLayoutSegments:function(){return y},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let n=r(12115),u=r(46752),o=r(3865),l=r(26381),a=r(65360),i=r(35439),c=r(72103),s=r(12845),f=void 0;function d(){let e=(0,n.useContext)(o.SearchParamsContext);return(0,n.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e])}function p(){return null==f||f("usePathname()"),(0,n.useContext)(o.PathnameContext)}function h(){let e=(0,n.useContext)(u.AppRouterContext);if(null===e)throw Object.defineProperty(Error("invariant expected app router to be mounted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return e}function _(){return null==f||f("useParams()"),(0,n.useContext)(o.PathParamsContext)}function y(e){void 0===e&&(e="children"),null==f||f("useSelectedLayoutSegments()");let t=(0,n.useContext)(u.LayoutRouterContext);return t?function e(t,r,n,u){let o;if(void 0===n&&(n=!0),void 0===u&&(u=[]),n)o=t[1][r];else{var i;let e=t[1];o=null!=(i=e.children)?i:Object.values(e)[0]}if(!o)return u;let c=o[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?u:(u.push(s),e(o,r,!1,u))}(t.parentTree,e):null}function b(e){void 0===e&&(e="children"),null==f||f("useSelectedLayoutSegment()");let t=y(e);if(!t||0===t.length)return null;let r="children"===e?t[0]:t[t.length-1];return r===a.DEFAULT_SEGMENT_KEY?null:r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47362:(e,t)=>{"use strict";function r(e,t){var r=e.length;for(e.push(t);0>>1,u=e[n];if(0>>1;no(i,r))co(s,i)?(e[n]=s,e[c]=r,n=c):(e[n]=i,e[a]=r,n=a);else if(co(s,r))e[n]=s,e[c]=r,n=c;else break}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,_=!1,y=!1,b=!1,v=!1,g="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,E="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=n(f);null!==t;){if(null===t.callback)u(f);else if(t.startTime<=e)u(f),t.sortIndex=t.expirationTime,r(s,t);else break;t=n(f)}}function O(e){if(b=!1,R(e),!y)if(null!==n(s))y=!0,P||(P=!0,l());else{var t=n(f);null!==t&&x(O,t.startTime-e)}}var P=!1,j=-1,T=5,S=-1;function M(){return!!v||!(t.unstable_now()-Se&&M());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),r=!0;break t}p===n(s)&&u(s),R(e)}else u(s);p=n(s)}if(null!==p)r=!0;else{var c=n(f);null!==c&&x(O,c.startTime-e),r=!1}}break e}finally{p=null,h=o,_=!1}}}finally{r?l():P=!1}}}if("function"==typeof E)l=function(){E(w)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,C=A.port2;A.port1.onmessage=w,l=function(){C.postMessage(null)}}else l=function(){g(w,0)};function x(e,r){j=g(function(){e(t.unstable_now())},r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125a?(e.sortIndex=o,r(f,e),null===n(s)&&e===n(f)&&(b?(m(j),j=-1):b=!0,x(O,o-a))):(e.sortIndex=i,r(s,e),y||_||(y=!0,P||(P=!0,l()))),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}},47650:(e,t,r)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(58730)},48302:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"InvariantError",{enumerable:!0,get:function(){return r}});class r extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},48359:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return r}});let r={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},48915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasInterceptionRouteInCurrentTree",{enumerable:!0,get:function(){return function e(t){let[r,u]=t;if(Array.isArray(r)&&("di"===r[2]||"ci"===r[2])||"string"==typeof r&&(0,n.isInterceptionRouteAppPath)(r))return!0;if(u){for(let t in u)if(e(u[t]))return!0}return!1}}});let n=r(57630);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49417:(e,t,r)=>{"use strict";function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var a=o?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(u,l,a):u[l]=e[l]}return u.default=e,r&&r.set(e,u),u}r.r(t),r.d(t,{_:()=>u})},49781:(e,t,r)=>{"use strict";let n,u;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return U}});let o=r(28140),l=r(49417),a=r(95155);r(66001);let i=o._(r(12669)),c=l._(r(12115)),s=r(77197),f=r(82073),d=r(3789),p=r(65444),h=r(41209),_=r(85153),y=r(11807),b=o._(r(17297)),v=r(62592);r(46752);let g=r(3201),m=s.createFromReadableStream,E=document,R=new TextEncoder,O=!1,P=!1,j=null;function T(e){if(0===e[0])n=[];else if(1===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});u?u.enqueue(R.encode(e[1])):n.push(e[1])}else if(2===e[0])j=e[1];else if(3===e[0]){if(!n)throw Object.defineProperty(Error("Unexpected server data: missing bootstrap script."),"__NEXT_ERROR_CODE",{value:"E18",enumerable:!1,configurable:!0});let r=atob(e[1]),o=new Uint8Array(r.length);for(var t=0;t{e.enqueue("string"==typeof t?R.encode(t):t)}),O&&!P)&&(null===e.desiredSize||e.desiredSize<0?e.error(Object.defineProperty(Error("The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection."),"__NEXT_ERROR_CODE",{value:"E117",enumerable:!1,configurable:!0})):e.close(),P=!0,n=void 0),u=e}}),{callServer:h.callServer,findSourceMapURL:_.findSourceMapURL});function A(e){let{pendingActionQueue:t}=e,r=(0,c.use)(w),n=(0,c.use)(t);return(0,a.jsx)(b.default,{actionQueue:n,globalErrorState:r.G,assetPrefix:r.p})}let C=c.default.StrictMode;function x(e){let{children:t}=e;return t}let N={onDefaultTransitionIndicator:function(){return()=>{}},onRecoverableError:d.onRecoverableError,onCaughtError:p.onCaughtError,onUncaughtError:p.onUncaughtError};function U(e){let t=new Promise((t,r)=>{w.then(r=>{(0,g.setAppBuildId)(r.b);let n=Date.now();t((0,y.createMutableActionQueue)((0,v.createInitialRouterState)({navigatedAt:n,initialFlightData:r.f,initialCanonicalUrlParts:r.c,initialParallelRoutes:new Map,location:window.location,couldBeIntercepted:r.i,postponed:r.s,prerendered:r.S}),e))},e=>r(e))}),r=(0,a.jsx)(C,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(x,{children:(0,a.jsx)(A,{pendingActionQueue:t})})})});"__next_error__"===document.documentElement.id?i.default.createRoot(E,N).render(r):c.default.startTransition(()=>{i.default.hydrateRoot(E,r,{...N,formState:j})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useUntrackedPathname",{enumerable:!0,get:function(){return o}});let n=r(12115),u=r(3865);function o(){return(0,n.useContext)(u.PathnameContext)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return u}}),r(92929);let n="/demo";function u(e){return 0===n.length||(e=e.slice(n.length)).startsWith("/")||(e="/"+e),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HEADER:function(){return n},FLIGHT_HEADERS:function(){return f},NEXT_ACTION_NOT_FOUND_HEADER:function(){return v},NEXT_DID_POSTPONE_HEADER:function(){return h},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return i},NEXT_HMR_REFRESH_HEADER:function(){return a},NEXT_IS_PRERENDER_HEADER:function(){return b},NEXT_REWRITTEN_PATH_HEADER:function(){return _},NEXT_REWRITTEN_QUERY_HEADER:function(){return y},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return l},NEXT_ROUTER_STALE_TIME_HEADER:function(){return p},NEXT_ROUTER_STATE_TREE_HEADER:function(){return u},NEXT_RSC_UNION_QUERY:function(){return d},NEXT_URL:function(){return c},RSC_CONTENT_TYPE_HEADER:function(){return s},RSC_HEADER:function(){return r}});let r="rsc",n="next-action",u="next-router-state-tree",o="next-router-prefetch",l="next-router-segment-prefetch",a="next-hmr-refresh",i="__next_hmr_refresh_hash__",c="next-url",s="text/x-component",f=[r,u,o,a,l],d="_rsc",p="x-nextjs-stale-time",h="x-nextjs-postponed",_="x-nextjs-rewritten-path",y="x-nextjs-rewritten-query",b="x-nextjs-prerender",v="x-nextjs-action-not-found";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return u}});let n=r(94681);function u(e){var t,r;t=self.__next_s,r=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[r,u]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");u&&(0,n.setAttributesFromProps)(o,u),r?(o.src=r,o.onload=()=>e(),o.onerror=t):u&&(o.innerHTML=u.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{r()}):r()}window.next={version:"15.5.26",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53965:e=>{!function(){var t={229:function(e){var t,r,n,u=e.exports={};function o(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var i=[],c=!1,s=-1;function f(){c&&n&&(c=!1,n.length?i=n.concat(i):s=-1,i.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=i.length;t;){for(n=i,i=[];++s1)for(var r=1;r{"use strict";function r(e){return null!==e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isThenable",{enumerable:!0,get:function(){return r}})},57150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let n=r(95155),u=r(15860),o={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}},l=function(e){let{error:t}=e,r=null==t?void 0:t.digest;return(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{}),(0,n.jsxs)("body",{children:[(0,n.jsx)(u.HandleISRError,{error:t}),(0,n.jsx)("div",{style:o.error,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{style:o.text,children:["Application error: a ",r?"server":"client","-side exception has occurred while loading ",window.location.hostname," (see the"," ",r?"server logs":"browser console"," for more information)."]}),r?(0,n.jsx)("p",{style:o.text,children:"Digest: "+r}):null]})})]})]})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},57630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return u},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return o}});let n=r(74061),u=["(..)(..)","(.)","(..)","(...)"];function o(e){return void 0!==e.split("/").find(e=>u.find(t=>e.startsWith(t)))}function l(e){let t,r,o;for(let n of e.split("/"))if(r=u.find(e=>n.startsWith(e))){[t,o]=e.split(r,2);break}if(!t||!r||!o)throw Object.defineProperty(Error("Invalid interception route: "+e+". Must be in the format //(..|...|..)(..)/"),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":o="/"===t?"/"+o:t+"/"+o;break;case"(..)":if("/"===t)throw Object.defineProperty(Error("Invalid interception route: "+e+". Cannot use (..) marker at the root level, use (.) instead."),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});o=t.split("/").slice(0,-1).concat(o).join("/");break;case"(...)":o="/"+o;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Object.defineProperty(Error("Invalid interception route: "+e+". Cannot use (..)(..) marker at the root level or one level up."),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});o=l.slice(0,-2).concat(o).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:o}}},58130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,r){let[o,l]=r,[a,i]=t;return(0,u.matchSegment)(a,o)?!(t.length<=2)&&e((0,n.getNextFlightSegmentPath)(t),l[i]):!!Array.isArray(a)}}});let n=r(16378),u=r(7460);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58730:(e,t,r)=>{"use strict";var n=r(12115);function u(e){var t="https://react.dev/errors/"+e;if(1{"use strict";function r(e){let t=5381;for(let r=0;r>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},60543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fillCacheWithNewSubTreeData:function(){return i},fillCacheWithNewSubTreeDataButOnlyLoading:function(){return c}});let n=r(94201),u=r(30637),o=r(69190),l=r(65360);function a(e,t,r,a,i,c){let{segmentPath:s,seedData:f,tree:d,head:p}=a,h=t,_=r;for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,r,n,i){let c,[s,f,d,p,h]=r;if(1===t.length){let e=a(r,n);return(0,l.addRefreshMarkerToActiveParallelSegments)(e,i),e}let[_,y]=t;if(!(0,o.matchSegment)(_,s))return null;if(2===t.length)c=a(f[y],n);else if(null===(c=e((0,u.getNextFlightSegmentPath)(t),f[y],n,i)))return null;let b=[t[0],{...f,[y]:c},d,p];return h&&(b[4]=!0),(0,l.addRefreshMarkerToActiveParallelSegments)(b,i),b}}});let n=r(65360),u=r(16378),o=r(7460),l=r(23597);function a(e,t){let[r,u]=e,[l,i]=t;if(l===n.DEFAULT_SEGMENT_KEY&&r!==n.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(r,l)){let t={};for(let e in u)void 0!==i[e]?t[e]=a(u[e],i[e]):t[e]=u[e];for(let e in i)t[e]||(t[e]=i[e]);let n=[r,t];return e[2]&&(n[2]=e[2]),e[3]&&(n[3]=e[3]),e[4]&&(n[4]=e[4]),n}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61426:(e,t,r)=>{"use strict";var n=r(95704),u=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),_=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function g(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}function m(){}function E(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var R=E.prototype=new m;R.constructor=E,b(R,g.prototype),R.isPureReactComponent=!0;var O=Array.isArray;function P(){}var j={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function S(e,t,r){var n=r.ref;return{$$typeof:u,type:e,key:t,ref:void 0!==n?n:null,props:r}}function M(e){return"object"==typeof e&&null!==e&&e.$$typeof===u}var w=/\/+/g;function A(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function C(e,t,r){if(null==e)return e;var n=[],l=0;return!function e(t,r,n,l,a){var i,c,s,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var d=!1;if(null===t)d=!0;else switch(f){case"bigint":case"string":case"number":d=!0;break;case"object":switch(t.$$typeof){case u:case o:d=!0;break;case h:return e((d=t._init)(t._payload),r,n,l,a)}}if(d)return a=a(t),d=""===l?"."+A(t,0):l,O(a)?(n="",null!=d&&(n=d.replace(w,"$&/")+"/"),e(a,r,n,"",function(e){return e})):null!=a&&(M(a)&&(i=a,c=n+(null==a.key||t&&t.key===a.key?"":(""+a.key).replace(w,"$&/")+"/")+d,a=S(i.type,c,i.props)),r.push(a)),1;d=0;var p=""===l?".":l+":";if(O(t))for(var y=0;y{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{handleHardNavError:function(){return u},useNavFailureHandler:function(){return o}}),r(12115);let n=r(29658);function u(e){return!!e&&!!window.next.__pendingUrl&&(0,n.createHrefFromUrl)(new URL(window.location.href))!==(0,n.createHrefFromUrl)(window.next.__pendingUrl)&&(console.error("Error occurred during navigation, falling back to hard navigation",e),window.location.href=window.next.__pendingUrl.toString(),!0)}function o(){}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},62244:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return A}});let n=r(41209),u=r(85153),o=r(52486),l=r(12845),a=r(77197),i=r(86871),c=r(66640),s=r(29658),f=r(35737),d=r(60895),p=r(44707),h=r(11126),_=r(30637),y=r(17297),b=r(48915),v=r(97332),g=r(23597),m=r(16378),E=r(86542),R=r(86437),O=r(83571),P=r(51755),j=r(92929),T=r(77519);r(66048);let S=a.createFromFetch;async function M(e,t,r){let i,s,f,d,{actionId:p,actionArgs:h}=r,_=(0,a.createTemporaryReferenceSet)(),y=(0,T.extractInfoFromServerReferenceId)(p),b="use-cache"===y.type?(0,T.omitUnusedArgs)(h,y):h,v=await (0,a.encodeReply)(b,{temporaryReferences:_}),g=await fetch(e.canonicalUrl,{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION_HEADER]:p,[o.NEXT_ROUTER_STATE_TREE_HEADER]:(0,m.prepareFlightRouterStateForRequest)(e.tree),...{},...t?{[o.NEXT_URL]:t}:{}},body:v});if("1"===g.headers.get(o.NEXT_ACTION_NOT_FOUND_HEADER))throw Object.defineProperty(new l.UnrecognizedActionError('Server Action "'+p+'" was not found on the server. \nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action'),"__NEXT_ERROR_CODE",{value:"E715",enumerable:!1,configurable:!0});let E=g.headers.get("x-action-redirect"),[O,P]=(null==E?void 0:E.split(";"))||[];switch(P){case"push":i=R.RedirectType.push;break;case"replace":i=R.RedirectType.replace;break;default:i=void 0}let j=!!g.headers.get(o.NEXT_IS_PRERENDER_HEADER);try{let e=JSON.parse(g.headers.get("x-action-revalidated")||"[[],0,0]");s={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){s=w}let M=O?(0,c.assignLocation)(O,new URL(e.canonicalUrl,window.location.href)):void 0,A=g.headers.get("content-type"),C=!!(A&&A.startsWith(o.RSC_CONTENT_TYPE_HEADER));if(!C&&!M)throw Object.defineProperty(Error(g.status>=400&&"text/plain"===A?await g.text():"An unexpected response was received from the server."),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});if(C){let e=await S(Promise.resolve(g),{callServer:n.callServer,findSourceMapURL:u.findSourceMapURL,temporaryReferences:_});f=M?void 0:e.a,d=(0,m.normalizeFlightData)(e.f)}else f=void 0,d=void 0;return{actionResult:f,actionFlightData:d,redirectLocation:M,redirectType:i,revalidatedParts:s,isPrerender:j}}let w={paths:[],tag:!1,cookie:!1};function A(e,t){let{resolve:r,reject:n}=t,u={},o=e.tree;u.preserveCustomHistoryState=!1;let l=e.nextUrl&&(0,b.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null,a=Date.now();return M(e,l,t).then(async c=>{let b,{actionResult:m,actionFlightData:T,redirectLocation:S,redirectType:M,isPrerender:w,revalidatedParts:A}=c;if(S&&(M===R.RedirectType.replace?(e.pushRef.pendingPush=!1,u.pendingPush=!1):(e.pushRef.pendingPush=!0,u.pendingPush=!0),u.canonicalUrl=b=(0,s.createHrefFromUrl)(S,!1)),!T)return(r(m),S)?(0,f.handleExternalUrl)(e,u,S.href,e.pushRef.pendingPush):e;if("string"==typeof T)return r(m),(0,f.handleExternalUrl)(e,u,T,e.pushRef.pendingPush);let C=A.paths.length>0||A.tag||A.cookie;for(let n of T){let{tree:i,seedData:c,head:s,isRootRender:h}=n;if(!h)return console.log("SERVER ACTION APPLY FAILED"),r(m),e;let E=(0,d.applyRouterStatePatchToTree)([""],o,i,b||e.canonicalUrl);if(null===E)return r(m),(0,v.handleSegmentMismatch)(e,t,i);if((0,p.isNavigatingToNewRootLayout)(o,E))return r(m),(0,f.handleExternalUrl)(e,u,b||e.canonicalUrl,e.pushRef.pendingPush);if(null!==c){let t=c[1],r=(0,y.createEmptyCacheNode)();r.rsc=t,r.prefetchRsc=null,r.loading=c[3],(0,_.fillLazyItemsTillLeafWithHead)(a,r,void 0,i,c,s,void 0),u.cache=r,u.prefetchCache=new Map,C&&await (0,g.refreshInactiveParallelSegments)({navigatedAt:a,state:e,updatedTree:E,updatedCache:r,includeNextUrl:!!l,canonicalUrl:u.canonicalUrl||e.canonicalUrl})}u.patchedTree=E,o=E}return S&&b?(C||((0,O.createSeededPrefetchCacheEntry)({url:S,data:{flightData:T,canonicalUrl:void 0,couldBeIntercepted:!1,prerendered:!1,postponed:!1,staleTime:-1},tree:e.tree,prefetchCache:e.prefetchCache,nextUrl:e.nextUrl,kind:w?i.PrefetchKind.FULL:i.PrefetchKind.AUTO}),u.prefetchCache=e.prefetchCache),n((0,E.getRedirectError)((0,j.hasBasePath)(b)?(0,P.removeBasePath)(b):b,M||R.RedirectType.push))):r(m),(0,h.handleMutable)(e,u)},t=>(n(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},62592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return s}});let n=r(29658),u=r(30637),o=r(86343),l=r(83571),a=r(86871),i=r(23597),c=r(16378);function s(e){var t,r;let{navigatedAt:s,initialFlightData:f,initialCanonicalUrlParts:d,initialParallelRoutes:p,location:h,couldBeIntercepted:_,postponed:y,prerendered:b}=e,v=d.join("/"),g=(0,c.getFlightDataPartsFromPath)(f[0]),{tree:m,seedData:E,head:R}=g,O={lazyData:null,rsc:null==E?void 0:E[1],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:p,loading:null!=(t=null==E?void 0:E[3])?t:null,navigatedAt:s},P=h?(0,n.createHrefFromUrl)(h):v;(0,i.addRefreshMarkerToActiveParallelSegments)(m,P);let j=new Map;(null===p||0===p.size)&&(0,u.fillLazyItemsTillLeafWithHead)(s,O,void 0,m,E,R,void 0);let T={tree:m,cache:O,prefetchCache:j,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:P,nextUrl:null!=(r=(0,o.extractPathFromFlightRouterState)(m)||(null==h?void 0:h.pathname))?r:null};if(h){let e=new URL(""+h.pathname+h.search,h.origin);(0,l.createSeededPrefetchCacheEntry)({url:e,data:{flightData:[g],canonicalUrl:void 0,couldBeIntercepted:!!_,prerendered:b,postponed:y,staleTime:b&&1?l.STATIC_STALETIME_MS:-1},tree:T.tree,prefetchCache:T.prefetchCache,nextUrl:T.nextUrl,kind:b?a.PrefetchKind.FULL:a.PrefetchKind.AUTO})}return T}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63499:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{IDLE_LINK_STATUS:function(){return s},PENDING_LINK_STATUS:function(){return c},mountFormInstance:function(){return g},mountLinkInstance:function(){return v},onLinkVisibilityChanged:function(){return E},onNavigationIntent:function(){return R},pingVisibleLinks:function(){return P},setLinkForCurrentNavigation:function(){return f},unmountLinkForCurrentNavigation:function(){return d},unmountPrefetchableInstance:function(){return m}}),r(11807);let n=r(17297),u=r(66048),o=r(12115),l=r(86871),a=r(48302),i=null,c={pending:!0},s={pending:!1};function f(e){(0,o.startTransition)(()=>{null==i||i.setOptimisticLinkStatus(s),null==e||e.setOptimisticLinkStatus(c),i=e})}function d(e){i===e&&(i=null)}let p="function"==typeof WeakMap?new WeakMap:new Map,h=new Set,_="function"==typeof IntersectionObserver?new IntersectionObserver(function(e){for(let t of e){let e=t.intersectionRatio>0;E(t.target,e)}},{rootMargin:"200px"}):null;function y(e,t){void 0!==p.get(e)&&m(e),p.set(e,t),null!==_&&_.observe(e)}function b(e){try{return(0,n.createPrefetchURL)(e)}catch(t){return("function"==typeof reportError?reportError:console.error)("Cannot prefetch '"+e+"' because it cannot be converted to a URL."),null}}function v(e,t,r,n,u,o){if(u){let u=b(t);if(null!==u){let t={router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:u.href,setOptimisticLinkStatus:o};return y(e,t),t}}return{router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:null,setOptimisticLinkStatus:o}}function g(e,t,r,n){let u=b(t);null!==u&&y(e,{router:r,fetchStrategy:n,isVisible:!1,prefetchTask:null,prefetchHref:u.href,setOptimisticLinkStatus:null})}function m(e){let t=p.get(e);if(void 0!==t){p.delete(e),h.delete(t);let r=t.prefetchTask;null!==r&&(0,u.cancelPrefetchTask)(r)}null!==_&&_.unobserve(e)}function E(e,t){let r=p.get(e);void 0!==r&&(r.isVisible=t,t?h.add(r):h.delete(r),O(r,u.PrefetchPriority.Default))}function R(e,t){let r=p.get(e);void 0!==r&&void 0!==r&&O(r,u.PrefetchPriority.Intent)}function O(e,t){var r;let n=e.prefetchTask;if(!e.isVisible){null!==n&&(0,u.cancelPrefetchTask)(n);return}r=e,(async()=>{let e;switch(r.fetchStrategy){case u.FetchStrategy.PPR:e=l.PrefetchKind.AUTO;break;case u.FetchStrategy.Full:e=l.PrefetchKind.FULL;break;case u.FetchStrategy.PPRRuntime:throw Object.defineProperty(new a.InvariantError("FetchStrategy.PPRRuntime should never be used when `experimental.clientSegmentCache` is disabled"),"__NEXT_ERROR_CODE",{value:"E772",enumerable:!1,configurable:!0});default:r.fetchStrategy,e=void 0}return r.router.prefetch(r.prefetchHref,{kind:e})})().catch(e=>{})}function P(e,t){for(let r of h){let n=r.prefetchTask;if(null!==n&&!(0,u.isPrefetchTaskDirty)(n,e,t))continue;null!==n&&(0,u.cancelPrefetchTask)(n);let o=(0,u.createCacheKey)(r.prefetchHref,e);r.prefetchTask=(0,u.schedulePrefetchTask)(o,t,r.fetchStrategy,u.PrefetchPriority.Default,null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessFallbackBoundary",{enumerable:!0,get:function(){return s}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(51486),a=r(37099);r(94781);let i=r(46752);class c extends o.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isHTTPAccessFallbackError)(e))return{triggeredStatus:(0,a.getAccessFallbackHTTPStatus)(e)};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.triggeredStatus?{triggeredStatus:void 0,previousPathname:e.pathname}:{triggeredStatus:t.triggeredStatus,previousPathname:e.pathname}}render(){let{notFound:e,forbidden:t,unauthorized:r,children:n}=this.props,{triggeredStatus:o}=this.state,l={[a.HTTPAccessErrorStatus.NOT_FOUND]:e,[a.HTTPAccessErrorStatus.FORBIDDEN]:t,[a.HTTPAccessErrorStatus.UNAUTHORIZED]:r};if(o){let i=o===a.HTTPAccessErrorStatus.NOT_FOUND&&e,c=o===a.HTTPAccessErrorStatus.FORBIDDEN&&t,s=o===a.HTTPAccessErrorStatus.UNAUTHORIZED&&r;return i||c||s?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("meta",{name:"robots",content:"noindex"}),!1,l[o]]}):n}return n}constructor(e){super(e),this.state={triggeredStatus:void 0,previousPathname:e.pathname}}}function s(e){let{notFound:t,forbidden:r,unauthorized:n,children:a}=e,s=(0,l.useUntrackedPathname)(),f=(0,o.useContext)(i.MissingSlotContext);return t||r||n?(0,u.jsx)(c,{pathname:s,notFound:t,forbidden:r,unauthorized:n,missingSlots:f,children:a}):(0,u.jsx)(u.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},64425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ROOT_SEGMENT_CACHE_KEY:function(){return o},ROOT_SEGMENT_REQUEST_KEY:function(){return u},appendSegmentCacheKeyPart:function(){return c},appendSegmentRequestKeyPart:function(){return a},convertSegmentPathToStaticExportFilename:function(){return d},createSegmentCacheKeyPart:function(){return i},createSegmentRequestKeyPart:function(){return l}});let n=r(65360),u="",o="";function l(e){if("string"==typeof e)return e.startsWith(n.PAGE_SEGMENT_KEY)?n.PAGE_SEGMENT_KEY:"/_not-found"===e?"_not-found":f(e);let t=e[0],r=e[2];return"$"+r+"$"+f(t)}function a(e,t,r){return e+"/"+("children"===t?r:"@"+f(t)+"/"+r)}function i(e,t){return"string"==typeof t?e:e+"$"+f(t[1])}function c(e,t,r){return e+"/"+("children"===t?r:"@"+f(t)+"/"+r)}let s=/^[a-zA-Z0-9\-_@]+$/;function f(e){return s.test(e)?e:"!"+btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function d(e){return"__next"+e.replace(/\//g,".")+".txt"}},64869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderSearchParamsFromClient",{enumerable:!0,get:function(){return o}});let n=r(23982),u=new WeakMap;function o(e){let t=u.get(e);if(t)return t;let r=Promise.resolve(e);return u.set(e,r),Object.keys(e).forEach(t=>{n.wellKnownProperties.has(t)||(r[t]=e[t])}),r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hmrRefreshReducer",{enumerable:!0,get:function(){return n}}),r(32753),r(29658),r(60895),r(44707),r(35737),r(11126),r(77609),r(17297),r(97332),r(48915);let n=function(e,t){return e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65360:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}function n(e){return e.startsWith("@")&&"@children"!==e}function u(e,t){if(e.includes(o)){let e=JSON.stringify(t);return"{}"!==e?o+"?"+e:o}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return l},PAGE_SEGMENT_KEY:function(){return o},addSearchParamsIfPageSegment:function(){return u},isGroupSegment:function(){return r},isParallelRouteSegment:function(){return n}});let o="__PAGE__",l="__DEFAULT__"},65444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{onCaughtError:function(){return s},onUncaughtError:function(){return f}});let n=r(28140),u=r(5829),o=r(24553),l=r(3463),a=r(88785),i=n._(r(57150)),c={decorateDevError:e=>e,handleClientError:()=>{},originConsoleError:console.error.bind(console)};function s(e,t){var r;let n,l=null==(r=t.errorBoundary)?void 0:r.constructor;if(n=n||l===a.ErrorBoundaryHandler&&t.errorBoundary.props.errorComponent===i.default)return f(e);(0,o.isBailoutToCSRError)(e)||(0,u.isNextRouterError)(e)||c.originConsoleError(e)}function f(e){(0,o.isBailoutToCSRError)(e)||(0,u.isNextRouterError)(e)||(0,l.reportGlobalError)(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(90535),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66048:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{FetchStrategy:function(){return h},NavigationResultTag:function(){return d},PrefetchPriority:function(){return p},cancelPrefetchTask:function(){return i},createCacheKey:function(){return f},getCurrentCacheVersion:function(){return l},isPrefetchTaskDirty:function(){return s},navigate:function(){return u},prefetch:function(){return n},reschedulePrefetchTask:function(){return c},revalidateEntireCache:function(){return o},schedulePrefetchTask:function(){return a}});let r=()=>{throw Object.defineProperty(Error("Segment Cache experiment is not enabled. This is a bug in Next.js."),"__NEXT_ERROR_CODE",{value:"E654",enumerable:!1,configurable:!0})},n=r,u=r,o=r,l=r,a=r,i=r,c=r,s=r,f=r;var d=function(e){return e[e.MPA=0]="MPA",e[e.Success=1]="Success",e[e.NoOp=2]="NoOp",e[e.Async=3]="Async",e}({}),p=function(e){return e[e.Intent=2]="Intent",e[e.Default=1]="Default",e[e.Background=0]="Background",e}({}),h=function(e){return e[e.LoadingBoundary=0]="LoadingBoundary",e[e.PPR=1]="PPR",e[e.PPRRuntime=2]="PPRRuntime",e[e.Full=3]="Full",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"assignLocation",{enumerable:!0,get:function(){return u}});let n=r(96058);function u(e,t){if(e.startsWith(".")){let r=t.origin+t.pathname;return new URL((r.endsWith("/")?r:r+"/")+e)}return new URL((0,n.addBasePath)(e),t.href)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},67858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return function e(t){if((0,u.isNextRouterError)(t)||(0,n.isBailoutToCSRError)(t))throw t;t instanceof Error&&"cause"in t&&e(t.cause)}}});let n=r(24553),u=r(5829);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68440:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{METADATA_BOUNDARY_NAME:function(){return r},OUTLET_BOUNDARY_NAME:function(){return u},ROOT_LAYOUT_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return n}});let r="__next_metadata_boundary__",n="__next_viewport_boundary__",u="__next_outlet_boundary__",o="__next_root_layout_boundary__"},68451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let n=r(86871),u=r(35737),o=r(36798),l=r(37854),a=r(38719),i=r(43933),c=r(65345),s=r(62244),f=function(e,t){switch(t.type){case n.ACTION_NAVIGATE:return(0,u.navigateReducer)(e,t);case n.ACTION_SERVER_PATCH:return(0,o.serverPatchReducer)(e,t);case n.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case n.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case n.ACTION_HMR_REFRESH:return(0,c.hmrRefreshReducer)(e,t);case n.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case n.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Object.defineProperty(Error("Unknown action"),"__NEXT_ERROR_CODE",{value:"E295",enumerable:!1,configurable:!0})}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return u}});let n=r(65360);function u(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(n.PAGE_SEGMENT_KEY)?n.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71099:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"forbidden",{enumerable:!0,get:function(){return n}}),r(37099).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});let n=r(77700),u=r(5240),o=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:o}=(0,u.parsePath)(e);return/\.[^/]+\/?$/.test(t)?""+(0,n.removeTrailingSlash)(t)+r+o:t.endsWith("/")?""+t+r+o:t+"/"+r+o};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71923:(e,t,r)=>{"use strict";e.exports=r(19393)},72103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return u},useServerInsertedHTML:function(){return o}});let n=r(49417)._(r(12115)),u=n.default.createContext(null);function o(e){let t=(0,n.useContext)(u);t&&t(e)}},73879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return u}});let n=r(5240);function u(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:u,hash:o}=(0,n.parsePath)(e);return""+t+r+u+o}},74061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return l}});let n=r(76196),u=r(65360);function o(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,u.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},75597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,r,o){let l=o.length<=2,[a,i]=o,c=(0,n.createRouterCacheKey)(i),s=r.parallelRoutes.get(a);if(!s)return;let f=t.parallelRoutes.get(a);if(f&&f!==s||(f=new Map(s),t.parallelRoutes.set(a,f)),l)return void f.delete(c);let d=s.get(c),p=f.get(c);p&&d&&(p===d&&(p={lazyData:p.lazyData,rsc:p.rsc,prefetchRsc:p.prefetchRsc,head:p.head,prefetchHead:p.prefetchHead,parallelRoutes:new Map(p.parallelRoutes)},f.set(c,p)),e(p,d,(0,u.getNextFlightSegmentPath)(o)))}}});let n=r(69190),u=r(16378);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76196:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},76248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{dispatchAppRouterAction:function(){return l},useActionQueue:function(){return a}});let n=r(49417)._(r(12115)),u=r(54089),o=null;function l(e){if(null===o)throw Object.defineProperty(Error("Internal Next.js error: Router action dispatched before initialization."),"__NEXT_ERROR_CODE",{value:"E668",enumerable:!1,configurable:!0});o(e)}function a(e){let[t,r]=n.default.useState(e.state);return o=t=>e.dispatch(t,r),(0,u.isThenable)(t)?(0,n.use)(t):t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77197:(e,t,r)=>{"use strict";e.exports=r(99062)},77278:(e,t)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"encodeURIPath",{enumerable:!0,get:function(){return r}})},77370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRenderParamsFromClient",{enumerable:!0,get:function(){return o}});let n=r(23982),u=new WeakMap;function o(e){let t=u.get(e);if(t)return t;let r=Promise.resolve(e);return u.set(e,r),Object.keys(e).forEach(t=>{n.wellKnownProperties.has(t)||(r[t]=e[t])}),r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{SERVER_REFERENCE_ID_LENGTH:function(){return r},extractInfoFromServerReferenceId:function(){return u},mightBeServerReferenceId:function(){return n},omitUnusedArgs:function(){return o}});let r=42;function n(e){return e.length===r}function u(e){let t=parseInt(e.slice(0,2),16),r=t>>1&63,n=Array(6);for(let e=0;e<6;e++){let t=r>>5-e&1;n[e]=1===t}return{type:1==(t>>7&1)?"use-cache":"server-action",usedArgs:n,hasRestArgs:1==(1&t)}}function o(e,t){let r=Array(e.length);for(let n=0;n=6&&t.hasRestArgs)&&(r[n]=e[n]);return r}},77609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return o}});let n=r(30637),u=r(60543);function o(e,t,r,o,l){let{tree:a,seedData:i,head:c,isRootRender:s}=o;if(null===i)return!1;if(s){let u=i[1];r.loading=i[3],r.rsc=u,r.prefetchRsc=null,(0,n.fillLazyItemsTillLeafWithHead)(e,r,t,a,i,c,l)}else r.rsc=t.rsc,r.prefetchRsc=t.prefetchRsc,r.parallelRoutes=new Map(t.parallelRoutes),r.loading=t.loading,(0,u.fillCacheWithNewSubTreeData)(e,r,t,o,l);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77700:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},77759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{GracefulDegradeBoundary:function(){return o},default:function(){return l}});let n=r(95155),u=r(12115);class o extends u.Component{static getDerivedStateFromError(e){return{hasError:!0}}componentDidMount(){let e=this.htmlRef.current;this.state.hasError&&e&&Object.entries(this.htmlAttributes).forEach(t=>{let[r,n]=t;e.setAttribute(r,n)})}render(){let{hasError:e}=this.state;return(this.rootHtml||(this.rootHtml=document.documentElement.innerHTML,this.htmlAttributes=function(e){let t={};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let n=r(15903),u=r(17797);var o=u._("_maxConcurrency"),l=u._("_runningCount"),a=u._("_queue"),i=u._("_processNext");class c{enqueue(e){let t,r,u=new Promise((e,n)=>{t=e,r=n}),o=async()=>{try{n._(this,l)[l]++;let r=await e();t(r)}catch(e){r(e)}finally{n._(this,l)[l]--,n._(this,i)[i]()}};return n._(this,a)[a].push({promiseFn:u,task:o}),n._(this,i)[i](),u}bump(e){let t=n._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=n._(this,a)[a].splice(t,1)[0];n._(this,a)[a].unshift(e),n._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),n._(this,o)[o]=e,n._(this,l)[l]=0,n._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(n._(this,l)[l]0){var t;null==(t=n._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"IconMark",{enumerable:!0,get:function(){return n}}),r(95155);let n=()=>null},81099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return r}});var r=function(e){return e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let n=r(95155);function u(e){let{Component:t,searchParams:u,params:o,promises:l}=e;{let{createRenderSearchParamsFromClient:e}=r(35878),l=e(u),{createRenderParamsFromClient:a}=r(307),i=a(o);return(0,n.jsx)(t,{params:i,searchParams:l})}}r(48302),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return n}});let n=r(28140)._(r(12115)).default.createContext({})},83571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DYNAMIC_STALETIME_MS:function(){return d},STATIC_STALETIME_MS:function(){return p},createSeededPrefetchCacheEntry:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let n=r(32753),u=r(86871),o=r(43933);function l(e,t,r){let n=e.pathname;return(t&&(n+=e.search),r)?""+r+"%"+n:n}function a(e,t,r){return l(e,t===u.PrefetchKind.FULL,r)}function i(e){let{url:t,nextUrl:r,tree:n,prefetchCache:o,kind:a,allowAliasing:i=!0}=e,c=function(e,t,r,n,o){for(let a of(void 0===t&&(t=u.PrefetchKind.TEMPORARY),[r,null])){let r=l(e,!0,a),i=l(e,!1,a),c=e.search?r:i,s=n.get(c);if(s&&o){if(s.url.pathname===e.pathname&&s.url.search!==e.search)return{...s,aliased:!0};return s}let f=n.get(i);if(o&&e.search&&t!==u.PrefetchKind.FULL&&f&&!f.key.includes("%"))return{...f,aliased:!0}}if(t!==u.PrefetchKind.FULL&&o){for(let t of n.values())if(t.url.pathname===e.pathname&&!t.key.includes("%"))return{...t,aliased:!0}}}(t,a,r,o,i);return c?(c.status=h(c),c.kind!==u.PrefetchKind.FULL&&a===u.PrefetchKind.FULL&&c.data.then(e=>{if(!(Array.isArray(e.flightData)&&e.flightData.some(e=>e.isRootRender&&null!==e.seedData)))return s({tree:n,url:t,nextUrl:r,prefetchCache:o,kind:null!=a?a:u.PrefetchKind.TEMPORARY})}),a&&c.kind===u.PrefetchKind.TEMPORARY&&(c.kind=a),c):s({tree:n,url:t,nextUrl:r,prefetchCache:o,kind:a||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:r,prefetchCache:n,url:o,data:l,kind:i}=e,c=l.couldBeIntercepted?a(o,i,t):a(o,i),s={treeAtTimeOfPrefetch:r,data:Promise.resolve(l),kind:i,prefetchTime:Date.now(),lastUsedTime:Date.now(),staleTime:l.staleTime,key:c,status:u.PrefetchCacheEntryStatus.fresh,url:o};return n.set(c,s),s}function s(e){let{url:t,kind:r,tree:l,nextUrl:i,prefetchCache:c}=e,s=a(t,r),f=o.prefetchQueue.enqueue(()=>(0,n.fetchServerResponse)(t,{flightRouterState:l,nextUrl:i,prefetchKind:r}).then(e=>{let r;if(e.couldBeIntercepted&&(r=function(e){let{url:t,nextUrl:r,prefetchCache:n,existingCacheKey:u}=e,o=n.get(u);if(!o)return;let l=a(t,o.kind,r);return n.set(l,{...o,key:l}),n.delete(u),l}({url:t,existingCacheKey:s,nextUrl:i,prefetchCache:c})),e.prerendered){let t=c.get(null!=r?r:s);t&&(t.kind=u.PrefetchKind.FULL,-1!==e.staleTime&&(t.staleTime=e.staleTime))}return e})),d={treeAtTimeOfPrefetch:l,data:f,kind:r,prefetchTime:Date.now(),lastUsedTime:null,staleTime:-1,key:s,status:u.PrefetchCacheEntryStatus.fresh,url:t};return c.set(s,d),d}function f(e){for(let[t,r]of e)h(r)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("0"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:r,lastUsedTime:n}=e;return Date.now()<(null!=n?n:r)+d?n?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:t===u.PrefetchKind.AUTO&&Date.now(){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange)return void e();let r=document.documentElement;r.dataset.scrollBehavior;let n=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"disableSmoothScrollDuringRouteTransition",{enumerable:!0,get:function(){return n}}),r(94781)},85153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"findSourceMapURL",{enumerable:!0,get:function(){return r}});let r=void 0;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{computeChangedPath:function(){return c},extractPathFromFlightRouterState:function(){return i},getSelectedParams:function(){return function e(t,r){for(let n of(void 0===r&&(r={}),Object.values(t[1]))){let t=n[0],o=Array.isArray(t),l=o?t[1]:t;!l||l.startsWith(u.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?r[t[0]]=t[1].split("/"):o&&(r[t[0]]=t[1]),r=e(n,r))}return r}}});let n=r(57630),u=r(65360),o=r(7460),l=e=>"string"==typeof e?"children"===e?"":e:e[1];function a(e){return e.reduce((e,t)=>{let r;return""===(t="/"===(r=t)[0]?r.slice(1):r)||(0,u.isGroupSegment)(t)?e:e+"/"+t},"")||"/"}function i(e){var t;let r=Array.isArray(e[0])?e[0][1]:e[0];if(r===u.DEFAULT_SEGMENT_KEY||n.INTERCEPTION_ROUTE_MARKERS.some(e=>r.startsWith(e)))return;if(r.startsWith(u.PAGE_SEGMENT_KEY))return"";let o=[l(r)],c=null!=(t=e[1])?t:{},s=c.children?i(c.children):void 0;if(void 0!==s)o.push(s);else for(let[e,t]of Object.entries(c)){if("children"===e)continue;let r=i(t);void 0!==r&&o.push(r)}return a(o)}function c(e,t){let r=function e(t,r){let[u,a]=t,[c,s]=r,f=l(u),d=l(c);if(n.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,o.matchSegment)(u,c)){var p;return null!=(p=i(r))?p:""}for(let t in a)if(s[t]){let r=e(a[t],s[t]);if(null!==r)return l(c)+"/"+r}return null}(e,t);return null==r||"/"===r?r:a(r.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{REDIRECT_ERROR_CODE:function(){return u},RedirectType:function(){return o},isRedirectError:function(){return l}});let n=r(81099),u="NEXT_REDIRECT";var o=function(e){return e.push="push",e.replace="replace",e}({});function l(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let t=e.digest.split(";"),[r,o]=t,l=t.slice(2,-2).join(";"),a=Number(t.at(-2));return r===u&&("replace"===o||"push"===o)&&"string"==typeof l&&!isNaN(a)&&a in n.RedirectStatusCode}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getRedirectError:function(){return l},getRedirectStatusCodeFromError:function(){return f},getRedirectTypeFromError:function(){return s},getURLFromRedirectError:function(){return c},permanentRedirect:function(){return i},redirect:function(){return a}});let n=r(81099),u=r(86437),o=void 0;function l(e,t,r){void 0===r&&(r=n.RedirectStatusCode.TemporaryRedirect);let o=Object.defineProperty(Error(u.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return o.digest=u.REDIRECT_ERROR_CODE+";"+t+";"+e+";"+r+";",o}function a(e,t){var r;throw null!=t||(t=(null==o||null==(r=o.getStore())?void 0:r.isAction)?u.RedirectType.push:u.RedirectType.replace),l(e,t,n.RedirectStatusCode.TemporaryRedirect)}function i(e,t){throw void 0===t&&(t=u.RedirectType.replace),l(e,t,n.RedirectStatusCode.PermanentRedirect)}function c(e){return(0,u.isRedirectError)(e)?e.digest.split(";").slice(2,-2).join(";"):null}function s(e){if(!(0,u.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return e.digest.split(";",2)[1]}function f(e){if(!(0,u.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(e.digest.split(";").at(-2))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86871:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HMR_REFRESH:function(){return a},ACTION_NAVIGATE:function(){return n},ACTION_PREFETCH:function(){return l},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return u},ACTION_SERVER_ACTION:function(){return i},ACTION_SERVER_PATCH:function(){return o},PrefetchCacheEntryStatus:function(){return s},PrefetchKind:function(){return c}});let r="refresh",n="navigate",u="restore",o="server-patch",l="prefetch",a="hmr-refresh",i="server-action";var c=function(e){return e.AUTO="auto",e.FULL="full",e.TEMPORARY="temporary",e}({}),s=function(e){return e.fresh="fresh",e.reusable="reusable",e.expired="expired",e.stale="stale",e}({});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86897:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element");function n(e,t,n){var u=null;if(void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),"key"in t)for(var o in n={},t)"key"!==o&&(n[o]=t[o]);else n=t;return{$$typeof:r,type:e,key:u,ref:void 0!==(t=n.ref)?t:null,props:n}}t.Fragment=Symbol.for("react.fragment"),t.jsx=n,t.jsxs=n},87317:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{abortTask:function(){return h},listenForDynamicRequest:function(){return p},startPPRNavigation:function(){return c},updateCacheNodeOnPopstateRestoration:function(){return function e(t,r){let n=r[1],u=t.parallelRoutes,l=new Map(u);for(let t in n){let r=n[t],a=r[0],i=(0,o.createRouterCacheKey)(a),c=u.get(t);if(void 0!==c){let n=c.get(i);if(void 0!==n){let u=e(n,r),o=new Map(c);o.set(i,u),l.set(t,o)}}}let a=t.rsc,i=b(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:[null,null],prefetchRsc:i?t.prefetchRsc:null,loading:t.loading,parallelRoutes:l,navigatedAt:t.navigatedAt}}}});let n=r(65360),u=r(7460),o=r(69190),l=r(44707),a=r(83571),i={route:null,node:null,dynamicRequestTree:null,children:null};function c(e,t,r,l,a,c,d,p,h){return function e(t,r,l,a,c,d,p,h,_,y,b){let v=l[1],g=a[1],m=null!==d?d[2]:null;c||!0===a[4]&&(c=!0);let E=r.parallelRoutes,R=new Map(E),O={},P=null,j=!1,T={};for(let r in g){let l,a=g[r],f=v[r],d=E.get(r),S=null!==m?m[r]:null,M=a[0],w=y.concat([r,M]),A=(0,o.createRouterCacheKey)(M),C=void 0!==f?f[0]:void 0,x=void 0!==d?d.get(A):void 0;if(null!==(l=M===n.DEFAULT_SEGMENT_KEY?void 0!==f?{route:f,node:null,dynamicRequestTree:null,children:null}:s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b):_&&0===Object.keys(a[1]).length?s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b):void 0!==f&&void 0!==C&&(0,u.matchSegment)(M,C)&&void 0!==x&&void 0!==f?e(t,x,f,a,c,S,p,h,_,w,b):s(t,f,a,x,c,void 0!==S?S:null,p,h,w,b))){if(null===l.route)return i;null===P&&(P=new Map),P.set(r,l);let e=l.node;if(null!==e){let t=new Map(d);t.set(A,e),R.set(r,t)}let t=l.route;O[r]=t;let n=l.dynamicRequestTree;null!==n?(j=!0,T[r]=n):T[r]=t}else O[r]=a,T[r]=a}if(null===P)return null;let S={lazyData:null,rsc:r.rsc,prefetchRsc:r.prefetchRsc,head:r.head,prefetchHead:r.prefetchHead,loading:r.loading,parallelRoutes:R,navigatedAt:t};return{route:f(a,O),node:S,dynamicRequestTree:j?f(a,T):null,children:P}}(e,t,r,l,!1,a,c,d,p,[],h)}function s(e,t,r,n,u,c,s,p,h,_){return!u&&(void 0===t||(0,l.isNavigatingToNewRootLayout)(t,r))?i:function e(t,r,n,u,l,i,c,s){let p,h,_,y,b=r[1],v=0===Object.keys(b).length;if(void 0!==n&&n.navigatedAt+a.DYNAMIC_STALETIME_MS>t)p=n.rsc,h=n.loading,_=n.head,y=n.navigatedAt;else if(null===u)return d(t,r,null,l,i,c,s);else if(p=u[1],h=u[3],_=v?l:null,y=t,u[4]||i&&v)return d(t,r,u,l,i,c,s);let g=null!==u?u[2]:null,m=new Map,E=void 0!==n?n.parallelRoutes:null,R=new Map(E),O={},P=!1;if(v)s.push(c);else for(let r in b){let n=b[r],u=null!==g?g[r]:null,a=null!==E?E.get(r):void 0,f=n[0],d=c.concat([r,f]),p=(0,o.createRouterCacheKey)(f),h=e(t,n,void 0!==a?a.get(p):void 0,u,l,i,d,s);m.set(r,h);let _=h.dynamicRequestTree;null!==_?(P=!0,O[r]=_):O[r]=n;let y=h.node;if(null!==y){let e=new Map;e.set(p,y),R.set(r,e)}}return{route:r,node:{lazyData:null,rsc:p,prefetchRsc:null,head:_,prefetchHead:null,loading:h,parallelRoutes:R,navigatedAt:y},dynamicRequestTree:P?f(r,O):null,children:m}}(e,r,n,c,s,p,h,_)}function f(e,t){let r=[e[0],t];return 2 in e&&(r[2]=e[2]),3 in e&&(r[3]=e[3]),4 in e&&(r[4]=e[4]),r}function d(e,t,r,n,u,l,a){let i=f(t,t[1]);return i[3]="refetch",{route:t,node:function e(t,r,n,u,l,a,i){let c=r[1],s=null!==n?n[2]:null,f=new Map;for(let r in c){let n=c[r],d=null!==s?s[r]:null,p=n[0],h=a.concat([r,p]),_=(0,o.createRouterCacheKey)(p),y=e(t,n,void 0===d?null:d,u,l,h,i),b=new Map;b.set(_,y),f.set(r,b)}let d=0===f.size;d&&i.push(a);let p=null!==n?n[1]:null,h=null!==n?n[3]:null;return{lazyData:null,parallelRoutes:f,prefetchRsc:void 0!==p?p:null,prefetchHead:d?u:[null,null],loading:void 0!==h?h:null,rsc:v(),head:d?v():null,navigatedAt:t}}(e,t,r,n,u,l,a),dynamicRequestTree:i,children:null}}function p(e,t){t.then(t=>{let{flightData:r}=t;if("string"!=typeof r){for(let t of r){let{segmentPath:r,tree:n,seedData:l,head:a}=t;l&&function(e,t,r,n,l){let a=e;for(let e=0;e{h(e,t)})}function h(e,t){let r=e.node;if(null===r)return;let n=e.children;if(null===n)_(e.route,r,t);else for(let e of n.values())h(e,t);e.dynamicRequestTree=null}function _(e,t,r){let n=e[1],u=t.parallelRoutes;for(let e in n){let t=n[e],l=u.get(e);if(void 0===l)continue;let a=t[0],i=(0,o.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&_(t,c,r)}let l=t.rsc;b(l)&&(null===r?l.resolve(null):l.reject(r));let a=t.head;b(a)&&a.resolve(null)}let y=Symbol();function b(e){return e&&e.tag===y}function v(){let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.status="pending",r.resolve=t=>{"pending"===r.status&&(r.status="fulfilled",r.value=t,e(t))},r.reject=e=>{"pending"===r.status&&(r.status="rejected",r.reason=e,t(e))},r.tag=y,r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ErrorBoundary:function(){return f},ErrorBoundaryHandler:function(){return s}});let n=r(28140),u=r(95155),o=n._(r(12115)),l=r(51486),a=r(5829);r(61489);let i=r(15860),c=(0,r(93913).isBot)(window.navigator.userAgent);class s extends o.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){let{error:r}=t;return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error&&!c?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.HandleISRError,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,u.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function f(e){let{errorComponent:t,errorStyles:r,errorScripts:n,children:o}=e,a=(0,l.useUntrackedPathname)();return t?(0,u.jsx)(s,{pathname:a,errorComponent:t,errorStyles:r,errorScripts:n,children:o}):(0,u.jsx)(u.Fragment,{children:o})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},90535:()=>{"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},92929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return u}});let n=r(2018);function u(e){return(0,n.pathHasPrefix)(e,"/demo")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},93223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{doesStaticSegmentAppearInURL:function(){return c},getCacheKeyForDynamicParam:function(){return s},getParamValueFromCacheKey:function(){return d},getRenderedPathname:function(){return a},getRenderedSearch:function(){return l},parseDynamicParamFromURLPart:function(){return i},urlToUrlWithoutFlightMarker:function(){return f}});let n=r(65360),u=r(64425),o=r(52486);function l(e){let t=e.headers.get(o.NEXT_REWRITTEN_QUERY_HEADER);return null!==t?""===t?"":"?"+t:f(new URL(e.url)).search}function a(e){let t=e.headers.get(o.NEXT_REWRITTEN_PATH_HEADER);return null!=t?t:f(new URL(e.url)).pathname}function i(e,t,r){switch(e){case"c":case"ci":return rencodeURIComponent(e)):[];case"oc":return rencodeURIComponent(e)):null;case"d":case"di":if(r>=t.length)return"";return encodeURIComponent(t[r]);default:return""}}function c(e){return!(e===u.ROOT_SEGMENT_REQUEST_KEY||e.startsWith(n.PAGE_SEGMENT_KEY)||"("===e[0]&&e.endsWith(")"))&&e!==n.DEFAULT_SEGMENT_KEY&&"/_not-found"!==e}function s(e,t){return"string"==typeof e?(0,n.addSearchParamsIfPageSegment)(e,Object.fromEntries(new URLSearchParams(t))):null===e?"":e.join("/")}function f(e){let t=new URL(e);if(t.searchParams.delete(o.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,r=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-r)}return t}function d(e,t){return"c"===t||"oc"===t?e.split("/"):e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},93913:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HTML_LIMITED_BOT_UA_RE:function(){return n.HTML_LIMITED_BOT_UA_RE},HTML_LIMITED_BOT_UA_RE_STRING:function(){return o},getBotType:function(){return i},isBot:function(){return a}});let n=r(14029),u=/Googlebot(?!-)|Googlebot$/i,o=n.HTML_LIMITED_BOT_UA_RE.source;function l(e){return n.HTML_LIMITED_BOT_UA_RE.test(e)}function a(e){return u.test(e)||l(e)}function i(e){return u.test(e)?"dom":l(e)?"html":void 0}},94201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return u}});let n=r(69190);function u(e,t,r){for(let u in r[1]){let o=r[1][u][0],l=(0,n.createRouterCacheKey)(o),a=t.parallelRoutes.get(u);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(u,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"setAttributesFromProps",{enumerable:!0,get:function(){return o}});let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"},n=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"];function u(e){return["async","defer","noModule"].includes(e)}function o(e,t){for(let[o,l]of Object.entries(t)){if(!t.hasOwnProperty(o)||n.includes(o)||void 0===l)continue;let a=r[o]||o.toLowerCase();"SCRIPT"===e.tagName&&u(a)?e[a]=!!l:e.setAttribute(a,String(l)),(!1===l||"SCRIPT"===e.tagName&&u(a)&&(!l||"false"===l))&&(e.setAttribute(a,""),e.removeAttribute(a))}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},95155:(e,t,r)=>{"use strict";e.exports=r(86897)},95704:(e,t,r)=>{"use strict";var n,u;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(u=r.g.process)?void 0:u.env)?r.g.process:r(53965)},96058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return o}});let n=r(73879),u=r(71239);function o(e,t){return(0,u.normalizePathTrailingSlash)((0,n.addPathPrefix)(e,"/demo"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},97332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return u}});let n=r(35737);function u(e,t,r){return(0,n.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98301:(e,t)=>{"use strict";function r(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return r}})},98924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let n=r(49417),u=r(95155),o=n._(r(12115)),l=r(46752);function a(){let e=(0,o.useContext)(l.TemplateContext);return(0,u.jsx)(u.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99062:(e,t,r)=>{"use strict";var n=r(47650),u={stream:!0},o=Object.prototype.hasOwnProperty,l=new Map;function a(e){var t=r(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function i(){}function c(e){for(var t=e[1],n=[],u=0;uf||35===f||114===f||120===f?(d=f,f=3,s++):(d=0,f=3);continue;case 2:44===(b=i[s++])?f=4:h=h<<4|(96i.length&&(b=-1)}var v=i.byteOffset+s;if(-1{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},9072:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},14045:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},15257:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]])},16088:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},30359:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]])},36537:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("DatabaseZap",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]])},37995:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},48139:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},50123:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},56922:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},59947:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},65451:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]])},68669:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]])},69545:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},70175:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},76216:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]])},77802:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]])},79234:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},80403:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},85469:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},85499:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},87024:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("SquareFunction",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]])},94620:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]])},95364:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(14680).A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1333-2601f57e81887558.js b/pages/demo/_next/static/chunks/1333-2601f57e81887558.js
deleted file mode 100644
index 91759597..00000000
--- a/pages/demo/_next/static/chunks/1333-2601f57e81887558.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1333],{6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},20639:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},23327:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},32978:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},35626:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(12115),n=r.t(l,2),a=r(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];x(n)&&"function"==typeof w&&(n=w(n._payload)),l.Children.forEach(n,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof w&&(t=w(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,u=s(r,d);if(!i){if(n||0===n)throw Error(o?M(e):g(e));return n}let p=k(a,i.props??{});return i.type!==l.Fragment&&(p.ref=r?u:d),l.cloneElement(i,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(k,"mergeProps"),p(m,"getElementRef"),p(v,"isSlottable");var b=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(x,"isLazyComponent"),p(A,"isPromiseLike");var g=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],S=r(95155),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71360:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},75426:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78108:(e,t,r)=>{r.d(t,{Z:()=>n});var l=r(12115);function n(e){let t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},78874:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>g,zi:()=>M});var l=r(12115),n=r(92556),a=r(94446),i=r(3468),o=r(70222),c=r(78108),d=r(4129),s=r(97602),u=r(95155),p="Switch",[f,y]=(0,i.A)(p),[h,k]=f(p),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:p,disabled:f,value:y="on",onCheckedChange:k,form:m,...v}=e,[b,g]=l.useState(null),M=(0,a.s)(t,e=>g(e)),w=l.useRef(!1),S=!b||m||!!b.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,u.jsxs)(h,{scope:r,checked:E,disabled:f,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":p,"data-state":A(E),"data-disabled":f?"":void 0,disabled:f,value:y,...v,ref:M,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())})}),S&&(0,u.jsx)(x,{control:b,bubbles:!w.current,name:i,value:y,checked:E,required:p,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=p;var v="SwitchThumb",b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(v,r);return(0,u.jsx)(s.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});b.displayName=v;var x=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var g=m,M=b}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js b/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js
new file mode 100644
index 00000000..a946bd96
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1395-39a84bc45525ef9f.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1395],{1211:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},1897:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},1947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},10002:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},23566:(e,t,n)=>{n.d(t,{q7:()=>I,bL:()=>T,RG:()=>M});var r=n(29320),a=n(62315),o=n(2430),l=n(36103),i=n(65335),d=n(29203),c=n(12377),u=n(82275),s=n(97645),y=n(26276),p="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},f="RovingFocusGroup",[m,k,v]=(0,o.N)(f),[A,M]=(0,i.A)(f,[v]),[x,b]=A(f),g=r.forwardRef((e,t)=>(0,y.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,y.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,y.jsx)(w,{...e,ref:t})})}));g.displayName=f;var w=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:v,onEntryFocus:A,preventScrollOnEntryFocus:M=!1,...b}=e,g=r.useRef(null),w=(0,l.s)(t,g),j=(0,s.jH)(d),[N=null,C]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,u.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,d=(0,u.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[l,e,o,d])]}({prop:f,defaultProp:m,onChange:v}),[T,I]=r.useState(!1),E=(0,u.c)(A),D=k(n),F=r.useRef(!1),[L,z]=r.useState(0);return r.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(p,E),()=>e.removeEventListener(p,E)},[E]),(0,y.jsx)(x,{scope:n,orientation:o,dir:j,loop:i,currentTabStopId:N,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>I(!0),[]),onFocusableItemAdd:r.useCallback(()=>z(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>z(e=>e-1),[]),children:(0,y.jsx)(c.sG.div,{tabIndex:T||0===L?-1:0,"data-orientation":o,...b,ref:w,style:{outline:"none",...e.style},onMouseDown:(0,a.m)(e.onMouseDown,()=>{F.current=!0}),onFocus:(0,a.m)(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!T){let t=new CustomEvent(p,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);R([e.find(e=>e.active),e.find(e=>e.id===N),...e].filter(Boolean).map(e=>e.ref.current),M)}}F.current=!1}),onBlur:(0,a.m)(e.onBlur,()=>I(!1))})})}),j="RovingFocusGroupItem",N=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:i,...u}=e,s=(0,d.B)(),p=i||s,h=b(j,n),f=h.currentTabStopId===p,v=k(n),{onFocusableItemAdd:A,onFocusableItemRemove:M}=h;return r.useEffect(()=>{if(o)return A(),()=>M()},[o,A,M]),(0,y.jsx)(m.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,y.jsx)(c.sG.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o?h.onItemFocus(p):e.preventDefault()}),onFocus:(0,a.m)(e.onFocus,()=>h.onItemFocus(p)),onKeyDown:(0,a.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let a=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return C[a]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=v().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(n,r+1):n.slice(r+1)}setTimeout(()=>R(n))}})})})});N.displayName=j;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}var T=g,I=N},24608:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},27102:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,n)=>{n.d(t,{UC:()=>L,B8:()=>D,bL:()=>E,l9:()=>F});var r=n(29320),a=n(62315),o=n(65335),l=n(23566),i=n(36103),d=n(96886),c=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),l=r.useRef({}),i=r.useRef(e),c=r.useRef("none"),[s,y]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=u(l.current);c.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=l.current,n=i.current;if(n!==e){let r=c.current,a=u(t);e?y("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):n&&r!==a?y("ANIMATION_OUT"):y("UNMOUNT"),i.current=e}},[e,y]),(0,d.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=u(l.current).includes(e.animationName);if(e.target===a&&r&&(y("ANIMATION_END"),!i.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(c.current=u(l.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}y("ANIMATION_END")},[a,y]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{e&&(l.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),l=(0,i.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:l}):null};function u(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var s=n(12377),y=n(97645),p=n(82275),h=n(29203),f=n(26276),m="Tabs",[k,v]=(0,o.A)(m,[l.RG]),A=(0,l.RG)(),[M,x]=k(m),b=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:l,orientation:i="horizontal",dir:d,activationMode:c="automatic",...u}=e,m=(0,y.jH)(d),[k,v]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,p.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,d=(0,p.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[l,e,o,d])]}({prop:a,onChange:o,defaultProp:l});return(0,f.jsx)(M,{scope:n,baseId:(0,h.B)(),value:k,onValueChange:v,orientation:i,dir:m,activationMode:c,children:(0,f.jsx)(s.sG.div,{dir:m,"data-orientation":i,...u,ref:t})})});b.displayName=m;var g="TabsList",w=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=x(g,n),i=A(n);return(0,f.jsx)(l.bL,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:(0,f.jsx)(s.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});w.displayName=g;var j="TabsTrigger",N=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,d=x(j,n),c=A(n),u=T(d.baseId,r),y=I(d.baseId,r),p=r===d.value;return(0,f.jsx)(l.q7,{asChild:!0,...c,focusable:!o,active:p,children:(0,f.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":y,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||o||!e||d.onValueChange(r)})})})});N.displayName=j;var C="TabsContent",R=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:l,...i}=e,d=x(C,n),u=T(d.baseId,a),y=I(d.baseId,a),p=a===d.value,h=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:o||p,children:n=>{let{present:r}=n;return(0,f.jsx)(s.sG.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:y,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&l})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function I(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=C;var E=b,D=w,F=N,L=R},37111:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]])},37995:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39367:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},39727:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},57275:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},59947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},61427:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},64761:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},79092:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},79433:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},85223:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]])},86931:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},89965:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},98123:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js b/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js
deleted file mode 100644
index 80a8c124..00000000
--- a/pages/demo/_next/static/chunks/1417-20c7c0e5ab7f270e.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1417],{7220:(e,t,a)=>{a.d(t,{SQ:()=>l,_2:()=>r,lp:()=>c,mB:()=>u,rI:()=>o,ty:()=>i});var s=a(95155);a(12115);var n=a(42209),d=a(25016);function o(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,s.jsx)(n.l9,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:a=4,...o}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...o})})}function r(e){let{className:t,inset:a,variant:o="default",...i}=e;return(0,s.jsx)(n.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function c(e){let{className:t,inset:a,...o}=e;return(0,s.jsx)(n.JU,{"data-slot":"dropdown-menu-label","data-inset":a,className:(0,d.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...o})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(n.wv,{"data-slot":"dropdown-menu-separator",className:(0,d.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},54679:(e,t,a)=>{a.d(t,{Cf:()=>c,Es:()=>m,L3:()=>f,c7:()=>u,lG:()=>i,rr:()=>x});var s=a(95155);a(12115);var n=a(19080),d=a(65229),o=a(25016);function i(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"dialog",...t})}function l(e){let{...t}=e;return(0,s.jsx)(n.ZL,{"data-slot":"dialog-portal",...t})}function r(e){let{className:t,...a}=e;return(0,s.jsx)(n.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function c(e){let{className:t,children:a,showCloseButton:i=!0,...c}=e;return(0,s.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,s.jsx)(r,{}),(0,s.jsxs)(n.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...c,children:[a,i&&(0,s.jsxs)(n.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(d.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(n.hE,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(n.VY,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...a})}},86233:(e,t,a)=>{a.d(t,{T:()=>u});var s=a(95155),n=a(12115),d=a(35299),o=a(97003),i=a(54679),l=a(33789),r=a(37621),c=a(18720);function u(e){let{open:t,onOpenChange:a,title:u,description:m,children:f,confirmText:x,actionLabel:p="Delete",destructive:g=!0,onConfirm:h}=e,[v,j]=(0,n.useState)(""),[b,N]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t&&j("")},[t]);let w=!b&&(!x||v===x),y=async e=>{if(null==e||e.preventDefault(),w){N(!0);try{await h(),a(!1)}catch(e){c.oR.error((0,r.gJ)(e))}finally{N(!1)}}};return(0,s.jsx)(i.lG,{open:t,onOpenChange:e=>!b&&a(e),children:(0,s.jsx)(i.Cf,{className:"sm:max-w-lg",children:(0,s.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4",children:[(0,s.jsxs)(i.c7,{children:[(0,s.jsx)(i.L3,{children:u}),m&&(0,s.jsx)(i.rr,{asChild:!0,children:(0,s.jsx)("div",{children:m})})]}),f,x&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("label",{className:"text-sm",htmlFor:"confirm-input",children:["To confirm, type ",(0,s.jsx)("span",{className:"bg-muted rounded px-1 font-mono font-medium",children:x})," in the field."]}),(0,s.jsx)(l.p,{id:"confirm-input",autoFocus:!0,autoComplete:"off",value:v,onChange:e=>j(e.target.value),placeholder:x})]}),(0,s.jsxs)(i.Es,{children:[(0,s.jsx)(o.$,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:b,children:"Cancel"}),(0,s.jsxs)(o.$,{type:"submit",variant:g?"destructive":"default",disabled:!w,children:[b&&(0,s.jsx)(d.A,{className:"animate-spin"}),p]})]})]})})})}},91615:(e,t,a)=>{a.d(t,{$:()=>i});var s=a(95155),n=a(24033),d=a(97003),o=a(7220);function i(e){let{items:t,label:a="Actions",disabled:i,size:l="sm"}=e;return(0,s.jsxs)(o.rI,{children:[(0,s.jsx)(o.ty,{asChild:!0,children:(0,s.jsxs)(d.$,{variant:"outline",size:l,disabled:i,children:[a," ",(0,s.jsx)(n.A,{className:"opacity-60"})]})}),(0,s.jsx)(o.SQ,{align:"end",className:"min-w-52",children:t.map((e,t)=>"separator"in e?(0,s.jsx)(o.mB,{},"sep-".concat(t)):"heading"in e?(0,s.jsx)(o.lp,{className:"text-muted-foreground text-xs",children:e.heading},"h-".concat(t)):(0,s.jsxs)(o._2,{disabled:e.disabled,variant:e.destructive?"destructive":"default",onSelect:()=>e.onSelect(),title:e.hint,children:[e.icon,e.label]},e.label))})]})}},95567:(e,t,a)=>{a.d(t,{p:()=>o});var s=a(95155),n=a(43465),d=a(25016);function o(e){let{icon:t=n.A,title:a,description:o,action:i,className:l}=e;return(0,s.jsxs)("div",{className:(0,d.cn)("flex flex-col items-center justify-center gap-2 px-6 py-12 text-center",l),children:[(0,s.jsx)("div",{className:"bg-muted text-muted-foreground mb-1 flex size-11 items-center justify-center rounded-full",children:(0,s.jsx)(t,{className:"size-5"})}),(0,s.jsx)("p",{className:"font-medium",children:a}),o&&(0,s.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:o}),i&&(0,s.jsx)("div",{className:"mt-2",children:i})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js b/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js
new file mode 100644
index 00000000..fec76b6f
--- /dev/null
+++ b/pages/demo/_next/static/chunks/142-5b0f0c3b0268f52a.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[142],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},22012:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},24608:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},68673:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>q});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function p(...e){return t=>{let l=!1,r=e.map(e=>{let r=d(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,d=[];b(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;b(t)&&"function"==typeof w&&(t=w(t._payload)),i=u(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=r.cloneElement(i,void 0,d):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let p=i?k(i):void 0,y=c(l,p);if(!i){if(a||0===a)throw Error(o?M(e):x(e));return a}let h=m(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:p),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var s=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var u=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}h(m,"mergeProps"),h(k,"getElementRef"),h(v,"isSlottable");var A=Symbol.for("react.lazy");function b(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===A&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}h(b,"isLazyComponent"),h(g,"isPromiseLike");var x=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(26276),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});S(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,q=r.forwardRef(j(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js b/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js
new file mode 100644
index 00000000..9e30cabc
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1452-959646fd8a9d848d.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1452],{11363:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(26276);a(29320);var r=a(88674);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},50565:(e,t,a)=>{a.d(t,{d:()=>l});var s=a(26276);a(29320);var r=a(63240),n=a(88674);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,t,a)=>{a.d(t,{J:()=>o});var s=a(26276),r=a(29320),n=a(95774),l=a(5820),i=a(88674);let d=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.b,{ref:t,className:(0,i.cn)(d(),a),...r})});o.displayName=n.b.displayName},74875:(e,t,a)=>{a.d(t,{D:()=>l});var s=a(26276),r=a(50985),n=a(88674);function l(e){let{label:t,htmlFor:a,help:l,error:i,optional:d,children:o,className:c}=e;return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-1.5",c),children:[(0,s.jsxs)(r.J,{htmlFor:a,className:"text-sm font-medium",children:[t,d&&(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,s.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},81452:(e,t,a)=>{a.d(t,{H:()=>Y,RuleWizard:()=>Z});var s=a(26276),r=a(29320),n=a(91052),l=a.n(n),i=a(78113),d=a(7489),o=a(1947),c=a(63991),u=a(80403),m=a(72538),p=a(53630),h=a(40688),x=a(10365),f=a(48947),g=a(31935),v=a(10002),j=a(15410),b=a(34993),N=a(47045),y=a(81155),k=a(50985),w=a(35833),S=a(50565),_=a(11363),C=a(12373),O=a(21444),A=a(74875),J=a(97542),D=a(90554),q=a(21195),E=a(89839),F=a(28971),T=a(73062),z=a(22927),M=a(88674),R=a(20201),$=a(46425);let P=()=>({kind:"lambda",arn:"",mode:"event",input:"",inputPath:"",pathsMap:"",template:"",retries:"",maxAge:"",dlq:""});function I(e){var t,a,s,r,n,l,i;let d=e.input_transformer;return{id:e.id,kind:null!=(s=(0,R.WL)(e.arn))?s:"lambda",arn:e.arn,mode:d?"transformer":e.input_path?"path":e.input?"constant":"event",input:null!=(r=e.input)?r:"",inputPath:null!=(n=e.input_path)?n:"",pathsMap:(null==d?void 0:d.input_paths_map)&&Object.keys(d.input_paths_map).length?JSON.stringify(d.input_paths_map,null,2):"",template:null!=(l=null==d?void 0:d.input_template)?l:"",retries:(null==(t=e.retry_policy)?void 0:t.maximum_retry_attempts)!=null?String(e.retry_policy.maximum_retry_attempts):"",maxAge:(null==(a=e.retry_policy)?void 0:a.maximum_event_age_in_seconds)!=null?String(e.retry_policy.maximum_event_age_in_seconds):"",dlq:null!=(i=e.dead_letter_arn)?i:"",extra:{role_arn:e.role_arn,message_group_id:e.message_group_id}}}function U(e){let t=e.retries.trim()||e.maxAge.trim()?{maximum_retry_attempts:e.retries.trim()?Number(e.retries):void 0,maximum_event_age_in_seconds:e.maxAge.trim()?Number(e.maxAge):void 0}:void 0;return{...e.extra,id:e.id,arn:e.arn,input:"constant"===e.mode?e.input.trim():void 0,input_path:"path"===e.mode?e.inputPath.trim():void 0,input_transformer:"transformer"===e.mode?{input_paths_map:e.pathsMap.trim()?JSON.parse(e.pathsMap):void 0,input_template:e.template}:void 0,retry_policy:t,dead_letter_arn:e.dlq||void 0}}let B=/^\$(\.[A-Za-z0-9_\-]+|\[\d+\])*$/,L=[["Every minute","rate(1 minute)"],["Every 5 minutes","rate(5 minutes)"],["Every 15 minutes","cron(0/15 * * * ? *)"],["Hourly","rate(1 hour)"],["Daily","rate(1 day)"],["Daily at 12:00 UTC","cron(0 12 * * ? *)"],["Weekdays at 09:00 UTC","cron(0 9 ? * MON-FRI *)"],["1st of the month, 00:00 UTC","cron(0 0 1 * ? *)"]],W=["0","12","*","*","?","*"],H=JSON.stringify({source:["my.app"],"detail-type":["order.paid"]},null,2),V=e=>!e||"object"!=typeof e||Array.isArray(e)?"Must be a JSON object":null;function G(e){let t=e.trim();if(!t.startsWith("cron(")||!t.endsWith(")"))return null;let a=t.slice(5,-1).trim().split(/\s+/);return 6===a.length?a:null}function Y(){var e,t,a,s;let r=(0,z.gf)("/api/v1/lambda/functions",{revalidateOnFocus:!1}),n=(0,z.gf)("/api/v1/sqs/queues",{revalidateOnFocus:!1}),l=(0,z.gf)("/api/v1/sns/topics",{revalidateOnFocus:!1}),i=(0,z.gf)("/api/v1/sfn/state-machines",{revalidateOnFocus:!1});return{lambda:{data:null==(e=r.data)?void 0:e.map(e=>({name:e.name,arn:e.arn})),error:r.error},sqs:{data:null==(t=n.data)?void 0:t.map(e=>({name:e.name,arn:e.arn})),error:n.error},sns:{data:null==(a=l.data)?void 0:a.map(e=>({name:e.name,arn:e.arn})),error:l.error},sfn:{data:null==(s=i.data)?void 0:s.map(e=>({name:e.name,arn:e.arn})),error:i.error}}}function Z(){var e;let t=(0,i.useRouter)(),a=(0,z.pE)("name"),n=!!a,j=(0,z.pE)("bus")||"default",[w,Z]=(0,r.useState)(j);(0,r.useEffect)(()=>Z(j),[j]);let K=(0,z.gf)(n?"".concat(R.MU,"/").concat((0,F.aJ)(a)):null,{revalidateOnFocus:!1,keepPreviousData:!1,query:(0,R.nq)(w)}),Q=(0,z.gf)(n?null:R.MU,{revalidateOnFocus:!1,query:(0,R.nq)(w)}),et=Y(),[ea,es]=(0,r.useState)(""),[er,en]=(0,r.useState)(""),[el,ei]=(0,r.useState)("schedule"),[ed,eo]=(0,r.useState)("rate(5 minutes)"),[ec,eu]=(0,r.useState)(W),[em,ep]=(0,r.useState)(!1),[eh,ex]=(0,r.useState)(H),[ef,eg]=(0,r.useState)(""),[ev,ej]=(0,r.useState)(null),[eb,eN]=(0,r.useState)(!1),[ey,ek]=(0,r.useState)([P()]),[ew,eS]=(0,r.useState)(!0),[e_,eC]=(0,r.useState)(!1),[eO,eA]=(0,r.useState)(!1),[eJ,eD]=(0,r.useState)(!1);(0,r.useEffect)(()=>{var e,t;return eg(JSON.stringify({version:"0",id:"6a7e8feb-b491-4cf7-a9f1-bf3703467718","detail-type":"order.paid",source:"my.app",account:null!=(t=null==(e=(0,F.Ht)())?void 0:e.account_id)?t:"000000000000",time:new Date().toISOString().replace(/\.\d+Z$/,"Z"),region:"us-east-1",resources:[],detail:{order_id:"o-1001",total:42}},null,2))},[]),(0,r.useEffect)(()=>{var e,t,a;let s=K.data;if(s&&!e_){if(es(s.name),en(null!=(e=s.description)?e:""),s.schedule_expression){ei("schedule"),eo(s.schedule_expression);let e=G(s.schedule_expression);e&&eu(e)}else ei("pattern"),ex(JSON.stringify(null!=(t=s.event_pattern)?t:{},null,2));ek((null!=(a=s.targets)?a:[]).map(I)),eS("DISABLED"!==s.state),eC(!0)}},[K.data,e_]);let eq=e=>{eo(e);let t=G(e);t&&eu(t)},eE=(0,r.useMemo)(()=>{var e,t;let a={};if(!n){let t=(0,R.qx)(ea);t?a.name=t:(null==(e=Q.data)?void 0:e.some(e=>e.name===ea))&&(a.name="A rule named ".concat(ea," already exists"))}if(er.length>512&&(a.description="Descriptions are at most 512 characters"),"schedule"===el){let e=(0,R.Me)(ed);e?a.schedule=e:"default"!==w&&(a.schedule="Schedules run on the default event bus only")}else{let e=null!=(t=(0,J.F)(eh))?t:V(JSON.parse(eh));e&&(a.pattern=e)}let s=new Set;return ey.forEach((e,t)=>{var r,n;if(e.arn?s.has(e.arn)&&(a["t".concat(t,"arn")]="This target is already added"):a["t".concat(t,"arn")]="Choose a ".concat(null!=(n=null==(r=R.aO.find(t=>t.kind===e.kind))?void 0:r.noun)?n:"target"),s.add(e.arn),"constant"===e.mode){let s=e.input.trim()?(0,J.F)(e.input):"Enter the JSON to send";s&&(a["t".concat(t,"input")]=e.input.trim()?"Invalid JSON: ".concat(s):s)}else if("path"===e.mode)B.test(e.inputPath.trim())||(a["t".concat(t,"input")]="Enter a JSONPath such as $.detail");else if("transformer"===e.mode){if(e.pathsMap.trim()){let s=(0,J.F)(e.pathsMap),r=s?null:JSON.parse(e.pathsMap);s?a["t".concat(t,"paths")]="Invalid JSON: ".concat(s):(!r||"object"!=typeof r||Array.isArray(r)||Object.values(r).some(e=>"string"!=typeof e||!B.test(e)))&&(a["t".concat(t,"paths")]='Must be an object of JSONPaths, e.g. {"id": "$.detail.id"}')}e.template.trim()||(a["t".concat(t,"template")]="The input template is required")}let l=Number(e.retries);e.retries.trim()&&(!Number.isInteger(l)||l<0||l>185)&&(a["t".concat(t,"retries")]="0 to 185");let i=Number(e.maxAge);e.maxAge.trim()&&(!Number.isInteger(i)||i<60||i>86400)&&(a["t".concat(t,"age")]="60 to 86400 seconds")}),a},[n,ea,Q.data,er,el,ed,eh,ey,w]),eF=e=>eO?eE[e]:void 0,eT=0===Object.keys(eE).length,ez=(0,r.useMemo)(()=>"schedule"!==el||(0,R.Me)(ed)?[]:(0,R.Oz)(ed,5),[el,ed]),eM=(0,r.useMemo)(()=>{try{return"rate"===(0,R.nP)(ed).kind}catch(e){return!1}},[ed]),eR=async()=>{var e,t;let a=null!=(e=(0,J.F)(eh))?e:V(JSON.parse(eh)),s=null!=(t=(0,J.F)(ef))?t:V(JSON.parse(ef));if(a||s)return void b.oR.error(a?"Event pattern: ".concat(a):"Sample event: ".concat(s));eN(!0);try{let e=await F.FH.post("".concat(R.W1,"/test-pattern"),{pattern:JSON.parse(eh),event:JSON.parse(ef)});ej(e.result)}catch(e){b.oR.error((0,F.gJ)(e))}finally{eN(!1)}},e$=async()=>{if(eA(!0),!eT)return void b.oR.error("Fix the highlighted fields before saving");let e={description:er.trim(),schedule_expression:"schedule"===el?ed.trim():void 0,event_pattern:"pattern"===el?JSON.parse(eh):void 0,state:ew?"ENABLED":"DISABLED",targets:ey.map(U)};eD(!0);try{let a=await F.FH.put("".concat(R.MU,"/").concat((0,F.aJ)(ea)),e,(0,R.nq)(w)),s=a.schedule_expression&&(0,R.xN)(a)?" Next run ".concat((0,T.Yq)(a.next_run)).concat("DISABLED"===a.state?" once enabled":"","."):"";b.oR.success("".concat(n?"Saved":"Created"," rule ").concat(a.name,".").concat(s)),await (0,z.Yi)(R.MU),t.push((0,R.Gd)(a.name,w))}catch(e){b.oR.error((0,F.gJ)(e)),eD(!1)}},eP=n?"Edit rule ".concat(a):"Create rule",eI=[{label:"EventBridge",href:"/events/"},{label:"Rules",href:"/events/"},...n?[{label:a,href:(0,R.Gd)(a,w)},{label:"Edit"}]:[{label:"Create rule"}]];if(n&&K.error&&!K.data){let e=K.error instanceof F.hD&&404===K.error.status;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,breadcrumbs:eI}),e?(0,s.jsx)(E.w,{children:(0,s.jsx)(C.p,{icon:d.A,title:"Rule not found",description:"Rule ".concat(a," does not exist."),action:(0,s.jsx)(N.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)(l(),{href:"/events/",children:[(0,s.jsx)(o.A,{})," Back to rules"]})})})}):(0,s.jsx)(O.W,{error:K.error,onRetry:()=>K.mutate()})]})}return n&&!e_?(0,s.jsx)(D.P0,{}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(q.z,{title:eP,description:"A rule runs on a schedule or matches published events, then delivers to up to five targets.",breadcrumbs:eI}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),e$()},className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,s.jsx)(E.w,{title:"Rule details",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Event bus",htmlFor:"rule-bus",help:n?"A rule's bus cannot be changed.":"Schedules run on the default bus only; event patterns work on any bus.",children:(0,s.jsx)($.z,{id:"rule-bus",value:w,onChange:Z,disabled:n,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Name",htmlFor:"rule-name",error:eF("name"),help:n?"Rule names cannot be changed.":"Up to 64 letters, digits, dots, hyphens and underscores.",children:(0,s.jsx)(y.p,{id:"rule-name",value:ea,onChange:e=>es(e.target.value),disabled:n,placeholder:"e.g. nightly-report",autoFocus:!n,autoComplete:"off",spellCheck:!1,className:"max-w-md"})}),(0,s.jsx)(A.D,{label:"Description",htmlFor:"rule-desc",optional:!0,error:eF("description"),children:(0,s.jsx)(_.T,{id:"rule-desc",rows:2,value:er,onChange:e=>en(e.target.value),className:"max-w-xl"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Rule type"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",role:"radiogroup","aria-label":"Rule type",children:[["schedule",c.A,"Schedule","Run the targets at a fixed rate or on a cron schedule (UTC)."],["pattern",u.A,"Event pattern","Run the targets when a published event matches a pattern."]].map(e=>{let[t,a,r,n]=e,l=el===t;return(0,s.jsxs)("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>ei(t),className:(0,M.cn)("relative flex gap-3 rounded-lg border p-3 text-left transition-colors",l?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,s.jsx)(a,{className:(0,M.cn)("mt-0.5 size-5 shrink-0",l?"text-primary":"text-muted-foreground")}),(0,s.jsxs)("span",{className:"flex flex-col gap-0.5 pr-6",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:r}),(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]}),l&&(0,s.jsx)("span",{className:"bg-primary text-primary-foreground absolute top-2 right-2 flex size-5 items-center justify-center rounded-full",children:(0,s.jsx)(m.A,{className:"size-3.5"})})]},t)})})]})]})}),"schedule"===el&&(0,s.jsx)(E.w,{title:"Schedule",description:"Times are UTC. The scheduler checks rules at the top of every minute.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.map(e=>{let[t,a]=e;return(0,s.jsx)(N.$,{type:"button",size:"sm",variant:ed.trim()===a?"secondary":"outline",className:"h-7 text-xs",onClick:()=>eq(a),title:a,children:t},a)})}),(0,s.jsx)(A.D,{label:"Schedule expression",htmlFor:"rule-schedule",error:null!=(e=eF("schedule"))?e:ed.trim()&&eE.schedule?eE.schedule:void 0,help:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-mono",children:"rate(N minute|minutes|hour|hours|day|days)"})," or"," ",(0,s.jsx)("span",{className:"font-mono",children:"cron(minutes hours day-of-month month day-of-week year)"})]}),children:(0,s.jsx)(y.p,{id:"rule-schedule",value:ed,onChange:e=>eq(e.target.value),placeholder:"rate(5 minutes)",spellCheck:!1,className:"max-w-md font-mono"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ep(!em),className:"text-primary w-fit text-sm hover:underline",children:em?"Hide cron builder":"Build a cron expression"}),em&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:R.fC.map((e,t)=>(0,s.jsx)(A.D,{label:(0,s.jsx)("span",{className:"text-xs",children:e.label}),htmlFor:"cron-".concat(t),help:e.hint,children:(0,s.jsx)(y.p,{id:"cron-".concat(t),value:ec[t],onChange:e=>((e,t)=>{let a=ec.map((a,s)=>s===e?t:a);eu(a),eo("cron(".concat(a.map(e=>e.trim()||"*").join(" "),")"))})(t,e.target.value),placeholder:e.placeholder,className:"h-8 font-mono",spellCheck:!1})},e.label))}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Use ",(0,s.jsx)("span",{className:"font-mono",children:"*"})," for any value, ",(0,s.jsx)("span",{className:"font-mono",children:"?"})," in exactly one of day-of-month and day-of-week, ranges ",(0,s.jsx)("span",{className:"font-mono",children:"MON-FRI"}),", lists ",(0,s.jsx)("span",{className:"font-mono",children:"1,15"})," and steps"," ",(0,s.jsx)("span",{className:"font-mono",children:"0/15"}),"."]})]})]}),(0,s.jsxs)("div",{className:"bg-muted/30 flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Next runs"," ",!eE.schedule&&(0,s.jsxs)("span",{className:"text-muted-foreground font-normal",children:["\xb7 ",(0,R.Bg)(ed)]})]}),ez.length?(0,s.jsx)("ol",{className:"flex flex-col gap-0.5 text-sm",children:ez.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap gap-x-3",children:[(0,s.jsx)("span",{className:"font-mono text-[13px]",children:(0,R.ay)(e)}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[(0,T.Yq)(e,!1)," local"]})]},e.getTime()))}):(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:eE.schedule?"Enter a valid expression to preview run times.":"No run in the next year."}),(0,s.jsxs)("p",{className:"text-muted-foreground flex gap-1.5 text-xs",children:[(0,s.jsx)(p.A,{className:"mt-px size-3.5 shrink-0"}),(0,s.jsxs)("span",{children:[eM?"Rates are counted from when the rule is saved (then from each run). ":"","This is an estimate: the server computes the exact next run, shown on the rule after saving."]})]})]})]})}),"pattern"===el&&(0,s.jsx)(E.w,{title:"Event pattern",description:"Every key in the pattern must match the event. Arrays list allowed values; nested objects match nested fields.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(A.D,{label:"Pattern",error:eF("pattern"),children:(0,s.jsx)(J.i,{value:eh,onChange:e=>(ex(e),ej(null)),rows:8,validate:V})}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Supported matchers: exact values ",(0,s.jsx)("span",{className:"font-mono",children:'["a","b"]'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"prefix":"ord"}'}),","," ",(0,s.jsx)("span",{className:"font-mono",children:'{"exists":true}'}),", ",(0,s.jsx)("span",{className:"font-mono",children:'{"anything-but":["x"]}'})," and"," ",(0,s.jsx)("span",{className:"font-mono",children:'{"numeric":[">",0,"<=",100]}'}),"."]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Test with a sample event"}),(0,s.jsx)(J.i,{value:ef,onChange:e=>(eg(e),ej(null)),rows:12,validate:V}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",onClick:eR,disabled:eb,children:[eb?(0,s.jsx)(h.A,{className:"animate-spin"}):(0,s.jsx)(x.A,{}),"Test pattern"]}),!0===ev&&(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-sm font-medium text-emerald-700 dark:text-emerald-400",children:[(0,s.jsx)(f.A,{className:"size-4"})," The sample event matches the pattern"]}),!1===ev&&(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1.5 text-sm font-medium",children:[(0,s.jsx)(g.A,{className:"size-4"})," The sample event does not match"]})]})]})]})}),(0,s.jsx)(E.w,{title:"Targets",description:"Each target receives the event JSON, part of it, a constant, or a transformed template. Failed deliveries are retried and can go to a dead-letter queue.",children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[0===ey.length&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"No targets: the rule will fire and count invocations but deliver nothing."}),ey.map((e,t)=>{var a,r,n;return(0,s.jsx)(X,{index:t,row:e,options:et[e.kind],onChange:e=>ek(ey.map((a,s)=>s===t?{...a,...e}:a)),onRemove:()=>ek(ey.filter((e,a)=>a!==t)),queues:et.sqs,errors:{arn:eF("t".concat(t,"arn")),input:eF("t".concat(t,"input")),paths:null!=(a=eF("t".concat(t,"paths")))?a:eE["t".concat(t,"paths")],template:eF("t".concat(t,"template")),retries:null!=(r=eF("t".concat(t,"retries")))?r:eE["t".concat(t,"retries")],age:null!=(n=eF("t".concat(t,"age")))?n:eE["t".concat(t,"age")]}},t)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(N.$,{type:"button",variant:"outline",size:"sm",disabled:ey.length>=5,onClick:()=>ek([...ey,P()]),children:[(0,s.jsx)(v.A,{})," Add target"]}),(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[ey.length," of 5"]})]})]})})]}),(0,s.jsx)("aside",{className:"xl:sticky xl:top-4",children:(0,s.jsx)(E.w,{title:"Summary",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(k.J,{htmlFor:"rule-enabled",className:"font-medium",children:"Enabled"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Disabled rules keep their configuration but never fire."})]}),(0,s.jsx)(S.d,{id:"rule-enabled",checked:ew,onCheckedChange:eS})]}),(0,s.jsxs)("dl",{className:"flex flex-col gap-3 border-t pt-3 text-sm",children:[(0,s.jsx)(ee,{label:"Name",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ea||"-"})}),(0,s.jsx)(ee,{label:"Type",children:"schedule"===el?"Schedule":"Event pattern"}),"schedule"===el?(0,s.jsx)(ee,{label:"Schedule",children:(0,s.jsx)("span",{className:"font-mono text-[13px] break-all",children:ed||"-"})}):(0,s.jsx)(ee,{label:"Pattern",children:(0,s.jsx)("span",{className:"font-mono text-[12.5px] break-all",children:(0,J.F)(eh)?"Invalid JSON":(0,R.tJ)(JSON.parse(eh),140)})}),(0,s.jsx)(ee,{label:"Targets",children:ey.filter(e=>e.arn).length?(0,s.jsx)("ul",{className:"flex flex-col gap-0.5",children:ey.filter(e=>e.arn).map(e=>{var t;return(0,s.jsxs)("li",{className:"truncate",children:[(0,s.jsxs)("span",{className:"text-muted-foreground text-xs",children:[null==(t=R.aO.find(t=>t.kind===e.kind))?void 0:t.label,":"]})," ",(0,R.je)(e.arn)]},e.arn)})}):"None"})]}),eO&&!eT&&(0,s.jsx)("p",{className:"text-destructive text-xs",children:"Some settings need attention. Check the highlighted fields."}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,s.jsxs)(N.$,{type:"submit",disabled:eJ,children:[eJ&&(0,s.jsx)(h.A,{className:"animate-spin"}),n?"Save changes":"Create rule"]}),(0,s.jsx)(N.$,{type:"button",variant:"outline",asChild:!0,children:(0,s.jsx)(l(),{href:n?(0,R.Gd)(a,w):"/events/",children:"Cancel"})})]})]})})})]})]})}let K=[{value:"event",label:"Matched event",help:"The whole event JSON."},{value:"path",label:"Part of the matched event",help:"The value at a JSONPath of the event."},{value:"constant",label:"Constant (JSON text)",help:"Fixed JSON instead of the event."},{value:"transformer",label:"Input transformer",help:"Extract values into variables, then fill a template."}],Q="__none__";function X(e){var t,a,n;let{index:l,row:i,options:d,queues:o,onChange:c,onRemove:u,errors:m}=e,[p,h]=(0,r.useState)(!1),x=p||!!(i.retries||i.maxAge||i.dlq),f=R.aO.find(e=>e.kind===i.kind),g=null!=(t=d.data)?t:[],v=i.arn&&d.data&&!g.some(e=>e.arn===i.arn),b=null!=(a=o.data)?a:[],k=K.find(e=>e.value===i.mode);return(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Target ",l+1]}),(0,s.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",className:"size-7",onClick:u,"aria-label":"Remove target",children:(0,s.jsx)(j.A,{})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[12rem_minmax(0,1fr)]",children:[(0,s.jsx)(A.D,{label:"Target type",children:(0,s.jsxs)(w.l6,{value:i.kind,onValueChange:e=>c({kind:e,arn:""}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Target type",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:R.aO.map(e=>(0,s.jsx)(w.eb,{value:e.kind,children:e.label},e.kind))})]})}),(0,s.jsx)(A.D,{label:f.label,error:null!=(n=m.arn)?n:d.error?(0,F.gJ)(d.error):void 0,help:i.arn?(0,s.jsx)("span",{className:"font-mono break-all",children:i.arn}):void 0,children:(0,s.jsxs)(w.l6,{value:i.arn,onValueChange:e=>c({arn:e}),disabled:!d.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":f.label,children:(0,s.jsx)(w.yv,{placeholder:d.data?g.length?"Choose a ".concat(f.noun):"No ".concat(f.noun,"s found"):"Loading..."})}),(0,s.jsxs)(w.gC,{children:[v&&(0,s.jsxs)(w.eb,{value:i.arn,children:[(0,R.je)(i.arn)," ",(0,s.jsx)("span",{className:"text-destructive text-xs",children:"(not found)"})]}),g.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]}),(0,s.jsx)(A.D,{label:"Configure target input",help:k.help,children:(0,s.jsxs)(w.l6,{value:i.mode,onValueChange:e=>c({mode:e}),children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full sm:w-72","aria-label":"Target input",children:(0,s.jsx)(w.yv,{})}),(0,s.jsx)(w.gC,{children:K.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})}),"constant"===i.mode&&(0,s.jsx)(A.D,{label:"Constant input (JSON)",error:m.input,children:(0,s.jsx)(_.T,{rows:3,value:i.input,onChange:e=>c({input:e.target.value}),placeholder:'{"task": "cleanup"}',className:"font-mono text-[13px]",spellCheck:!1})}),"path"===i.mode&&(0,s.jsx)(A.D,{label:"Input path",error:m.input,help:"For example $.detail sends only the event's detail object.",children:(0,s.jsx)(y.p,{value:i.inputPath,onChange:e=>c({inputPath:e.target.value}),placeholder:"$.detail",className:"h-8 font-mono text-[13px]",spellCheck:!1})}),"transformer"===i.mode&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.D,{label:"Input path",optional:!0,error:m.paths,help:"A JSON object mapping variable names to JSONPaths into the event.",children:(0,s.jsx)(_.T,{rows:3,value:i.pathsMap,onChange:e=>c({pathsMap:e.target.value}),placeholder:'{\n "order": "$.detail.order_id",\n "source": "$.source"\n}',className:"font-mono text-[13px]",spellCheck:!1})}),(0,s.jsx)(A.D,{label:"Template",error:m.template,help:"Use placeholders. inserts the whole event, the rule name.",children:(0,s.jsx)(_.T,{rows:3,value:i.template,onChange:e=>c({template:e.target.value}),placeholder:'{"text": "Order from "}',className:"font-mono text-[13px]",spellCheck:!1})})]}),(0,s.jsxs)("label",{className:"flex w-fit items-center gap-2 text-sm",children:[(0,s.jsx)(S.d,{checked:x,onCheckedChange:e=>{h(e),e||c({retries:"",maxAge:"",dlq:""})},"aria-label":"Retry policy and dead-letter queue"}),"Retry policy and dead-letter queue"]}),x&&(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,s.jsx)(A.D,{label:"Maximum age of event",error:m.age,help:"Seconds, 60-86400 (default 86400).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.maxAge,onChange:e=>c({maxAge:e.target.value.replace(/[^\d]/g,"")}),placeholder:"86400",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Retry attempts",error:m.retries,help:"0-185 (default 185).",children:(0,s.jsx)(y.p,{inputMode:"numeric",value:i.retries,onChange:e=>c({retries:e.target.value.replace(/[^\d]/g,"")}),placeholder:"185",className:"h-8"})}),(0,s.jsx)(A.D,{label:"Dead-letter queue",help:"Undeliverable events go to this SQS queue.",error:o.error?(0,F.gJ)(o.error):void 0,children:(0,s.jsxs)(w.l6,{value:i.dlq||Q,onValueChange:e=>c({dlq:e===Q?"":e}),disabled:!o.data,children:[(0,s.jsx)(w.bq,{size:"sm",className:"w-full","aria-label":"Dead-letter queue",children:(0,s.jsx)(w.yv,{placeholder:"None"})}),(0,s.jsxs)(w.gC,{children:[(0,s.jsx)(w.eb,{value:Q,children:"None"}),i.dlq&&!b.some(e=>e.arn===i.dlq)&&(0,s.jsx)(w.eb,{value:i.dlq,children:(0,R.je)(i.dlq)}),b.map(e=>(0,s.jsx)(w.eb,{value:e.arn,children:e.name},e.arn))]})]})})]})]})}function ee(e){let{label:t,children:a}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground text-xs font-medium",children:t}),(0,s.jsx)("dd",{className:"min-w-0 break-words",children:a})]})}},89839:(e,t,a)=>{a.d(t,{w:()=>n});var s=a(26276),r=a(88674);function n(e){let{title:t,description:a,actions:n,children:l,className:i,bodyClassName:d,flush:o}=e;return(0,s.jsxs)("section",{className:(0,r.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||n)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),n&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:n})]}),(0,s.jsx)("div",{className:(0,r.cn)(!o&&"p-4",d),children:l})]})}},97542:(e,t,a)=>{a.d(t,{F:()=>c,i:()=>u});var s=a(26276),r=a(29320),n=a(7489),l=a(48947),i=a(79092),d=a(47045),o=a(88674);function c(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:t,onChange:a,rows:u=16,readOnly:m,validate:p,className:h,id:x}=e,f=(0,r.useMemo)(()=>{let e=c(t);return e||(p?p(JSON.parse(t)):null)},[t,p]),g=Math.max(t.split("\n").length,u);return(0,s.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",h),children:[(0,s.jsxs)("div",{className:(0,o.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",f&&!m&&"border-destructive/60"),children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:g},(e,t)=>(0,s.jsx)("div",{children:t+1},t))}),(0,s.jsx)("textarea",{id:x,value:t,readOnly:m,onChange:e=>null==a?void 0:a(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!m){e.preventDefault();let s=e.currentTarget,{selectionStart:r,selectionEnd:n}=s,l=t.slice(0,r)+" "+t.slice(n);null==a||a(l),requestAnimationFrame(()=>{s.selectionStart=s.selectionEnd=r+2})}},spellCheck:!1,rows:g,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!m&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[f?(0,s.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,s.jsx)(n.A,{className:"size-3.5"})," ",f]}):(0,s.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,s.jsx)(l.A,{className:"size-3.5"})," Valid JSON"]}),(0,s.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==a||a(JSON.stringify(JSON.parse(t),null,2))}catch(e){}},disabled:!!c(t),children:[(0,s.jsx)(i.A,{})," Format"]})]})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js b/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js
new file mode 100644
index 00000000..2158bfbc
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1457-fd95b6d33da31afc.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1457],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),s=r(12377),p=r(26276),u="Switch",[f,y]=(0,i.A)(u),[h,m]=f(u),b=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:y="on",onCheckedChange:m,form:b,...k}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),S=l.useRef(!1),E=!v||b||!!v.closest("form"),[M=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:m});return(0,p.jsxs)(h,{scope:r,checked:M,disabled:f,children:[(0,p.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":M,"aria-required":u,"data-state":g(M),"data-disabled":f?"":void 0,disabled:f,value:y,...k,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,p.jsx)(A,{control:v,bubbles:!S.current,name:i,value:y,checked:M,required:u,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});b.displayName=u;var k="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=m(k,r);return(0,p.jsx)(s.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=k;var A=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,p.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var x=b,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},76216:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];A(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(k(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?b(i):void 0,p=s(r,d);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=m(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?p:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var y=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}u(m,"mergeProps"),u(b,"getElementRef"),u(k,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&g(e._payload)}function g(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(g,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],E=r(26276),M=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});M(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js b/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js
new file mode 100644
index 00000000..a2ab2ce5
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1481-269b428d2ec485b3.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1481],{2430:(e,t,r)=>{r.d(t,{N:()=>c});var l=r(29320),n=r(65335),o=r(36103),a=r(18442),i=r(26276);function c(e){let t=e+"CollectionProvider",[r,c]=(0,n.A)(t),[s,d]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:r}=e,n=l.useRef(null),o=l.useRef(new Map).current;return(0,i.jsx)(s,{scope:t,itemMap:o,collectionRef:n,children:r})};u.displayName=t;let m=e+"CollectionSlot",f=l.forwardRef((e,t)=>{let{scope:r,children:l}=e,n=d(m,r),c=(0,o.s)(t,n.collectionRef);return(0,i.jsx)(a.DX,{ref:c,children:l})});f.displayName=m;let y=e+"CollectionItemSlot",p="data-radix-collection-item",h=l.forwardRef((e,t)=>{let{scope:r,children:n,...c}=e,s=l.useRef(null),u=(0,o.s)(t,s),m=d(y,r);return l.useEffect(()=>(m.itemMap.set(s,{ref:s,...c}),()=>void m.itemMap.delete(s))),(0,i.jsx)(a.DX,{...{[p]:""},ref:u,children:n})});return h.displayName=y,[{Provider:u,Slot:f,ItemSlot:h},function(t){let r=d(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},c]}},3209:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},21308:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>d});var l=r(29320),n=(e,t,r,l,n,o,a,i)=>{let c=document.documentElement,s=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,l=r&&o?n.map(e=>o[e]||e):n;r?(c.classList.remove(...l),c.classList.add(o&&o[t]?o[t]:t)):c.setAttribute(e,t)}),r=t,i&&s.includes(r)&&(c.style.colorScheme=r)}if(l)d(l);else try{let e=localStorage.getItem(t)||r,l=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(l)}catch(e){}},o=["light","dark"],a="(prefers-color-scheme: dark)",i=l.createContext(void 0),c={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=l.useContext(i))?e:c},d=e=>l.useContext(i)?l.createElement(l.Fragment,null,e.children):l.createElement(m,{...e}),u=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:n=!0,enableColorScheme:c=!0,storageKey:s="theme",themes:d=u,defaultTheme:m=n?"system":"light",attribute:b="data-theme",value:v,children:g,nonce:k,scriptProps:x}=e,[S,w]=l.useState(()=>y(s,m)),[E,A]=l.useState(()=>"system"===S?h():S),C=v?Object.values(v):d,M=l.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=h());let l=v?v[t]:t,a=r?p(k):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...C),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(b)?b.forEach(s):s(b),c){let e=o.includes(m)?m:null,r=o.includes(t)?t:e;i.style.colorScheme=r}null==a||a()},[k]),R=l.useCallback(e=>{let t="function"==typeof e?e(S):e;w(t);try{localStorage.setItem(s,t)}catch(e){}},[S]),j=l.useCallback(e=>{A(h(e)),"system"===S&&n&&!t&&M("system")},[S,t]);l.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(j),j(e),()=>e.removeListener(j)},[j]),l.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?w(e.newValue):R(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[R]),l.useEffect(()=>{M(null!=t?t:S)},[t,S]);let P=l.useMemo(()=>({theme:S,setTheme:R,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:n?[...d,"system"]:d,systemTheme:n?E:void 0}),[S,R,t,E,n,d]);return l.createElement(i.Provider,{value:P},l.createElement(f,{forcedTheme:t,storageKey:s,attribute:b,enableSystem:n,enableColorScheme:c,defaultTheme:m,value:v,themes:d,nonce:k,scriptProps:x}),g)},f=l.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:i,defaultTheme:c,value:s,themes:d,nonce:u,scriptProps:m}=e,f=JSON.stringify([o,r,c,t,d,s,a,i]).slice(1,-1);return l.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(f,")")}})}),y=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},39367:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},40688:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},49305:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},82708:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},84083:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},89965:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},91276:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(29320),n=r.t(l,2),o=r(93993),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function s(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,i=!1,c=[];k(n)&&"function"==typeof E&&(n=E(n._payload)),l.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof E&&(t=E(t._payload)),a=p(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=l.cloneElement(a,void 0,c):!i&&1===l.Children.count(n)&&l.isValidElement(n)&&(a=n);let s=a?b(a):void 0,u=d(r,s);if(!a){if(n||0===n)throw Error(i?w(e):S(e));return n}let m=h(o,a.props??{});return a.type!==l.Fragment&&(m.ref=r?u:s),l.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}m(f,"createSlot");var y=Symbol.for("radix.slottable");m(function(e){let t=m(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var p=m((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let r={...t};for(let l in t){let n=e[l],o=t[l];/^on[A-Z]/.test(l)?n&&o?r[l]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...o}:"className"===l&&(r[l]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}m(h,"mergeProps"),m(b,"getElementRef"),m(v,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}m(k,"isLazyComponent"),m(x,"isPromiseLike");var S=m(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=m(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),E=n[" use ".trim().toString()],A=r(26276),C=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,A.jsx)(n?r:t,{...o,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});C(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,A.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},97645:(e,t,r)=>{r.d(t,{jH:()=>o});var l=r(29320);r(26276);var n=l.createContext(void 0);function o(e){let t=l.useContext(n);return e||t||"ltr"}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js b/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js
new file mode 100644
index 00000000..ed233ccd
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1490-839e6ed2aa0a8eee.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1490],{7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(29320),a=l.t(r,2),n=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,c=[];A(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let d=i?m(i):void 0,y=p(l,d);if(!i){if(a||0===a)throw Error(o?M(e):g(e));return a}let u=k(n,i.props??{});return i.type!==r.Fragment&&(u.ref=l?y:d),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var h=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var s=u((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}u(k,"mergeProps"),u(m,"getElementRef"),u(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}u(A,"isLazyComponent"),u(x,"isPromiseLike");var g=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(26276),C=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});C(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,E.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},98123:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js b/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js
new file mode 100644
index 00000000..6c58facc
--- /dev/null
+++ b/pages/demo/_next/static/chunks/150-46fef33977dc7f29.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[150],{17286:(e,t,n)=>{n.d(t,{Rh:()=>f,Wh:()=>b});var s=n(26276),a=n(40688),r=n(48947),l=n(31935),i=n(64761),c=n(64206),o=n(46319),d=n(42812),u=n(88674);let m={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},x={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),g={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let t=g[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function p(e){let{tone:t,spinning:n}=e,m="size-3.5 shrink-0";if(n)return(0,s.jsx)(a.A,{className:(0,u.cn)(m,"animate-spin")});switch(t){case"success":return(0,s.jsx)(r.A,{className:m});case"danger":return(0,s.jsx)(l.A,{className:m});case"warning":return(0,s.jsx)(i.A,{className:m});case"info":return(0,s.jsx)(c.A,{className:(0,u.cn)(m,"fill-current")});default:return"neutral"===t?(0,s.jsx)(o.A,{className:m}):(0,s.jsx)(d.A,{className:m})}}function b(e){var t;let{status:n,label:a,tone:r,className:l}=e,i=null!=r?r:null!=(t=x[n.toLowerCase()])?t:"neutral",c=null!=a?a:f(n);return(0,s.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",m[i],l),children:[(0,s.jsx)(p,{tone:i,spinning:h.has(n.toLowerCase())}),(0,s.jsx)("span",{children:c})]})}},27374:(e,t,n)=>{n.d(t,{NG:()=>v,eN:()=>b,pJ:()=>N,q:()=>p,rj:()=>f,ti:()=>j});var s=n(26276),a=n(29320),r=n(98123),l=n(9443),i=n(9828),c=n(47045),o=n(89839),d=n(53023),u=n(76962),m=n(21444),x=n(60528),h=n(22927),g=n(88674);function f(e){let t=/^[a-z0-9.-]*$/.test(e),n=e.length>0&&/^[a-z0-9]/.test(e)&&/[a-z0-9]$/.test(e);return[{label:"Between 3 and 63 characters",ok:e.length>=3&&e.length<=63},{label:"Only lowercase letters, digits, dots (.) and hyphens (-)",ok:e.length>0&&t},{label:"Starts and ends with a letter or digit",ok:n}]}function p(e){return f(e).every(e=>e.ok)}let b=(e,t)=>{let n=new URLSearchParams({name:e,...t});return"/s3/bucket/?".concat(n.toString())};function j(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1).toLowerCase():""}function v(e){let{code:t,className:n}=e;return(0,s.jsxs)("div",{className:(0,g.cn)("bg-muted/50 relative rounded-md border",n),children:[(0,s.jsx)("pre",{className:"overflow-x-auto p-3 pr-10 font-mono text-[12.5px] leading-5 whitespace-pre",children:t}),(0,s.jsx)("div",{className:"absolute top-2 right-2",children:(0,s.jsx)(u.i8,{value:t,label:"Copy code"})})]})}function k(e){let{value:t}=e,[n,i]=(0,a.useState)(!1);return(0,s.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1",children:[(0,s.jsx)("span",{className:"truncate font-mono text-[13px]",children:n?t:"•".repeat(Math.min(24,t.length||8))}),(0,s.jsx)("button",{type:"button",onClick:()=>i(!n),"aria-label":n?"Hide":"Show",className:"text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded",children:n?(0,s.jsx)(r.A,{className:"size-3.5"}):(0,s.jsx)(l.A,{className:"size-3.5"})}),(0,s.jsx)(u.i8,{value:t,label:"Copy secret"})]})}function N(e){let{bucket:t}=e,{data:n,error:r,isLoading:l,mutate:g}=(0,h.gf)("/api/v1/s3/credentials",{revalidateOnFocus:!1}),[f,p]=(0,a.useState)(!!t),b=n?["export AWS_ACCESS_KEY_ID=".concat(n.access_key_id),"export AWS_SECRET_ACCESS_KEY=".concat(n.secret_access_key),"export AWS_DEFAULT_REGION=".concat(n.region),"","aws --endpoint-url ".concat(n.endpoint," s3 ls").concat(t?" s3://".concat(t,"/"):"")].join("\n"):"";return(0,s.jsx)(o.w,{title:(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"text-muted-foreground size-4"})," S3 API access"]}),description:"The HomeCloud S3 endpoint speaks the S3 protocol: point any AWS SDK or the AWS CLI at it.",actions:(0,s.jsxs)(c.$,{variant:"outline",size:"sm",onClick:()=>p(!f),children:[f?"Hide":"Show"," details"]}),className:f?void 0:"[&>header]:border-b-0",bodyClassName:f?void 0:"hidden",children:r?(0,s.jsx)(m.W,{error:r,onRetry:()=>g()}):l||!n?(0,s.jsx)(x.E,{className:"h-24"}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.v,{columns:2,items:[{label:"Endpoint",value:(0,s.jsx)(u.xh,{value:n.endpoint})},{label:"Region",value:(0,s.jsx)(u.xh,{value:n.region})},{label:"Access key ID",value:(0,s.jsx)(u.xh,{value:n.access_key_id})},{label:"Secret access key",value:(0,s.jsx)(k,{value:n.secret_access_key})}]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"AWS CLI example"}),(0,s.jsx)(v,{code:b})]})]})})}},28553:(e,t,n)=>{n.d(t,{LY:()=>u,O6:()=>c,_y:()=>o,fP:()=>d});var s=n(26276),a=n(15410),r=n(10002),l=n(47045),i=n(81155);function c(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,n]=e;return{key:t,value:n}})}function o(e){let t={};for(let n of e)n.key.trim()&&(t[n.key.trim()]=n.value);return Object.keys(t).length?t:void 0}function d(e){let{rows:t,onChange:n,keyPlaceholder:c="Key",valuePlaceholder:o="Value",addLabel:d="Add tag",max:u=50}=e,m=(e,s)=>n(t.map((t,n)=>n===e?{...t,...s}:t));return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,s.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,s.jsx)("span",{children:c}),(0,s.jsx)("span",{children:o})]}),t.map((e,r)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,s.jsx)(i.p,{value:e.key,onChange:e=>m(r,{key:e.target.value}),placeholder:c,className:"h-8"}),(0,s.jsx)(i.p,{value:e.value,onChange:e=>m(r,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,s.jsx)(l.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>n(t.filter((e,t)=>t!==r)),"aria-label":"Remove",children:(0,s.jsx)(a.A,{})})]},r)),(0,s.jsx)("div",{children:(0,s.jsxs)(l.$,{type:"button",variant:"outline",size:"sm",onClick:()=>n([...t,{key:"",value:""}]),disabled:t.length>=u,children:[(0,s.jsx)(r.A,{})," ",d]})})]})}function u(e){let{tags:t}=e,n=Object.entries(null!=t?t:{});return n.length?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(e=>{let[t,n]=e;return(0,s.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:t}),n&&(0,s.jsxs)("span",{children:["=",n]})]},t)})}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},50565:(e,t,n)=>{n.d(t,{d:()=>l});var s=n(26276);n(29320);var a=n(63240),r=n(88674);function l(e){let{className:t,...n}=e;return(0,s.jsx)(a.bL,{"data-slot":"switch",className:(0,r.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:(0,s.jsx)(a.zi,{"data-slot":"switch-thumb",className:(0,r.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},50985:(e,t,n)=>{n.d(t,{J:()=>o});var s=n(26276),a=n(29320),r=n(95774),l=n(5820),i=n(88674);let c=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,s.jsx)(r.b,{ref:t,className:(0,i.cn)(c(),n),...a})});o.displayName=r.b.displayName},53023:(e,t,n)=>{n.d(t,{v:()=>r});var s=n(26276),a=n(88674);function r(e){let{items:t,columns:n=3,className:r}=e;return(0,s.jsx)("dl",{className:(0,a.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[n],r),children:t.map(e=>(0,s.jsxs)("div",{className:(0,a.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,s.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,s.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},73062:(e,t,n)=>{n.d(t,{Fl:()=>h,YI:()=>i,Yq:()=>o,ZV:()=>l,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>r,td:()=>x,z3:()=>a});let s=["B","KB","MB","GB","TB","PB"];function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),a=0;for(;n>=1024&&a=100?0:t);return"".concat(e<0?"-":"").concat(r," ").concat(s[a])}function r(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function i(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return a(e);case"Bytes/Second":return"".concat(a(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function c(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function o(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=c(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=c(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=c(e);if(!n)return"-";let s=(n.getTime()-t)/1e3,a=Math.abs(s),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(a<45||s>0&&s<60)return"just now";let l=s;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function h(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},74875:(e,t,n)=>{n.d(t,{D:()=>l});var s=n(26276),a=n(50985),r=n(88674);function l(e){let{label:t,htmlFor:n,help:l,error:i,optional:c,children:o,className:d}=e;return(0,s.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-1.5",d),children:[(0,s.jsxs)(a.J,{htmlFor:n,className:"text-sm font-medium",children:[t,c&&(0,s.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,s.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},76035:(e,t,n)=>{n.d(t,{$:()=>w,E:()=>C});var s=n(26276),a=n(29320),r=n(78113),l=n(48947),i=n(64206),c=n(64761),o=n(40688),d=n(34993),u=n(47045),m=n(10646),x=n(64573),h=n(81155),g=n(50985),f=n(50565),p=n(62083),b=n(74875),j=n(28553),v=n(28971),k=n(22927),N=n(88674),y=n(27374);function w(e){let{open:t,onOpenChange:n}=e,p=(0,r.useRouter)(),[w,C]=(0,a.useState)(""),[S,A]=(0,a.useState)(!1),[_,E]=(0,a.useState)(!0),[z,B]=(0,a.useState)(!1),[F,D]=(0,a.useState)([]),[L,I]=(0,a.useState)(!1),[R,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(C(""),A(!1),E(!0),B(!1),D([]),M(!1))},[t]);let O=(0,y.rj)(w),T=(0,y.q)(w),J=async e=>{if(e.preventDefault(),M(!0),T){I(!0);try{await v.FH.post("/api/v1/s3/buckets",{name:w,versioning:S,public:!_,object_lock:z,tags:(0,j._y)(F)}),d.oR.success("Bucket ".concat(w," created")),(0,k.Yi)("/api/v1/s3"),n(!1),p.push((0,y.eN)(w))}catch(e){d.oR.error((0,v.gJ)(e))}finally{I(!1)}}};return(0,s.jsx)(x.lG,{open:t,onOpenChange:e=>!L&&n(e),children:(0,s.jsx)(x.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,s.jsxs)("form",{onSubmit:J,className:"flex flex-col gap-5",children:[(0,s.jsxs)(x.c7,{children:[(0,s.jsx)(x.L3,{children:"Create bucket"}),(0,s.jsx)(x.rr,{children:"Buckets are containers for objects stored in HomeCloud S3."})]}),(0,s.jsxs)(b.D,{label:"Bucket name",htmlFor:"bucket-name",children:[(0,s.jsx)(h.p,{id:"bucket-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:w,onChange:e=>C(e.target.value),onBlur:()=>M(!0),placeholder:"my-bucket","aria-invalid":R&&!T}),(0,s.jsx)("ul",{className:"mt-1 flex flex-col gap-1 text-xs",children:O.map(e=>(0,s.jsxs)("li",{className:(0,N.cn)("flex items-center gap-1.5",e.ok?"text-emerald-600 dark:text-emerald-400":R||w?"text-destructive":"text-muted-foreground"),children:[e.ok?(0,s.jsx)(l.A,{className:"size-3.5"}):(0,s.jsx)(i.A,{className:"size-3.5"}),e.label]},e.label))})]}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-versioning",className:"font-medium",children:"Bucket versioning"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Keep multiple variants of an object to recover from overwrites and deletes."})]}),(0,s.jsx)(f.d,{id:"bucket-versioning",checked:S,onCheckedChange:A})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-block",className:"font-medium",children:"Block all public access"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"When off, anyone can read objects in this bucket without credentials."})]}),(0,s.jsx)(f.d,{id:"bucket-block",checked:_,onCheckedChange:E})]}),!_&&(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50 p-2 text-xs text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300",children:[(0,s.jsx)(c.A,{className:"mt-0.5 size-3.5 shrink-0"}),"Objects in this bucket will be publicly readable by anyone who can reach the S3 endpoint."]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,s.jsx)(m.S,{id:"bucket-lock",checked:z,onCheckedChange:e=>B(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-lock",className:"font-medium",children:"Enable Object Lock"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Store objects using a write-once-read-many model. Can only be set at creation."})]})]}),(0,s.jsx)(b.D,{label:"Tags",optional:!0,children:(0,s.jsx)(j.fP,{rows:F,onChange:D})}),(0,s.jsxs)(x.Es,{children:[(0,s.jsx)(u.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:L,children:"Cancel"}),(0,s.jsxs)(u.$,{type:"submit",disabled:L||R&&!T,children:[L&&(0,s.jsx)(o.A,{className:"animate-spin"}),"Create bucket"]})]})]})})})}function C(e){let{bucket:t,open:n,onOpenChange:r,onDeleted:l}=e,[i,o]=(0,a.useState)(!1),[u,x]=(0,a.useState)(null);return(0,a.useEffect)(()=>{n&&(o(!1),x(null))},[n]),(0,s.jsxs)(p.T,{open:n,onOpenChange:r,title:"Delete bucket ".concat(t,"?"),description:"Deleting a bucket cannot be undone. Bucket names are unique; another bucket with this name can be created afterwards.",confirmText:t,actionLabel:"Delete bucket",onConfirm:async()=>{x(null);try{await v.FH.del("/api/v1/s3/buckets/".concat((0,v.aJ)(t)),i?{force:"true"}:void 0)}catch(e){throw e instanceof v.hD&&"BucketNotEmpty"===e.code?x("The bucket is not empty. Select “Empty the bucket first” to delete all objects together with the bucket."):x((0,v.gJ)(e)),e}d.oR.success("Bucket ".concat(t," deleted")),(0,k.Yi)("/api/v1/s3"),null==l||l()},children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,s.jsx)(m.S,{id:"bucket-force",checked:i,onCheckedChange:e=>o(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(g.J,{htmlFor:"bucket-force",className:"font-medium",children:"Empty the bucket first (delete all objects)"}),(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Every object and object version in the bucket is permanently deleted."})]})]}),u&&(0,s.jsxs)("div",{className:"border-destructive/30 bg-destructive/5 text-destructive flex items-start gap-2 rounded-md border p-3 text-sm",children:[(0,s.jsx)(c.A,{className:"mt-0.5 size-4 shrink-0"}),(0,s.jsx)("span",{children:u})]})]})}},76962:(e,t,n)=>{n.d(t,{Dk:()=>u,i8:()=>m,xh:()=>x});var s=n(26276),a=n(29320),r=n(72538),l=n(37995),i=n(34993),c=n(47045),o=n(47006),d=n(88674);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(s){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let n=document.execCommand("copy");return document.body.removeChild(t),n}}function m(e){let{value:t,label:n,className:m,size:x="icon",toastMessage:h}=e,[g,f]=(0,a.useState)(!1),p=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},b=g?r.A:l.A;return"sm"===x?(0,s.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:p,className:m,children:[(0,s.jsx)(b,{className:(0,d.cn)(g&&"text-emerald-600")}),null!=n?n:"Copy"]}):(0,s.jsxs)(o.m_,{children:[(0,s.jsx)(o.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:p,"aria-label":null!=n?n:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",m),children:(0,s.jsx)(b,{className:(0,d.cn)("size-3.5",g&&"text-emerald-600")})})}),(0,s.jsx)(o.ZI,{children:g?"Copied":null!=n?n:"Copy"})]})}function x(e){let{value:t,mono:n=!0,className:a,display:r}=e;return t?(0,s.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",a),children:[(0,s.jsx)("span",{className:(0,d.cn)("truncate",n&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,s.jsx)(m,{value:t})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}},89839:(e,t,n)=>{n.d(t,{w:()=>r});var s=n(26276),a=n(88674);function r(e){let{title:t,description:n,actions:r,children:l,className:i,bodyClassName:c,flush:o}=e;return(0,s.jsxs)("section",{className:(0,a.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||r)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),n&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:n})]}),r&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]}),(0,s.jsx)("div",{className:(0,a.cn)(!o&&"p-4",c),children:l})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js b/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js
deleted file mode 100644
index bc20ab79..00000000
--- a/pages/demo/_next/static/chunks/1514-a0a787fb38394f9b.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1514],{18514:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},35626:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},54485:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},59e3:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},60356:(e,t,n)=>{n.d(t,{UC:()=>L,B8:()=>I,bL:()=>j,l9:()=>S});var r=n(12115),a=n(92556),i=n(3468),o=n(29525),l=n(94446),s=n(4129),u=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,i]=r.useState(),o=r.useRef({}),l=r.useRef(e),u=r.useRef("none"),[c,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=d(o.current);u.current="mounted"===c?e:"none"},[c]),(0,s.N)(()=>{let t=o.current,n=l.current;if(n!==e){let r=u.current,a=d(t);e?f("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==a?f("ANIMATION_OUT"):f("UNMOUNT"),l.current=e}},[e,f]),(0,s.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=d(o.current).includes(e.animationName);if(e.target===a&&r&&(f("ANIMATION_END"),!l.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},i=e=>{e.target===a&&(u.current=d(o.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(o.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),o=(0,l.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof n||a.isPresent?r.cloneElement(i,{ref:o}):null};function d(e){return(null==e?void 0:e.animationName)||"none"}u.displayName="Presence";var c=n(97602),f=n(66218),p=n(70222),h=n(68946),m=n(95155),y="Tabs",[v,b]=(0,i.A)(y,[o.RG]),k=(0,o.RG)(),[N,w]=v(y),g=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:u="automatic",...d}=e,y=(0,f.jH)(s),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,p.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:a,s=(0,p.c)(n);return[l,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else i(t)},[o,e,i,s])]}({prop:a,onChange:i,defaultProp:o});return(0,m.jsx)(N,{scope:n,baseId:(0,h.B)(),value:v,onValueChange:b,orientation:l,dir:y,activationMode:u,children:(0,m.jsx)(c.sG.div,{dir:y,"data-orientation":l,...d,ref:t})})});g.displayName=y;var x="TabsList",A=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,i=w(x,n),l=k(n);return(0,m.jsx)(o.bL,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,m.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});A.displayName=x;var M="TabsTrigger",T=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...l}=e,s=w(M,n),u=k(n),d=C(s.baseId,r),f=O(s.baseId,r),p=r===s.value;return(0,m.jsx)(o.q7,{asChild:!0,...u,focusable:!i,active:p,children:(0,m.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...l,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==s.activationMode;p||i||!e||s.onValueChange(r)})})})});T.displayName=M;var E="TabsContent",R=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:i,children:o,...l}=e,s=w(E,n),d=C(s.baseId,a),f=O(s.baseId,a),p=a===s.value,h=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,m.jsx)(u,{present:i||p,children:n=>{let{present:r}=n;return(0,m.jsx)(c.sG.div,{"data-state":p?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&o})}})});function C(e,t){return"".concat(e,"-trigger-").concat(t)}function O(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=E;var j=g,I=A,S=T,L=R},71360:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},75159:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]])},99587:(e,t,n)=>{n.d(t,{bL:()=>g,zi:()=>x});var r=n(12115),a=n(92556),i=n(94446),o=n(3468),l=n(70222),s=n(78108),u=n(4129),d=n(97602),c=n(95155),f="Switch",[p,h]=(0,o.A)(f),[m,y]=p(f),v=r.forwardRef((e,t)=>{let{__scopeSwitch:n,name:o,checked:s,defaultChecked:u,required:f,disabled:p,value:h="on",onCheckedChange:y,form:v,...b}=e,[k,g]=r.useState(null),x=(0,i.s)(t,e=>g(e)),A=r.useRef(!1),M=!k||v||!!k.closest("form"),[T=!1,E]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,i=r.useRef(a),o=(0,l.c)(t);return r.useEffect(()=>{i.current!==a&&(o(a),i.current=a)},[a,i,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,s=o?e:a,u=(0,l.c)(n);return[s,r.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else i(t)},[o,e,i,u])]}({prop:s,defaultProp:u,onChange:y});return(0,c.jsxs)(m,{scope:n,checked:T,disabled:p,children:[(0,c.jsx)(d.sG.button,{type:"button",role:"switch","aria-checked":T,"aria-required":f,"data-state":w(T),"data-disabled":p?"":void 0,disabled:p,value:h,...b,ref:x,onClick:(0,a.m)(e.onClick,e=>{E(e=>!e),M&&(A.current=e.isPropagationStopped(),A.current||e.stopPropagation())})}),M&&(0,c.jsx)(N,{control:k,bubbles:!A.current,name:o,value:h,checked:T,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=f;var b="SwitchThumb",k=r.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=y(b,n);return(0,c.jsx)(d.sG.span,{"data-state":w(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});k.displayName=b;var N=e=>{let{control:t,checked:n,bubbles:a=!0,...i}=e,o=r.useRef(null),l=(0,s.Z)(n),d=function(e){let[t,n]=r.useState(void 0);return(0,u.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(t);return r.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(l!==n&&t){let r=new Event("click",{bubbles:a});t.call(e,n),e.dispatchEvent(r)}},[l,n,a]),(0,c.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function w(e){return e?"checked":"unchecked"}var g=v,x=k}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js b/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js
new file mode 100644
index 00000000..6e8f975d
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1536-367972fc74b101c4.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1536],{17286:(e,t,n)=>{n.d(t,{Rh:()=>f,Wh:()=>b});var a=n(26276),r=n(40688),s=n(48947),l=n(31935),o=n(64761),i=n(64206),c=n(46319),d=n(42812),u=n(88674);let g={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},m={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},h=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),p={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function f(e){let t=p[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function x(e){let{tone:t,spinning:n}=e,g="size-3.5 shrink-0";if(n)return(0,a.jsx)(r.A,{className:(0,u.cn)(g,"animate-spin")});switch(t){case"success":return(0,a.jsx)(s.A,{className:g});case"danger":return(0,a.jsx)(l.A,{className:g});case"warning":return(0,a.jsx)(o.A,{className:g});case"info":return(0,a.jsx)(i.A,{className:(0,u.cn)(g,"fill-current")});default:return"neutral"===t?(0,a.jsx)(c.A,{className:g}):(0,a.jsx)(d.A,{className:g})}}function b(e){var t;let{status:n,label:r,tone:s,className:l}=e,o=null!=s?s:null!=(t=m[n.toLowerCase()])?t:"neutral",i=null!=r?r:f(n);return(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",g[o],l),children:[(0,a.jsx)(x,{tone:o,spinning:h.has(n.toLowerCase())}),(0,a.jsx)("span",{children:i})]})}},35833:(e,t,n)=>{n.d(t,{TR:()=>h,bq:()=>g,eb:()=>p,gC:()=>m,l6:()=>c,s3:()=>d,yv:()=>u});var a=n(26276);n(29320);var r=n(13412),s=n(77440),l=n(72538),o=n(56761),i=n(88674);function c(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(r.WT,{"data-slot":"select-value",...t})}function g(e){let{className:t,size:n="default",children:l,...o}=e;return(0,a.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":n,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[l,(0,a.jsx)(r.In,{asChild:!0,children:(0,a.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:n,position:s="popper",...l}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...l,children:[(0,a.jsx)(f,{}),(0,a.jsx)(r.LM,{className:(0,i.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(x,{})]})})}function h(e){let{className:t,...n}=e;return(0,a.jsx)(r.JU,{"data-slot":"select-label",className:(0,i.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function p(e){let{className:t,children:n,...s}=e;return(0,a.jsxs)(r.q7,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(r.VF,{children:(0,a.jsx)(l.A,{className:"size-4"})})}),(0,a.jsx)(r.p4,{children:n})]})}function f(e){let{className:t,...n}=e;return(0,a.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(o.A,{className:"size-4"})})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(s.A,{className:"size-4"})})}},36337:(e,t,n)=>{n.d(t,{f:()=>o});var a=n(26276),r=n(47006),s=n(73062),l=n(22927);function o(e){let{value:t,className:n}=e,o=(0,l.cB)(3e4);return t?(0,a.jsxs)(r.m_,{children:[(0,a.jsx)(r.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=n?n:"whitespace-nowrap",children:(0,s.fF)(t,o)})}),(0,a.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},50985:(e,t,n)=>{n.d(t,{J:()=>c});var a=n(26276),r=n(29320),s=n(95774),l=n(5820),o=n(88674);let i=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.b,{ref:t,className:(0,o.cn)(i(),n),...r})});c.displayName=s.b.displayName},51536:(e,t,n)=>{n.d(t,{L:()=>F,LogGroupList:()=>z,X:()=>T});var a=n(26276),r=n(29320),s=n(91052),l=n.n(s),o=n(78113),i=n(40688),c=n(86931),d=n(10002),u=n(85469),g=n(34993),m=n(47045),h=n(64573),p=n(81155),f=n(35833),x=n(47353),b=n(62083),v=n(79181),j=n(12373),w=n(74875),y=n(21195),N=n(17286),C=n(36337),k=n(28971),L=n(73062),S=n(22927),_=n(93064);function T(e){let{source:t}=e;return"container"===t?(0,a.jsx)(N.Wh,{status:"container",tone:"info",label:"Container"}):(0,a.jsx)(N.Wh,{status:"stored",tone:"neutral",label:"Stored"})}function A(e){let{id:t,value:n,onChange:r}=e;return(0,a.jsxs)(f.l6,{value:String(n),onValueChange:e=>r(Number(e)),children:[(0,a.jsx)(f.bq,{id:t,className:"w-full",children:(0,a.jsx)(f.yv,{})}),(0,a.jsxs)(f.gC,{children:[(0,a.jsx)(f.eb,{value:"0",children:"Never expire"}),!_.eX.includes(n)&&0!==n&&(0,a.jsx)(f.eb,{value:String(n),children:(0,_.VQ)(n)}),_.eX.map(e=>(0,a.jsx)(f.eb,{value:String(e),children:(0,_.VQ)(e)},e))]})]})}function F(e){let{open:t,onOpenChange:n,group:s}=e,[l,o]=(0,r.useState)(s.retention_days),[c,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&o(s.retention_days)},[t,s.retention_days]);let u=async e=>{e.preventDefault(),d(!0);try{await k.FH.put("/api/v1/logs/groups/".concat((0,k.aJ)(s.name),"/retention"),{retention_days:l}),g.oR.success("Retention of ".concat(s.name," set to ").concat((0,_.VQ)(l).toLowerCase())),(0,S.Yi)("/api/v1/logs"),n(!1)}catch(e){g.oR.error((0,k.gJ)(e))}finally{d(!1)}};return(0,a.jsx)(h.lG,{open:t,onOpenChange:e=>!c&&n(e),children:(0,a.jsx)(h.Cf,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{onSubmit:u,className:"flex flex-col gap-5",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsx)(h.L3,{children:"Edit retention setting"}),(0,a.jsx)(h.rr,{className:"break-all",children:s.name})]}),(0,a.jsx)(w.D,{label:"Expire events after",htmlFor:"retention",help:"Streams with no events newer than the retention period are deleted.",children:(0,a.jsx)(A,{id:"retention",value:l,onChange:o})}),(0,a.jsxs)(h.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:c,children:[c&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Save"]})]})]})})})}function M(e){let{open:t,onOpenChange:n,existing:s}=e,l=(0,o.useRouter)(),[c,d]=(0,r.useState)(""),[u,f]=(0,r.useState)(0),[x,b]=(0,r.useState)(!1),[v,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&(d(""),f(0),b(!1))},[t]);let y=c.trim(),N=y?y.startsWith("/hc/")?"The /hc/ prefix is reserved for container log groups":y.length>512?"At most 512 characters":/^[\w\-./#]+$/.test(y)?(null==s?void 0:s.some(e=>e.name===y))?"A log group with this name already exists":null:"Use letters, numbers and _ - . / # only":"Name is required",C=async e=>{if(e.preventDefault(),b(!0),!N){j(!0);try{await k.FH.post("/api/v1/logs/groups",{name:y,retention_days:u}),g.oR.success("Log group ".concat(y," created")),(0,S.Yi)("/api/v1/logs"),n(!1),l.push((0,_.hy)(y))}catch(e){g.oR.error((0,k.gJ)(e))}finally{j(!1)}}};return(0,a.jsx)(h.lG,{open:t,onOpenChange:e=>!v&&n(e),children:(0,a.jsx)(h.Cf,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{onSubmit:C,className:"flex flex-col gap-5",children:[(0,a.jsxs)(h.c7,{children:[(0,a.jsx)(h.L3,{children:"Create log group"}),(0,a.jsx)(h.rr,{children:"Applications write events to streams inside a log group with PutLogEvents."})]}),(0,a.jsx)(w.D,{label:"Log group name",htmlFor:"lg-name",error:x||c?N:void 0,children:(0,a.jsx)(p.p,{id:"lg-name",autoFocus:!0,className:"font-mono",value:c,onChange:e=>d(e.target.value),placeholder:"/myapp/production",spellCheck:!1})}),(0,a.jsx)(w.D,{label:"Retention",htmlFor:"lg-retention",children:(0,a.jsx)(A,{id:"lg-retention",value:u,onChange:f})}),(0,a.jsxs)(h.Es,{children:[(0,a.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:v,children:"Cancel"}),(0,a.jsxs)(m.$,{type:"submit",disabled:v,children:[v&&(0,a.jsx)(i.A,{className:"animate-spin"}),"Create"]})]})]})})})}function z(){let{data:e,error:t,isLoading:n,isValidating:s,mutate:o}=(0,S.gf)("/api/v1/logs/groups",{refreshInterval:3e4}),i=(0,_.RA)(),h=(0,S.pE)("create"),[p,f]=(0,r.useState)([]),[w,N]=(0,r.useState)(!1),[A,z]=(0,r.useState)(!1),[I,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"1"===h&&N(!0)},[h]);let R=null==e?void 0:e.find(e=>e.name===p[0]),B=(null==R?void 0:R.source)==="stored",D=(0,r.useMemo)(()=>[{id:"name",header:"Log group",value:e=>"".concat(e.name," ").concat((0,_.gQ)(e.name,i)),cell:e=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,a.jsx)(l(),{href:(0,_.hy)(e.name),className:"".concat((0,v.V)()," font-mono text-[13px] break-all"),onClick:e=>e.stopPropagation(),children:e.name}),"container"===e.source&&(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:(0,_.gQ)(e.name,i)})]})},{id:"source",header:"Source",value:e=>e.source,cell:e=>(0,a.jsx)(T,{source:e.source})},{id:"retention",header:"Retention",value:e=>"container"===e.source?-1:e.retention_days||1e9,cell:e=>"container"===e.source?(0,a.jsx)("span",{className:"text-muted-foreground",children:"Container lifetime"}):(0,_.VQ)(e.retention_days),hideBelow:"sm"},{id:"bytes",header:"Stored bytes",value:e=>e.stored_bytes,cell:e=>"container"===e.source?(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,a.jsx)("span",{className:"tabular-nums",children:(0,L.z3)(e.stored_bytes)}),hideBelow:"md"},{id:"created",header:"Created",value:e=>e.created_at,cell:e=>(0,a.jsx)(C.f,{value:e.created_at}),hideBelow:"md"}],[i]),O=async()=>{R&&(await k.FH.del("/api/v1/logs/groups/".concat((0,k.aJ)(R.name))),g.oR.success("Log group ".concat(R.name," deleted")),f([]),(0,S.Yi)("/api/v1/logs"))};return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(y.z,{breadcrumbs:[{label:"CloudWatch",href:"/cloudwatch/"},{label:"Log groups"}],title:"Log groups",description:(0,a.jsxs)(a.Fragment,{children:["Stored log groups keep events your applications send with PutLogEvents. Container log groups (",(0,a.jsx)("span",{className:"font-mono",children:"/hc/..."}),") are read-only views of the stdout and stderr of running HomeCloud containers."]})}),(0,a.jsx)(v.b,{title:"Log groups",data:e,columns:D,rowId:e=>e.name,loading:n,error:t,onRefresh:()=>o(),refreshing:s,selection:"single",selected:p,onSelectedChange:f,searchPlaceholder:"Filter log groups",defaultSort:{id:"name"},actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.$,{disabled:!R,items:[{label:"Edit retention setting",disabled:!B,hint:B?void 0:"Container log groups live as long as the container",onSelect:()=>z(!0)},{separator:!0},{label:"Delete log group",destructive:!0,icon:(0,a.jsx)(c.A,{}),disabled:!B,hint:B?void 0:"Container log groups are read-only",onSelect:()=>E(!0)}]}),(0,a.jsxs)(m.$,{size:"sm",onClick:()=>N(!0),children:[(0,a.jsx)(d.A,{})," Create log group"]})]}),empty:(0,a.jsx)(j.p,{icon:u.A,title:"No log groups",description:"Log groups appear here when containers run or when you create one.",action:(0,a.jsxs)(m.$,{size:"sm",onClick:()=>N(!0),children:[(0,a.jsx)(d.A,{})," Create log group"]})})}),(0,a.jsx)(M,{open:w,onOpenChange:N,existing:e}),R&&B&&(0,a.jsx)(F,{open:A,onOpenChange:z,group:R}),R&&B&&(0,a.jsx)(b.T,{open:I,onOpenChange:E,title:"Delete log group?",description:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-mono break-all",children:R.name})," and all of its streams and events (",(0,L.z3)(R.stored_bytes),") will be deleted permanently."]}),confirmText:R.name,actionLabel:"Delete log group",onConfirm:O})]})}},73062:(e,t,n)=>{n.d(t,{Fl:()=>h,YI:()=>o,Yq:()=>c,ZV:()=>l,a3:()=>g,fF:()=>u,fU:()=>d,qt:()=>s,td:()=>m,z3:()=>r});let a=["B","KB","MB","GB","TB","PB"];function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),r=0;for(;n>=1024&&r=100?0:t);return"".concat(e<0?"-":"").concat(s," ").concat(a[r])}function s(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function o(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return r(e);case"Bytes/Second":return"".concat(r(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function i(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=i(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=i(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=i(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,r=Math.abs(a),s=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(r<45||a>0&&a<60)return"just now";let l=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function h(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},74875:(e,t,n)=>{n.d(t,{D:()=>l});var a=n(26276),r=n(50985),s=n(88674);function l(e){let{label:t,htmlFor:n,help:l,error:o,optional:i,children:c,className:d}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,a.jsxs)(r.J,{htmlFor:n,className:"text-sm font-medium",children:[t,i&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,o?(0,a.jsx)("p",{className:"text-destructive text-xs",children:o}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},93064:(e,t,n)=>{n.d(t,{$M:()=>v,BB:()=>m,EN:()=>u,RA:()=>x,T$:()=>h,VQ:()=>y,cC:()=>f,eX:()=>w,gQ:()=>N,gS:()=>o,gi:()=>d,hy:()=>j,nR:()=>i,t6:()=>p,tG:()=>b,we:()=>c});var a=n(26276),r=n(29320),s=n(17286),l=n(22927);let o=["Average","Sum","Minimum","Maximum","SampleCount"],i=[{value:60,label:"1 minute"},{value:300,label:"5 minutes"},{value:900,label:"15 minutes"},{value:3600,label:"1 hour"}],c=[{value:"GreaterThanThreshold",symbol:">",label:"Greater than"},{value:"GreaterThanOrEqualToThreshold",symbol:">=",label:"Greater than or equal to"},{value:"LessThanThreshold",symbol:"<",label:"Less than"},{value:"LessThanOrEqualToThreshold",symbol:"<=",label:"Less than or equal to"}];function d(e){return e%3600==0?"".concat(e/3600," hour").concat(3600===e?"":"s"):e%60==0?"".concat(e/60," minute").concat(60===e?"":"s"):"".concat(e," seconds")}let u=[{value:"missing",label:"Treat missing data as missing"},{value:"notBreaching",label:"Treat missing data as good (not breaching threshold)"},{value:"breaching",label:"Treat missing data as bad (breaching threshold)"},{value:"ignore",label:"Ignore (maintain the alarm state)"}],g={LessThanLowerOrGreaterThanUpperThreshold:"outside the anomaly detection band",LessThanLowerThreshold:"below the anomaly detection band",GreaterThanUpperThreshold:"above the anomaly detection band"};function m(e){var t,n,a;let r=d(e.period*e.evaluation_periods),s=e.datapoints_to_alarm||e.evaluation_periods,l=s===e.evaluation_periods?1===s?"1 datapoint":"".concat(s," datapoints"):"".concat(s," out of ").concat(e.evaluation_periods," datapoints"),o=e.statistic&&"Average"!==e.statistic?" (".concat(e.statistic,")"):"",i=g[e.comparison_operator];return i?"".concat(e.metric||"Metric").concat(o," ").concat(i," for ").concat(l," within ").concat(r):"".concat(e.metric).concat(o," ").concat((t=e.comparison_operator,null!=(a=null==(n=c.find(e=>e.value===t))?void 0:n.symbol)?a:t)," ").concat(e.threshold," for ").concat(l," within ").concat(r)}function h(e){return e?Object.entries(e).sort((e,t)=>{let[n]=e,[a]=t;return n.localeCompare(a)}).map(e=>{let[t,n]=e;return"".concat(t,"=").concat(n)}).join(", "):""}let p={ALARM:"In alarm",OK:"OK",INSUFFICIENT_DATA:"Insufficient data"};function f(e){var t;let{state:n}=e,r="ALARM"===n?"danger":"OK"===n?"success":"neutral";return(0,a.jsx)(s.Wh,{status:n.toLowerCase(),tone:r,label:null!=(t=p[n])?t:n})}function x(){let{data:e}=(0,l.gf)("/api/v1/ec2/instances",{refreshInterval:6e4});return(0,r.useMemo)(()=>{let t=new Map;for(let n of null!=e?e:[])n.name&&t.set(n.id,n.name);return t},[e])}function b(e,t){return e?Object.entries(e).map(e=>{let[n,a]=e,r="InstanceId"===n?t.get(a):void 0;return r?"".concat(r," (").concat(a,")"):a}).join(", "):""}let v=[{value:15,label:"15m"},{value:60,label:"1h"},{value:180,label:"3h"},{value:720,label:"12h"},{value:1440,label:"24h"}],j=e=>"/cloudwatch/logs/group/?name=".concat(encodeURIComponent(e)),w=[1,3,5,7,14,30,60,90,120,150,180,365];function y(e){return e?1===e?"1 day":"".concat(e," days"):"Never expire"}function N(e,t){var n;let a=/^\/hc\/([^/]+)\/(.+)$/.exec(e);if(!a)return"";let[,r,s]=a;if("ec2"===r){let e=t.get(s);return e?"Console output of EC2 instance ".concat(e):"Console output of EC2 instance ".concat(s)}return"s3"===r?"HomeCloud S3 server output":"Container output of ".concat(null!=(n=({rds:"RDS database",elasticache:"ElastiCache cluster",lambda:"Lambda function"})[r])?n:r," ").concat(s)}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js b/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js
deleted file mode 100644
index 4201f746..00000000
--- a/pages/demo/_next/static/chunks/1537-5418411d17191e6b.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1537],{7e3:(e,t,n)=>{n.d(t,{Fl:()=>m,YI:()=>i,Yq:()=>c,ZV:()=>l,a3:()=>h,fF:()=>u,fU:()=>d,qt:()=>s,td:()=>g,z3:()=>r});let a=["B","KB","MB","GB","TB","PB"];function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),r=0;for(;n>=1024&&r=100?0:t);return"".concat(e<0?"-":"").concat(s," ").concat(a[r])}function s(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function i(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return r(e);case"Bytes/Second":return"".concat(r(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=o(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=o(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,r=Math.abs(a),s=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(r<45||a>0&&a<60)return"just now";let l=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function m(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},11723:(e,t,n)=>{n.d(t,{f:()=>i});var a=n(95155),r=n(82180),s=n(7e3),l=n(73697);function i(e){let{value:t,className:n}=e,i=(0,l.cB)(3e4);return t?(0,a.jsxs)(r.m_,{children:[(0,a.jsx)(r.k$,{asChild:!0,children:(0,a.jsx)("span",{className:null!=n?n:"whitespace-nowrap",children:(0,s.fF)(t,i)})}),(0,a.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,n)=>{n.d(t,{D:()=>l});var a=n(95155),r=n(90235),s=n(25016);function l(e){let{label:t,htmlFor:n,help:l,error:i,optional:o,children:c,className:d}=e;return(0,a.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,a.jsxs)(r.J,{htmlFor:n,className:"text-sm font-medium",children:[t,o&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},32559:(e,t,n)=>{n.d(t,{Fc:()=>i,TN:()=>c,XL:()=>o});var a=n(95155);n(12115);var r=n(83101),s=n(25016);let l=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:n,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,s.cn)(l({variant:n}),t),...r})}function o(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,s.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...n})}function c(e){let{className:t,...n}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,s.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...n})}},47507:(e,t,n)=>{n.d(t,{TR:()=>m,bq:()=>h,eb:()=>p,gC:()=>g,l6:()=>c,s3:()=>d,yv:()=>u});var a=n(95155);n(12115);var r=n(95435),s=n(24033),l=n(5917),i=n(12108),o=n(25016);function c(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(r.WT,{"data-slot":"select-value",...t})}function h(e){let{className:t,size:n="default",children:l,...i}=e;return(0,a.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":n,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[l,(0,a.jsx)(r.In,{asChild:!0,children:(0,a.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function g(e){let{className:t,children:n,position:s="popper",...l}=e;return(0,a.jsx)(r.ZL,{children:(0,a.jsxs)(r.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...l,children:[(0,a.jsx)(x,{}),(0,a.jsx)(r.LM,{className:(0,o.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(f,{})]})})}function m(e){let{className:t,...n}=e;return(0,a.jsx)(r.JU,{"data-slot":"select-label",className:(0,o.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function p(e){let{className:t,children:n,...s}=e;return(0,a.jsxs)(r.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(r.VF,{children:(0,a.jsx)(l.A,{className:"size-4"})})}),(0,a.jsx)(r.p4,{children:n})]})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(i.A,{className:"size-4"})})}function f(e){let{className:t,...n}=e;return(0,a.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(s.A,{className:"size-4"})})}},63963:(e,t,n)=>{n.d(t,{Ge:()=>_,HH:()=>p,NK:()=>A,TD:()=>v,WL:()=>k,X6:()=>F,XZ:()=>g,Zg:()=>d,aM:()=>S,dl:()=>b,e2:()=>m,eF:()=>f,er:()=>h,i6:()=>z,it:()=>N,iw:()=>M,j0:()=>u,jE:()=>L,jw:()=>j,lr:()=>R,mG:()=>x,qR:()=>c,uD:()=>D,vs:()=>E,x6:()=>P,xD:()=>T});var a=n(95155),r=n(52619),s=n.n(r),l=n(47507),i=n(73864),o=n(73697);let c="/api/v1/elb/load-balancers",d="/api/v1/elb/target-groups",u="/api/v1/elb",h=(e,t)=>"/elb/load-balancer/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),g=(e,t)=>"/elb/target-group/?name=".concat(encodeURIComponent(e)).concat(t?"&tab=".concat(t):""),m=e=>"/ecs/service/?name=".concat(encodeURIComponent(e)),p=e=>"/vpc/?id=".concat(encodeURIComponent(e)),x=e=>"/vpc/subnets/?vpc_id=".concat(encodeURIComponent(e)),f=/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?$/,v=e=>"provisioning"===e;function j(e){return e.some(v)?2e3:15e3}function b(e){let{state:t}=e;return"provisioning"===t?(0,a.jsx)(i.Wh,{status:"pending",label:"Provisioning",tone:"warning"}):(0,a.jsx)(i.Wh,{status:t})}let y={healthy:"success",unhealthy:"danger",unavailable:"warning",initial:"warning",unused:"neutral"};function N(e){var t;let{health:n}=e,r=null!=(t=y[n])?t:"neutral";return(0,a.jsx)(i.Wh,{status:n,tone:r})}let w=e=>/^[0-9a-f]{32}$/.test(e),C=e=>e.startsWith("i-");function k(e){return C(e)?"Instance":w(e)?"ECS task":"Target"}function _(e){let{id:t,className:n}=e,r=C(t)?"/ec2/instance/?id=".concat(encodeURIComponent(t)):w(t)?"/ecs/task/?id=".concat(encodeURIComponent(t)):null,l=w(t)?t.slice(0,12):t,i="font-mono text-[13px] whitespace-nowrap ".concat(null!=n?n:"");return r?(0,a.jsx)(s(),{href:r,title:t,onClick:e=>e.stopPropagation(),className:"text-primary hover:underline ".concat(i),children:l}):(0,a.jsx)("span",{className:i,children:t})}function S(e){let{name:t}=e;return(0,a.jsx)(s(),{href:g(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function F(e){let{name:t}=e;return(0,a.jsx)(s(),{href:h(t),onClick:e=>e.stopPropagation(),className:"text-primary font-medium whitespace-nowrap hover:underline",children:t})}function T(e,t){var n;return null==(n=e.public_ports)?void 0:n["".concat(t.port,"/tcp")]}function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(n?"https":"http","://").concat(e.public_host||"localhost",":").concat(t)}let I=(e,t)=>{var n;return(null!=(n=e.listeners)?n:[]).some(e=>"".concat(e.port,"/tcp")===t&&"HTTPS"===e.protocol)};function D(e){var t;let{lb:n,empty:r="-",compact:s}=e,l=Object.entries(null!=(t=n.public_ports)?t:{}).sort((e,t)=>parseInt(e[0])-parseInt(t[0]));if(!l.length)return(0,a.jsx)("span",{className:"text-muted-foreground",children:r});let i=n.public_host||"localhost";return(0,a.jsx)("span",{className:"flex flex-wrap gap-x-3 gap-y-1",children:l.map(e=>{let[t,r]=e;return(0,a.jsx)("a",{href:P(n,r,I(n,t)),target:"_blank",rel:"noreferrer",onClick:e=>e.stopPropagation(),className:"text-primary font-mono text-[13px] whitespace-nowrap hover:underline",children:s?"".concat(t.split("/")[0]," → ").concat(r):"".concat(I(n,t)?"https://":"").concat(i,":").concat(r)},t)})})}function R(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,o.gf)(c,{refreshInterval:e?e=>j((null!=e?e:[]).map(e=>e.state)):0})}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return(0,o.gf)(d,{refreshInterval:e})}function M(){return(0,o.gf)("/api/v1/ec2/instances",{refreshInterval:3e4})}function z(e,t){return(null!=t?t:[]).filter(t=>(function(e){var t,n;let a=new Set;for(let r of null!=(t=e.listeners)?t:[])for(let e of(r.default_target_group&&a.add(r.default_target_group),null!=(n=r.rules)?n:[]))a.add(e.target_group);return[...a]})(t).includes(e)).map(e=>e.name)}function L(e){let t={total:e.length,healthy:0,unhealthy:0,other:0};for(let n of e)"healthy"===n.health?t.healthy++:"unhealthy"===n.health?t.unhealthy++:t.other++;return t}function E(e){let{id:t,value:n,onChange:r,vpcId:s,placeholder:i="Choose a target group",invalid:o}=e,{data:c,isLoading:d}=A(),u=(null!=c?c:[]).filter(e=>!s||e.vpc_id===s).sort((e,t)=>e.name.localeCompare(t.name));return(0,a.jsxs)(l.l6,{value:n,onValueChange:e=>e&&r(e),disabled:d&&!c,children:[(0,a.jsx)(l.bq,{id:t,className:"w-full","aria-invalid":o,children:(0,a.jsx)(l.yv,{placeholder:d&&!c?"Loading target groups...":u.length?i:"No target groups in this VPC"})}),(0,a.jsx)(l.gC,{children:u.map(e=>(0,a.jsxs)(l.eb,{value:e.name,children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[e.protocol,":",e.port," \xb7 ",e.targets.length," target",1===e.targets.length?"":"s"]})]},e.name))})]})}},65451:(e,t,n)=>{n.d(t,{Ff:()=>P,IS:()=>D,Qs:()=>R,hg:()=>I});var a=n(95155),r=n(12115),s=n(52619),l=n.n(s),i=n(20063),o=n(35299),c=n(6132),d=n(18720),u=n(32559),h=n(97003),g=n(84916),m=n(54679),p=n(33789),x=n(47507),f=n(86233),v=n(16981),j=n(73864),b=n(37621),y=n(7e3),N=n(73697),w=n(25016),C=n(63963);let k=e=>{var t,n,a,r;return{path:null!=(t=null==e?void 0:e.path)?t:"/",interval:String(null!=(n=null==e?void 0:e.interval_seconds)?n:15),healthy:String(null!=(a=null==e?void 0:e.healthy_threshold)?a:2),unhealthy:String(null!=(r=null==e?void 0:e.unhealthy_threshold)?r:2)}},_=(e,t,n)=>/^\d+$/.test(e)&&Number(e)>=t&&Number(e)<=n;function S(e){let t={};return(!e.path.startsWith("/")||/\s/.test(e.path))&&(t.path="Must start with / and contain no spaces"),_(e.interval,5,300)||(t.interval="5-300 seconds"),_(e.healthy,1,10)||(t.healthy="1-10"),_(e.unhealthy,1,10)||(t.unhealthy="1-10"),t}let F=e=>({path:e.path,interval_seconds:Number(e.interval),healthy_threshold:Number(e.healthy),unhealthy_threshold:Number(e.unhealthy)});function T(e){let{form:t,onChange:n,errors:r,idPrefix:s}=e,l=e=>n({...t,...e});return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(v.D,{label:"Health check path",htmlFor:"".concat(s,"-path"),error:r.path,help:"HTTP GET from inside the VPC; any 2xx or 3xx response is healthy.",children:(0,a.jsx)(p.p,{id:"".concat(s,"-path"),value:t.path,onChange:e=>l({path:e.target.value}),className:"font-mono",spellCheck:!1})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,a.jsx)(v.D,{label:"Interval (seconds)",htmlFor:"".concat(s,"-interval"),error:r.interval,children:(0,a.jsx)(p.p,{id:"".concat(s,"-interval"),inputMode:"numeric",value:t.interval,onChange:e=>l({interval:e.target.value})})}),(0,a.jsx)(v.D,{label:"Healthy threshold",htmlFor:"".concat(s,"-healthy"),error:r.healthy,children:(0,a.jsx)(p.p,{id:"".concat(s,"-healthy"),inputMode:"numeric",value:t.healthy,onChange:e=>l({healthy:e.target.value})})}),(0,a.jsx)(v.D,{label:"Unhealthy threshold",htmlFor:"".concat(s,"-unhealthy"),error:r.unhealthy,children:(0,a.jsx)(p.p,{id:"".concat(s,"-unhealthy"),inputMode:"numeric",value:t.unhealthy,onChange:e=>l({unhealthy:e.target.value})})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Thresholds are consecutive checks needed to change state. Each check times out after 4 seconds. Only unhealthy targets are removed from routing."})]})}function P(e){var t;let{open:n,onOpenChange:s}=e,l=(0,i.useRouter)(),c=(0,N.gf)(n?"/api/v1/vpc/vpcs":null,{revalidateOnFocus:!1}),[u,g]=(0,r.useState)(""),[f,j]=(0,r.useState)("80"),[y,w]=(0,r.useState)(""),[P,I]=(0,r.useState)(k()),[D,R]=(0,r.useState)(!1),[A,M]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n&&(g(""),j("80"),w(""),I(k()),R(!1))},[n]),(0,r.useEffect)(()=>{var e,t;n&&!y&&(null==(e=c.data)?void 0:e.length)&&w((null!=(t=c.data.find(e=>e.default))?t:c.data[0]).id)},[n,y,c.data]);let z={...S(P)};C.eF.test(u)||(z.name="1-32 letters, digits and hyphens; must not start or end with a hyphen"),_(f,1,65535)||(z.port="1-65535"),y||(z.vpc="Choose a VPC");let L=e=>D?z[e]:void 0,E=async e=>{if(e.preventDefault(),R(!0),Object.keys(z).length)return;let t={name:u,port:Number(f),vpc_id:y,health_check:F(P)};M(!0);try{await b.FH.post(C.Zg,t),d.oR.success("Created target group ".concat(u)),await (0,N.Yi)(C.j0),s(!1),l.push((0,C.XZ)(u))}catch(e){d.oR.error((0,b.gJ)(e))}finally{M(!1)}};return(0,a.jsx)(m.lG,{open:n,onOpenChange:e=>!A&&s(e),children:(0,a.jsx)(m.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:(0,a.jsxs)("form",{onSubmit:E,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Create target group"}),(0,a.jsx)(m.rr,{children:"A set of EC2 instances or ECS tasks that load balancers forward HTTP requests to."})]}),(0,a.jsx)(v.D,{label:"Target group name",htmlFor:"tg-name",error:L("name"),children:(0,a.jsx)(p.p,{id:"tg-name",value:u,onChange:e=>g(e.target.value),placeholder:"e.g. web-tg",autoFocus:!0,autoComplete:"off",spellCheck:!1})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[10rem_minmax(0,1fr)]",children:[(0,a.jsx)(v.D,{label:"Protocol : Port",htmlFor:"tg-port",error:L("port"),help:"Default port targets receive traffic on.",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:"HTTP:"}),(0,a.jsx)(p.p,{id:"tg-port",inputMode:"numeric",value:f,onChange:e=>j(e.target.value)})]})}),(0,a.jsx)(v.D,{label:"VPC",htmlFor:"tg-vpc",error:L("vpc"),help:"Targets and load balancers must be in this VPC.",children:(0,a.jsxs)(x.l6,{value:y,onValueChange:e=>e&&w(e),disabled:!c.data,children:[(0,a.jsx)(x.bq,{id:"tg-vpc",className:"w-full",children:(0,a.jsx)(x.yv,{placeholder:c.data?"Choose a VPC":"Loading VPCs..."})}),(0,a.jsx)(x.gC,{children:(null!=(t=c.data)?t:[]).map(e=>(0,a.jsxs)(x.eb,{value:e.id,children:[(0,a.jsx)("span",{className:"font-medium",children:e.name||e.id}),(0,a.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:[e.id," \xb7 ",e.cidr,e.default?" \xb7 default":""]})]},e.id))})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border p-3",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Health checks"}),(0,a.jsx)(T,{form:P,onChange:I,errors:{path:L("path"),interval:L("interval"),healthy:L("healthy"),unhealthy:L("unhealthy")},idPrefix:"tg-hc"})]}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:A,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:A,children:[A&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Create target group"]})]})]})})})}function I(e){let{tg:t,onClose:n}=e,[s,l]=(0,r.useState)(k()),[i,c]=(0,r.useState)(!1),[u,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&(l(k(t.health_check)),c(!1))},[t]);let p=S(s),x=e=>i?p[e]:void 0,f=async e=>{if(e.preventDefault(),c(!0),t&&!Object.keys(p).length){g(!0);try{await b.FH.patch("".concat(C.Zg,"/").concat((0,b.aJ)(t.name)),F(s)),d.oR.success("Updated health checks for ".concat(t.name)),await (0,N.Yi)(C.j0),n()}catch(e){d.oR.error((0,b.gJ)(e))}finally{g(!1)}}};return(0,a.jsx)(m.lG,{open:!!t,onOpenChange:e=>!e&&!u&&n(),children:(0,a.jsx)(m.Cf,{className:"sm:max-w-xl",children:(0,a.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Edit health check settings"}),(0,a.jsxs)(m.rr,{children:["Applies to every load balancer that forwards to ",null==t?void 0:t.name,". Takes effect at the next check."]})]}),(0,a.jsx)(T,{form:s,onChange:l,errors:{path:x("path"),interval:x("interval"),healthy:x("healthy"),unhealthy:x("unhealthy")},idPrefix:"ehc"}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:n,disabled:u,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:u,children:[u&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Save changes"]})]})]})})})}function D(e){var t;let{tg:n,onClose:s}=e,i=(0,C.iw)(),[x,f]=(0,r.useState)([]),[k,S]=(0,r.useState)(""),[F,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n&&(f([]),S(String(n.port)))},[n]);let P=(0,r.useMemo)(()=>{var e;return(null!=(e=i.data)?e:[]).filter(e=>"running"===e.state&&(!n||e.vpc_id===n.vpc_id)).sort((e,t)=>(e.name||e.id).localeCompare(t.name||t.id))},[i.data,n]),I=(null!=(t=i.data)?t:[]).filter(e=>"running"===e.state&&n&&e.vpc_id!==n.vpc_id).length,D=_(k,1,65535),R=async e=>{if(e.preventDefault(),n&&x.length&&D){T(!0);try{await b.FH.post("".concat(C.Zg,"/").concat((0,b.aJ)(n.name),"/targets"),{targets:x.map(e=>({id:e,port:Number(k)}))}),d.oR.success("Registered ".concat((0,y.td)(x.length,"target")," in ").concat(n.name)),await (0,N.Yi)(C.j0),s()}catch(e){d.oR.error((0,b.gJ)(e))}finally{T(!1)}}};return(0,a.jsx)(m.lG,{open:!!n,onOpenChange:e=>!e&&!F&&s(),children:(0,a.jsx)(m.Cf,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-4",children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Register targets"}),(0,a.jsxs)(m.rr,{children:["Choose running instances in ",null==n?void 0:n.vpc_id," to receive traffic from ",null==n?void 0:n.name,"."]})]}),i.error?(0,a.jsxs)(u.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{}),(0,a.jsx)(u.XL,{children:"Could not load instances"}),(0,a.jsx)(u.TN,{children:(0,b.gJ)(i.error)})]}):i.data?0===P.length?(0,a.jsxs)("p",{className:"text-muted-foreground rounded-md border border-dashed p-6 text-center text-sm",children:["No running instances in this VPC."," ",(0,a.jsx)(l(),{href:"/ec2/launch/",className:"text-primary hover:underline",children:"Launch an instance"}),"."]}):(0,a.jsxs)("div",{className:"max-h-72 divide-y overflow-y-auto rounded-md border",children:[(0,a.jsxs)("label",{className:"bg-muted/40 flex items-center gap-3 px-3 py-2 text-xs font-semibold",children:[(0,a.jsx)(g.S,{checked:x.length===P.length||!!x.length&&"indeterminate",onCheckedChange:e=>f(e?P.map(e=>e.id):[]),"aria-label":"Select all instances"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"Instance"})]}),P.map(e=>{let t,r=x.includes(e.id);return(0,a.jsxs)("label",{className:(0,w.cn)("flex cursor-pointer items-center gap-3 px-3 py-2",r&&"bg-primary/5 dark:bg-primary/10"),children:[(0,a.jsx)(g.S,{checked:r,onCheckedChange:t=>f(t?[...x,e.id]:x.filter(t=>t!==e.id))}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name||e.id}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.id}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.private_ip}),(0,a.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.instance_type})]}),(t=e.id,(null==n?void 0:n.targets.some(e=>e.id===t&&String(e.port)===k))&&(0,a.jsx)(j.Wh,{status:"registered",tone:"info",label:"Registered"}))]},e.id)})]}):(0,a.jsx)("div",{className:"bg-muted/50 h-32 animate-pulse rounded-md border"}),I>0&&(0,a.jsxs)("p",{className:"text-muted-foreground text-xs",children:[(0,y.td)(I,"running instance")," in other VPCs are hidden."]}),(0,a.jsx)(v.D,{label:"Port",htmlFor:"rt-port",error:D?void 0:"1-65535",help:"Port the instances serve on. Defaults to the target group port (".concat(null==n?void 0:n.port,")."),children:(0,a.jsx)(p.p,{id:"rt-port",inputMode:"numeric",value:k,onChange:e=>S(e.target.value),className:"w-32"})}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"ECS services with a load balancer register and deregister their tasks automatically; they don't need to be added here."}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(h.$,{type:"button",variant:"outline",onClick:s,disabled:F,children:"Cancel"}),(0,a.jsxs)(h.$,{type:"submit",disabled:F||!x.length||!D,children:[F&&(0,a.jsx)(o.A,{className:"animate-spin"}),"Register ",x.length?(0,y.td)(x.length,"target"):"targets"]})]})]})})})}function R(e){var t,n;let{tg:r,usedBy:s,onClose:l,onDeleted:i}=e;return(0,a.jsx)(f.T,{open:!!r,onOpenChange:e=>!e&&l(),title:"Delete target group ".concat(null!=(t=null==r?void 0:r.name)?t:"","?"),description:s.length?(0,a.jsxs)(u.Fc,{variant:"destructive",children:[(0,a.jsx)(c.A,{}),(0,a.jsx)(u.XL,{children:"Target group in use"}),(0,a.jsx)(u.TN,{children:(0,a.jsxs)("span",{children:["It is used by"," ",s.map((e,t)=>(0,a.jsxs)("span",{children:[t>0&&", ",(0,a.jsx)(C.X6,{name:e})]},e)),". Delete the listeners or rules that forward to it first, or the deletion will be rejected."]})})]}):(0,a.jsxs)(a.Fragment,{children:["The target group and its ",(0,y.td)(null!=(n=null==r?void 0:r.targets.length)?n:0,"target registration")," are deleted. The instances themselves keep running."]}),confirmText:null==r?void 0:r.name,onConfirm:async()=>{r&&(await b.FH.del("".concat(C.Zg,"/").concat((0,b.aJ)(r.name))),d.oR.success("Deleted target group ".concat(r.name)),await (0,N.Yi)(C.j0),null==i||i())}})}},73864:(e,t,n)=>{n.d(t,{Rh:()=>x,Wh:()=>v});var a=n(95155),r=n(35299),s=n(61362),l=n(78874),i=n(52056),o=n(99051),c=n(32978),d=n(36835),u=n(25016);let h={success:"text-emerald-700 bg-emerald-50 ring-emerald-600/20 dark:text-emerald-300 dark:bg-emerald-500/10 dark:ring-emerald-400/20",warning:"text-amber-700 bg-amber-50 ring-amber-600/20 dark:text-amber-300 dark:bg-amber-500/10 dark:ring-amber-400/20",neutral:"text-slate-600 bg-slate-100 ring-slate-500/20 dark:text-slate-300 dark:bg-slate-500/15 dark:ring-slate-400/20",danger:"text-red-700 bg-red-50 ring-red-600/20 dark:text-red-300 dark:bg-red-500/10 dark:ring-red-400/20",info:"text-blue-700 bg-blue-50 ring-blue-600/20 dark:text-blue-300 dark:bg-blue-500/10 dark:ring-blue-400/20"},g={running:"success",available:"success",active:"success",enabled:"success",ok:"success",success:"success",allowed:"success","in-use":"info",pending:"warning",stopping:"warning","shutting-down":"warning",starting:"warning",rebooting:"warning",insufficient_data:"neutral",stopped:"neutral",inactive:"neutral",suspended:"neutral",disabled:"neutral",implicitdeny:"neutral",terminated:"danger",failed:"danger",alarm:"danger",error:"danger",explicitdeny:"danger","scheduled for deletion":"danger",creating:"warning",deleting:"warning",modifying:"warning",restoring:"warning","backing-up":"warning",updating:"warning",confirmed:"success","in-flight":"info",delayed:"neutral"},m=new Set(["pending","stopping","shutting-down","starting","rebooting","creating","deleting","modifying","restoring","backing-up","updating"]),p={implicitdeny:"Implicitly denied",explicitdeny:"Explicitly denied",insufficient_data:"Insufficient data","in-use":"In use","shutting-down":"Shutting down","backing-up":"Backing up","in-flight":"In flight"};function x(e){let t=p[e.toLowerCase()];if(t)return t;if(e!==e.toLowerCase()&&e!==e.toUpperCase())return e;let n=e.toLowerCase().replace(/[_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function f(e){let{tone:t,spinning:n}=e,h="size-3.5 shrink-0";if(n)return(0,a.jsx)(r.A,{className:(0,u.cn)(h,"animate-spin")});switch(t){case"success":return(0,a.jsx)(s.A,{className:h});case"danger":return(0,a.jsx)(l.A,{className:h});case"warning":return(0,a.jsx)(i.A,{className:h});case"info":return(0,a.jsx)(o.A,{className:(0,u.cn)(h,"fill-current")});default:return"neutral"===t?(0,a.jsx)(c.A,{className:h}):(0,a.jsx)(d.A,{className:h})}}function v(e){var t;let{status:n,label:r,tone:s,className:l}=e,i=null!=s?s:null!=(t=g[n.toLowerCase()])?t:"neutral",o=null!=r?r:x(n);return(0,a.jsxs)("span",{className:(0,u.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",h[i],l),children:[(0,a.jsx)(f,{tone:i,spinning:m.has(n.toLowerCase())}),(0,a.jsx)("span",{children:o})]})}},90235:(e,t,n)=>{n.d(t,{J:()=>c});var a=n(95155),r=n(12115),s=n(43991),l=n(83101),i=n(25016);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.b,{ref:t,className:(0,i.cn)(o(),n),...r})});c.displayName=s.b.displayName}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js b/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js
deleted file mode 100644
index 2e1332e8..00000000
--- a/pages/demo/_next/static/chunks/1593-bc79e8f31d5cc831.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1593],{6132:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20562:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},32978:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35017:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]])},35626:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36835:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43465:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},46046:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},52020:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},52056:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},60356:(e,t,a)=>{a.d(t,{UC:()=>z,B8:()=>I,bL:()=>O,l9:()=>q});var n=a(12115),r=a(92556),i=a(3468),d=a(29525),o=a(94446),l=a(4129),c=e=>{let{present:t,children:a}=e,r=function(e){var t,a;let[r,i]=n.useState(),d=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[u,y]=(t=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=a[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=s(d.current);c.current="mounted"===u?e:"none"},[u]),(0,l.N)(()=>{let t=d.current,a=o.current;if(a!==e){let n=c.current,r=s(t);e?y("MOUNT"):"none"===r||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):a&&n!==r?y("ANIMATION_OUT"):y("UNMOUNT"),o.current=e}},[e,y]),(0,l.N)(()=>{if(r){var e;let t,a=null!=(e=r.ownerDocument.defaultView)?e:window,n=e=>{let n=s(d.current).includes(e.animationName);if(e.target===r&&n&&(y("ANIMATION_END"),!o.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=a.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},i=e=>{e.target===r&&(c.current=s(d.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{a.clearTimeout(t),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{e&&(d.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof a?a({present:r.isPresent}):n.Children.only(a),d=(0,o.s)(r.ref,function(e){var t,a;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(r=(n=null==(a=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:a.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof a||r.isPresent?n.cloneElement(i,{ref:d}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var u=a(97602),y=a(66218),h=a(70222),p=a(68946),f=a(95155),k="Tabs",[v,m]=(0,i.A)(k,[d.RG]),A=(0,d.RG)(),[M,b]=v(k),x=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:l,activationMode:c="automatic",...s}=e,k=(0,y.jH)(l),[v,m]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,h.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,o=d?e:r,l=(0,h.c)(a);return[o,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&l(a)}else i(t)},[d,e,i,l])]}({prop:r,onChange:i,defaultProp:d});return(0,f.jsx)(M,{scope:a,baseId:(0,p.B)(),value:v,onValueChange:m,orientation:o,dir:k,activationMode:c,children:(0,f.jsx)(u.sG.div,{dir:k,"data-orientation":o,...s,ref:t})})});x.displayName=k;var w="TabsList",g=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...r}=e,i=b(w,a),o=A(a);return(0,f.jsx)(d.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,f.jsx)(u.sG.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});g.displayName=w;var N="TabsTrigger",C=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:i=!1,...o}=e,l=b(N,a),c=A(a),s=T(l.baseId,n),y=E(l.baseId,n),h=n===l.value;return(0,f.jsx)(d.q7,{asChild:!0,...c,focusable:!i,active:h,children:(0,f.jsx)(u.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":y,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...o,ref:t,onMouseDown:(0,r.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(n)}),onKeyDown:(0,r.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&l.onValueChange(n)}),onFocus:(0,r.m)(e.onFocus,()=>{let e="manual"!==l.activationMode;h||i||!e||l.onValueChange(n)})})})});C.displayName=N;var R="TabsContent",j=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,forceMount:i,children:d,...o}=e,l=b(R,a),s=T(l.baseId,r),y=E(l.baseId,r),h=r===l.value,p=n.useRef(h);return n.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:i||h,children:a=>{let{present:n}=a;return(0,f.jsx)(u.sG.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:y,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:n&&d})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function E(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var O=x,I=g,q=C,z=j},61362:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71360:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},74054:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78874:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89559:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90368:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},91169:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},93499:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},99265:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(71847).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},99587:(e,t,a)=>{a.d(t,{bL:()=>x,zi:()=>w});var n=a(12115),r=a(92556),i=a(94446),d=a(3468),o=a(70222),l=a(78108),c=a(4129),s=a(97602),u=a(95155),y="Switch",[h,p]=(0,d.A)(y),[f,k]=h(y),v=n.forwardRef((e,t)=>{let{__scopeSwitch:a,name:d,checked:l,defaultChecked:c,required:y,disabled:h,value:p="on",onCheckedChange:k,form:v,...m}=e,[A,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),g=n.useRef(!1),N=!A||v||!!A.closest("form"),[C=!1,R]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,o.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,l=d?e:r,c=(0,o.c)(a);return[l,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&c(a)}else i(t)},[d,e,i,c])]}({prop:l,defaultProp:c,onChange:k});return(0,u.jsxs)(f,{scope:a,checked:C,disabled:h,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":y,"data-state":b(C),"data-disabled":h?"":void 0,disabled:h,value:p,...m,ref:w,onClick:(0,r.m)(e.onClick,e=>{R(e=>!e),N&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),N&&(0,u.jsx)(M,{control:A,bubbles:!g.current,name:d,value:p,checked:C,required:y,disabled:h,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=y;var m="SwitchThumb",A=n.forwardRef((e,t)=>{let{__scopeSwitch:a,...n}=e,r=k(m,a);return(0,u.jsx)(s.sG.span,{"data-state":b(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});A.displayName=m;var M=e=>{let{control:t,checked:a,bubbles:r=!0,...i}=e,d=n.useRef(null),o=(0,l.Z)(a),s=function(e){let[t,a]=n.useState(void 0);return(0,c.N)(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;a({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}a(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=d.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==a&&t){let n=new Event("click",{bubbles:r});t.call(e,a),e.dispatchEvent(n)}},[o,a,r]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:d,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b(e){return e?"checked":"unchecked"}var x=v,w=A}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js b/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js
deleted file mode 100644
index f10b7d89..00000000
--- a/pages/demo/_next/static/chunks/1610-9d0bca101f0fc771.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1610],{2084:(e,s,l)=>{l.d(s,{$j:()=>D,$r:()=>w,D_:()=>j,ET:()=>O,EV:()=>K,II:()=>k,PV:()=>v,Tn:()=>b,_n:()=>S,cA:()=>A,cC:()=>_,mg:()=>F,qS:()=>y});var a=l(95155),t=l(52619),i=l.n(t),r=l(84916),n=l(33789),d=l(90235),o=l(47507),c=l(7235),u=l(16981),m=l(50524),h=l(73697),x=l(25016),p=l(98351);let g={s:1,min:60,h:3600,days:86400},f="alias/aws/sqs",v={visibility:"30",retention:"4",retentionUnit:"days",delay:"0",wait:"0",maxSizeKB:"256",dedup:!1,dedupScope:"queue",throughputLimit:"perQueue",dlqEnabled:!1,dlq:"",maxReceives:"3",sse:"sqs",kmsKey:f,kmsReuse:"300",allow:"",allowSources:[],policyEnabled:!1,policy:""};function y(e){if(!e)return null;try{let s=JSON.parse(e);return s&&"string"==typeof s.redrivePermission?s:null}catch(e){return null}}function b(e){return e.kms_master_key_id?"kms":e.sqs_managed_sse_enabled?"sqs":"none"}function j(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch(s){return e}}function k(e){var s,l,a,t,i,r,n,d;let o=y(e.redrive_allow_policy),[c,u]=function(e){for(let s of["days","h","min"])if(e%g[s]==0)return[String(e/g[s]),s];return[String(e),"s"]}(e.message_retention_seconds);return{visibility:String(e.visibility_timeout),retention:c,retentionUnit:u,delay:String(e.delay_seconds),wait:String(e.receive_wait_time_seconds),maxSizeKB:String(Math.round(e.max_message_size/1024)),dedup:e.content_based_deduplication,dedupScope:null!=(a=e.deduplication_scope)?a:"queue",throughputLimit:null!=(t=e.fifo_throughput_limit)?t:"perQueue",dlqEnabled:!!e.redrive_policy,dlq:null!=(i=null==(s=e.redrive_policy)?void 0:s.dead_letter_queue)?i:"",maxReceives:String(null!=(r=null==(l=e.redrive_policy)?void 0:l.max_receive_count)?r:3),sse:b(e),kmsKey:e.kms_master_key_id||f,kmsReuse:String(e.kms_data_key_reuse_period_seconds||300),allow:(null==o?void 0:o.redrivePermission)==="allowAll"?"":null!=(n=null==o?void 0:o.redrivePermission)?n:"",allowSources:null!=(d=null==o?void 0:o.sourceQueueArns)?d:[],policyEnabled:!!e.policy,policy:e.policy?j(e.policy):""}}let N=e=>/^\s*\d+\s*$/.test(e)?Number(e):NaN,_=e=>N(e.retention)*g[e.retentionUnit];function w(e){let s={},l=(e,l,a,t,i)=>{(!Number.isInteger(l)||lt)&&(s[e]=i)};if(l("visibility",N(e.visibility),0,43200,"Enter 0-43200 seconds (12 hours)"),l("retention",_(e),60,1209600,"Enter between 1 minute and 14 days"),l("delay",N(e.delay),0,900,"Enter 0-900 seconds (15 minutes)"),l("wait",N(e.wait),0,20,"Enter 0-20 seconds"),l("maxSizeKB",N(e.maxSizeKB),1,256,"Enter 1-256 KB"),e.dlqEnabled&&(e.dlq||(s.dlq="Choose a dead-letter queue"),l("maxReceives",N(e.maxReceives),1,1e3,"Enter 1-1000")),"kms"===e.sse&&(e.kmsKey.trim()||(s.kmsKey="Enter a KMS key ID, ARN or alias"),l("kmsReuse",N(e.kmsReuse),60,86400,"Enter 60-86400 seconds (1 minute to 24 hours)")),"byQueue"===e.allow&&(e.allowSources.length<1||e.allowSources.length>10)&&(s.allowSources="Choose 1-10 source queues"),e.policyEnabled){let l=(0,m.F)(e.policy);l?s.policy=l:e.policy.trim().startsWith("{")||(s.policy="The policy must be a JSON object")}return s}function S(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a={visibility_timeout:N(e.visibility),message_retention_seconds:_(e),delay_seconds:N(e.delay),receive_wait_time_seconds:N(e.wait),max_message_size:1024*N(e.maxSizeKB)};return s&&(a.content_based_deduplication=e.dedup,a.deduplication_scope=e.dedupScope,a.fifo_throughput_limit=e.throughputLimit),"kms"===e.sse?(a.kms_master_key_id=e.kmsKey.trim(),a.kms_data_key_reuse_period_seconds=N(e.kmsReuse),a.sqs_managed_sse_enabled=!1):(a.kms_master_key_id="",a.sqs_managed_sse_enabled="sqs"===e.sse),a.redrive_allow_policy=e.allow?JSON.stringify("byQueue"===e.allow?{redrivePermission:e.allow,sourceQueueArns:e.allowSources}:{redrivePermission:e.allow}):"",a.policy=e.policyEnabled?JSON.stringify(JSON.parse(e.policy)):"",e.dlqEnabled?a.redrive_policy={dead_letter_queue:e.dlq,max_receive_count:N(e.maxReceives)}:l&&(a.redrive_policy={dead_letter_queue:"",max_receive_count:0}),a}function q(e){let{id:s,value:l,onChange:t,suffix:i,invalid:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.p,{id:s,inputMode:"numeric",value:l,onChange:e=>t(e.target.value),className:"h-9 w-32","aria-invalid":r}),(0,a.jsx)("span",{className:"text-muted-foreground text-sm",children:i})]})}function C(e){let{label:s,value:l,onChange:t,options:i}=e;return(0,a.jsx)("div",{role:"radiogroup","aria-label":s,className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:i.map(e=>(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":l===e.value,onClick:()=>t(e.value),className:(0,x.cn)("flex items-start gap-3 rounded-md border p-3 text-left transition-colors",l===e.value?"border-primary bg-primary/5 ring-primary ring-1":"hover:bg-muted/40"),children:[(0,a.jsx)("span",{className:(0,x.cn)("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",l===e.value?"border-primary":"border-input"),children:l===e.value&&(0,a.jsx)("span",{className:"bg-primary size-2 rounded-full"})}),(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.title}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:e.text})]})]},e.value||"_"))})}function F(e){let{config:s,onChange:l,errors:t,fifo:i}=e;return(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsx)(u.D,{label:"Visibility timeout",htmlFor:"cfg-vis",error:t.visibility,help:"How long a received message stays hidden from other consumers. 0 seconds to 12 hours.",children:(0,a.jsx)(q,{id:"cfg-vis",value:s.visibility,onChange:e=>l({visibility:e}),suffix:"seconds",invalid:!!t.visibility})}),(0,a.jsx)(u.D,{label:"Message retention period",htmlFor:"cfg-ret",error:t.retention,help:"How long messages are kept. 1 minute to 14 days.",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.p,{id:"cfg-ret",inputMode:"numeric",value:s.retention,onChange:e=>l({retention:e.target.value}),className:"h-9 w-24","aria-invalid":!!t.retention}),(0,a.jsxs)(o.l6,{value:s.retentionUnit,onValueChange:e=>l({retentionUnit:e}),children:[(0,a.jsx)(o.bq,{className:"w-28","aria-label":"Retention unit",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"s",children:"Seconds"}),(0,a.jsx)(o.eb,{value:"min",children:"Minutes"}),(0,a.jsx)(o.eb,{value:"h",children:"Hours"}),(0,a.jsx)(o.eb,{value:"days",children:"Days"})]})]})]})}),(0,a.jsx)(u.D,{label:"Delivery delay",htmlFor:"cfg-delay",error:t.delay,help:i?"Applies to the whole queue; FIFO queues do not support per-message delays. 0-900 seconds.":"Delay before new messages become visible. 0-900 seconds.",children:(0,a.jsx)(q,{id:"cfg-delay",value:s.delay,onChange:e=>l({delay:e}),suffix:"seconds",invalid:!!t.delay})}),(0,a.jsx)(u.D,{label:"Receive message wait time",htmlFor:"cfg-wait",error:t.wait,help:"Default long-polling wait for receive calls. 0 = short polling, up to 20 seconds.",children:(0,a.jsx)(q,{id:"cfg-wait",value:s.wait,onChange:e=>l({wait:e}),suffix:"seconds",invalid:!!t.wait})}),(0,a.jsx)(u.D,{label:"Maximum message size",htmlFor:"cfg-size",error:t.maxSizeKB,help:"1-256 KB.",children:(0,a.jsx)(q,{id:"cfg-size",value:s.maxSizeKB,onChange:e=>l({maxSizeKB:e}),suffix:"KB",invalid:!!t.maxSizeKB})}),i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4 rounded-md border p-3 md:col-span-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-dedup",className:"font-medium",children:"Content-based deduplication"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Use a hash of the message body as the deduplication ID, so senders don't have to provide one. Duplicates within 5 minutes are dropped."})]}),(0,a.jsx)(c.d,{id:"cfg-dedup",checked:s.dedup,onCheckedChange:e=>l({dedup:e})})]}),(0,a.jsx)(u.D,{label:"Deduplication scope",htmlFor:"cfg-dedup-scope",help:"Whether deduplication IDs are unique across the queue or within each message group.",children:(0,a.jsxs)(o.l6,{value:s.dedupScope,onValueChange:e=>l({dedupScope:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-dedup-scope",className:"w-full max-w-xs",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"queue",children:"Queue"}),(0,a.jsx)(o.eb,{value:"messageGroup",children:"Message group"})]})]})}),(0,a.jsx)(u.D,{label:"FIFO throughput limit",htmlFor:"cfg-throughput",help:"messageGroup"===s.dedupScope&&"perMessageGroupId"===s.throughputLimit?"High throughput mode: the quota applies to each message group.":"Whether the throughput quota applies to the whole queue or to each message group.",children:(0,a.jsxs)(o.l6,{value:s.throughputLimit,onValueChange:e=>l({throughputLimit:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-throughput",className:"w-full max-w-xs",children:(0,a.jsx)(o.yv,{})}),(0,a.jsxs)(o.gC,{children:[(0,a.jsx)(o.eb,{value:"perQueue",children:"Per queue"}),(0,a.jsx)(o.eb,{value:"perMessageGroupId",children:"Per message group ID"})]})]})})]})]})}let E=[{value:"sqs",title:"SSE-SQS",text:"Encrypt with SQS-managed keys."},{value:"kms",title:"SSE-KMS",text:"Encrypt with a KMS key you choose."},{value:"none",title:"Disabled",text:"No server-side encryption."}];function D(e){var s,l;let{config:t,onChange:r,errors:d}=e,o=(0,h.gf)("kms"===t.sse?"/api/v1/kms/keys":null,{revalidateOnFocus:!1}),c=Array.from(new Set([f,...(null!=(s=(0,h.gf)("kms"===t.sse?"/api/v1/kms/aliases":null,{revalidateOnFocus:!1}).data)?s:[]).map(e=>e.name),...(null!=(l=o.data)?l:[]).filter(e=>"Enabled"===e.state).map(e=>e.id)]));return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(C,{label:"Server-side encryption",value:t.sse,onChange:e=>r({sse:e}),options:E}),"kms"===t.sse&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsxs)(u.D,{label:"KMS key",htmlFor:"cfg-kms-key",error:d.kmsKey,help:(0,a.jsxs)(a.Fragment,{children:["Key ID, key ARN or alias."," ",(0,a.jsx)(i(),{href:"/kms/",className:"text-primary hover:underline",children:"Manage keys"})]}),children:[(0,a.jsx)(n.p,{id:"cfg-kms-key",list:"cfg-kms-keys",value:t.kmsKey,onChange:e=>r({kmsKey:e.target.value}),className:"h-9 font-mono text-[13px]",autoComplete:"off",spellCheck:!1,"aria-invalid":!!d.kmsKey}),(0,a.jsx)("datalist",{id:"cfg-kms-keys",children:c.map(e=>(0,a.jsx)("option",{value:e},e))})]}),(0,a.jsx)(u.D,{label:"Data key reuse period",htmlFor:"cfg-kms-reuse",error:d.kmsReuse,help:"60 seconds to 24 hours.",children:(0,a.jsx)(q,{id:"cfg-kms-reuse",value:t.kmsReuse,onChange:e=>r({kmsReuse:e}),suffix:"seconds",invalid:!!d.kmsReuse})})]})]})}function A(e){var s,l;let{config:t,onChange:r,errors:m,fifo:h,queues:x,self:g}=e,f=(null!=x?x:[]).filter(e=>e.fifo===h&&e.name!==g),v=f.find(e=>e.name===t.dlq),b=y(null==v?void 0:v.redrive_allow_policy),j=null==(s=(null!=x?x:[]).find(e=>e.name===g))?void 0:s.arn,k=b&&("denyAll"===b.redrivePermission||"byQueue"===b.redrivePermission&&!(j&&(null==(l=b.sourceQueueArns)?void 0:l.includes(j))));return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-dlq-on",className:"font-medium",children:"Send undeliverable messages to a dead-letter queue"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"A message received more than the maximum number of times without being deleted is moved to the dead-letter queue."})]}),(0,a.jsx)(c.d,{id:"cfg-dlq-on",checked:t.dlqEnabled,onCheckedChange:e=>r({dlqEnabled:e})})]}),t.dlqEnabled&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2",children:[(0,a.jsx)(u.D,{label:"Dead-letter queue",htmlFor:"cfg-dlq",error:m.dlq,help:f.length?"Only ".concat(h?"FIFO":"standard"," queues can be used."):(0,a.jsxs)(a.Fragment,{children:["No other ",h?"FIFO":"standard"," queue exists."," ",(0,a.jsx)(i(),{href:"/sqs/create/",className:"text-primary hover:underline",children:"Create one first"}),"."]}),children:(0,a.jsxs)(o.l6,{value:t.dlq,onValueChange:e=>r({dlq:e}),children:[(0,a.jsx)(o.bq,{id:"cfg-dlq",className:"w-full","aria-invalid":!!m.dlq,children:(0,a.jsx)(o.yv,{placeholder:x?"Choose a queue":"Loading queues..."})}),(0,a.jsx)(o.gC,{children:f.map(e=>(0,a.jsx)(o.eb,{value:e.name,children:e.name},e.name))})]})}),(0,a.jsx)(u.D,{label:"Maximum receives",htmlFor:"cfg-maxrecv",error:m.maxReceives,help:"1-1000 receives before a message is moved.",children:(0,a.jsx)(n.p,{id:"cfg-maxrecv",inputMode:"numeric",value:t.maxReceives,onChange:e=>r({maxReceives:e.target.value}),className:"h-9 w-32","aria-invalid":!!m.maxReceives})}),t.dlq&&(0,a.jsxs)("p",{className:"text-muted-foreground text-xs md:col-span-2",children:["Messages will move to"," ",(0,a.jsx)(i(),{href:(0,p.BY)(t.dlq),className:"text-primary hover:underline",children:t.dlq})," ","after ",t.maxReceives||"?"," receives.",k&&(0,a.jsxs)("span",{className:"mt-1 block text-amber-700 dark:text-amber-300",children:[t.dlq,"'s redrive allow policy (",b.redrivePermission,") may not permit this queue as a source."]})]})]})]})}let z=[{value:"",title:"Allow all",text:"Any queue of the same type (default)."},{value:"byQueue",title:"By queue",text:"Only the source queues you choose."},{value:"denyAll",title:"Deny all",text:"No queue can use this one as its DLQ."}];function K(e){let{config:s,onChange:l,errors:t,fifo:i,queues:n,self:d}=e,o=(null!=n?n:[]).filter(e=>e.fifo===i&&e.name!==d),c=new Set(o.map(e=>e.arn)),m=[...o.map(e=>({arn:e.arn,name:e.name})),...s.allowSources.filter(e=>!c.has(e)).map(e=>({arn:e,name:e}))];return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(C,{label:"Redrive allow policy",value:s.allow,onChange:e=>l({allow:e}),options:z}),"byQueue"===s.allow&&(0,a.jsx)(u.D,{label:"Source queues",error:t.allowSources,help:"Choose up to 10 ".concat(i?"FIFO":"standard"," queues (").concat(s.allowSources.length," selected)."),children:m.length?(0,a.jsx)("div",{className:"flex max-h-56 flex-col divide-y overflow-y-auto rounded-md border",children:m.map(e=>(0,a.jsxs)("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[(0,a.jsx)(r.S,{checked:s.allowSources.includes(e.arn),onCheckedChange:a=>{let t;return t=e.arn,l({allowSources:!0===a?[...s.allowSources.filter(e=>e!==t),t]:s.allowSources.filter(e=>e!==t)})},"aria-label":e.name}),(0,a.jsx)("span",{className:"min-w-0 truncate font-mono text-[13px]",title:e.arn,children:e.name})]},e.arn))}):(0,a.jsx)("p",{className:"text-muted-foreground rounded-md border p-3 text-sm",children:n?"No other ".concat(i?"FIFO":"standard"," queues exist yet."):"Loading queues..."})})]})}function O(e){let{config:s,onChange:l,errors:t,arn:i}=e;return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(d.J,{htmlFor:"cfg-policy-on",className:"font-medium",children:"Attach an access policy"}),(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"A resource policy document, as in Amazon SQS. HomeCloud stores and returns it; access is decided by IAM identity policies."})]}),(0,a.jsx)(c.d,{id:"cfg-policy-on",checked:s.policyEnabled,onCheckedChange:e=>l({policyEnabled:e,policy:e&&!s.policy.trim()?JSON.stringify({Version:"2012-10-17",Id:"__default_policy_ID",Statement:[{Sid:"__owner_statement",Effect:"Allow",Principal:{AWS:i.split(":")[4]||"*"},Action:["SQS:*"],Resource:i||"*"}]},null,2):s.policy})})]}),s.policyEnabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.i,{value:s.policy,onChange:e=>l({policy:e}),rows:10}),t.policy&&(0,a.jsx)("p",{className:"text-destructive text-xs",children:t.policy})]})]})}},7235:(e,s,l)=>{l.d(s,{d:()=>r});var a=l(95155);l(12115);var t=l(99587),i=l(25016);function r(e){let{className:s,...l}=e;return(0,a.jsx)(t.bL,{"data-slot":"switch",className:(0,i.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...l,children:(0,a.jsx)(t.zi,{"data-slot":"switch-thumb",className:(0,i.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},16981:(e,s,l)=>{l.d(s,{D:()=>r});var a=l(95155),t=l(90235),i=l(25016);function r(e){let{label:s,htmlFor:l,help:r,error:n,optional:d,children:o,className:c}=e;return(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",c),children:[(0,a.jsxs)(t.J,{htmlFor:l,className:"text-sm font-medium",children:[s,d&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,n?(0,a.jsx)("p",{className:"text-destructive text-xs",children:n}):r?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:r}):null]})}},26667:(e,s,l)=>{l.d(s,{A:()=>a});let a=(0,l(71847).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},50524:(e,s,l)=>{l.d(s,{F:()=>c,i:()=>u});var a=l(95155),t=l(12115),i=l(6132),r=l(61362),n=l(26667),d=l(97003),o=l(25016);function c(e){if(!e.trim())return"Document is empty";try{return JSON.parse(e),null}catch(e){return e instanceof Error?e.message:String(e)}}function u(e){let{value:s,onChange:l,rows:u=16,readOnly:m,validate:h,className:x,id:p}=e,g=(0,t.useMemo)(()=>{let e=c(s);return e||(h?h(JSON.parse(s)):null)},[s,h]),f=Math.max(s.split("\n").length,u);return(0,a.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",x),children:[(0,a.jsxs)("div",{className:(0,o.cn)("bg-muted/30 flex overflow-hidden rounded-md border font-mono text-[13px] leading-5",g&&!m&&"border-destructive/60"),children:[(0,a.jsx)("div",{"aria-hidden":!0,className:"text-muted-foreground/60 bg-muted/50 border-r px-2 py-2 text-right select-none",children:Array.from({length:f},(e,s)=>(0,a.jsx)("div",{children:s+1},s))}),(0,a.jsx)("textarea",{id:p,value:s,readOnly:m,onChange:e=>null==l?void 0:l(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!m){e.preventDefault();let a=e.currentTarget,{selectionStart:t,selectionEnd:i}=a,r=s.slice(0,t)+" "+s.slice(i);null==l||l(r),requestAnimationFrame(()=>{a.selectionStart=a.selectionEnd=t+2})}},spellCheck:!1,rows:f,className:"min-w-0 flex-1 resize-none overflow-x-auto bg-transparent px-3 py-2 whitespace-pre outline-none"})]}),!m&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[g?(0,a.jsxs)("span",{className:"text-destructive flex items-center gap-1",children:[(0,a.jsx)(i.A,{className:"size-3.5"})," ",g]}):(0,a.jsxs)("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[(0,a.jsx)(r.A,{className:"size-3.5"})," Valid JSON"]}),(0,a.jsxs)(d.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{try{null==l||l(JSON.stringify(JSON.parse(s),null,2))}catch(e){}},disabled:!!c(s),children:[(0,a.jsx)(n.A,{})," Format"]})]})]})}},60495:(e,s,l)=>{l.d(s,{LY:()=>u,O6:()=>d,_y:()=>o,fP:()=>c});var a=l(95155),t=l(65229),i=l(6191),r=l(97003),n=l(33789);function d(e){return Object.entries(null!=e?e:{}).map(e=>{let[s,l]=e;return{key:s,value:l}})}function o(e){let s={};for(let l of e)l.key.trim()&&(s[l.key.trim()]=l.value);return Object.keys(s).length?s:void 0}function c(e){let{rows:s,onChange:l,keyPlaceholder:d="Key",valuePlaceholder:o="Value",addLabel:c="Add tag",max:u=50}=e,m=(e,a)=>l(s.map((s,l)=>l===e?{...s,...a}:s));return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[s.length>0&&(0,a.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,a.jsx)("span",{children:d}),(0,a.jsx)("span",{children:o})]}),s.map((e,i)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,a.jsx)(n.p,{value:e.key,onChange:e=>m(i,{key:e.target.value}),placeholder:d,className:"h-8"}),(0,a.jsx)(n.p,{value:e.value,onChange:e=>m(i,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,a.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>l(s.filter((e,s)=>s!==i)),"aria-label":"Remove",children:(0,a.jsx)(t.A,{})})]},i)),(0,a.jsx)("div",{children:(0,a.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>l([...s,{key:"",value:""}]),disabled:s.length>=u,children:[(0,a.jsx)(i.A,{})," ",c]})})]})}function u(e){let{tags:s}=e,l=Object.entries(null!=s?s:{});return l.length?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(e=>{let[s,l]=e;return(0,a.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:s}),l&&(0,a.jsxs)("span",{children:["=",l]})]},s)})}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},61362:(e,s,l)=>{l.d(s,{A:()=>a});let a=(0,l(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},62325:(e,s,l)=>{l.d(s,{w:()=>i});var a=l(95155),t=l(25016);function i(e){let{title:s,description:l,actions:i,children:r,className:n,bodyClassName:d,flush:o}=e;return(0,a.jsxs)("section",{className:(0,t.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",n),children:[(s||i)&&(0,a.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[s&&(0,a.jsx)("h2",{className:"text-base font-semibold",children:s}),l&&(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:l})]}),i&&(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:i})]}),(0,a.jsx)("div",{className:(0,t.cn)(!o&&"p-4",d),children:r})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js b/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js
deleted file mode 100644
index f4c28010..00000000
--- a/pages/demo/_next/static/chunks/1641-c8aff58c35c31de5.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1641],{6132:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},16140:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]])},19408:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},20386:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]])},20508:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},20562:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},20639:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},21786:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},26617:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},32320:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},32978:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},39068:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},52056:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},57828:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},61362:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},70532:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},73366:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]])},75426:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},78874:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86651:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},89470:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]])},89559:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},93499:(e,a,d)=>{d.d(a,{A:()=>y});let y=(0,d(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js b/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js
new file mode 100644
index 00000000..5bd09803
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1681-a9fcd944336cfde4.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1681,2886],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},37995:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>g,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),s=r(12377),p=r(26276),u="Switch",[y,f]=(0,i.A)(u),[h,k]=y(u),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:y,value:f="on",onCheckedChange:k,form:m,...b}=e,[v,g]=l.useState(null),w=(0,a.s)(t,e=>g(e)),S=l.useRef(!1),M=!v||m||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,p.jsxs)(h,{scope:r,checked:E,disabled:y,children:[(0,p.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":A(E),"data-disabled":y?"":void 0,disabled:y,value:f,...b,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),M&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),M&&(0,p.jsx)(x,{control:v,bubbles:!S.current,name:i,value:f,checked:E,required:u,disabled:y,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var b="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(b,r);return(0,p.jsx)(s.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=b;var x=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),s=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,p.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var g=m,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69200:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function y(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];x(n)&&"function"==typeof S&&(n=S(n._payload)),l.Children.forEach(n,e=>{if(b(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof S&&(t=S(t._payload)),i=h(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,p=s(r,d);if(!i){if(n||0===n)throw Error(o?w(e):g(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?p:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(y,"createSlot");var f=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=f,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}u(k,"mergeProps"),u(m,"getElementRef"),u(b,"isSlottable");var v=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(x,"isLazyComponent"),u(A,"isPromiseLike");var g=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=n[" use ".trim().toString()],M=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=y(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,M.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,M.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js b/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js
new file mode 100644
index 00000000..aee2751f
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1719-2d8b4a4c2391a956.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1719,2886],{1211:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},14045:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29526:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,r)=>{r.d(t,{UC:()=>D,B8:()=>T,bL:()=>O,l9:()=>P});var n=r(29320),a=r(62315),i=r(65335),l=r(23566),o=r(36103),d=r(96886),c=e=>{let{present:t,children:r}=e,a=function(e){var t,r;let[a,i]=n.useState(),l=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[s,p]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=r[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=u(l.current);c.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=l.current,r=o.current;if(r!==e){let n=c.current,a=u(t);e?p("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):r&&n!==a?p("ANIMATION_OUT"):p("UNMOUNT"),o.current=e}},[e,p]),(0,d.N)(()=>{if(a){var e;let t,r=null!=(e=a.ownerDocument.defaultView)?e:window,n=e=>{let n=u(l.current).includes(e.animationName);if(e.target===a&&n&&(p("ANIMATION_END"),!o.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=r.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},i=e=>{e.target===a&&(c.current=u(l.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",n),a.addEventListener("animationend",n),()=>{r.clearTimeout(t),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",n),a.removeEventListener("animationend",n)}}p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:n.useCallback(e=>{e&&(l.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),l=(0,o.s)(a.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(a=(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof r||a.isPresent?n.cloneElement(i,{ref:l}):null};function u(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var s=r(12377),p=r(97645),f=r(82275),y=r(29203),h=r(26276),m="Tabs",[v,k]=(0,i.A)(m,[l.RG]),b=(0,l.RG)(),[g,A]=v(m),x=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:a,onValueChange:i,defaultValue:l,orientation:o="horizontal",dir:d,activationMode:c="automatic",...u}=e,m=(0,p.jH)(d),[v,k]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[a]=r,i=n.useRef(a),l=(0,f.c)(t);return n.useEffect(()=>{i.current!==a&&(l(a),i.current=a)},[a,i,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,o=l?e:a,d=(0,f.c)(r);return[o,n.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else i(t)},[l,e,i,d])]}({prop:a,onChange:i,defaultProp:l});return(0,h.jsx)(g,{scope:r,baseId:(0,y.B)(),value:v,onValueChange:k,orientation:o,dir:m,activationMode:c,children:(0,h.jsx)(s.sG.div,{dir:m,"data-orientation":o,...u,ref:t})})});x.displayName=m;var w="TabsList",M=n.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...a}=e,i=A(w,r),o=b(r);return(0,h.jsx)(l.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,h.jsx)(s.sG.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});M.displayName=w;var C="TabsTrigger",N=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,d=A(C,r),c=b(r),u=j(d.baseId,n),p=S(d.baseId,n),f=n===d.value;return(0,h.jsx)(l.q7,{asChild:!0,...c,focusable:!i,active:f,children:(0,h.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(n)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(n)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;f||i||!e||d.onValueChange(n)})})})});N.displayName=C;var E="TabsContent",R=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:a,forceMount:i,children:l,...o}=e,d=A(E,r),u=j(d.baseId,a),p=S(d.baseId,a),f=a===d.value,y=n.useRef(f);return n.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(c,{present:i||f,children:r=>{let{present:n}=r;return(0,h.jsx)(s.sG.div,{"data-state":f?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:p,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:n&&l})}})});function j(e,t){return"".concat(e,"-trigger-").concat(t)}function S(e,t){return"".concat(e,"-content-").concat(t)}R.displayName=E;var O=x,T=M,P=N,D=R},37995:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},45814:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var n=r(29320),a=r(62315),i=r(36103),l=r(65335),o=r(82275),d=r(79225),c=r(96886),u=r(12377),s=r(26276),p="Switch",[f,y]=(0,l.A)(p),[h,m]=f(p),v=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:l,checked:d,defaultChecked:c,required:p,disabled:f,value:y="on",onCheckedChange:m,form:v,...k}=e,[b,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),M=n.useRef(!1),C=!b||v||!!b.closest("form"),[N=!1,E]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[a,i]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[a]=r,i=n.useRef(a),l=(0,o.c)(t);return n.useEffect(()=>{i.current!==a&&(l(a),i.current=a)},[a,i,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,d=l?e:a,c=(0,o.c)(r);return[d,n.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else i(t)},[l,e,i,c])]}({prop:d,defaultProp:c,onChange:m});return(0,s.jsxs)(h,{scope:r,checked:N,disabled:f,children:[(0,s.jsx)(u.sG.button,{type:"button",role:"switch","aria-checked":N,"aria-required":p,"data-state":A(N),"data-disabled":f?"":void 0,disabled:f,value:y,...k,ref:w,onClick:(0,a.m)(e.onClick,e=>{E(e=>!e),C&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),C&&(0,s.jsx)(g,{control:b,bubbles:!M.current,name:l,value:y,checked:N,required:p,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=p;var k="SwitchThumb",b=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=m(k,r);return(0,s.jsx)(u.sG.span,{"data-state":A(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});b.displayName=k;var g=e=>{let{control:t,checked:r,bubbles:a=!0,...i}=e,l=n.useRef(null),o=(0,d.Z)(r),u=function(e){let[t,r]=n.useState(void 0);return(0,c.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,a=t.blockSize}else n=e.offsetWidth,a=e.offsetHeight;r({width:n,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=l.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let n=new Event("click",{bubbles:a});t.call(e,r),e.dispatchEvent(n)}},[o,r,a]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=v,w=b},64206:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},81335:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]])},86931:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(29320),a=r.t(n,2),i=r(93993),l=Object.defineProperty,o=(e,t)=>l(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let r=!1,n=e.map(e=>{let n=d(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=n.forwardRef((t,r)=>{let{children:a,...i}=t,l=null,o=!1,d=[];g(a)&&"function"==typeof M&&(a=M(a._payload)),n.Children.forEach(a,e=>{if(k(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof M&&(t=M(t._payload)),l=h(e,t),d.push(l?.props?.children)}else d.push(e)}),l?l=n.cloneElement(l,void 0,d):!o&&1===n.Children.count(a)&&n.isValidElement(a)&&(l=a);let c=l?v(l):void 0,s=u(r,c);if(!l){if(a||0===a)throw Error(o?w(e):x(e));return a}let p=m(i,l.props??{});return l.type!==n.Fragment&&(p.ref=r?s:c),n.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(m,"mergeProps"),p(v,"getElementRef"),p(k,"isSlottable");var b=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(g,"isLazyComponent"),p(A,"isPromiseLike");var x=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],C=r(26276),N=Object.defineProperty,E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),a=n.forwardRef((e,n)=>{let{asChild:a,...i}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(a?r:t,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});N(function(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=n.forwardRef(R(function(e,t){return(0,C.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js b/pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js
similarity index 99%
rename from pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js
rename to pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js
index a0c10e95..a34c96a2 100644
--- a/pages/demo/_next/static/chunks/e868780c.c23ff2f7f8b56308.js
+++ b/pages/demo/_next/static/chunks/17f2321f.e75e484eec52c258.js
@@ -1,4 +1,4 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3888],{79101:(e,i,s)=>{s.r(i),s.d(i,{Terminal:()=>rP});var r=s(95704),n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,i,s,r)=>{for(var h,a=r>1?void 0:r?o(i,s):i,l=e.length-1;l>=0;l--)(h=e[l])&&(a=(r?h(i,s,a):h(a))||a);return r&&a&&n(i,s,a),a},a=(e,i)=>(s,r)=>i(s,r,e),l="Terminal input",c={get:()=>l,set:e=>l=e},d="Too much output to announce, navigate to rows manually to read",_={get:()=>d,set:e=>d=e};function u(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function f(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function g(e,i,s,r,n){f(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function p(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function v(e,i=0,s=e.length){let r="";for(let n=i;n65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var m=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},S=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},b=class e{constructor(){this.fg=0,this.bg=0,this.extended=new w}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},w=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},y=class e extends b{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new w,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?p(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},C="di$target",k="di$dependencies",x=new Map;function E(e){if(x.has(e))return x.get(e);let i=function(e,s,r){var n,o,h;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,h=r,o[C]===o?o[k].push({id:n,index:h}):(o[k]=[{id:n,index:h}],o[C]=o)};return i._id=e,x.set(e,i),i}var B=E("BufferService"),D=E("CoreMouseService"),R=E("CoreService"),M=E("CharsetService"),L=E("InstantiationService"),P=E("LogService"),T=E("OptionsService"),A=E("OscLinkService"),O=E("UnicodeService"),I=E("DecorationService"),N=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s)return void i(void 0);let r=[],n=this._optionsService.rawOptions.linkHandler,o=new y,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;in?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}?
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8381],{77542:(e,i,s)=>{s.r(i),s.d(i,{Terminal:()=>rP});var r=s(36159),n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,i,s,r)=>{for(var h,a=r>1?void 0:r?o(i,s):i,l=e.length-1;l>=0;l--)(h=e[l])&&(a=(r?h(i,s,a):h(a))||a);return r&&a&&n(i,s,a),a},a=(e,i)=>(s,r)=>i(s,r,e),l="Terminal input",c={get:()=>l,set:e=>l=e},d="Too much output to announce, navigate to rows manually to read",_={get:()=>d,set:e=>d=e};function u(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function f(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function g(e,i,s,r,n){f(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function p(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function v(e,i=0,s=e.length){let r="";for(let n=i;n65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var m=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},S=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},b=class e{constructor(){this.fg=0,this.bg=0,this.extended=new w}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},w=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},y=class e extends b{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new w,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?p(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},C="di$target",k="di$dependencies",x=new Map;function E(e){if(x.has(e))return x.get(e);let i=function(e,s,r){var n,o,h;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,h=r,o[C]===o?o[k].push({id:n,index:h}):(o[k]=[{id:n,index:h}],o[C]=o)};return i._id=e,x.set(e,i),i}var B=E("BufferService"),D=E("CoreMouseService"),R=E("CoreService"),M=E("CharsetService"),L=E("InstantiationService"),P=E("LogService"),T=E("OptionsService"),A=E("OscLinkService"),O=E("UnicodeService"),I=E("DecorationService"),N=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s)return void i(void 0);let r=[],n=this._optionsService.rawOptions.linkHandler,o=new y,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;in?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}?
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}(0,i),hover:(e,i)=>n?.hover?.(e,i,o),leave:(e,i)=>n?.leave?.(e,i,o)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(l=i,a=o.extended.urlId):(l=-1,a=-1)}}i(r)}};N=h([a(0,B),a(1,T),a(2,A)],N);var H=E("CharSizeService"),W=E("CoreBrowserService"),z=E("MouseService"),F=E("RenderService"),$=E("SelectionService"),K=E("CharacterJoinerService"),U=E("ThemeService"),q=E("LinkProviderService"),V=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?G.isErrorNoTelemetry(e)?new G(e.message+`
diff --git a/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js b/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js
deleted file mode 100644
index 670441cc..00000000
--- a/pages/demo/_next/static/chunks/1819-ba32c9c8a5fbe2c4.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1819],{4774:(e,t,a)=>{a.d(t,{BC:()=>g,GM:()=>d,GN:()=>h,Kh:()=>N,aR:()=>p,dB:()=>w,fe:()=>f,h6:()=>y,nO:()=>j,qT:()=>m,sV:()=>u});var n=a(95155),s=a(32320),i=a(19408),l=a(20508),r=a(89470),o=a(39068),c=a(41183);let d=e=>"/iam/role/?name=".concat(encodeURIComponent(e)),u=e=>"/iam/roles/create/".concat(e?"?service=".concat(encodeURIComponent(e)):""),m=[{principal:"lambda.amazonaws.com",name:"Lambda",description:"Allows Lambda functions to call HomeCloud services on your behalf."},{principal:"ec2.amazonaws.com",name:"EC2",description:"Allows EC2 instances to call HomeCloud services on your behalf."},{principal:"ecs-tasks.amazonaws.com",name:"Elastic Container Service Task",description:"Allows ECS tasks to call HomeCloud services on your behalf."},{principal:"states.amazonaws.com",name:"Step Functions",description:"Allows state machines to invoke Lambda functions and other services."},{principal:"events.amazonaws.com",name:"EventBridge",description:"Allows EventBridge rules to deliver events to targets."},{principal:"apigateway.amazonaws.com",name:"API Gateway",description:"Allows API Gateway to call integrations and push logs to CloudWatch."},{principal:"cloudformation.amazonaws.com",name:"CloudFormation",description:"Allows CloudFormation to create and manage stack resources on your behalf."},{principal:"scheduler.amazonaws.com",name:"EventBridge Scheduler",description:"Allows schedules to invoke their targets."}],f=e=>{var t,a;return null!=(a=null==(t=m.find(t=>t.principal===e))?void 0:t.name)?a:e.replace(/\.amazonaws\.com$/,"")},x=e=>1===e.length?e[0]:e;function h(e){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{Service:x(e)},Action:"sts:AssumeRole"}]}}function p(e,t){return{Version:"2012-10-17",Statement:[{Effect:"Allow",Principal:{AWS:x(t.length?t:["arn:aws:iam::".concat(e,":root")])},Action:"sts:AssumeRole"}]}}let v=e=>"string"==typeof e&&e.length>0||Array.isArray(e)&&e.length>0&&e.every(e=>"string"==typeof e&&e.length>0);function g(e){if(!e||"object"!=typeof e||Array.isArray(e))return"The trust policy must be a JSON object";let t=e.Statement;if(null==t)return"Statement is required";let a=Array.isArray(t)?t:[t];if(0===a.length)return"Statement must not be empty";for(let e=0;e!["AWS","Service","Federated"].includes(e));if(a)return"Statement[".concat(e,"].Principal.").concat(a,": use AWS, Service or Federated");if(!t.length)return"Statement[".concat(e,"].Principal must name at least one principal");for(let a of t)if(!v(n[a]))return"Statement[".concat(e,"].Principal.").concat(a," must be a string or a non-empty array of strings")}if(void 0!==t.Resource||void 0!==t.NotResource)return"Statement[".concat(e,"].Resource is not allowed in a trust policy");if(void 0!==t.Action&&void 0!==t.NotAction)return"Statement[".concat(e,"] cannot have both Action and NotAction");let s=void 0!==t.NotAction?"NotAction":"Action";if(!v(t[s]))return"Statement[".concat(e,"].").concat(s," must be a string or a non-empty array of strings");let i=(0,c.DD)(t[s]).find(e=>!e.toLowerCase().startsWith("sts:"));if(i)return"Statement[".concat(e,"].").concat(s,' "').concat(i,'": trust policies only grant sts: actions')}return null}function j(e){let t=[],a=new Set,n=e=>{let n="".concat(e.kind,":").concat(e.value);a.has(n)||(a.add(n),t.push(e))};for(let t of(0,c.GX)(e)){if(!t||"Allow"!==t.Effect)continue;let e=t.Principal;if("*"===e){n({kind:"any",label:"Anyone",value:"*"});continue}if(e&&"object"==typeof e){for(let t of(0,c.DD)(e.Service))n({kind:"service",label:"AWS service: ".concat(f(t)),value:t});for(let t of(0,c.DD)(e.AWS))n(function(e){if("*"===e)return{kind:"any",label:"Any AWS principal",value:e};if(/^\d{12}$/.test(e))return{kind:"account",label:"Account: ".concat(e),value:e};let t=/^arn:[\w-]+:(iam|sts)::(\d*):(.*)$/.exec(e);if(t){let[,,a,n]=t;if("root"===n)return{kind:"account",label:"Account: ".concat(a),value:e};if(n.startsWith("user/"))return{kind:"user",label:"User: ".concat(n.slice(n.lastIndexOf("/")+1)),value:e};if(n.startsWith("role/"))return{kind:"role",label:"Role: ".concat(n.slice(n.lastIndexOf("/")+1)),value:e}}return{kind:"other",label:e,value:e}}(t));for(let t of(0,c.DD)(e.Federated))n({kind:"federated",label:"Identity provider: ".concat(t),value:t})}}return t}let b={service:s.A,account:i.A,user:l.A,role:r.A,federated:o.A,any:o.A,other:o.A};function w(e){let{role:t,max:a=3}=e,s=j(t.assume_role_policy);if(!s.length)return(0,n.jsx)("span",{className:"text-muted-foreground",children:"None"});let i=s.slice(0,a);return(0,n.jsxs)("span",{className:"flex flex-col gap-0.5",children:[i.map(e=>{let t=b[e.kind];return(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",title:e.value,children:[(0,n.jsx)(t,{className:"text-muted-foreground size-3.5 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:e.label})]},"".concat(e.kind,":").concat(e.value))}),s.length>a&&(0,n.jsxs)("span",{className:"text-muted-foreground text-xs",children:["and ",s.length-a," more"]})]})}function N(e){let t=Math.floor(e/3600),a=Math.round(e%3600/60);return a?"".concat(t," h ").concat(a," min"):1===t?"1 hour":"".concat(t," hours")}let y=[1,2,4,6,8,12].map(e=>({value:3600*e,label:1===e?"1 hour":"".concat(e," hours")}))},7e3:(e,t,a)=>{a.d(t,{Fl:()=>x,YI:()=>r,Yq:()=>c,ZV:()=>l,a3:()=>m,fF:()=>u,fU:()=>d,qt:()=>i,td:()=>f,z3:()=>s});let n=["B","KB","MB","GB","TB","PB"];function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let a=Math.abs(e),s=0;for(;a>=1024&&s=100?0:t);return"".concat(e<0?"-":"").concat(i," ").concat(n[s])}function i(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function r(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(l(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(l(e,0)," ms");case"Seconds":return"".concat(l(e,1)," s");default:return l(e)}}function o(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=o(e);return a?a.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=o(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),a=o(e);if(!a)return"-";let n=(a.getTime()-t)/1e3,s=Math.abs(n),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||n>0&&n<60)return"just now";let l=n;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(l)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:a)}function x(e){let t=e.endsWith("/")?e.slice(0,-1):e,a=t.lastIndexOf("/");return a>=0?t.slice(a+1):t}},11723:(e,t,a)=>{a.d(t,{f:()=>r});var n=a(95155),s=a(82180),i=a(7e3),l=a(73697);function r(e){let{value:t,className:a}=e,r=(0,l.cB)(3e4);return t?(0,n.jsxs)(s.m_,{children:[(0,n.jsx)(s.k$,{asChild:!0,children:(0,n.jsx)("span",{className:null!=a?a:"whitespace-nowrap",children:(0,i.fF)(t,r)})}),(0,n.jsx)(s.ZI,{children:(0,i.Yq)(t)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(95155),s=a(90235),i=a(25016);function l(e){let{label:t,htmlFor:a,help:l,error:r,optional:o,children:c,className:d}=e;return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",d),children:[(0,n.jsxs)(s.J,{htmlFor:a,className:"text-sm font-medium",children:[t,o&&(0,n.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,r?(0,n.jsx)("p",{className:"text-destructive text-xs",children:r}):l?(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},31629:(e,t,a)=>{a.d(t,{v:()=>i});var n=a(95155),s=a(25016);function i(e){let{items:t,columns:a=3,className:i}=e;return(0,n.jsx)("dl",{className:(0,s.cn)("grid grid-cols-1 gap-x-8 gap-y-4",{2:"sm:grid-cols-2",3:"sm:grid-cols-2 lg:grid-cols-3",4:"sm:grid-cols-2 lg:grid-cols-4"}[a],i),children:t.map(e=>(0,n.jsxs)("div",{className:(0,s.cn)("min-w-0",e.wide&&"sm:col-span-full"),children:[(0,n.jsx)("dt",{className:"text-muted-foreground mb-0.5 text-xs font-medium",children:e.label}),(0,n.jsx)("dd",{className:"min-w-0 text-sm break-words",children:""===e.value||null===e.value||void 0===e.value?(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"}):e.value})]},e.label))})}},47507:(e,t,a)=>{a.d(t,{TR:()=>x,bq:()=>m,eb:()=>h,gC:()=>f,l6:()=>c,s3:()=>d,yv:()=>u});var n=a(95155);a(12115);var s=a(95435),i=a(24033),l=a(5917),r=a(12108),o=a(25016);function c(e){let{...t}=e;return(0,n.jsx)(s.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,n.jsx)(s.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,n.jsx)(s.WT,{"data-slot":"select-value",...t})}function m(e){let{className:t,size:a="default",children:l,...r}=e;return(0,n.jsxs)(s.l9,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[l,(0,n.jsx)(s.In,{asChild:!0,children:(0,n.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function f(e){let{className:t,children:a,position:i="popper",...l}=e;return(0,n.jsx)(s.ZL,{children:(0,n.jsxs)(s.UC,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...l,children:[(0,n.jsx)(p,{}),(0,n.jsx)(s.LM,{className:(0,o.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,n.jsx)(v,{})]})})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(s.JU,{"data-slot":"select-label",className:(0,o.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function h(e){let{className:t,children:a,...i}=e;return(0,n.jsxs)(s.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,n.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,n.jsx)(s.VF,{children:(0,n.jsx)(l.A,{className:"size-4"})})}),(0,n.jsx)(s.p4,{children:a})]})}function p(e){let{className:t,...a}=e;return(0,n.jsx)(s.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,n.jsx)(r.A,{className:"size-4"})})}function v(e){let{className:t,...a}=e;return(0,n.jsx)(s.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,n.jsx)(i.A,{className:"size-4"})})}},90923:(e,t,a)=>{a.d(t,{Xi:()=>o,av:()=>c,j7:()=>r,tU:()=>l});var n=a(95155);a(12115);var s=a(60356),i=a(25016);function l(e){let{className:t,...a}=e;return(0,n.jsx)(s.bL,{"data-slot":"tabs",className:(0,i.cn)("flex flex-col gap-4",t),...a})}function r(e){let{className:t,...a}=e;return(0,n.jsx)(s.B8,{"data-slot":"tabs-list",className:(0,i.cn)("text-muted-foreground flex h-10 w-full items-end justify-start gap-1 overflow-x-auto border-b",t),...a})}function o(e){let{className:t,...a}=e;return(0,n.jsx)(s.l9,{"data-slot":"tabs-trigger",className:(0,i.cn)("relative -mb-px inline-flex h-10 items-center justify-center gap-1.5 border-b-2 border-transparent px-3 text-sm font-medium whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function c(e){let{className:t,...a}=e;return(0,n.jsx)(s.UC,{"data-slot":"tabs-content",className:(0,i.cn)("flex-1 outline-none",t),...a})}},91819:(e,t,a)=>{a.d(t,{StateMachineDetailPage:()=>$,p:()=>O});var n=a(95155),s=a(12115),i=a(52619),l=a.n(i),r=a(4774),o=a(20063),c=a(6132),d=a(18514),u=a(71360),m=a(85921),f=a(35626),x=a(36168),h=a(35299),p=a(18720),v=a(97003),g=a(54679),j=a(33789),b=a(47507),w=a(90923),N=a(99116),y=a(82523),S=a(95567),A=a(97438),C=a(16981),k=a(50524),z=a(31629),_=a(59516),E=a(17705),D=a(62325),R=a(73864),F=a(60495),B=a(11723),I=a(37621),P=a(7e3),M=a(73697),L=a(73178),T=a(81271),q=a(88256);let W=["executions","definition"];function $(){var e;let t=(0,o.useRouter)(),a=(0,M.pE)("name"),i=(0,M.pE)("tab"),f=(0,M.pE)("start"),x=(0,M.bN)(),h=W.includes(i)?i:"executions",{data:p,error:g,isLoading:j,mutate:b}=(0,M.gf)(a?(0,T.lg)(a):null,{refreshInterval:e=>{var t;return(null!=(t=null==e?void 0:e.executions.RUNNING)?t:0)>0?3e3:15e3}}),y=(0,T.TR)({onDeleted:()=>t.push("/sfn/")}),[C,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{f&&p&&(k(!0),x("start",null))},[f,p,x]);let L=[{label:"Step Functions",href:"/sfn/"},{label:"State machines",href:"/sfn/"},{label:a||"State machine"}];if(!a)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E.z,{title:"State machine",breadcrumbs:L}),(0,n.jsx)(S.p,{title:"No state machine selected",description:"Open a state machine from the list.",action:(0,n.jsx)(G,{})})]});if(g&&!p){let e=g instanceof I.hD&&404===g.status;return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)(E.z,{title:a,breadcrumbs:L}),e?(0,n.jsx)(D.w,{children:(0,n.jsx)(S.p,{icon:c.A,title:"State machine not found",description:"State machine ".concat(a," does not exist."),action:(0,n.jsx)(G,{})})}):(0,n.jsx)(A.W,{error:g,onRetry:()=>b()})]})}if(j||!p)return(0,n.jsx)(_.P0,{});let q=p.state_machine;return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)(E.z,{title:q.name,badge:(0,n.jsx)(R.Wh,{status:q.status.toLowerCase()}),description:q.definition.Comment?String(q.definition.Comment):"".concat("EXPRESS"===q.type?"Express":"Standard"," state machine"),breadcrumbs:L,actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:(0,T.Te)(q.name),children:[(0,n.jsx)(d.A,{})," Edit"]})}),(0,n.jsxs)(v.$,{variant:"outline",size:"sm",onClick:()=>y.remove(q.name),children:[(0,n.jsx)(u.A,{})," Delete"]}),(0,n.jsxs)(v.$,{size:"sm",onClick:()=>k(!0),children:[(0,n.jsx)(m.A,{})," Start execution"]})]})}),(0,n.jsx)(D.w,{title:"Details",children:(0,n.jsx)(z.v,{columns:3,items:[{label:"Name",value:q.name},{label:"Status",value:(0,n.jsx)(R.Wh,{status:q.status.toLowerCase()})},{label:"Type",value:"EXPRESS"===q.type?"Express":"Standard"},{label:"Execution role",value:q.role_arn?(0,n.jsx)(l(),{href:(0,r.GM)(null!=(e=q.role_arn.split("/").pop())?e:""),className:"text-primary hover:underline",children:q.role_arn.split("/").pop()}):""},{label:"Created",value:(0,n.jsxs)("span",{children:[(0,P.Yq)(q.created_at)," (",(0,n.jsx)(B.f,{value:q.created_at}),")"]})},{label:"Last updated",value:(0,n.jsxs)("span",{children:[(0,P.Yq)(q.updated_at)," (",(0,n.jsx)(B.f,{value:q.updated_at}),")"]})},{label:"Executions",value:(0,n.jsx)(T.YH,{counts:p.executions})},{label:"ARN",value:(0,n.jsx)(N.xh,{value:q.arn}),wide:!0},...q.tags&&Object.keys(q.tags).length?[{label:"Tags",value:(0,n.jsx)(F.LY,{tags:q.tags}),wide:!0}]:[]]})}),(0,n.jsxs)(w.tU,{value:h,onValueChange:e=>x("tab","executions"===e?null:e),children:[(0,n.jsxs)(w.j7,{children:[(0,n.jsx)(w.Xi,{value:"executions",children:"Executions"}),(0,n.jsx)(w.Xi,{value:"definition",children:"Definition"})]}),(0,n.jsx)(w.av,{value:"executions",children:(0,n.jsx)(U,{machine:q.name,onStart:()=>k(!0)})}),(0,n.jsx)(w.av,{value:"definition",children:(0,n.jsx)(Y,{detail:p})})]}),(0,n.jsx)(O,{machine:C?q.name:null,onClose:()=>k(!1)}),y.dialog]})}function G(){return(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:"/sfn/",children:[(0,n.jsx)(f.A,{})," Back to state machines"]})})}function U(e){let{machine:t,onStart:a}=e,[i,r]=(0,s.useState)("all"),{data:o,error:c,isLoading:d,isValidating:u,mutate:f}=(0,M.gf)("".concat((0,T.lg)(t),"/executions"),{query:{status:"all"===i?void 0:i},refreshInterval:e=>(null!=e?e:[]).some(e=>"RUNNING"===e.status)?2e3:15e3}),h=(null!=o?o:[]).some(e=>"RUNNING"===e.status),p=(0,M.cB)(h?1e3:6e4),g=[{id:"name",header:"Name",cell:e=>(0,n.jsx)(l(),{href:(0,T._E)(e.id),className:"".concat((0,y.V)()," font-mono text-[13px]"),children:e.name}),value:e=>e.name},{id:"status",header:"Status",cell:e=>(0,n.jsx)(T.vZ,{status:e.status}),value:e=>e.status},{id:"start",header:"Started",cell:e=>(0,n.jsx)("span",{className:"whitespace-nowrap",children:(0,P.Yq)(e.start_date)}),value:e=>e.start_date,hideBelow:"sm"},{id:"stop",header:"Stopped",cell:e=>e.stop_date?(0,n.jsx)("span",{className:"whitespace-nowrap",children:(0,P.Yq)(e.stop_date)}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"}),value:e=>{var t;return null!=(t=e.stop_date)?t:""},hideBelow:"md"},{id:"duration",header:"Duration",cell:e=>(0,n.jsx)("span",{className:"tabular-nums whitespace-nowrap",children:(0,T.gz)(e.start_date,e.stop_date,p)}),value:e=>(e.stop_date?new Date(e.stop_date).getTime():p)-new Date(e.start_date).getTime()}];return(0,n.jsx)(y.b,{title:"Executions",data:o,columns:g,rowId:e=>e.id,loading:d,error:c,onRefresh:()=>f(),refreshing:u,searchPlaceholder:"Find executions by name",defaultSort:{id:"start",desc:!0},actions:(0,n.jsxs)(v.$,{size:"sm",onClick:a,children:[(0,n.jsx)(m.A,{})," Start execution"]}),filters:(0,n.jsxs)(b.l6,{value:i,onValueChange:e=>e&&r(e),children:[(0,n.jsx)(b.bq,{size:"sm",className:"h-8 w-40","aria-label":"Status filter",children:(0,n.jsx)(b.yv,{})}),(0,n.jsxs)(b.gC,{children:[(0,n.jsx)(b.eb,{value:"all",children:"All statuses"}),L.c.map(e=>(0,n.jsx)(b.eb,{value:e,children:(0,T.m8)(e)},e))]})]}),empty:"all"!==i?(0,n.jsx)(S.p,{icon:x.A,title:"No ".concat((0,T.m8)(i).toLowerCase()," executions"),action:(0,n.jsx)(v.$,{variant:"outline",size:"sm",onClick:()=>r("all"),children:"Show all executions"})}):(0,n.jsx)(S.p,{icon:x.A,title:"No executions",description:"Start an execution with a JSON input. Executions also start from EventBridge rules that target this state machine.",action:(0,n.jsxs)(v.$,{size:"sm",onClick:a,children:[(0,n.jsx)(m.A,{})," Start execution"]})})})}function Y(e){let{detail:t}=e,a=t.state_machine,s=(0,T.j9)(a.definition);return(0,n.jsxs)("div",{className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-2",children:[(0,n.jsx)(D.w,{title:"Graph",bodyClassName:"p-3",children:(0,n.jsx)(q.bH,{definition:a.definition})}),(0,n.jsx)(D.w,{title:"Definition",actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.i8,{value:s,size:"sm",label:"Copy",toastMessage:"Definition copied"}),(0,n.jsx)(v.$,{variant:"outline",size:"sm",asChild:!0,children:(0,n.jsxs)(l(),{href:(0,T.Te)(a.name),children:[(0,n.jsx)(d.A,{})," Edit"]})})]}),bodyClassName:"p-3",children:(0,n.jsx)("pre",{className:"bg-muted/30 max-h-[36rem] overflow-auto rounded-md border p-3 font-mono text-[12.5px] leading-5",children:s})})]})}function O(e){let{machine:t,onClose:a,initialInput:i}=e,l=(0,o.useRouter)(),[r,c]=(0,s.useState)(""),[d,u]=(0,s.useState)("{}"),[f,x]=(0,s.useState)(!1),[b,w]=(0,s.useState)(!1);(0,s.useEffect)(()=>{t&&(c(""),w(!1),void 0!==i&&u(i))},[t,i]);let N=r?(0,T.eA)(r,"Execution names"):null,y=(0,k.F)(d),S=async e=>{if(e.preventDefault(),w(!0),t&&!N&&!y){x(!0);try{let e=await I.FH.post("".concat((0,T.lg)(t),"/executions"),{name:r||void 0,input:JSON.parse(d)});p.oR.success("Started execution ".concat(e.name)),await (0,M.Yi)(T.k$),a(),l.push((0,T._E)(e.id))}catch(e){p.oR.error((0,I.gJ)(e))}finally{x(!1)}}};return(0,n.jsx)(g.lG,{open:!!t,onOpenChange:e=>!e&&!f&&a(),children:(0,n.jsx)(g.Cf,{className:"sm:max-w-2xl",children:(0,n.jsxs)("form",{onSubmit:S,className:"flex min-w-0 flex-col gap-4",children:[(0,n.jsxs)(g.c7,{children:[(0,n.jsx)(g.L3,{children:"Start execution"}),(0,n.jsxs)(g.rr,{children:["Run ",(0,n.jsx)("span",{className:"font-mono",children:t})," with a JSON input. You are taken to the execution to follow it."]})]}),(0,n.jsx)(C.D,{label:"Name",optional:!0,htmlFor:"exec-name",error:b||r?N:void 0,help:"Unique within this state machine. Defaults to a random ID.",children:(0,n.jsx)(j.p,{id:"exec-name",autoComplete:"off",spellCheck:!1,value:r,onChange:e=>c(e.target.value),className:"font-mono text-[13px]"})}),(0,n.jsx)(C.D,{label:"Input",children:(0,n.jsx)("div",{className:"max-h-[50vh] overflow-auto",children:(0,n.jsx)(k.i,{value:d,onChange:u,rows:8})})}),(0,n.jsxs)(g.Es,{children:[(0,n.jsx)(v.$,{type:"button",variant:"outline",onClick:a,disabled:f,children:"Cancel"}),(0,n.jsxs)(v.$,{type:"submit",disabled:f||!!y||!!N,children:[f?(0,n.jsx)(h.A,{className:"animate-spin"}):(0,n.jsx)(m.A,{}),"Start execution"]})]})]})})})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js b/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js
new file mode 100644
index 00000000..19e4db43
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1830-dbb06546d320e8e5.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1830],{1947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},23566:(e,t,n)=>{n.d(t,{q7:()=>S,bL:()=>j,RG:()=>k});var r=n(29320),a=n(62315),o=n(2430),l=n(36103),i=n(65335),u=n(29203),c=n(12377),s=n(82275),d=n(97645),f=n(26276),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},m="RovingFocusGroup",[h,v,b]=(0,o.N)(m),[g,k]=(0,i.A)(m,[b]),[A,w]=g(m),x=r.forwardRef((e,t)=>(0,f.jsx)(h.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(h.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,f.jsx)(M,{...e,ref:t})})}));x.displayName=m;var M=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...w}=e,x=r.useRef(null),M=(0,l.s)(t,x),R=(0,d.jH)(u),[E=null,N]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,s.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=(0,s.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}({prop:m,defaultProp:h,onChange:b}),[j,S]=r.useState(!1),I=(0,s.c)(g),T=v(n),D=r.useRef(!1),[O,F]=r.useState(0);return r.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,I),()=>e.removeEventListener(p,I)},[I]),(0,f.jsx)(A,{scope:n,orientation:o,dir:R,loop:i,currentTabStopId:E,onItemFocus:r.useCallback(e=>N(e),[N]),onItemShiftTab:r.useCallback(()=>S(!0),[]),onFocusableItemAdd:r.useCallback(()=>F(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>F(e=>e-1),[]),children:(0,f.jsx)(c.sG.div,{tabIndex:j||0===O?-1:0,"data-orientation":o,...w,ref:M,style:{outline:"none",...e.style},onMouseDown:(0,a.m)(e.onMouseDown,()=>{D.current=!0}),onFocus:(0,a.m)(e.onFocus,e=>{let t=!D.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);C([e.find(e=>e.active),e.find(e=>e.id===E),...e].filter(Boolean).map(e=>e.ref.current),k)}}D.current=!1}),onBlur:(0,a.m)(e.onBlur,()=>S(!1))})})}),R="RovingFocusGroupItem",E=r.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:i,...s}=e,d=(0,u.B)(),p=i||d,y=w(R,n),m=y.currentTabStopId===p,b=v(n),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return r.useEffect(()=>{if(o)return g(),()=>k()},[o,g,k]),(0,f.jsx)(h.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,f.jsx)(c.sG.span,{tabIndex:m?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,a.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,a.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let a=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return N[a]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=y.loop?function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(n,r+1):n.slice(r+1)}setTimeout(()=>C(n))}})})})});E.displayName=R;var N={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}var j=x,S=E},24608:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},29902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,n)=>{n.d(t,{UC:()=>O,B8:()=>T,bL:()=>I,l9:()=>D});var r=n(29320),a=n(62315),o=n(65335),l=n(23566),i=n(36103),u=n(96886),c=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),l=r.useRef({}),i=r.useRef(e),c=r.useRef("none"),[d,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=s(l.current);c.current="mounted"===d?e:"none"},[d]),(0,u.N)(()=>{let t=l.current,n=i.current;if(n!==e){let r=c.current,a=s(t);e?f("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==a?f("ANIMATION_OUT"):f("UNMOUNT"),i.current=e}},[e,f]),(0,u.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=s(l.current).includes(e.animationName);if(e.target===a&&r&&(f("ANIMATION_END"),!i.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(c.current=s(l.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{e&&(l.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),l=(0,i.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:l}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var d=n(12377),f=n(97645),p=n(82275),y=n(29203),m=n(26276),h="Tabs",[v,b]=(0,o.A)(h,[l.RG]),g=(0,l.RG)(),[k,A]=v(h),w=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:l,orientation:i="horizontal",dir:u,activationMode:c="automatic",...s}=e,h=(0,f.jH)(u),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),l=(0,p.c)(t);return r.useEffect(()=>{o.current!==a&&(l(a),o.current=a)},[a,o,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:a,u=(0,p.c)(n);return[i,r.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else o(t)},[l,e,o,u])]}({prop:a,onChange:o,defaultProp:l});return(0,m.jsx)(k,{scope:n,baseId:(0,y.B)(),value:v,onValueChange:b,orientation:i,dir:h,activationMode:c,children:(0,m.jsx)(d.sG.div,{dir:h,"data-orientation":i,...s,ref:t})})});w.displayName=h;var x="TabsList",M=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=A(x,n),i=g(n);return(0,m.jsx)(l.bL,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:(0,m.jsx)(d.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});M.displayName=x;var R="TabsTrigger",E=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,u=A(R,n),c=g(n),s=j(u.baseId,r),f=S(u.baseId,r),p=r===u.value;return(0,m.jsx)(l.q7,{asChild:!0,...c,focusable:!o,active:p,children:(0,m.jsx)(d.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:s,...i,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():u.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&u.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==u.activationMode;p||o||!e||u.onValueChange(r)})})})});E.displayName=R;var N="TabsContent",C=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:l,...i}=e,u=A(N,n),s=j(u.baseId,a),f=S(u.baseId,a),p=a===u.value,y=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,m.jsx)(c,{present:o||p,children:n=>{let{present:r}=n;return(0,m.jsx)(d.sG.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":s,hidden:!r,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&l})}})});function j(e,t){return"".concat(e,"-trigger-").concat(t)}function S(e,t){return"".concat(e,"-content-").concat(t)}C.displayName=N;var I=w,T=M,D=E,O=C},37995:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},42812:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},79092:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},86931:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,n)=>{n.d(t,{b:()=>j});var r=n(29320),a=n.t(r,2),o=n(93993),l=Object.defineProperty,i=(e,t)=>l(e,"name",{value:t,configurable:!0});function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function c(...e){return t=>{let n=!1,r=e.map(e=>{let r=u(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;td(e,"name",{value:t,configurable:!0});function p(e){let t=r.forwardRef((t,n)=>{let{children:a,...o}=t,l=null,i=!1,u=[];k(a)&&"function"==typeof M&&(a=M(a._payload)),r.Children.forEach(a,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof M&&(t=M(t._payload)),l=m(e,t),u.push(l?.props?.children)}else u.push(e)}),l?l=r.cloneElement(l,void 0,u):!i&&1===r.Children.count(a)&&r.isValidElement(a)&&(l=a);let c=l?v(l):void 0,d=s(n,c);if(!l){if(a||0===a)throw Error(i?x(e):w(e));return a}let f=h(o,l.props??{});return l.type!==r.Fragment&&(f.ref=n?d:c),r.cloneElement(l,f)});return t.displayName=`${e}.Slot`,t}f(p,"createSlot");var y=Symbol.for("radix.slottable");f(function(e){let t=f(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var m=f((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}f(h,"mergeProps"),f(v,"getElementRef"),f(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}f(k,"isLazyComponent"),f(A,"isPromiseLike");var w=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],R=n(26276),E=Object.defineProperty,N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=p(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,R.jsx)(a?n:t,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});E(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,j=r.forwardRef(C(function(e,t){return(0,R.jsx)(N.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js b/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js
deleted file mode 100644
index 39514f48..00000000
--- a/pages/demo/_next/static/chunks/1884-97bfbc48adb573f3.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1884],{19080:(e,t,n)=>{n.d(t,{bm:()=>eo,UC:()=>et,VY:()=>er,hJ:()=>ee,ZL:()=>$,bL:()=>Q,hE:()=>en});var r=n(12115),o=n(92556),i=n(94446),a=n(3468),l=n(68946),s=n(70222),u=n(44831),d=n(69666),c=n(75433),f=n(4129),p=e=>{let{present:t,children:n}=e,o=function(e){var t,n;let[o,i]=r.useState(),a=r.useRef({}),l=r.useRef(e),s=r.useRef("none"),[u,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=m(a.current);s.current="mounted"===u?e:"none"},[u]),(0,f.N)(()=>{let t=a.current,n=l.current;if(n!==e){let r=s.current,o=m(t);e?d("MOUNT"):"none"===o||(null==t?void 0:t.display)==="none"?d("UNMOUNT"):n&&r!==o?d("ANIMATION_OUT"):d("UNMOUNT"),l.current=e}},[e,d]),(0,f.N)(()=>{if(o){var e;let t,n=null!=(e=o.ownerDocument.defaultView)?e:window,r=e=>{let r=m(a.current).includes(e.animationName);if(e.target===o&&r&&(d("ANIMATION_END"),!l.current)){let e=o.style.animationFillMode;o.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=e)})}},i=e=>{e.target===o&&(s.current=m(a.current))};return o.addEventListener("animationstart",i),o.addEventListener("animationcancel",r),o.addEventListener("animationend",r),()=>{n.clearTimeout(t),o.removeEventListener("animationstart",i),o.removeEventListener("animationcancel",r),o.removeEventListener("animationend",r)}}d("ANIMATION_END")},[o,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:r.useCallback(e=>{e&&(a.current=getComputedStyle(e)),i(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),l=(0,i.s)(o.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(o=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:l}):null};function m(e){return(null==e?void 0:e.animationName)||"none"}p.displayName="Presence";var g=n(97602),v=n(19526),N=n(40101),y=n(97745),D=n(32467),h=n(95155),O="Dialog",[R,b]=(0,a.A)(O),[w,I]=R(O),E=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:a,modal:u=!0}=e,d=r.useRef(null),c=r.useRef(null),[f=!1,p]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[o,i]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[o]=n,i=r.useRef(o),a=(0,s.c)(t);return r.useEffect(()=>{i.current!==o&&(a(o),i.current=o)},[o,i,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,l=a?e:o,u=(0,s.c)(n);return[l,r.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&u(n)}else i(t)},[a,e,i,u])]}({prop:o,defaultProp:i,onChange:a});return(0,h.jsx)(w,{scope:t,triggerRef:d,contentRef:c,contentId:(0,l.B)(),titleId:(0,l.B)(),descriptionId:(0,l.B)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:u,children:n})};E.displayName=O;var j="DialogTrigger";r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=I(j,n),l=(0,i.s)(t,a.triggerRef);return(0,h.jsx)(g.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":X(a.open),...r,ref:l,onClick:(0,o.m)(e.onClick,a.onOpenToggle)})}).displayName=j;var x="DialogPortal",[C,A]=R(x,{forceMount:void 0}),M=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:i}=e,a=I(x,t);return(0,h.jsx)(C,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,h.jsx)(p,{present:n||a.open,children:(0,h.jsx)(c.Z,{asChild:!0,container:i,children:e})}))})};M.displayName=x;var _="DialogOverlay",T=r.forwardRef((e,t)=>{let n=A(_,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=I(_,e.__scopeDialog);return i.modal?(0,h.jsx)(p,{present:r||i.open,children:(0,h.jsx)(F,{...o,ref:t})}):null});T.displayName=_;var F=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(_,n);return(0,h.jsx)(N.A,{as:D.DX,allowPinchZoom:!0,shards:[o.contentRef],children:(0,h.jsx)(g.sG.div,{"data-state":X(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),P="DialogContent",k=r.forwardRef((e,t)=>{let n=A(P,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=I(P,e.__scopeDialog);return(0,h.jsx)(p,{present:r||i.open,children:i.modal?(0,h.jsx)(U,{...o,ref:t}):(0,h.jsx)(L,{...o,ref:t})})});k.displayName=P;var U=r.forwardRef((e,t)=>{let n=I(P,e.__scopeDialog),a=r.useRef(null),l=(0,i.s)(t,n.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,y.Eq)(e)},[]),(0,h.jsx)(S,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.m)(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:(0,o.m)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.m)(e.onFocusOutside,e=>e.preventDefault())})}),L=r.forwardRef((e,t)=>{let n=I(P,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,h.jsx)(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let l=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(l))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),S=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:l,...s}=e,c=I(P,n),f=r.useRef(null),p=(0,i.s)(t,f);return(0,v.Oh)(),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.n,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,children:(0,h.jsx)(u.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":X(c.open),...s,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Y,{titleId:c.titleId}),(0,h.jsx)(z,{contentRef:f,descriptionId:c.descriptionId})]})]})}),W="DialogTitle",B=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(W,n);return(0,h.jsx)(g.sG.h2,{id:o.titleId,...r,ref:t})});B.displayName=W;var G="DialogDescription",q=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=I(G,n);return(0,h.jsx)(g.sG.p,{id:o.descriptionId,...r,ref:t})});q.displayName=G;var V="DialogClose",Z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=I(V,n);return(0,h.jsx)(g.sG.button,{type:"button",...r,ref:t,onClick:(0,o.m)(e.onClick,()=>i.onOpenChange(!1))})});function X(e){return e?"open":"closed"}Z.displayName=V;var H="DialogTitleWarning",[J,K]=(0,a.q)(H,{contentName:P,titleName:W,docsSlug:"dialog"}),Y=e=>{let{titleId:t}=e,n=K(H),o="`".concat(n.contentName,"` requires a `").concat(n.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(n.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(n.docsSlug);return r.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},z=e=>{let{contentRef:t,descriptionId:n}=e,o=K("DialogDescriptionWarning"),i="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(o.contentName,"}.");return r.useEffect(()=>{var e;let r=null==(e=t.current)?void 0:e.getAttribute("aria-describedby");n&&r&&(document.getElementById(n)||console.warn(i))},[i,t,n]),null},Q=E,$=M,ee=T,et=k,en=B,er=q,eo=Z},65229:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js b/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js
new file mode 100644
index 00000000..fe0a2c36
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1930-6cbf49bb6738f91b.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1930],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},22470:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},30359:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},44057:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69545:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>R});var r=l(29320),n=l.t(r,2),a=l(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function y(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=y(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;tp(e,"name",{value:t,configurable:!0});function u(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,i=null,o=!1,y=[];A(n)&&"function"==typeof M&&(n=M(n._payload)),r.Children.forEach(n,e=>{if(x(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof M&&(t=M(t._payload)),i=f(e,t),y.push(i?.props?.children)}else y.push(e)}),i?i=r.cloneElement(i,void 0,y):!o&&1===r.Children.count(n)&&r.isValidElement(n)&&(i=n);let d=i?m(i):void 0,p=c(l,d);if(!i){if(n||0===n)throw Error(o?w(e):g(e));return n}let h=k(a,i.props??{});return i.type!==r.Fragment&&(h.ref=l?p:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(u,"createSlot");var s=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var f=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function x(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}h(k,"mergeProps"),h(m,"getElementRef"),h(x,"isSlottable");var v=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&b(e._payload)}function b(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(b,"isPromiseLike");var g=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=l(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=u(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=r.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js b/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js
new file mode 100644
index 00000000..81389389
--- /dev/null
+++ b/pages/demo/_next/static/chunks/1968-7f453ed0e6f4674b.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1968],{1211:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},1947:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7489:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},8266:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},10002:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},28296:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},29724:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]])},29902:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},33359:(e,t,a)=>{a.d(t,{UC:()=>z,B8:()=>I,bL:()=>O,l9:()=>q});var n=a(29320),r=a(62315),i=a(65335),d=a(23566),o=a(36103),l=a(96886),c=e=>{let{present:t,children:a}=e,r=function(e){var t,a;let[r,i]=n.useState(),d=n.useRef({}),o=n.useRef(e),c=n.useRef("none"),[u,y]=(t=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=a[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=s(d.current);c.current="mounted"===u?e:"none"},[u]),(0,l.N)(()=>{let t=d.current,a=o.current;if(a!==e){let n=c.current,r=s(t);e?y("MOUNT"):"none"===r||(null==t?void 0:t.display)==="none"?y("UNMOUNT"):a&&n!==r?y("ANIMATION_OUT"):y("UNMOUNT"),o.current=e}},[e,y]),(0,l.N)(()=>{if(r){var e;let t,a=null!=(e=r.ownerDocument.defaultView)?e:window,n=e=>{let n=s(d.current).includes(e.animationName);if(e.target===r&&n&&(y("ANIMATION_END"),!o.current)){let e=r.style.animationFillMode;r.style.animationFillMode="forwards",t=a.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=e)})}},i=e=>{e.target===r&&(c.current=s(d.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{a.clearTimeout(t),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{e&&(d.current=getComputedStyle(e)),i(e)},[])}}(t),i="function"==typeof a?a({present:r.isPresent}):n.Children.only(a),d=(0,o.s)(r.ref,function(e){var t,a;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(r=(n=null==(a=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:a.get)&&"isReactWarning"in n&&n.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof a||r.isPresent?n.cloneElement(i,{ref:d}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence";var u=a(12377),y=a(97645),h=a(82275),p=a(29203),f=a(26276),k="Tabs",[v,m]=(0,i.A)(k,[d.RG]),A=(0,d.RG)(),[M,b]=v(k),x=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:d,orientation:o="horizontal",dir:l,activationMode:c="automatic",...s}=e,k=(0,y.jH)(l),[v,m]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,h.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,o=d?e:r,l=(0,h.c)(a);return[o,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&l(a)}else i(t)},[d,e,i,l])]}({prop:r,onChange:i,defaultProp:d});return(0,f.jsx)(M,{scope:a,baseId:(0,p.B)(),value:v,onValueChange:m,orientation:o,dir:k,activationMode:c,children:(0,f.jsx)(u.sG.div,{dir:k,"data-orientation":o,...s,ref:t})})});x.displayName=k;var w="TabsList",g=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...r}=e,i=b(w,a),o=A(a);return(0,f.jsx)(d.bL,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:(0,f.jsx)(u.sG.div,{role:"tablist","aria-orientation":i.orientation,...r,ref:t})})});g.displayName=w;var N="TabsTrigger",C=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:i=!1,...o}=e,l=b(N,a),c=A(a),s=T(l.baseId,n),y=E(l.baseId,n),h=n===l.value;return(0,f.jsx)(d.q7,{asChild:!0,...c,focusable:!i,active:h,children:(0,f.jsx)(u.sG.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":y,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:s,...o,ref:t,onMouseDown:(0,r.m)(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(n)}),onKeyDown:(0,r.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&l.onValueChange(n)}),onFocus:(0,r.m)(e.onFocus,()=>{let e="manual"!==l.activationMode;h||i||!e||l.onValueChange(n)})})})});C.displayName=N;var R="TabsContent",j=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:r,forceMount:i,children:d,...o}=e,l=b(R,a),s=T(l.baseId,r),y=E(l.baseId,r),h=r===l.value,p=n.useRef(h);return n.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(c,{present:i||h,children:a=>{let{present:n}=a;return(0,f.jsx)(u.sG.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":s,hidden:!n,id:y,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:n&&d})}})});function T(e,t){return"".concat(e,"-trigger-").concat(t)}function E(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var O=x,I=g,q=C,z=j},37995:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},39727:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43036:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},46319:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},50123:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]])},51203:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},56753:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,a)=>{a.d(t,{bL:()=>x,zi:()=>w});var n=a(29320),r=a(62315),i=a(36103),d=a(65335),o=a(82275),l=a(79225),c=a(96886),s=a(12377),u=a(26276),y="Switch",[h,p]=(0,d.A)(y),[f,k]=h(y),v=n.forwardRef((e,t)=>{let{__scopeSwitch:a,name:d,checked:l,defaultChecked:c,required:y,disabled:h,value:p="on",onCheckedChange:k,form:v,...m}=e,[A,x]=n.useState(null),w=(0,i.s)(t,e=>x(e)),g=n.useRef(!1),N=!A||v||!!A.closest("form"),[C=!1,R]=function({prop:e,defaultProp:t,onChange:a=()=>{}}){let[r,i]=function({defaultProp:e,onChange:t}){let a=n.useState(e),[r]=a,i=n.useRef(r),d=(0,o.c)(t);return n.useEffect(()=>{i.current!==r&&(d(r),i.current=r)},[r,i,d]),a}({defaultProp:t,onChange:a}),d=void 0!==e,l=d?e:r,c=(0,o.c)(a);return[l,n.useCallback(t=>{if(d){let a="function"==typeof t?t(e):t;a!==e&&c(a)}else i(t)},[d,e,i,c])]}({prop:l,defaultProp:c,onChange:k});return(0,u.jsxs)(f,{scope:a,checked:C,disabled:h,children:[(0,u.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":C,"aria-required":y,"data-state":b(C),"data-disabled":h?"":void 0,disabled:h,value:p,...m,ref:w,onClick:(0,r.m)(e.onClick,e=>{R(e=>!e),N&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),N&&(0,u.jsx)(M,{control:A,bubbles:!g.current,name:d,value:p,checked:C,required:y,disabled:h,form:v,style:{transform:"translateX(-100%)"}})]})});v.displayName=y;var m="SwitchThumb",A=n.forwardRef((e,t)=>{let{__scopeSwitch:a,...n}=e,r=k(m,a);return(0,u.jsx)(s.sG.span,{"data-state":b(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});A.displayName=m;var M=e=>{let{control:t,checked:a,bubbles:r=!0,...i}=e,d=n.useRef(null),o=(0,l.Z)(a),s=function(e){let[t,a]=n.useState(void 0);return(0,c.N)(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;a({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}a(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=d.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==a&&t){let n=new Event("click",{bubbles:r});t.call(e,a),e.dispatchEvent(n)}},[o,a,r]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:d,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function b(e){return e?"checked":"unchecked"}var x=v,w=A},64761:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},86931:(e,t,a)=>{a.d(t,{A:()=>n});let n=(0,a(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js b/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js
deleted file mode 100644
index 18468c2a..00000000
--- a/pages/demo/_next/static/chunks/2008-922f78b1b1b1523a.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2008],{6191:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},14639:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])},20562:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},35626:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},43465:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,n)=>{n.d(t,{b:()=>C});var r=n(12115),a=n.t(r,2),o=n(47650),i=Object.defineProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0});function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let n=!1,r=e.map(e=>{let r=d(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,n)=>{let{children:a,...o}=t,i=null,l=!1,d=[];k(a)&&"function"==typeof M&&(a=M(a._payload)),r.Children.forEach(a,e=>{if(b(e)){l=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof M&&(t=M(t._payload)),i=h(e,t),d.push(i?.props?.children)}else d.push(e)}),i?i=r.cloneElement(i,void 0,d):!l&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let u=i?v(i):void 0,s=c(n,u);if(!i){if(a||0===a)throw Error(l?w(e):x(e));return a}let p=m(o,i.props??{});return i.type!==r.Fragment&&(p.ref=n?s:u),r.cloneElement(i,p)});return t.displayName=`${e}.Slot`,t}p(f,"createSlot");var y=Symbol.for("radix.slottable");p(function(e){let t=p(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=p((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let n={...t};for(let r in t){let a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}p(m,"mergeProps"),p(v,"getElementRef"),p(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}p(k,"isLazyComponent"),p(A,"isPromiseLike");var x=p(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=p(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=a[" use ".trim().toString()],N=n(95155),E=Object.defineProperty,R=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,N.jsx)(a?n:t,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});E(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,C=r.forwardRef(j(function(e,t){return(0,N.jsx)(R.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null==(n=e.onMouseDown)||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52987:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},60356:(e,t,n)=>{n.d(t,{UC:()=>I,B8:()=>T,bL:()=>S,l9:()=>D});var r=n(12115),a=n(92556),o=n(3468),i=n(29525),l=n(94446),d=n(4129),u=e=>{let{present:t,children:n}=e,a=function(e){var t,n;let[a,o]=r.useState(),i=r.useRef({}),l=r.useRef(e),u=r.useRef("none"),[s,p]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=c(i.current);u.current="mounted"===s?e:"none"},[s]),(0,d.N)(()=>{let t=i.current,n=l.current;if(n!==e){let r=u.current,a=c(t);e?p("MOUNT"):"none"===a||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):n&&r!==a?p("ANIMATION_OUT"):p("UNMOUNT"),l.current=e}},[e,p]),(0,d.N)(()=>{if(a){var e;let t,n=null!=(e=a.ownerDocument.defaultView)?e:window,r=e=>{let r=c(i.current).includes(e.animationName);if(e.target===a&&r&&(p("ANIMATION_END"),!l.current)){let e=a.style.animationFillMode;a.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=e)})}},o=e=>{e.target===a&&(u.current=c(i.current))};return a.addEventListener("animationstart",o),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{n.clearTimeout(t),a.removeEventListener("animationstart",o),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{e&&(i.current=getComputedStyle(e)),o(e)},[])}}(t),o="function"==typeof n?n({present:a.isPresent}):r.Children.only(n),i=(0,l.s)(a.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(a=(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(o));return"function"==typeof n||a.isPresent?r.cloneElement(o,{ref:i}):null};function c(e){return(null==e?void 0:e.animationName)||"none"}u.displayName="Presence";var s=n(97602),p=n(66218),f=n(70222),y=n(68946),h=n(95155),m="Tabs",[v,b]=(0,o.A)(m,[i.RG]),g=(0,i.RG)(),[k,A]=v(m),x=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:d,activationMode:u="automatic",...c}=e,m=(0,p.jH)(d),[v,b]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let n=r.useState(e),[a]=n,o=r.useRef(a),i=(0,f.c)(t);return r.useEffect(()=>{o.current!==a&&(i(a),o.current=a)},[a,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,l=i?e:a,d=(0,f.c)(n);return[l,r.useCallback(t=>{if(i){let n="function"==typeof t?t(e):t;n!==e&&d(n)}else o(t)},[i,e,o,d])]}({prop:a,onChange:o,defaultProp:i});return(0,h.jsx)(k,{scope:n,baseId:(0,y.B)(),value:v,onValueChange:b,orientation:l,dir:m,activationMode:u,children:(0,h.jsx)(s.sG.div,{dir:m,"data-orientation":l,...c,ref:t})})});x.displayName=m;var w="TabsList",M=r.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...a}=e,o=A(w,n),l=g(n);return(0,h.jsx)(i.bL,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:(0,h.jsx)(s.sG.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});M.displayName=w;var N="TabsTrigger",E=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,d=A(N,n),u=g(n),c=C(d.baseId,r),p=O(d.baseId,r),f=r===d.value;return(0,h.jsx)(i.q7,{asChild:!0,...u,focusable:!o,active:f,children:(0,h.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":p,"data-state":f?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...l,ref:t,onMouseDown:(0,a.m)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,a.m)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,a.m)(e.onFocus,()=>{let e="manual"!==d.activationMode;f||o||!e||d.onValueChange(r)})})})});E.displayName=N;var R="TabsContent",j=r.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,forceMount:o,children:i,...l}=e,d=A(R,n),c=C(d.baseId,a),p=O(d.baseId,a),f=a===d.value,y=r.useRef(f);return r.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,h.jsx)(u,{present:o||f,children:n=>{let{present:r}=n;return(0,h.jsx)(s.sG.div,{"data-state":f?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":c,hidden:!r,id:p,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:r&&i})}})});function C(e,t){return"".concat(e,"-trigger-").concat(t)}function O(e,t){return"".concat(e,"-content-").concat(t)}j.displayName=R;var S=x,T=M,D=E,I=j},71360:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},71613:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},74054:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},75426:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},86651:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},90368:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},93499:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},99051:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js b/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js
deleted file mode 100644
index d1fb15d0..00000000
--- a/pages/demo/_next/static/chunks/2074-f1841ca9174cd224.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2074],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},20639:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},23327:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>C});var n=r(12115),l=r.t(n,2),o=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:l,...o}=t,a=null,i=!1,c=[];g(l)&&"function"==typeof S&&(l=S(l._payload)),n.Children.forEach(l,e=>{if(k(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof S&&(t=S(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(l)&&n.isValidElement(l)&&(a=l);let d=a?m(a):void 0,f=s(r,d);if(!a){if(l||0===l)throw Error(i?w(e):x(e));return l}let u=b(o,a.props??{});return a.type!==n.Fragment&&(u.ref=r?f:d),n.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}u(p,"createSlot");var y=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=u((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function b(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function k(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}u(b,"mergeProps"),u(m,"getElementRef"),u(k,"isSlottable");var v=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(g,"isLazyComponent"),u(A,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S=l[" use ".trim().toString()],E=r(95155),R=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),l=n.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(l?r:t,{...o,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});R(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,C=n.forwardRef(j(function(e,t){return(0,E.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},55867:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},57828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},65229:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},70532:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99587:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var n=r(12115),l=r(92556),o=r(94446),a=r(3468),i=r(70222),c=r(78108),d=r(4129),s=r(97602),f=r(95155),u="Switch",[p,y]=(0,a.A)(u),[h,b]=p(u),m=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:a,checked:c,defaultChecked:d,required:u,disabled:p,value:y="on",onCheckedChange:b,form:m,...k}=e,[v,x]=n.useState(null),w=(0,o.s)(t,e=>x(e)),S=n.useRef(!1),E=!v||m||!!v.closest("form"),[R=!1,M]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[l,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[l]=r,o=n.useRef(l),a=(0,i.c)(t);return n.useEffect(()=>{o.current!==l&&(a(l),o.current=l)},[l,o,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,c=a?e:l,d=(0,i.c)(r);return[c,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else o(t)},[a,e,o,d])]}({prop:c,defaultProp:d,onChange:b});return(0,f.jsxs)(h,{scope:r,checked:R,disabled:p,children:[(0,f.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":R,"aria-required":u,"data-state":A(R),"data-disabled":p?"":void 0,disabled:p,value:y,...k,ref:w,onClick:(0,l.m)(e.onClick,e=>{M(e=>!e),E&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),E&&(0,f.jsx)(g,{control:v,bubbles:!S.current,name:a,value:y,checked:R,required:u,disabled:p,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var k="SwitchThumb",v=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,l=b(k,r);return(0,f.jsx)(s.sG.span,{"data-state":A(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:t})});v.displayName=k;var g=e=>{let{control:t,checked:r,bubbles:l=!0,...o}=e,a=n.useRef(null),i=(0,c.Z)(r),s=function(e){let[t,r]=n.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,l;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,l=t.blockSize}else n=e.offsetWidth,l=e.offsetHeight;r({width:n,height:l})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return n.useEffect(()=>{let e=a.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(i!==r&&t){let n=new Event("click",{bubbles:l});t.call(e,r),e.dispatchEvent(n)}},[i,r,l]),(0,f.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=m,w=v}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js b/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js
deleted file mode 100644
index 0aee3ff9..00000000
--- a/pages/demo/_next/static/chunks/2092-62380e5e4f804a52.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2092],{16981:(e,s,t)=>{t.d(s,{D:()=>r});var a=t(95155),n=t(90235),l=t(25016);function r(e){let{label:s,htmlFor:t,help:r,error:i,optional:d,children:o,className:c}=e;return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",c),children:[(0,a.jsxs)(n.J,{htmlFor:t,className:"text-sm font-medium",children:[s,d&&(0,a.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),o,i?(0,a.jsx)("p",{className:"text-destructive text-xs",children:i}):r?(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:r}):null]})}},23327:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(71847).A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},47507:(e,s,t)=>{t.d(s,{TR:()=>h,bq:()=>x,eb:()=>p,gC:()=>m,l6:()=>o,s3:()=>c,yv:()=>u});var a=t(95155);t(12115);var n=t(95435),l=t(24033),r=t(5917),i=t(12108),d=t(25016);function o(e){let{...s}=e;return(0,a.jsx)(n.bL,{"data-slot":"select",...s})}function c(e){let{...s}=e;return(0,a.jsx)(n.YJ,{"data-slot":"select-group",...s})}function u(e){let{...s}=e;return(0,a.jsx)(n.WT,{"data-slot":"select-value",...s})}function x(e){let{className:s,size:t="default",children:r,...i}=e;return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...i,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:s,children:t,position:l="popper",...r}=e;return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:l,...r,children:[(0,a.jsx)(f,{}),(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,a.jsx)(g,{})]})})}function h(e){let{className:s,...t}=e;return(0,a.jsx)(n.JU,{"data-slot":"select-label",className:(0,d.cn)("text-muted-foreground px-2 py-1.5 text-xs",s),...t})}function p(e){let{className:s,children:t,...l}=e;return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",s),...l,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(r.A,{className:"size-4"})})}),(0,a.jsx)(n.p4,{children:t})]})}function f(e){let{className:s,...t}=e;return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(i.A,{className:"size-4"})})}function g(e){let{className:s,...t}=e;return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(l.A,{className:"size-4"})})}},60495:(e,s,t)=>{t.d(s,{LY:()=>u,O6:()=>d,_y:()=>o,fP:()=>c});var a=t(95155),n=t(65229),l=t(6191),r=t(97003),i=t(33789);function d(e){return Object.entries(null!=e?e:{}).map(e=>{let[s,t]=e;return{key:s,value:t}})}function o(e){let s={};for(let t of e)t.key.trim()&&(s[t.key.trim()]=t.value);return Object.keys(s).length?s:void 0}function c(e){let{rows:s,onChange:t,keyPlaceholder:d="Key",valuePlaceholder:o="Value",addLabel:c="Add tag",max:u=50}=e,x=(e,a)=>t(s.map((s,t)=>t===e?{...s,...a}:s));return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[s.length>0&&(0,a.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,a.jsx)("span",{children:d}),(0,a.jsx)("span",{children:o})]}),s.map((e,l)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,a.jsx)(i.p,{value:e.key,onChange:e=>x(l,{key:e.target.value}),placeholder:d,className:"h-8"}),(0,a.jsx)(i.p,{value:e.value,onChange:e=>x(l,{value:e.target.value}),placeholder:o,className:"h-8"}),(0,a.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>t(s.filter((e,s)=>s!==l)),"aria-label":"Remove",children:(0,a.jsx)(n.A,{})})]},l)),(0,a.jsx)("div",{children:(0,a.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>t([...s,{key:"",value:""}]),disabled:s.length>=u,children:[(0,a.jsx)(l.A,{})," ",c]})})]})}function u(e){let{tags:s}=e,t=Object.entries(null!=s?s:{});return t.length?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map(e=>{let[s,t]=e;return(0,a.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:s}),t&&(0,a.jsxs)("span",{children:["=",t]})]},s)})}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},62325:(e,s,t)=>{t.d(s,{w:()=>l});var a=t(95155),n=t(25016);function l(e){let{title:s,description:t,actions:l,children:r,className:i,bodyClassName:d,flush:o}=e;return(0,a.jsxs)("section",{className:(0,n.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(s||l)&&(0,a.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[s&&(0,a.jsx)("h2",{className:"text-base font-semibold",children:s}),t&&(0,a.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:t})]}),l&&(0,a.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:l})]}),(0,a.jsx)("div",{className:(0,n.cn)(!o&&"p-4",d),children:r})]})}},77801:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(71847).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},85450:(e,s,t)=>{t.d(s,{AF:()=>N,Ho:()=>b,Mj:()=>y});var a=t(95155),n=t(52619),l=t.n(n),r=t(12115),i=t(35299),d=t(77801),o=t(23327),c=t(18720),u=t(97003),x=t(54679),m=t(47507),h=t(99116),p=t(62325),f=t(37621),g=t(73697),j=t(41183);let v="__none__";function b(e){let{value:s,onChange:t,id:n,className:l}=e,{data:i,isLoading:d}=(0,g.gf)("".concat(j.mP,"/policies")),[o,c]=(0,r.useMemo)(()=>{let e=[...null!=i?i:[]].sort((e,s)=>e.name.localeCompare(s.name));return[e.filter(e=>e.managed),e.filter(e=>!e.managed)]},[i]);return(0,a.jsxs)(m.l6,{value:s||v,onValueChange:e=>t(e===v?"":e),disabled:d,children:[(0,a.jsx)(m.bq,{id:n,className:null!=l?l:"w-full sm:w-96","aria-label":"Permissions boundary",children:(0,a.jsx)(m.yv,{placeholder:d?"Loading policies...":"No permissions boundary"})}),(0,a.jsxs)(m.gC,{className:"max-h-80",children:[(0,a.jsx)(m.eb,{value:v,children:"No permissions boundary"}),c.length>0&&(0,a.jsxs)(m.s3,{children:[(0,a.jsx)(m.TR,{children:"Customer managed"}),c.map(e=>(0,a.jsx)(m.eb,{value:e.arn,children:e.name},e.arn))]}),(0,a.jsxs)(m.s3,{children:[(0,a.jsx)(m.TR,{children:"AWS managed"}),o.map(e=>(0,a.jsx)(m.eb,{value:e.arn,children:e.name},e.arn))]})]})]})}function y(e){let{kind:s}=e;return(0,a.jsxs)(a.Fragment,{children:["A permissions boundary is a managed policy that sets the maximum permissions the ",s," can have. The ",s,"'s effective permissions are the ones allowed by both its policies and the boundary."]})}function N(e){var s;let{kind:t,arn:n,onSet:x,readOnlyNote:m}=e,v=(0,g.gf)(n?"".concat(j.mP,"/policies"):null),b=n?(null!=(s=v.data)?s:[]).find(e=>e.arn===n):void 0,N=!!n&&!!v.data&&!b,[k,C]=(0,r.useState)(!1),[z,_]=(0,r.useState)(!1),A=async()=>{if(x){_(!0);try{await x(""),c.oR.success("Permissions boundary removed")}catch(e){c.oR.error((0,f.gJ)(e))}finally{_(!1)}}};return(0,a.jsxs)(p.w,{title:"Permissions boundary",description:(0,a.jsx)(y,{kind:t}),actions:x?(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsxs)(u.$,{size:"sm",variant:"outline",onClick:A,disabled:z,children:[z&&(0,a.jsx)(i.A,{className:"animate-spin"})," Remove boundary"]}),(0,a.jsx)(u.$,{size:"sm",variant:"outline",onClick:()=>C(!0),children:n?"Change boundary":"Set boundary"})]}):void 0,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(d.A,{className:"size-4 shrink-0 text-amber-600 dark:text-amber-400"}),(0,a.jsx)(l(),{href:(0,j.Wr)((0,j.xx)(n)),className:j.ps,children:(0,j.xx)(n)}),b&&(0,a.jsx)(j.MQ,{managed:b.managed})]}),(0,a.jsx)(h.xh,{value:n,className:"text-[13px]"}),N&&(0,a.jsxs)("p",{className:"text-destructive text-xs",children:["The boundary policy no longer exists, so it allows nothing: the ",t," has no effective permissions."]})]}):(0,a.jsx)("p",{className:"text-muted-foreground",children:"Permissions boundary is not set."}),!x&&m&&(0,a.jsxs)("p",{className:"text-muted-foreground flex items-start gap-2 text-xs",children:[(0,a.jsx)(o.A,{className:"mt-0.5 size-3.5 shrink-0"})," ",m]})]}),x&&(0,a.jsx)(w,{open:k,onOpenChange:C,kind:t,current:null!=n?n:"",onSet:x})]})}function w(e){let{open:s,onOpenChange:t,kind:n,current:l,onSet:d}=e,[o,m]=(0,r.useState)(l),[h,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{s&&m(l)},[s,l]);let g=async()=>{p(!0);try{await d(o),c.oR.success(o?"Permissions boundary set":"Permissions boundary removed"),t(!1)}catch(e){c.oR.error((0,f.gJ)(e))}finally{p(!1)}};return(0,a.jsx)(x.lG,{open:s,onOpenChange:e=>!h&&t(e),children:(0,a.jsxs)(x.Cf,{children:[(0,a.jsxs)(x.c7,{children:[(0,a.jsx)(x.L3,{children:"Set permissions boundary"}),(0,a.jsx)(x.rr,{children:(0,a.jsx)(y,{kind:n})})]}),(0,a.jsx)(b,{value:o,onChange:m,className:"w-full"}),(0,a.jsxs)(x.Es,{children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>t(!1),disabled:h,children:"Cancel"}),(0,a.jsxs)(u.$,{onClick:g,disabled:h||o===l,children:[h&&(0,a.jsx)(i.A,{className:"animate-spin"})," Set boundary"]})]})]})})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2112-41340fe381241d76.js b/pages/demo/_next/static/chunks/2112-41340fe381241d76.js
deleted file mode 100644
index a8e13818..00000000
--- a/pages/demo/_next/static/chunks/2112-41340fe381241d76.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2112],{1253:(e,t,a)=>{a.d(t,{W:()=>m});var n=a(95155),r=a(12115),s=a(20063),l=a(18720),i=a(84916),o=a(86233),c=a(37621),d=a(7e3),u=a(73697),p=a(62307);function m(e){let{zone:t,onClose:a,redirect:m}=e,h=(0,s.useRouter)(),[x,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>f(!1),[t]);let g=t?(0,p.LK)(t.name):"",v=!!t&&t.records>0;return(0,n.jsx)(o.T,{open:!!t,onOpenChange:e=>!e&&a(),title:"Delete hosted zone ".concat(g),confirmText:g,description:(0,n.jsxs)("p",{children:["The zone stops answering immediately. Clients that cached its records keep them until their TTL expires.",!v&&" The zone has no records besides the generated SOA and NS."]}),onConfirm:async()=>{if(t){if(v&&!x)throw Error("Confirm that the ".concat((0,d.td)(t.records,"record")," in the zone should be deleted too"));await c.FH.del("".concat(p.EK,"/").concat((0,c.aJ)(t.id)),v?{force:!0}:void 0),l.oR.success("Deleted hosted zone ".concat(g)),m&&h.push("/route53/"),await (0,u.Yi)(p.fD)}},children:v&&(0,n.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-600/30 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/10 dark:text-amber-300",children:[(0,n.jsx)(i.S,{className:"mt-0.5",checked:x,onCheckedChange:e=>f(!!e)}),(0,n.jsxs)("span",{children:["Also delete the ",(0,d.td)(t.records,"record")," in this zone (force delete)."]})]})})}},11723:(e,t,a)=>{a.d(t,{f:()=>i});var n=a(95155),r=a(82180),s=a(7e3),l=a(73697);function i(e){let{value:t,className:a}=e,i=(0,l.cB)(3e4);return t?(0,n.jsxs)(r.m_,{children:[(0,n.jsx)(r.k$,{asChild:!0,children:(0,n.jsx)("span",{className:null!=a?a:"whitespace-nowrap",children:(0,s.fF)(t,i)})}),(0,n.jsx)(r.ZI,{children:(0,s.Yq)(t)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}},16981:(e,t,a)=>{a.d(t,{D:()=>l});var n=a(95155),r=a(90235),s=a(25016);function l(e){let{label:t,htmlFor:a,help:l,error:i,optional:o,children:c,className:d}=e;return(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-1.5",d),children:[(0,n.jsxs)(r.J,{htmlFor:a,className:"text-sm font-medium",children:[t,o&&(0,n.jsx)("span",{className:"text-muted-foreground font-normal",children:" - optional"})]}),c,i?(0,n.jsx)("p",{className:"text-destructive text-xs",children:i}):l?(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:l}):null]})}},62307:(e,t,a)=>{a.d(t,{EK:()=>p,Kt:()=>z,LK:()=>h,Pi:()=>x,T0:()=>y,WF:()=>N,Wn:()=>m,Y8:()=>v,ao:()=>j,c4:()=>b,c8:()=>T,fD:()=>u,in:()=>g,oY:()=>A,pG:()=>w});var n=a(95155),r=a(52619),s=a.n(r),l=a(99708),i=a(39068),o=a(10253),c=a(25016),d=a(73697);let u="/api/v1/route53",p="".concat(u,"/zones"),m=e=>"/route53/zone/?id=".concat(encodeURIComponent(e)),h=e=>e.replace(/\.$/,"");function x(){return(0,d.gf)(p,{refreshInterval:3e4})}let f=/^([a-zA-Z0-9_]([a-zA-Z0-9_-]{0,61}[a-zA-Z0-9_])?\.)+$/;function g(e){let t=e.trim().toLowerCase();return t?(t.endsWith(".")||(t+="."),!f.test(t)||t.length>254)?"Use labels of letters, digits, hyphens and underscores separated by dots, e.g. example.internal":null:"Enter a domain name"}function v(e,t){return e&&"@"!==e?e.endsWith(".")?e:"".concat(e,".").endsWith(t)?"".concat(e,"."):"".concat(e,".").concat(t):t}let b=["A","AAAA","CNAME","TXT","MX","SRV","NS","CAA","PTR"],N={A:{placeholder:"192.168.1.20",help:"IPv4 addresses, one per line."},AAAA:{placeholder:"fd00::20",help:"IPv6 addresses, one per line."},CNAME:{placeholder:"www.example.com.",help:"Exactly one domain name. A CNAME cannot share its name with other records or sit at the zone apex."},TXT:{placeholder:"v=spf1 -all",help:"One string per line, up to 255 characters each. Quotes are added for you."},MX:{placeholder:"10 mail.example.com.",help:"Priority and mail server, one per line."},SRV:{placeholder:"10 5 5060 sip.example.com.",help:"Priority, weight, port and target, one per line."},NS:{placeholder:"ns1.example.com.",help:"Name servers for a delegated subdomain, one per line."},CAA:{placeholder:'0 issue "letsencrypt.org"',help:"Flags, tag and value, one per line."},PTR:{placeholder:"host.example.com.",help:"Domain names, one per line (reverse DNS)."}},k=/^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;function j(e,t){if(/[\n\r;]/.test(t))return"Values may not contain semicolons";switch(e){case"A":return k.test(t)?null:"".concat(t," is not an IPv4 address");case"AAAA":return!function(e){if(!e.includes(":")||k.test(e))return!1;try{return new URL("http://[".concat(e,"]/")),!0}catch(e){return!1}}(t)?"".concat(t," is not an IPv6 address"):null;case"CNAME":case"NS":case"PTR":return f.test("".concat(t.replace(/\.$/,""),"."))?null:"".concat(t," is not a domain name");case"TXT":return t.length>255?"TXT strings are at most 255 characters":null;case"MX":return/^\d+\s+\S+$/.test(t)?null:"Use the form: priority mail-server";case"SRV":return/^\d+\s+\d+\s+\d+\s+\S+$/.test(t)?null:"Use the form: priority weight port target";case"CAA":return/^\d+\s+[a-zA-Z0-9]+\s+\S.*$/.test(t)?null:'Use the form: flags tag "value"'}return null}function y(e,t){let a=e.trim().toLowerCase();if(!a||"@"===a)return null;let n=v(a,t);return n.endsWith(t)?f.test(n.replace(/^\*\./,""))?null:"Use letters, digits, hyphens and underscores; a leading * is a wildcard":"The name must be inside ".concat(h(t))}function A(e){let{isPrivate:t,className:a}=e,r=t?l.A:i.A;return(0,n.jsxs)("span",{className:(0,c.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap ring-1 ring-inset",t?"bg-slate-100 text-slate-700 ring-slate-500/20 dark:bg-slate-500/15 dark:text-slate-300 dark:ring-slate-400/20":"bg-violet-50 text-violet-700 ring-violet-600/20 dark:bg-violet-500/10 dark:text-violet-300 dark:ring-violet-400/20",a),children:[(0,n.jsx)(r,{className:"size-3"})," ",t?"Private":"Public"]})}let C={instance:"EC2 instance",task:"ECS task",database:"Database","load-balancer":"Load balancer"},w=e=>C[e];function T(){var e,t,a,n;let r=!(arguments.length>0)||void 0===arguments[0]||arguments[0],s=(0,d.gf)(r?"/api/v1/ec2/instances":null,{refreshInterval:3e4}),l=(0,d.gf)(r?"/api/v1/ecs/tasks":null,{refreshInterval:3e4}),i=(0,d.gf)(r?"/api/v1/rds/instances":null,{refreshInterval:3e4}),c=(0,d.gf)(r?"/api/v1/elb/load-balancers":null,{refreshInterval:3e4}),u=[];for(let t of null!=(e=s.data)?e:[])"terminated"!==t.state&&u.push({id:t.id,kind:"instance",label:t.name?"".concat(t.name," (").concat(t.id,")"):t.id,detail:"".concat(t.state).concat(t.private_ip?" \xb7 ".concat(t.private_ip):""),href:"/ec2/instance/?id=".concat(encodeURIComponent(t.id)),live:"running"===t.state||"pending"===t.state});for(let e of null!=(t=l.data)?t:[])"STOPPED"!==e.last_status&&u.push({id:e.id,kind:"task",label:"".concat(e.id.slice(0,12)).concat(e.service?" (".concat(e.service,")"):""),detail:"".concat(e.last_status).concat(e.private_ip?" \xb7 ".concat(e.private_ip):""),href:"/ecs/task/?id=".concat(encodeURIComponent(e.id)),live:"RUNNING"===e.last_status});for(let e of null!=(a=i.data)?a:[])u.push({id:e.id,kind:"database",label:e.id,detail:"".concat(e.engine," \xb7 ").concat(e.status),href:(0,o.YW)(e.kind,e.id),live:"stopped"!==e.status&&"failed"!==e.status&&"deleting"!==e.status});for(let e of null!=(n=c.data)?n:[])u.push({id:e.name,kind:"load-balancer",label:e.name,detail:"".concat(e.scheme," \xb7 ").concat(e.private_ip||e.state),href:"/elb/load-balancer/?name=".concat(encodeURIComponent(e.name)),live:!!e.private_ip});return{targets:u,loading:!s.data||!l.data||!i.data||!c.data}}function z(e){let{alias:t,targets:a,loading:r}=e,l=a.find(e=>e.id===t);return l?(0,n.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:w(l.kind)}),(0,n.jsx)(s(),{href:l.href,className:"text-primary font-mono text-[13px] hover:underline",onClick:e=>e.stopPropagation(),children:"task"===l.kind?l.id.slice(0,12):l.id}),!l.live&&(0,n.jsx)("span",{className:"text-xs text-amber-700 dark:text-amber-400",children:"(not running: no answer)"})]}):(0,n.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"font-mono text-[13px]",children:t}),!r&&(0,n.jsx)("span",{className:"text-destructive text-xs",children:"(not found: no answer)"})]})}},67001:(e,t,a)=>{a.d(t,{T:()=>s});var n=a(95155);a(12115);var r=a(25016);function s(e){let{className:t,...a}=e;return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},90235:(e,t,a)=>{a.d(t,{J:()=>c});var n=a(95155),r=a(12115),s=a(43991),l=a(83101),i=a(25016);let o=(0,l.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(s.b,{ref:t,className:(0,i.cn)(o(),a),...r})});c.displayName=s.b.displayName},99116:(e,t,a)=>{a.d(t,{Dk:()=>u,i8:()=>p,xh:()=>m});var n=a(95155),r=a(12115),s=a(5917),l=a(75426),i=a(18720),o=a(97003),c=a(82180),d=a(25016);async function u(e){try{return await navigator.clipboard.writeText(e),!0}catch(n){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let a=document.execCommand("copy");return document.body.removeChild(t),a}}function p(e){let{value:t,label:a,className:p,size:m="icon",toastMessage:h}=e,[x,f]=(0,r.useState)(!1),g=async e=>{e.stopPropagation(),e.preventDefault(),await u(t)?(f(!0),h&&i.oR.success(h),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},v=x?s.A:l.A;return"sm"===m?(0,n.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:g,className:p,children:[(0,n.jsx)(v,{className:(0,d.cn)(x&&"text-emerald-600")}),null!=a?a:"Copy"]}):(0,n.jsxs)(c.m_,{children:[(0,n.jsx)(c.k$,{asChild:!0,children:(0,n.jsx)("button",{type:"button",onClick:g,"aria-label":null!=a?a:"Copy",className:(0,d.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",p),children:(0,n.jsx)(v,{className:(0,d.cn)("size-3.5",x&&"text-emerald-600")})})}),(0,n.jsx)(c.ZI,{children:x?"Copied":null!=a?a:"Copy"})]})}function m(e){let{value:t,mono:a=!0,className:r,display:s}=e;return t?(0,n.jsxs)("span",{className:(0,d.cn)("inline-flex max-w-full items-center gap-1",r),children:[(0,n.jsx)("span",{className:(0,d.cn)("truncate",a&&"font-mono text-[0.8125rem]"),title:t,children:null!=s?s:t}),(0,n.jsx)(p,{value:t})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"-"})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js b/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js
deleted file mode 100644
index 7038773d..00000000
--- a/pages/demo/_next/static/chunks/2151-f6771539118eac7c.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2151],{5379:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>d});var l=r(12115),n=(e,t,r,l,n,o,a,i)=>{let c=document.documentElement,s=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,l=r&&o?n.map(e=>o[e]||e):n;r?(c.classList.remove(...l),c.classList.add(o&&o[t]?o[t]:t)):c.setAttribute(e,t)}),r=t,i&&s.includes(r)&&(c.style.colorScheme=r)}if(l)d(l);else try{let e=localStorage.getItem(t)||r,l=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(l)}catch(e){}},o=["light","dark"],a="(prefers-color-scheme: dark)",i=l.createContext(void 0),c={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=l.useContext(i))?e:c},d=e=>l.useContext(i)?l.createElement(l.Fragment,null,e.children):l.createElement(m,{...e}),u=["light","dark"],m=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:n=!0,enableColorScheme:c=!0,storageKey:s="theme",themes:d=u,defaultTheme:m=n?"system":"light",attribute:b="data-theme",value:v,children:g,nonce:k,scriptProps:x}=e,[S,w]=l.useState(()=>y(s,m)),[E,A]=l.useState(()=>"system"===S?h():S),C=v?Object.values(v):d,M=l.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=h());let l=v?v[t]:t,a=r?p(k):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...C),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(b)?b.forEach(s):s(b),c){let e=o.includes(m)?m:null,r=o.includes(t)?t:e;i.style.colorScheme=r}null==a||a()},[k]),R=l.useCallback(e=>{let t="function"==typeof e?e(S):e;w(t);try{localStorage.setItem(s,t)}catch(e){}},[S]),j=l.useCallback(e=>{A(h(e)),"system"===S&&n&&!t&&M("system")},[S,t]);l.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(j),j(e),()=>e.removeListener(j)},[j]),l.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?w(e.newValue):R(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[R]),l.useEffect(()=>{M(null!=t?t:S)},[t,S]);let P=l.useMemo(()=>({theme:S,setTheme:R,forcedTheme:t,resolvedTheme:"system"===S?E:S,themes:n?[...d,"system"]:d,systemTheme:n?E:void 0}),[S,R,t,E,n,d]);return l.createElement(i.Provider,{value:P},l.createElement(f,{forcedTheme:t,storageKey:s,attribute:b,enableSystem:n,enableColorScheme:c,defaultTheme:m,value:v,themes:d,nonce:k,scriptProps:x}),g)},f=l.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:i,defaultTheme:c,value:s,themes:d,nonce:u,scriptProps:m}=e,f=JSON.stringify([o,r,c,t,d,s,a,i]).slice(1,-1);return l.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(f,")")}})}),y=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},p=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light")},6132:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9540:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},20508:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},32320:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},37494:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var l=r(12115),n=r.t(l,2),o=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function s(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...o}=t,a=null,i=!1,c=[];k(n)&&"function"==typeof E&&(n=E(n._payload)),l.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof E&&(t=E(t._payload)),a=p(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=l.cloneElement(a,void 0,c):!i&&1===l.Children.count(n)&&l.isValidElement(n)&&(a=n);let s=a?b(a):void 0,u=d(r,s);if(!a){if(n||0===n)throw Error(i?w(e):S(e));return n}let m=h(o,a.props??{});return a.type!==l.Fragment&&(m.ref=r?u:s),l.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}m(f,"createSlot");var y=Symbol.for("radix.slottable");m(function(e){let t=m(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var p=m((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let r={...t};for(let l in t){let n=e[l],o=t[l];/^on[A-Z]/.test(l)?n&&o?r[l]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...o}:"className"===l&&(r[l]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}m(h,"mergeProps"),m(b,"getElementRef"),m(v,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&x(e._payload)}function x(e){return"object"==typeof e&&null!==e&&"then"in e}m(k,"isLazyComponent"),m(x,"isPromiseLike");var S=m(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=m(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),E=n[" use ".trim().toString()],A=r(95155),C=Object.defineProperty,M=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,A.jsx)(n?r:t,{...o,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});C(function(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var R=Object.defineProperty,j=l.forwardRef(R(function(e,t){return(0,A.jsx)(M.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},59427:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},66218:(e,t,r)=>{r.d(t,{jH:()=>o});var l=r(12115);r(95155);var n=l.createContext(void 0);function o(e){let t=l.useContext(n);return e||t||"ltr"}},84926:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},86651:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},88167:(e,t,r)=>{r.d(t,{N:()=>c});var l=r(12115),n=r(3468),o=r(94446),a=r(32467),i=r(95155);function c(e){let t=e+"CollectionProvider",[r,c]=(0,n.A)(t),[s,d]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:r}=e,n=l.useRef(null),o=l.useRef(new Map).current;return(0,i.jsx)(s,{scope:t,itemMap:o,collectionRef:n,children:r})};u.displayName=t;let m=e+"CollectionSlot",f=l.forwardRef((e,t)=>{let{scope:r,children:l}=e,n=d(m,r),c=(0,o.s)(t,n.collectionRef);return(0,i.jsx)(a.DX,{ref:c,children:l})});f.displayName=m;let y=e+"CollectionItemSlot",p="data-radix-collection-item",h=l.forwardRef((e,t)=>{let{scope:r,children:n,...c}=e,s=l.useRef(null),u=(0,o.s)(t,s),m=d(y,r);return l.useEffect(()=>(m.itemMap.set(s,{ref:s,...c}),()=>void m.itemMap.delete(s))),(0,i.jsx)(a.DX,{...{[p]:""},ref:u,children:n})});return h.displayName=y,[{Provider:u,Slot:f,ItemSlot:h},function(t){let r=d(e+"CollectionConsumer",t);return l.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(p,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},c]}},91456:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(71847).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js b/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js
deleted file mode 100644
index 43530778..00000000
--- a/pages/demo/_next/static/chunks/2163-544a128d1dbff73d.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2163],{60495:(e,a,t)=>{t.d(a,{LY:()=>m,O6:()=>o,_y:()=>c,fP:()=>d});var l=t(95155),n=t(65229),s=t(6191),r=t(97003),i=t(33789);function o(e){return Object.entries(null!=e?e:{}).map(e=>{let[a,t]=e;return{key:a,value:t}})}function c(e){let a={};for(let t of e)t.key.trim()&&(a[t.key.trim()]=t.value);return Object.keys(a).length?a:void 0}function d(e){let{rows:a,onChange:t,keyPlaceholder:o="Key",valuePlaceholder:c="Value",addLabel:d="Add tag",max:m=50}=e,u=(e,l)=>t(a.map((a,t)=>t===e?{...a,...l}:a));return(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[a.length>0&&(0,l.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,l.jsx)("span",{children:o}),(0,l.jsx)("span",{children:c})]}),a.map((e,s)=>(0,l.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,l.jsx)(i.p,{value:e.key,onChange:e=>u(s,{key:e.target.value}),placeholder:o,className:"h-8"}),(0,l.jsx)(i.p,{value:e.value,onChange:e=>u(s,{value:e.target.value}),placeholder:c,className:"h-8"}),(0,l.jsx)(r.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>t(a.filter((e,a)=>a!==s)),"aria-label":"Remove",children:(0,l.jsx)(n.A,{})})]},s)),(0,l.jsx)("div",{children:(0,l.jsxs)(r.$,{type:"button",variant:"outline",size:"sm",onClick:()=>t([...a,{key:"",value:""}]),disabled:a.length>=m,children:[(0,l.jsx)(s.A,{})," ",d]})})]})}function m(e){let{tags:a}=e,t=Object.entries(null!=a?a:{});return t.length?(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map(e=>{let[a,t]=e;return(0,l.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:a}),t&&(0,l.jsxs)("span",{children:["=",t]})]},a)})}):(0,l.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},68607:(e,a,t)=>{t.d(a,{R:()=>N,i:()=>C});var l=t(95155),n=t(12115),s=t(52619),r=t.n(s),i=t(93499),o=t(35299),c=t(20639),d=t(18720),m=t(97003),u=t(33789),x=t(47507),h=t(99116),p=t(16981),g=t(31629),f=t(62325),j=t(37621),v=t(73697),b=t(10045);let y="/api/v1/ecr/repositories";function N(e){var a,t,s;let{id:o,value:c,onChange:d,invalid:m}=e,h=(0,v.gf)(y,{revalidateOnFocus:!1}),[p,g]=(0,n.useState)(""),f=(0,v.gf)(p?"".concat(y,"/").concat(p.split("/").map(encodeURIComponent).join("/")):null),j=null==(a=h.data)?void 0:a.find(e=>e.name===p),b=(null!=(s=null==(t=f.data)?void 0:t.images)?s:[]).flatMap(e=>{var a;return(null==(a=e.tags)?void 0:a.length)?e.tags.map(e=>{var a;return{uri:"".concat(null!=(a=null==j?void 0:j.uri)?a:"",":").concat(e),label:e}}):[{uri:e.uri,label:e.digest.slice(0,19)}]});return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,l.jsx)(u.p,{id:o,value:c,onChange:e=>d(e.target.value),placeholder:"localhost:5500/my-repo:latest",className:"max-w-2xl font-mono",spellCheck:!1,"aria-invalid":m}),h.data&&h.data.length>0&&(0,l.jsxs)("div",{className:"flex max-w-2xl flex-col gap-2 sm:flex-row sm:items-center",children:[(0,l.jsx)("span",{className:"text-muted-foreground shrink-0 text-xs",children:"Browse ECR:"}),(0,l.jsxs)(x.l6,{value:p,onValueChange:g,children:[(0,l.jsx)(x.bq,{className:"h-8 w-full min-w-0 sm:w-56","aria-label":"ECR repository",children:(0,l.jsx)(x.yv,{placeholder:"Repository"})}),(0,l.jsx)(x.gC,{children:h.data.map(e=>(0,l.jsx)(x.eb,{value:e.name,children:e.name},e.name))})]}),(0,l.jsxs)(x.l6,{value:b.some(e=>e.uri===c)?c:"",onValueChange:d,disabled:!p||!f.data,children:[(0,l.jsx)(x.bq,{className:"h-8 w-full min-w-0 sm:w-56","aria-label":"Image",children:(0,l.jsx)(x.yv,{placeholder:p&&f.data&&!b.length?"No images":"Image tag"})}),(0,l.jsx)(x.gC,{children:b.map(e=>(0,l.jsx)(x.eb,{value:e.uri,children:e.label},e.uri))})]})]}),h.data&&0===h.data.length&&(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Push an image to"," ",(0,l.jsxs)(r(),{href:"/ecr/",target:"_blank",className:"text-primary inline-flex items-center gap-0.5 hover:underline",children:["ECR ",(0,l.jsx)(i.A,{className:"size-3"})]})," ","or enter any registry URI the host can pull, e.g. public.ecr.aws/..."]})]})}function C(e){var a,t,s,r,i;let{fn:x}=e,[y,C]=(0,n.useState)(null!=(a=x.image_uri)?a:""),[w,k]=(0,n.useState)(""),[S,z]=(0,n.useState)(""),[R,D]=(0,n.useState)(""),[_,I]=(0,n.useState)(!1),[E,A]=(0,n.useState)(null),F=null!=(t=x.image_config)?t:{},P=async e=>{if(e.preventDefault(),y.trim()){A("image");try{await j.FH.put("".concat((0,b.gQ)(x.name),"/code"),{image_uri:y.trim()}),d.oR.success("Deploying ".concat(y.trim())),await (0,v.Yi)(b.c5)}catch(e){d.oR.error((0,j.gJ)(e))}finally{A(null)}}},$=e=>e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):[],B=async e=>{e.preventDefault(),A("cfg");try{await j.FH.patch((0,b.gQ)(x.name),{image_config:{EntryPoint:$(w),Command:$(S),WorkingDirectory:R.trim()}}),d.oR.success("Saved the image configuration"),await (0,v.Yi)(b.c5),I(!1)}catch(e){d.oR.error((0,j.gJ)(e))}finally{A(null)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(f.w,{title:"Container image",description:"The function runs this image. Deploying pulls the image again, even when the tag is unchanged.",children:(0,l.jsxs)("form",{onSubmit:P,className:"flex flex-col gap-4",children:[(0,l.jsx)(g.v,{columns:2,items:[{label:"Current image URI",value:(0,l.jsx)(h.xh,{value:null!=(s=x.image_uri)?s:""}),wide:!0}]}),(0,l.jsx)(p.D,{label:"Image URI",htmlFor:"img-uri",children:(0,l.jsx)(N,{id:"img-uri",value:y,onChange:C})}),(0,l.jsx)("div",{className:"flex justify-end border-t pt-4",children:(0,l.jsxs)(m.$,{type:"submit",disabled:!!E||!y.trim(),children:["image"===E?(0,l.jsx)(o.A,{className:"animate-spin"}):(0,l.jsx)(c.A,{})," Deploy new image"]})})]})}),(0,l.jsx)(f.w,{title:"Image configuration",description:"Overrides for the image's ENTRYPOINT, CMD and WORKDIR.",actions:!_&&(0,l.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{var e,a,t;k((null!=(e=F.EntryPoint)?e:[]).join(", ")),z((null!=(a=F.Command)?a:[]).join(", ")),D(null!=(t=F.WorkingDirectory)?t:""),I(!0)},children:"Edit"}),children:_?(0,l.jsxs)("form",{onSubmit:B,className:"flex flex-col gap-4",children:[(0,l.jsx)(p.D,{label:"Entrypoint",htmlFor:"img-entry",optional:!0,help:"Comma-separated, e.g. /lambda-entrypoint.sh",children:(0,l.jsx)(u.p,{id:"img-entry",value:w,onChange:e=>k(e.target.value),className:"font-mono"})}),(0,l.jsx)(p.D,{label:"Command",htmlFor:"img-cmd",optional:!0,help:"Comma-separated, e.g. app.handler",children:(0,l.jsx)(u.p,{id:"img-cmd",value:S,onChange:e=>z(e.target.value),className:"font-mono"})}),(0,l.jsx)(p.D,{label:"Working directory",htmlFor:"img-wd",optional:!0,children:(0,l.jsx)(u.p,{id:"img-wd",value:R,onChange:e=>D(e.target.value),className:"font-mono"})}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,l.jsx)(m.$,{type:"button",variant:"outline",onClick:()=>I(!1),disabled:!!E,children:"Cancel"}),(0,l.jsxs)(m.$,{type:"submit",disabled:!!E,children:["cfg"===E&&(0,l.jsx)(o.A,{className:"animate-spin"}),"Save"]})]})]}):(0,l.jsx)(g.v,{columns:3,items:[{label:"Entrypoint",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:(null!=(r=F.EntryPoint)?r:[]).join(" ")||"Image default"})},{label:"Command",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:(null!=(i=F.Command)?i:[]).join(" ")||"Image default"})},{label:"Working directory",value:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:F.WorkingDirectory||"Image default"})}]})})]})}},82163:(e,a,t)=>{t.d(a,{CreateFunction:()=>P,h:()=>A});var l=t(95155),n=t(12115),s=t(52619),r=t.n(s),i=t(20063),o=t(26617),c=t(16140),d=t(20386),m=t(73366),u=t(21786),x=t(65229),h=t(35299),p=t(20639),g=t(18720),f=t(97003),j=t(33789),v=t(68122),b=t(97438),y=t(16981),N=t(17705),C=t(62325),w=t(60495),k=t(43131),S=t(37621),z=t(7e3),R=t(73697),D=t(25016),_=t(10045),I=t(68607),E=t(4395);function A(e){let a=e.map(e=>e.key.trim()).filter(Boolean);if(new Set(a).size!==a.length)return"Variable names must be unique";if(e.some(e=>!e.key.trim()&&e.value.trim()))return"Every variable with a value needs a name";let t=a.find(e=>!_.Wy.test(e));return t?'"'.concat(t,'" is not a valid name: use letters, digits and underscores, not starting with a digit'):null}function F(e){let{active:a,disabled:t,onClick:n,icon:s,title:r,text:i}=e;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,disabled:t,onClick:n,className:(0,D.cn)("flex items-start gap-3 rounded-md border p-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60",a?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,l.jsx)(s,{className:"text-muted-foreground mt-0.5 size-5 shrink-0"}),(0,l.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:r}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:i})]})]})}function P(){var e,a,t;let s=(0,i.useRouter)(),P=(0,_.ZO)(),[B,O]=(0,n.useState)(""),[T,M]=(0,n.useState)(""),[U,W]=(0,n.useState)("Zip"),[Z,L]=(0,n.useState)(""),[q,Y]=(0,n.useState)(""),[V,H]=(0,n.useState)("x86_64"),[K,J]=(0,n.useState)(""),[Q,X]=(0,n.useState)([]),[G,ee]=(0,n.useState)("template"),[ea,et]=(0,n.useState)(null),[el,en]=(0,n.useState)(""),[es,er]=(0,n.useState)(!1),[ei,eo]=(0,n.useState)("128"),[ec,ed]=(0,n.useState)("3"),[em,eu]=(0,n.useState)([]),[ex,eh]=(0,n.useState)(!1),[ep,eg]=(0,n.useState)(!1),ef=(0,n.useRef)(null);(0,n.useEffect)(()=>{var e,a,t;!q&&(null==(e=P.data)?void 0:e.length)&&Y(null!=(t=null==(a=P.data.find(e=>"python3.12"===e.name))?void 0:a.name)?t:P.data[0].name)},[P.data,q]);let ej=null==(e=P.data)?void 0:e.find(e=>e.name===q),ev=!!(null==ej?void 0:ej.template);(0,n.useEffect)(()=>{ej&&!ej.template&&"template"===G&&ee("zip")},[ej,G]),(0,n.useEffect)(()=>{ej&&(!es||"template"===G)&&en(ej.default_handler)},[ej,es,G]);let eb=Number(ei),ey=Number(ec),eN=(0,n.useMemo)(()=>{let e={};if(_.dF.test(B)||(e.name="1-64 characters: letters, digits, hyphens (-) and underscores (_)"),"Zip"!==U||q||(e.runtime="Choose a runtime"),"Image"!==U||/^\S+$/.test(Z.trim())||(e.image="Enter a container image URI, e.g. localhost:5500/my-repo:latest"),(!Number.isInteger(eb)||eb<128||eb>10240)&&(e.memory="Enter a whole number of MB from 128 to 10240"),(!Number.isInteger(ey)||ey<1||ey>900)&&(e.timeout="Enter a whole number of seconds from 1 to 900"),"Zip"===U&&"zip"===G){ea?ea.size>_.j3&&(e.zip="The package is ".concat((0,z.z3)(ea.size),"; the limit is 50 MB")):e.zip="Choose a .zip file";let a=(0,_.P8)(q,el);a&&(e.handler=a)}let a=A(em);return a&&(e.env=a),e},[B,U,Z,q,eb,ey,G,ea,el,em]),eC=e=>ex||"name"===e&&B?eN[e]:void 0,ew=0===Object.keys(eN).length,ek=async()=>{if(eh(!0),!ew)return void g.oR.error("Fix the highlighted fields before creating the function");eg(!0);try{let e={name:B,description:T.trim()||void 0,memory_mb:eb,timeout_seconds:ey,environment:(0,w._y)(em),architectures:[V],role:K||void 0};"Image"===U?(e.package_type="Image",e.image_uri=Z.trim()):(e.runtime=q,Q.length&&(e.layers=Q),"zip"===G&&ea&&(e.handler=el,e.code={zip_base64:await (0,_.bB)(ea)}));let a=await S.FH.post(_.U1,e);g.oR.success("Created function ".concat(a.name)),await (0,R.Yi)(_.c5),s.push((0,_.qw)(a.name,"Zip"===U&&"template"===G?"code":void 0))}catch(e){g.oR.error((0,S.gJ)(e)),eg(!1)}};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(N.z,{title:"Create function",description:"Start from a runtime's hello-world template, upload a deployment package, or run a container image.",breadcrumbs:[{label:"Lambda",href:"/lambda/"},{label:"Functions",href:"/lambda/"},{label:"Create function"}]}),(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ek()},className:"grid grid-cols-1 items-start gap-4 xl:grid-cols-[minmax(0,1fr)_320px]",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,l.jsx)(C.w,{title:"Basic information",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)(y.D,{label:"Function name",htmlFor:"fn-name",error:eC("name"),help:"1-64 characters: letters, digits, hyphens and underscores. It cannot be changed later.",children:(0,l.jsx)(j.p,{id:"fn-name",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:B,onChange:e=>O(e.target.value),placeholder:"my-function",className:"max-w-md font-mono","aria-invalid":!!eC("name")})}),(0,l.jsx)(y.D,{label:"Description",htmlFor:"fn-desc",optional:!0,children:(0,l.jsx)(j.p,{id:"fn-desc",value:T,onChange:e=>M(e.target.value),className:"max-w-xl",maxLength:256})}),(0,l.jsx)(y.D,{label:"Package type",children:(0,l.jsxs)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,l.jsx)(F,{active:"Zip"===U,onClick:()=>W("Zip"),icon:o.A,title:"Zip archive",text:"Pick a managed runtime; author code in the console or upload a .zip."}),(0,l.jsx)(F,{active:"Image"===U,onClick:()=>W("Image"),icon:c.A,title:"Container image",text:"Run an image that implements the Lambda Runtime API, e.g. from ECR."})]})}),"Image"===U?(0,l.jsx)(y.D,{label:"Container image URI",htmlFor:"fn-image",error:eC("image"),help:"The image is pulled when the function is created and whenever its code is updated.",children:(0,l.jsx)(I.R,{id:"fn-image",value:Z,onChange:L,invalid:!!eC("image")})}):(0,l.jsx)(y.D,{label:"Runtime",error:eC("runtime"),children:P.error?(0,l.jsx)(b.W,{error:P.error,onRetry:()=>P.mutate()}):P.data?(0,l.jsx)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:P.data.map(e=>{let a=e.name===q;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>Y(e.name),className:(0,D.cn)("flex min-w-0 flex-col items-start gap-0.5 rounded-md border px-3 py-2.5 text-left transition-colors",a?"border-primary bg-primary/5 ring-primary ring-1 dark:bg-primary/10":"hover:bg-muted/50"),children:[(0,l.jsxs)("span",{className:"text-sm font-medium",children:[e.label,e.deprecated&&(0,l.jsx)("span",{className:"text-muted-foreground text-xs font-normal",children:" (deprecated)"})]}),(0,l.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:e.name}),(0,l.jsx)("span",{className:"text-muted-foreground max-w-full truncate text-xs",title:e.image,children:e.template?"Image ".concat(e.image):"Deployment package required"})]},e.name)})}):(0,l.jsx)(v.E,{className:"h-20 rounded-md"})}),(0,l.jsx)(y.D,{label:"Architecture",help:"The instruction set of the execution environment.",children:(0,l.jsx)("div",{role:"radiogroup",className:"flex flex-wrap gap-2",children:_.Xe.map(e=>(0,l.jsx)(f.$,{type:"button",role:"radio","aria-checked":V===e,size:"sm",variant:V===e?"secondary":"outline",onClick:()=>H(e),className:(0,D.cn)("font-mono",V===e&&"ring-primary ring-1"),children:e},e))})})]})}),"Zip"===U&&(0,l.jsx)(C.w,{title:"Code source",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{role:"radiogroup",className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,l.jsx)(F,{active:"template"===G,disabled:!ev,onClick:()=>ee("template"),icon:d.A,title:"Start from runtime template",text:ev?"A hello-world handler you can edit in the console.":"".concat(null!=(a=null==ej?void 0:ej.label)?a:"This runtime"," has no template: upload a package.")}),(0,l.jsx)(F,{active:"zip"===G,onClick:()=>ee("zip"),icon:m.A,title:"Upload a .zip file",text:"A deployment package with your code and dependencies."})]}),"template"===G?ej?(0,l.jsxs)("div",{className:"overflow-hidden rounded-md border",children:[(0,l.jsxs)("div",{className:"bg-muted/50 flex items-center justify-between gap-2 border-b px-3 py-1.5 text-xs",children:[(0,l.jsx)("span",{className:"font-mono font-medium",children:ej.default_file}),(0,l.jsx)("span",{className:"text-muted-foreground",children:"Read-only preview"})]}),(0,l.jsx)("pre",{className:"bg-muted/20 max-h-80 overflow-auto p-3 font-mono text-[12.5px] leading-5",children:ej.template})]}):(0,l.jsx)(v.E,{className:"h-40 rounded-md"}):(0,l.jsxs)(y.D,{label:"Deployment package",error:eC("zip"),help:"A .zip file up to 50 MB. Files at the root of the archive end up in /var/task.",children:[(0,l.jsx)("input",{ref:ef,type:"file",accept:".zip,application/zip",className:"hidden",onChange:e=>{var a,t;et(null!=(t=null==(a=e.target.files)?void 0:a[0])?t:null),e.target.value=""}}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)(f.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{var e;return null==(e=ef.current)?void 0:e.click()},children:[(0,l.jsx)(u.A,{})," ",ea?"Choose another file":"Choose .zip file"]}),ea&&(0,l.jsxs)("span",{className:"bg-muted inline-flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-sm",children:[(0,l.jsx)(m.A,{className:"size-4 shrink-0"}),(0,l.jsx)("span",{className:"truncate font-mono text-[13px]",children:ea.name}),(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:(0,z.z3)(ea.size)}),(0,l.jsx)("button",{type:"button",onClick:()=>et(null),"aria-label":"Remove file",className:"text-muted-foreground hover:text-foreground",children:(0,l.jsx)(x.A,{className:"size-3.5"})})]})]})]}),(0,l.jsx)(y.D,{label:"Handler",htmlFor:"fn-handler",error:eC("handler"),help:"template"===G?"Template code uses the runtime's default handler. You can change it after creation.":(0,_.Aj)(q),children:(0,l.jsx)(j.p,{id:"fn-handler",value:el,disabled:"template"===G,onChange:e=>{en(e.target.value),er(!0)},className:"max-w-md font-mono",spellCheck:!1})}),(0,l.jsx)(y.D,{label:"Layers",optional:!0,help:"Shared libraries and code, extracted to /opt in order before the function starts.",children:(0,l.jsx)(E.LV,{value:Q,onChange:X,runtime:q,architecture:V})})]})}),(0,l.jsx)(C.w,{title:"Permissions",children:(0,l.jsx)(y.D,{label:"Execution role",htmlFor:"fn-role",optional:!0,help:"The function's code receives temporary credentials for this role in AWS_ACCESS_KEY_ID and friends. Without a role it runs without credentials.",children:(0,l.jsx)(k.n,{id:"fn-role",value:K,onChange:e=>J(e),service:"lambda.amazonaws.com",allowNone:!0,placeholder:"No execution role",className:"max-w-xl"})})}),(0,l.jsx)(C.w,{title:"Settings",children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsx)(y.D,{label:"Memory (MB)",htmlFor:"fn-memory",error:eC("memory"),help:"128-10240 MB. CPU is allotted in proportion to memory.",children:(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(j.p,{id:"fn-memory",type:"number",min:128,max:10240,value:ei,onChange:e=>eo(e.target.value),className:"h-8 w-28"}),_.lU.map(e=>(0,l.jsx)(f.$,{type:"button",size:"sm",variant:eb===e?"secondary":"ghost",className:"h-7 px-2 text-xs",onClick:()=>eo(String(e)),children:(0,z.qt)(e)},e))]})}),(0,l.jsx)(y.D,{label:"Timeout (seconds)",htmlFor:"fn-timeout",error:eC("timeout"),help:"1-900 seconds. Invocations that run longer are stopped.",children:(0,l.jsx)(j.p,{id:"fn-timeout",type:"number",min:1,max:900,value:ec,onChange:e=>ed(e.target.value),className:"h-8 w-28"})}),(0,l.jsx)(y.D,{label:"Environment variables",optional:!0,error:eC("env"),children:(0,l.jsx)(w.fP,{rows:em,onChange:eu,keyPlaceholder:"Key",valuePlaceholder:"Value",addLabel:"Add environment variable"})})]})})]}),(0,l.jsx)("aside",{className:"xl:sticky xl:top-4",children:(0,l.jsx)(C.w,{title:"Summary",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("dl",{className:"flex flex-col gap-3 text-sm",children:[(0,l.jsx)($,{label:"Function name",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:B||"-"})}),"Image"===U?(0,l.jsx)($,{label:"Container image",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:Z||"-"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($,{label:"Runtime",children:null!=(t=null==ej?void 0:ej.label)?t:"-"}),(0,l.jsx)($,{label:"Code",children:"template"===G?(0,l.jsxs)(l.Fragment,{children:["Template ",(0,l.jsx)("span",{className:"text-muted-foreground font-mono text-xs",children:null==ej?void 0:ej.default_file})]}):ea?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:ea.name})," ",(0,l.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",(0,z.z3)(ea.size),")"]})]}):"No package chosen"}),(0,l.jsx)($,{label:"Handler",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:el||"-"})}),Q.length>0&&(0,l.jsx)($,{label:"Layers",children:Q.length})]}),(0,l.jsx)($,{label:"Architecture",children:(0,l.jsx)("span",{className:"font-mono text-[13px]",children:V})}),(0,l.jsx)($,{label:"Execution role",children:(0,l.jsx)("span",{className:"font-mono text-[13px] break-all",children:K?K.split("/").pop():"None"})}),(0,l.jsxs)($,{label:"Memory / timeout",children:[Number.isInteger(eb)?(0,z.qt)(eb):"-"," / ",Number.isInteger(ey)&&ey>0?(0,_.BE)(ey):"-"]}),(0,l.jsx)($,{label:"Environment variables",children:(0,w._y)(em)?Object.keys((0,w._y)(em)).length:"None"})]}),ex&&!ew&&(0,l.jsx)("p",{className:"text-destructive text-xs",children:"Some settings need attention. Check the highlighted fields."}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 border-t pt-4",children:[(0,l.jsxs)(f.$,{type:"submit",disabled:ep||"Zip"===U&&!q,children:[ep?(0,l.jsx)(h.A,{className:"animate-spin"}):(0,l.jsx)(p.A,{}),"Create function"]}),(0,l.jsx)(f.$,{type:"button",variant:"outline",asChild:!0,children:(0,l.jsx)(r(),{href:"/lambda/",children:"Cancel"})})]})]})})})]})]})}function $(e){let{label:a,children:t}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("dt",{className:"text-muted-foreground text-xs font-medium",children:a}),(0,l.jsx)("dd",{className:"min-w-0 break-words",children:t})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js b/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js
deleted file mode 100644
index 52f6685d..00000000
--- a/pages/demo/_next/static/chunks/2164-94cd05207cd4c462.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2164],{6132:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},27937:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},29525:(e,t,r)=>{r.d(t,{q7:()=>D,bL:()=>j,RG:()=>k});var n=r(12115),o=r(92556),l=r(88167),a=r(94446),i=r(3468),c=r(68946),u=r(97602),s=r(70222),f=r(66218),d=r(95155),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[m,v,b]=(0,l.N)(h),[g,k]=(0,i.A)(h,[b]),[w,A]=g(h),x=n.forwardRef((e,t)=>(0,d.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(R,{...e,ref:t})})}));x.displayName=h;var R=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:l,loop:i=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...A}=e,x=n.useRef(null),R=(0,a.s)(t,x),E=(0,f.jH)(c),[S=null,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[o,l]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[o]=r,l=n.useRef(o),a=(0,s.c)(t);return n.useEffect(()=>{l.current!==o&&(a(o),l.current=o)},[o,l,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,i=a?e:o,c=(0,s.c)(r);return[i,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else l(t)},[a,e,l,c])]}({prop:h,defaultProp:m,onChange:b}),[j,D]=n.useState(!1),_=(0,s.c)(g),F=v(r),I=n.useRef(!1),[P,L]=n.useState(0);return n.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,_),()=>e.removeEventListener(p,_)},[_]),(0,d.jsx)(w,{scope:r,orientation:l,dir:E,loop:i,currentTabStopId:S,onItemFocus:n.useCallback(e=>C(e),[C]),onItemShiftTab:n.useCallback(()=>D(!0),[]),onFocusableItemAdd:n.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>L(e=>e-1),[]),children:(0,d.jsx)(u.sG.div,{tabIndex:j||0===P?-1:0,"data-orientation":l,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:(0,o.m)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,o.m)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),k)}}I.current=!1}),onBlur:(0,o.m)(e.onBlur,()=>D(!1))})})}),E="RovingFocusGroupItem",S=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:l=!0,active:a=!1,tabStopId:i,...s}=e,f=(0,c.B)(),p=i||f,y=A(E,r),h=y.currentTabStopId===p,b=v(r),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return n.useEffect(()=>{if(l)return g(),()=>k()},[l,g,k]),(0,d.jsx)(m.ItemSlot,{scope:r,id:p,focusable:l,active:a,children:(0,d.jsx)(u.sG.span,{tabIndex:h?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,o.m)(e.onMouseDown,e=>{l?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,o.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,o.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return C[o]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=y.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>M(r))}})})})});S.displayName=E;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var j=x,D=S},32978:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},35299:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},36835:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},43991:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(12115),o=r.t(n,2),l=r(47650),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:o,...l}=t,a=null,i=!1,c=[];k(o)&&"function"==typeof R&&(o=R(o._payload)),n.Children.forEach(o,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof R&&(t=R(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(o)&&n.isValidElement(o)&&(a=o);let u=a?v(a):void 0,f=s(r,u);if(!a){if(o||0===o)throw Error(i?x(e):A(e));return o}let d=m(l,a.props??{});return a.type!==n.Fragment&&(d.ref=r?f:u),n.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}d(p,"createSlot");var y=Symbol.for("radix.slottable");d(function(e){let t=d(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=d((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{let t=l(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}d(m,"mergeProps"),d(v,"getElementRef"),d(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}d(k,"isLazyComponent"),d(w,"isPromiseLike");var A=d(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=d(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),R=o[" use ".trim().toString()],E=r(95155),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),o=n.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(o?r:t,{...l,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});S(function(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var M=Object.defineProperty,j=n.forwardRef(M(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},52056:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},55867:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},61362:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},78874:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},89559:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js b/pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js
similarity index 95%
rename from pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js
rename to pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js
index e78c8620..0ab63cf1 100644
--- a/pages/demo/_next/static/chunks/5581.aa9cac14282894f8.js
+++ b/pages/demo/_next/static/chunks/2166.4feae7d72ea214c1.js
@@ -1 +1 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5581],{75581:(e,t,r)=>{r.r(t),r.d(t,{FitAddon:()=>i});var i=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),n={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},a=n.top+n.bottom;return{cols:Math.max(2,Math.floor((s-(n.right+n.left)-t)/e.css.cell.width)),rows:Math.max(1,Math.floor((i-a)/e.css.cell.height))}}}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2166],{22166:(e,t,r)=>{r.r(t),r.d(t,{FitAddon:()=>i});var i=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),n={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},a=n.top+n.bottom;return{cols:Math.max(2,Math.floor((s-(n.right+n.left)-t)/e.css.cell.width)),rows:Math.max(1,Math.floor((i-a)/e.css.cell.height))}}}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js b/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js
deleted file mode 100644
index 0cf1ca86..00000000
--- a/pages/demo/_next/static/chunks/2214-edb7d8ef98da3f72.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2214],{6132:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6191:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},32978:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},36835:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},40583:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]])},43465:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},43991:(e,t,l)=>{l.d(t,{b:()=>z});var r=l(12115),a=l.t(r,2),n=l(47650),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;ty(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:a,...n}=t,i=null,o=!1,c=[];A(a)&&"function"==typeof w&&(a=w(a._payload)),r.Children.forEach(a,e=>{if(v(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;A(t)&&"function"==typeof w&&(t=w(t._payload)),i=s(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=r.cloneElement(i,void 0,c):!o&&1===r.Children.count(a)&&r.isValidElement(a)&&(i=a);let d=i?m(i):void 0,y=p(l,d);if(!i){if(a||0===a)throw Error(o?g(e):x(e));return a}let h=k(n,i.props??{});return i.type!==r.Fragment&&(h.ref=l?y:d),r.cloneElement(i,h)});return t.displayName=`${e}.Slot`,t}h(f,"createSlot");var u=Symbol.for("radix.slottable");h(function(e){let t=h(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=u,t},"createSlottable");var s=h((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let l={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?l[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(l[r]=a):"style"===r?l[r]={...a,...n}:"className"===r&&(l[r]=[a,n].filter(Boolean).join(" "))}return{...e,...l}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===u}h(k,"mergeProps"),h(m,"getElementRef"),h(v,"isSlottable");var b=Symbol.for("react.lazy");function A(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===b&&"_payload"in e&&M(e._payload)}function M(e){return"object"==typeof e&&null!==e&&"then"in e}h(A,"isLazyComponent"),h(M,"isPromiseLike");var x=h(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),g=h(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=a[" use ".trim().toString()],E=l(95155),S=Object.defineProperty,j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),a=r.forwardRef((e,r)=>{let{asChild:a,...n}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(a?l:t,{...n,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});S(function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var C=Object.defineProperty,z=r.forwardRef(C(function(e,t){return(0,E.jsx)(j.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},46046:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},52056:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},57828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},61362:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},70532:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},78874:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},80003:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},89559:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},99051:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},99708:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(71847).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2240-937631aef2e41767.js b/pages/demo/_next/static/chunks/2240-937631aef2e41767.js
new file mode 100644
index 00000000..d05016e8
--- /dev/null
+++ b/pages/demo/_next/static/chunks/2240-937631aef2e41767.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2240],{10646:(e,t,a)=>{a.d(t,{S:()=>o});var s=a(26276),l=a(29320),r=a(93788),n=a(72538),i=a(88674);let o=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(r.bL,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...l,children:(0,s.jsx)(r.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(n.A,{className:"h-4 w-4"})})})});o.displayName=r.bL.displayName},11363:(e,t,a)=>{a.d(t,{T:()=>r});var s=a(26276);a(29320);var l=a(88674);function r(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,l.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},21444:(e,t,a)=>{a.d(t,{W:()=>d});var s=a(26276),l=a(7489),r=a(29902),n=a(47045),i=a(28971),o=a(88674);function d(e){let{error:t,onRetry:a,className:d}=e;return(0,s.jsxs)("div",{className:(0,o.cn)("border-destructive/30 bg-destructive/5 text-destructive flex flex-col gap-3 rounded-lg border p-4 text-sm sm:flex-row sm:items-center sm:justify-between",d),children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(l.A,{className:"mt-0.5 size-4 shrink-0"}),(0,s.jsx)("span",{className:"break-words",children:(0,i.gJ)(t)})]}),a&&(0,s.jsxs)(n.$,{variant:"outline",size:"sm",onClick:a,className:"text-foreground shrink-0",children:[(0,s.jsx)(r.A,{})," Retry"]})]})}},28553:(e,t,a)=>{a.d(t,{LY:()=>x,O6:()=>o,_y:()=>d,fP:()=>c});var s=a(26276),l=a(15410),r=a(10002),n=a(47045),i=a(81155);function o(e){return Object.entries(null!=e?e:{}).map(e=>{let[t,a]=e;return{key:t,value:a}})}function d(e){let t={};for(let a of e)a.key.trim()&&(t[a.key.trim()]=a.value);return Object.keys(t).length?t:void 0}function c(e){let{rows:t,onChange:a,keyPlaceholder:o="Key",valuePlaceholder:d="Value",addLabel:c="Add tag",max:x=50}=e,u=(e,s)=>a(t.map((t,a)=>a===e?{...t,...s}:t));return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[t.length>0&&(0,s.jsxs)("div",{className:"text-muted-foreground hidden grid-cols-[1fr_1fr_2rem] gap-2 text-xs font-medium sm:grid",children:[(0,s.jsx)("span",{children:o}),(0,s.jsx)("span",{children:d})]}),t.map((e,r)=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_2rem] gap-2",children:[(0,s.jsx)(i.p,{value:e.key,onChange:e=>u(r,{key:e.target.value}),placeholder:o,className:"h-8"}),(0,s.jsx)(i.p,{value:e.value,onChange:e=>u(r,{value:e.target.value}),placeholder:d,className:"h-8"}),(0,s.jsx)(n.$,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>a(t.filter((e,t)=>t!==r)),"aria-label":"Remove",children:(0,s.jsx)(l.A,{})})]},r)),(0,s.jsx)("div",{children:(0,s.jsxs)(n.$,{type:"button",variant:"outline",size:"sm",onClick:()=>a([...t,{key:"",value:""}]),disabled:t.length>=x,children:[(0,s.jsx)(r.A,{})," ",c]})})]})}function x(e){let{tags:t}=e,a=Object.entries(null!=t?t:{});return a.length?(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(e=>{let[t,a]=e;return(0,s.jsxs)("span",{className:"bg-muted inline-flex items-center rounded-md border px-2 py-0.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:t}),a&&(0,s.jsxs)("span",{children:["=",a]})]},t)})}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"No tags"})}},32240:(e,t,a)=>{a.d(t,{CryptoPage:()=>L,_x:()=>E,b3:()=>D});var s=a(26276),l=a(29320),r=a(91052),n=a.n(r),i=a(44057),o=a(45300),d=a(40688),c=a(7489),x=a(24068),u=a(68157),m=a(47045),p=a(10646),h=a(50985),f=a(35833),g=a(11363),y=a(76962),b=a(21444),v=a(74875),j=a(21195),N=a(89839),k=a(28553),w=a(28971),C=a(22927),_=a(88674),A=a(89865);function S(e){let t=new TextEncoder().encode(e),a="";for(let e of t)a+=String.fromCharCode(e);return btoa(a)}function T(e){try{let t=atob(e),a=Uint8Array.from(t,e=>e.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(a)}catch(e){return null}}function F(e){let{arn:t,keys:a}=e,l=(0,A.ai)(t),r=null==a?void 0:a.find(e=>e.id===l);return(0,s.jsx)(n(),{href:(0,A.B0)(l),className:"text-primary font-mono text-[13px] break-all hover:underline",children:r?(0,A.w8)(r):l})}function E(e){var t;let{keyId:a,lockKey:r}=e,n=(0,A.VY)(),[p,h]=(0,l.useState)("encrypt"),[f,j]=(0,l.useState)(null!=a?a:""),[C,E]=(0,l.useState)(""),[z,D]=(0,l.useState)(""),[L,M]=(0,l.useState)([]),[P,O]=(0,l.useState)(!1),[$,H]=(0,l.useState)(null),[R,Y]=(0,l.useState)(null),[I,K]=(0,l.useState)(null);(0,l.useEffect)(()=>{a&&j(a)},[a]),(0,l.useEffect)(()=>{var e;if(f||!n.data)return;let t=n.data.filter(e=>"Enabled"===e.state),a=null!=(e=t.find(e=>!e.managed))?e:t[0];a&&j(a.id)},[f,n.data]);let V=null==(t=n.data)?void 0:t.find(e=>e.id===f),J=new TextEncoder().encode(C).length,U=J>4096,W=e=>{h(e),H(null)},B=async()=>{O(!0),H(null),Y(null);try{let e=await w.FH.post("".concat(A.YL,"/encrypt"),{key_id:f,plaintext:S(C),encryption_context:(0,k._y)(L)});Y(e)}catch(e){H((0,w.gJ)(e))}finally{O(!1)}},X=async()=>{O(!0),H(null),K(null);try{let e=await w.FH.post("".concat(A.YL,"/decrypt"),{ciphertext_blob:z.replace(/\s+/g,""),encryption_context:(0,k._y)(L)});K(e)}catch(e){H((0,w.gJ)(e))}finally{O(!1)}},G=I?T(I.plaintext):null,Z=!!f&&(null==V?void 0:V.state)==="Enabled"&&C.length>0&&!U&&!P,q=z.trim().length>0&&!P;return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{role:"tablist","aria-label":"Operation",className:"bg-muted inline-flex w-fit rounded-lg p-1",children:["encrypt","decrypt"].map(e=>(0,s.jsxs)("button",{type:"button",role:"tab","aria-selected":p===e,onClick:()=>W(e),className:(0,_.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",p===e?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),children:["encrypt"===e?(0,s.jsx)(i.A,{className:"size-4"}):(0,s.jsx)(o.A,{className:"size-4"}),"encrypt"===e?"Encrypt":"Decrypt"]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(N.w,{title:"encrypt"===p?"Input":"Ciphertext",bodyClassName:"flex flex-col gap-4",children:["encrypt"===p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.D,{label:"KMS key",htmlFor:"crypto-key",help:r?void 0:"Only enabled keys can encrypt.",error:V&&"Enabled"!==V.state?"This key is ".concat("PendingDeletion"===V.state?"pending deletion":"disabled"," and cannot encrypt."):void 0,children:n.error?(0,s.jsx)(b.W,{error:n.error,onRetry:()=>n.mutate()}):(0,s.jsx)(A.i$,{id:"crypto-key",keys:n.data,value:f,onChange:j,onlyEnabled:!0,symmetricOnly:!0,disabled:r})}),(0,s.jsx)(v.D,{label:"Plaintext",htmlFor:"crypto-plaintext",error:U?"Plaintext is limited to ".concat(4096," bytes; encrypt a data key for larger payloads."):void 0,help:"".concat(J," / ").concat(4096," bytes (UTF-8)"),children:(0,s.jsx)(g.T,{id:"crypto-plaintext",value:C,onChange:e=>E(e.target.value),placeholder:"Text to encrypt",rows:6,spellCheck:!1,className:"font-mono text-[13px]","aria-invalid":U})})]}):(0,s.jsx)(v.D,{label:"Ciphertext blob",htmlFor:"crypto-blob",help:"Base64 ciphertext returned by Encrypt. The key is identified from the blob itself.",children:(0,s.jsx)(g.T,{id:"crypto-blob",value:z,onChange:e=>D(e.target.value),placeholder:"AST...",rows:6,spellCheck:!1,className:"font-mono text-[13px] break-all"})}),(0,s.jsx)(v.D,{label:"Encryption context",optional:!0,help:"Key/value pairs bound to the ciphertext. Decrypt must supply exactly the same pairs.",children:(0,s.jsx)(k.fP,{rows:L,onChange:M,keyPlaceholder:"Context key",valuePlaceholder:"Context value",addLabel:"Add context pair"})}),(0,s.jsx)("div",{children:"encrypt"===p?(0,s.jsxs)(m.$,{onClick:B,disabled:!Z,children:[P?(0,s.jsx)(d.A,{className:"animate-spin"}):(0,s.jsx)(i.A,{})," Encrypt"]}):(0,s.jsxs)(m.$,{onClick:X,disabled:!q,children:[P?(0,s.jsx)(d.A,{className:"animate-spin"}):(0,s.jsx)(o.A,{})," Decrypt"]})})]}),(0,s.jsxs)(N.w,{title:"Output",bodyClassName:"flex flex-col gap-3",children:[$&&(0,s.jsxs)(u.Fc,{variant:"destructive",children:[(0,s.jsx)(c.A,{}),(0,s.jsx)(u.XL,{children:"encrypt"===p?"Encryption failed":"Decryption failed"}),(0,s.jsx)(u.TN,{className:"break-words",children:$})]}),"encrypt"===p&&R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Ciphertext blob (base64)"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(y.i8,{value:R.ciphertext_blob,size:"sm",toastMessage:"Ciphertext copied"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{R&&(D(R.ciphertext_blob),K(null),W("decrypt"))},children:["Decrypt it ",(0,s.jsx)(x.A,{})]})]})]}),(0,s.jsx)(g.T,{readOnly:!0,value:R.ciphertext_blob,rows:6,className:"bg-muted/40 font-mono text-[12.5px] break-all",onFocus:e=>e.target.select()}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Encrypted with ",(0,s.jsx)(F,{arn:R.key_id,keys:n.data}),"."]})]}):"decrypt"===p&&I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:null!==G?"Plaintext":"Plaintext (binary, base64)"}),(0,s.jsx)(y.i8,{value:null!=G?G:I.plaintext,size:"sm",toastMessage:"Plaintext copied"})]}),(0,s.jsx)("pre",{className:"bg-muted/40 max-h-72 overflow-auto rounded-md border p-3 font-mono text-[13px] break-all whitespace-pre-wrap",children:null!=G?G:I.plaintext}),(0,s.jsxs)("p",{className:"text-muted-foreground text-xs",children:["Decrypted with ",(0,s.jsx)(F,{arn:I.key_id,keys:n.data}),"."]})]}):!$&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"encrypt"===p?"The base64 ciphertext appears here.":"The decrypted plaintext and the key that was used appear here."})]})]})]})}let z={encrypt:"Encrypt",decrypt:"Decrypt",sign:"Sign",verify:"Verify",mac:"Generate MAC","verify-mac":"Verify MAC"};function D(e){var t,a,r,n,i;let o,{k:j}=e,k=j.key_spec.startsWith("HMAC_"),F="SIGN_VERIFY"===j.key_usage,E=k?["mac","verify-mac"]:F?["sign","verify"]:["encrypt","decrypt"],D=(0,C.gf)(k?null:"".concat(A.vJ,"/").concat(encodeURIComponent(j.id),"/public-key")),L=k?[(o=j.key_spec,"HMAC_SHA_".concat(o.replace("HMAC_","")))]:null!=(r=F?null==(t=D.data)?void 0:t.signing_algorithms:null==(a=D.data)?void 0:a.encryption_algorithms)?r:[],[M,P]=(0,l.useState)(E[0]),[O,$]=(0,l.useState)(""),[H,R]=(0,l.useState)(""),[Y,I]=(0,l.useState)(!1),[K,V]=(0,l.useState)(""),[J,U]=(0,l.useState)(!1),[W,B]=(0,l.useState)(null),[X,G]=(0,l.useState)(null);(0,l.useEffect)(()=>{!O&&L.length&&$(L[0])},[O,L]);let Z="decrypt"!==M,q="verify"===M||"verify-mac"===M||"decrypt"===M,Q=Y?H.trim():S(H),ee=async()=>{U(!0),B(null),G(null);try{let e=K.replace(/\s+/g,""),t=Y?"DIGEST":"RAW";if("encrypt"===M){let e=await w.FH.post("".concat(A.YL,"/encrypt"),{key_id:j.id,plaintext:Q,encryption_algorithm:O});G({label:"Ciphertext blob (base64)",value:e.ciphertext_blob})}else if("decrypt"===M){let t=await w.FH.post("".concat(A.YL,"/decrypt"),{key_id:j.id,ciphertext_blob:e,encryption_algorithm:O});G({label:"Plaintext",value:t.plaintext,text:T(t.plaintext)})}else if("sign"===M){let e=await w.FH.post("".concat(A.YL,"/sign"),{key_id:j.id,message:Q,message_type:t,algorithm:O});G({label:"Signature (base64)",value:e.signature})}else if("mac"===M){let e=await w.FH.post("".concat(A.YL,"/generate-mac"),{key_id:j.id,message:Q,algorithm:O});G({label:"MAC (base64)",value:e.mac})}else{let a="verify"===M?{key_id:j.id,message:Q,message_type:t,algorithm:O,signature:e}:{key_id:j.id,message:Q,algorithm:O,mac:e},s=await w.FH.post("".concat(A.YL,"/").concat(M),a);G({label:"verify"===M?"Signature":"MAC",value:"",valid:s.valid})}}catch(e){B((0,w.gJ)(e))}finally{U(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{role:"tablist","aria-label":"Operation",className:"bg-muted inline-flex w-fit rounded-lg p-1",children:E.map(e=>(0,s.jsx)("button",{type:"button",role:"tab","aria-selected":M===e,onClick:()=>{P(e),B(null),G(null)},className:(0,_.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors",M===e?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),children:z[e]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(N.w,{title:"Input",bodyClassName:"flex flex-col gap-4",children:[(0,s.jsx)(v.D,{label:"Algorithm",htmlFor:"asym-alg",children:(0,s.jsxs)(f.l6,{value:O,onValueChange:$,disabled:L.length<=1,children:[(0,s.jsx)(f.bq,{id:"asym-alg",className:"w-full font-mono text-[13px]",children:(0,s.jsx)(f.yv,{placeholder:D.isLoading?"Loading...":"Choose an algorithm"})}),(0,s.jsx)(f.gC,{children:L.map(e=>(0,s.jsx)(f.eb,{value:e,className:"font-mono text-[13px]",children:e},e))})]})}),Z&&(0,s.jsx)(v.D,{label:"encrypt"===M?"Plaintext":Y?"Message digest (base64)":"Message",htmlFor:"asym-msg",help:F?void 0:"".concat(new TextEncoder().encode(H).length," bytes (UTF-8)"),children:(0,s.jsx)(g.T,{id:"asym-msg",value:H,onChange:e=>R(e.target.value),rows:5,spellCheck:!1,className:"font-mono text-[13px]"})}),F&&Z&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.S,{id:"asym-digest",checked:Y,onCheckedChange:e=>I(!0===e)}),(0,s.jsx)(h.J,{htmlFor:"asym-digest",className:"text-sm font-normal",children:"The message is a precomputed digest (base64)"})]}),q&&(0,s.jsx)(v.D,{label:"decrypt"===M?"Ciphertext blob (base64)":"verify"===M?"Signature (base64)":"MAC (base64)",htmlFor:"asym-proof",children:(0,s.jsx)(g.T,{id:"asym-proof",value:K,onChange:e=>V(e.target.value),rows:4,spellCheck:!1,className:"font-mono text-[13px] break-all"})}),(0,s.jsx)("div",{children:(0,s.jsxs)(m.$,{onClick:ee,disabled:J||!O||"Enabled"!==j.state||Z&&!H||q&&!K.trim(),children:[J&&(0,s.jsx)(d.A,{className:"animate-spin"})," ",z[M]]})})]}),(0,s.jsxs)(N.w,{title:"Output",bodyClassName:"flex flex-col gap-3",children:[W&&(0,s.jsxs)(u.Fc,{variant:"destructive",children:[(0,s.jsx)(c.A,{}),(0,s.jsxs)(u.XL,{children:[z[M]," failed"]}),(0,s.jsx)(u.TN,{className:"break-words",children:W})]}),(null==X?void 0:X.valid)!==void 0?(0,s.jsxs)(u.Fc,{variant:X.valid?"default":"destructive",children:[(0,s.jsx)(u.XL,{children:X.valid?"".concat(X.label," is valid"):"".concat(X.label," is not valid")}),(0,s.jsx)(u.TN,{children:X.valid?"The message matches.":"The message was changed, or a different key or algorithm was used."})]}):X?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:null===X.text?"".concat(X.label," (binary, base64)"):X.label}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(y.i8,{value:null!=(n=X.text)?n:X.value,size:"sm"}),"decrypt"!==M&&(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{(null==X?void 0:X.value)&&(V(X.value),G(null),P("encrypt"===M?"decrypt":"sign"===M?"verify":"verify-mac"))},children:["encrypt"===M?"Decrypt it":"Verify it"," ",(0,s.jsx)(x.A,{})]})]})]}),(0,s.jsx)(g.T,{readOnly:!0,value:null!=(i=X.text)?i:X.value,rows:5,className:"bg-muted/40 font-mono text-[12.5px] break-all",onFocus:e=>e.target.select()})]}):!W&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"The result appears here."})]})]}),!k&&(0,s.jsx)(N.w,{title:"Public key",description:"Share the public key to let others encrypt data for this key or verify its signatures without calling KMS.",children:D.error?(0,s.jsx)(b.W,{error:D.error,onRetry:()=>D.mutate()}):D.data?(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(y.i8,{value:D.data.pem,size:"sm",toastMessage:"Public key copied"})}),(0,s.jsx)("pre",{className:"bg-muted/40 overflow-auto rounded-md border p-3 font-mono text-[12px]",children:D.data.pem})]}):(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"Loading public key..."})})]})}function L(){let e=(0,C.pE)("key");return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(j.z,{title:"Encrypt / decrypt",description:"Try KMS encryption from the console. Payloads are limited to 4 KB; nothing you enter here is stored.",breadcrumbs:[{label:"KMS",href:"/kms/"},{label:"Encrypt / decrypt"}]}),(0,s.jsx)(E,{keyId:e||void 0})]})}},47006:(e,t,a)=>{a.d(t,{Bc:()=>n,ZI:()=>d,k$:()=>o,m_:()=>i});var s=a(26276);a(29320);var l=a(86864),r=a(88674);function n(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(l.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function i(e){let{...t}=e;return(0,s.jsx)(n,{children:(0,s.jsx)(l.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,s.jsx)(l.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:a=0,children:n,...i}=e;return(0,s.jsx)(l.ZL,{children:(0,s.jsxs)(l.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[n,(0,s.jsx)(l.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},68157:(e,t,a)=>{a.d(t,{Fc:()=>i,TN:()=>d,XL:()=>o});var s=a(26276);a(29320);var l=a(5820),r=a(88674);let n=(0,l.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:a,...l}=e;return(0,s.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,r.cn)(n({variant:a}),t),...l})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-title",className:(0,r.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-description",className:(0,r.cn)("text-muted-foreground col-start-2 block space-y-1 text-sm [&_p]:leading-relaxed",t),...a})}},76962:(e,t,a)=>{a.d(t,{Dk:()=>x,i8:()=>u,xh:()=>m});var s=a(26276),l=a(29320),r=a(72538),n=a(37995),i=a(34993),o=a(47045),d=a(47006),c=a(88674);async function x(e){try{return await navigator.clipboard.writeText(e),!0}catch(s){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let a=document.execCommand("copy");return document.body.removeChild(t),a}}function u(e){let{value:t,label:a,className:u,size:m="icon",toastMessage:p}=e,[h,f]=(0,l.useState)(!1),g=async e=>{e.stopPropagation(),e.preventDefault(),await x(t)?(f(!0),p&&i.oR.success(p),setTimeout(()=>f(!1),1500)):i.oR.error("Could not copy to the clipboard")},y=h?r.A:n.A;return"sm"===m?(0,s.jsxs)(o.$,{type:"button",variant:"outline",size:"sm",onClick:g,className:u,children:[(0,s.jsx)(y,{className:(0,c.cn)(h&&"text-emerald-600")}),null!=a?a:"Copy"]}):(0,s.jsxs)(d.m_,{children:[(0,s.jsx)(d.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:g,"aria-label":null!=a?a:"Copy",className:(0,c.cn)("text-muted-foreground hover:text-foreground hover:bg-accent inline-flex size-6 shrink-0 items-center justify-center rounded transition-colors",u),children:(0,s.jsx)(y,{className:(0,c.cn)("size-3.5",h&&"text-emerald-600")})})}),(0,s.jsx)(d.ZI,{children:h?"Copied":null!=a?a:"Copy"})]})}function m(e){let{value:t,mono:a=!0,className:l,display:r}=e;return t?(0,s.jsxs)("span",{className:(0,c.cn)("inline-flex max-w-full items-center gap-1",l),children:[(0,s.jsx)("span",{className:(0,c.cn)("truncate",a&&"font-mono text-[0.8125rem]"),title:t,children:null!=r?r:t}),(0,s.jsx)(u,{value:t})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}},81155:(e,t,a)=>{a.d(t,{p:()=>r});var s=a(26276);a(29320);var l=a(88674);function r(e){let{className:t,type:a,...r}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,l.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}},89839:(e,t,a)=>{a.d(t,{w:()=>r});var s=a(26276),l=a(88674);function r(e){let{title:t,description:a,actions:r,children:n,className:i,bodyClassName:o,flush:d}=e;return(0,s.jsxs)("section",{className:(0,l.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",i),children:[(t||r)&&(0,s.jsxs)("header",{className:"flex flex-col gap-2 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[t&&(0,s.jsx)("h2",{className:"text-base font-semibold",children:t}),a&&(0,s.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:a})]}),r&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:r})]}),(0,s.jsx)("div",{className:(0,l.cn)(!d&&"p-4",o),children:n})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js b/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js
new file mode 100644
index 00000000..4d6358ca
--- /dev/null
+++ b/pages/demo/_next/static/chunks/2373-7fb2701203f01ca2.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2373],{7489:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},23566:(e,t,r)=>{r.d(t,{q7:()=>D,bL:()=>j,RG:()=>k});var n=r(29320),o=r(62315),l=r(2430),a=r(36103),i=r(65335),c=r(29203),u=r(12377),s=r(82275),f=r(97645),d=r(26276),p="rovingFocusGroup.onEntryFocus",y={bubbles:!1,cancelable:!0},h="RovingFocusGroup",[m,v,b]=(0,l.N)(h),[g,k]=(0,i.A)(h,[b]),[w,A]=g(h),x=n.forwardRef((e,t)=>(0,d.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(R,{...e,ref:t})})}));x.displayName=h;var R=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:l,loop:i=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:g,preventScrollOnEntryFocus:k=!1,...A}=e,x=n.useRef(null),R=(0,a.s)(t,x),E=(0,f.jH)(c),[S=null,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[o,l]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[o]=r,l=n.useRef(o),a=(0,s.c)(t);return n.useEffect(()=>{l.current!==o&&(a(o),l.current=o)},[o,l,a]),r}({defaultProp:t,onChange:r}),a=void 0!==e,i=a?e:o,c=(0,s.c)(r);return[i,n.useCallback(t=>{if(a){let r="function"==typeof t?t(e):t;r!==e&&c(r)}else l(t)},[a,e,l,c])]}({prop:h,defaultProp:m,onChange:b}),[j,D]=n.useState(!1),_=(0,s.c)(g),F=v(r),I=n.useRef(!1),[P,L]=n.useState(0);return n.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(p,_),()=>e.removeEventListener(p,_)},[_]),(0,d.jsx)(w,{scope:r,orientation:l,dir:E,loop:i,currentTabStopId:S,onItemFocus:n.useCallback(e=>C(e),[C]),onItemShiftTab:n.useCallback(()=>D(!0),[]),onFocusableItemAdd:n.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>L(e=>e-1),[]),children:(0,d.jsx)(u.sG.div,{tabIndex:j||0===P?-1:0,"data-orientation":l,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:(0,o.m)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,o.m)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!j){let t=new CustomEvent(p,y);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=F().filter(e=>e.focusable);M([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),k)}}I.current=!1}),onBlur:(0,o.m)(e.onBlur,()=>D(!1))})})}),E="RovingFocusGroupItem",S=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:l=!0,active:a=!1,tabStopId:i,...s}=e,f=(0,c.B)(),p=i||f,y=A(E,r),h=y.currentTabStopId===p,b=v(r),{onFocusableItemAdd:g,onFocusableItemRemove:k}=y;return n.useEffect(()=>{if(l)return g(),()=>k()},[l,g,k]),(0,d.jsx)(m.ItemSlot,{scope:r,id:p,focusable:l,active:a,children:(0,d.jsx)(u.sG.span,{tabIndex:h?0:-1,"data-orientation":y.orientation,...s,ref:t,onMouseDown:(0,o.m)(e.onMouseDown,e=>{l?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,o.m)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,o.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return C[o]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=y.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>M(r))}})})})});S.displayName=E;var C={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var j=x,D=S},29902:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},40688:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},64206:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},85882:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(14680).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>j});var n=r(29320),o=r.t(n,2),l=r(93993),a=Object.defineProperty,i=(e,t)=>a(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let r=!1,n=e.map(e=>{let n=c(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;tf(e,"name",{value:t,configurable:!0});function p(e){let t=n.forwardRef((t,r)=>{let{children:o,...l}=t,a=null,i=!1,c=[];k(o)&&"function"==typeof R&&(o=R(o._payload)),n.Children.forEach(o,e=>{if(b(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;k(t)&&"function"==typeof R&&(t=R(t._payload)),a=h(e,t),c.push(a?.props?.children)}else c.push(e)}),a?a=n.cloneElement(a,void 0,c):!i&&1===n.Children.count(o)&&n.isValidElement(o)&&(a=o);let u=a?v(a):void 0,f=s(r,u);if(!a){if(o||0===o)throw Error(i?x(e):A(e));return o}let d=m(l,a.props??{});return a.type!==n.Fragment&&(d.ref=r?f:u),n.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}d(p,"createSlot");var y=Symbol.for("radix.slottable");d(function(e){let t=d(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=y,t},"createSlottable");var h=d((e,t)=>{if("child"in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{let t=l(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===y}d(m,"mergeProps"),d(v,"getElementRef"),d(b,"isSlottable");var g=Symbol.for("react.lazy");function k(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&w(e._payload)}function w(e){return"object"==typeof e&&null!==e&&"then"in e}d(k,"isLazyComponent"),d(w,"isPromiseLike");var A=d(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),x=d(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),R=o[" use ".trim().toString()],E=r(26276),S=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=p(`Primitive.${t}`),o=n.forwardRef((e,n)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,E.jsx)(o?r:t,{...l,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});S(function(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var M=Object.defineProperty,j=n.forwardRef(M(function(e,t){return(0,E.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js b/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js
new file mode 100644
index 00000000..362e29dc
--- /dev/null
+++ b/pages/demo/_next/static/chunks/244-5740d44de1fdaeb6.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[244],{1211:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},2430:(e,t,l)=>{l.d(t,{N:()=>c});var r=l(29320),n=l(65335),a=l(36103),o=l(18442),i=l(26276);function c(e){let t=e+"CollectionProvider",[l,c]=(0,n.A)(t),[d,p]=l(t,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:t,children:l}=e,n=r.useRef(null),a=r.useRef(new Map).current;return(0,i.jsx)(d,{scope:t,itemMap:a,collectionRef:n,children:l})};u.displayName=t;let y=e+"CollectionSlot",f=r.forwardRef((e,t)=>{let{scope:l,children:r}=e,n=p(y,l),c=(0,a.s)(t,n.collectionRef);return(0,i.jsx)(o.DX,{ref:c,children:r})});f.displayName=y;let s=e+"CollectionItemSlot",h="data-radix-collection-item",m=r.forwardRef((e,t)=>{let{scope:l,children:n,...c}=e,d=r.useRef(null),u=(0,a.s)(t,d),y=p(s,l);return r.useEffect(()=>(y.itemMap.set(d,{ref:d,...c}),()=>void y.itemMap.delete(d))),(0,i.jsx)(o.DX,{...{[h]:""},ref:u,children:n})});return m.displayName=s,[{Provider:u,Slot:f,ItemSlot:m},function(t){let l=p(e+"CollectionConsumer",t);return r.useCallback(()=>{let e=l.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(h,"]")));return Array.from(l.itemMap.values()).sort((e,l)=>t.indexOf(e.ref.current)-t.indexOf(l.ref.current))},[l.collectionRef,l.itemMap])},c]}},7489:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9443:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},9828:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},10002:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},64206:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},77440:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},86931:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(14680).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},95774:(e,t,l)=>{l.d(t,{b:()=>j});var r=l(29320),n=l.t(r,2),a=l(93993),o=Object.defineProperty,i=(e,t)=>o(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let l=!1,r=e.map(e=>{let r=c(e,t);return l||"function"!=typeof r||(l=!0),r});if(l)return()=>{for(let t=0;tu(e,"name",{value:t,configurable:!0});function f(e){let t=r.forwardRef((t,l)=>{let{children:n,...a}=t,o=null,i=!1,c=[];x(n)&&"function"==typeof w&&(n=w(n._payload)),r.Children.forEach(n,e=>{if(v(e)){i=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof w&&(t=w(t._payload)),o=h(e,t),c.push(o?.props?.children)}else c.push(e)}),o?o=r.cloneElement(o,void 0,c):!i&&1===r.Children.count(n)&&r.isValidElement(n)&&(o=n);let d=o?k(o):void 0,u=p(l,d);if(!o){if(n||0===n)throw Error(i?M(e):g(e));return n}let y=m(a,o.props??{});return o.type!==r.Fragment&&(y.ref=l?u:d),r.cloneElement(o,y)});return t.displayName=`${e}.Slot`,t}y(f,"createSlot");var s=Symbol.for("radix.slottable");y(function(e){let t=y(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=s,t},"createSlottable");var h=y((e,t)=>{if("child"in e.props){let t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function m(e,t){let l={...t};for(let r in t){let n=e[r],a=t[r];/^on[A-Z]/.test(r)?n&&a?l[r]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(l[r]=n):"style"===r?l[r]={...n,...a}:"className"===r&&(l[r]=[n,a].filter(Boolean).join(" "))}return{...e,...l}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,l=t&&"isReactWarning"in t&&t.isReactWarning;return l?e.ref:(l=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function v(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}y(m,"mergeProps"),y(k,"getElementRef"),y(v,"isSlottable");var A=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===A&&"_payload"in e&&b(e._payload)}function b(e){return"object"==typeof e&&null!==e&&"then"in e}y(x,"isLazyComponent"),y(b,"isPromiseLike");var g=y(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),M=y(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=n[" use ".trim().toString()],C=l(26276),R=Object.defineProperty,S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let l=f(`Primitive.${t}`),n=r.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,C.jsx)(n?l:t,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});R(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var E=Object.defineProperty,j=r.forwardRef(E(function(e,t){return(0,C.jsx)(S.label,{...e,ref:t,onMouseDown:t=>{var l;t.target.closest("button, input, select, textarea")||(null==(l=e.onMouseDown)||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},97645:(e,t,l)=>{l.d(t,{jH:()=>a});var r=l(29320);l(26276);var n=r.createContext(void 0);function a(e){let t=r.useContext(n);return e||t||"ltr"}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js b/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js
new file mode 100644
index 00000000..94ff4d8b
--- /dev/null
+++ b/pages/demo/_next/static/chunks/2498-f13d085283c1079e.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2498],{2222:(e,t,n)=>{n.d(t,{SQ:()=>l,_2:()=>d,lp:()=>c,mB:()=>u,rI:()=>o,ty:()=>i});var r=n(26276);n(29320);var a=n(56128),s=n(88674);function o(e){let{...t}=e;return(0,r.jsx)(a.bL,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(a.l9,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:n=4,...o}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...o})})}function d(e){let{className:t,inset:n,variant:o="default",...i}=e;return(0,r.jsx)(a.q7,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":o,className:(0,s.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i})}function c(e){let{className:t,inset:n,...o}=e;return(0,r.jsx)(a.JU,{"data-slot":"dropdown-menu-label","data-inset":n,className:(0,s.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...o})}function u(e){let{className:t,...n}=e;return(0,r.jsx)(a.wv,{"data-slot":"dropdown-menu-separator",className:(0,s.cn)("bg-border -mx-1 my-1 h-px",t),...n})}},2498:(e,t,n)=>{n.d(t,{b:()=>O,g:()=>A});var r=n(26276),a=n(29320),s=n(91052),o=n.n(s),i=n(78113),l=n(21308),d=n(39367),c=n(84083),u=n(27102),m=n(82708),p=n(91276),h=n(89965),x=n(3209),f=n(49305),g=n(47045),v=n(2222),b=n(69844),w=n(47006),j=n(76962),y=n(44936),N=n(28971),k=n(22927),S=n(98985),C=n(88674);function A(e){let{className:t,compact:n}=e;return(0,r.jsxs)("span",{className:(0,C.cn)("flex items-center gap-2 font-semibold tracking-tight",t),children:[(0,r.jsx)("span",{className:"bg-brand flex size-7 items-center justify-center rounded-md text-white shadow-sm",children:(0,r.jsx)(d.A,{className:"size-4",strokeWidth:2.5})}),!n&&(0,r.jsx)("span",{children:"HomeCloud"})]})}function z(e){let{s:t,className:n}=e,a=t.icon;return(0,r.jsx)("span",{className:(0,C.cn)("flex size-7 shrink-0 items-center justify-center rounded-md",t.color,n),children:(0,r.jsx)(a,{className:"size-4"})})}function E(){let[e,t]=(0,a.useState)(!1);return(0,r.jsxs)(b.AM,{open:e,onOpenChange:t,children:[(0,r.jsx)(b.Wv,{asChild:!0,children:(0,r.jsxs)(g.$,{variant:"ghost",size:"sm",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground data-[state=open]:bg-topbar-muted h-8",children:[(0,r.jsx)(c.A,{})," ",(0,r.jsx)("span",{className:"hidden sm:inline",children:"Services"})]})}),(0,r.jsxs)(b.hl,{align:"start",sideOffset:8,className:"max-h-[80vh] w-[min(92vw,760px)] overflow-y-auto p-0",children:[(0,r.jsx)("div",{className:"border-b px-4 py-3",children:(0,r.jsx)("p",{className:"text-sm font-semibold",children:"All services"})}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-x-6 gap-y-5 p-4 sm:grid-cols-2 md:grid-cols-3",children:(0,S.aM)().map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground mb-1.5 text-xs font-semibold tracking-wide uppercase",children:e.category}),(0,r.jsx)("ul",{className:"flex flex-col gap-0.5",children:e.services.map(e=>(0,r.jsx)("li",{children:e.comingSoon?(0,r.jsxs)("span",{className:"text-muted-foreground flex cursor-not-allowed items-center gap-2 rounded-md px-2 py-1.5 text-sm opacity-70",children:[(0,r.jsx)(z,{s:e,className:"grayscale"}),(0,r.jsx)("span",{className:"truncate",children:e.name}),(0,r.jsx)("span",{className:"bg-muted ml-auto rounded px-1.5 py-0.5 text-[10px] font-medium uppercase",children:"Soon"})]}):(0,r.jsxs)(o(),{href:e.href,onClick:()=>t(!1),className:"hover:bg-accent flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",children:[(0,r.jsx)(z,{s:e}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block truncate font-medium",children:e.name}),(0,r.jsx)("span",{className:"text-muted-foreground block truncate text-xs",children:e.description})]})]})},e.id))})]},e.category))})]})]})}function D(){let e=[];for(let n of S.Bg){var t;for(let r of(e.push({service:n,label:n.name,href:n.href,sub:n.comingSoon?"Coming soon":n.description}),null!=(t=n.nav)?t:[]))for(let t of r.items)t.href!==n.href&&e.push({service:n,label:"".concat(n.name," › ").concat(t.label),href:t.href})}return e}function T(){let e=(0,i.useRouter)(),[t,n]=(0,a.useState)(""),[s,o]=(0,a.useState)(!1),[l,d]=(0,a.useState)(0),c=(0,a.useRef)(null),m=(0,a.useMemo)(D,[]),p=(0,a.useMemo)(()=>{let e=t.trim().toLowerCase();return e?m.filter(t=>"".concat(t.label," ").concat(t.service.description," ").concat(t.service.category).toLowerCase().includes(e)).slice(0,12):m.filter(e=>!e.label.includes("›")).slice(0,10)},[t,m]);(0,a.useEffect)(()=>{let e=e=>{let t=e.target;if("/"===e.key&&!["INPUT","TEXTAREA"].includes(t.tagName)&&!t.isContentEditable&&!t.closest(".xterm")){var n;e.preventDefault(),null==(n=c.current)||n.focus()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let h=t=>{var r;t.service.comingSoon||(o(!1),n(""),null==(r=c.current)||r.blur(),e.push(t.href))};return(0,r.jsxs)(b.AM,{open:s&&p.length>=0,onOpenChange:o,children:[(0,r.jsx)(b.dT,{asChild:!0,children:(0,r.jsxs)("div",{className:"relative w-full max-w-md",children:[(0,r.jsx)(u.A,{className:"pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-white/50"}),(0,r.jsx)("input",{ref:c,value:t,onChange:e=>{n(e.target.value),d(0),o(!0)},onFocus:()=>o(!0),onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),d(e=>Math.min(e+1,p.length-1));else if("ArrowUp"===e.key)e.preventDefault(),d(e=>Math.max(e-1,0));else if("Enter"===e.key&&p[l])e.preventDefault(),h(p[l]);else if("Escape"===e.key){var t;o(!1),null==(t=c.current)||t.blur()}},placeholder:"Search services","aria-label":"Search services",className:"bg-topbar-muted h-8 w-full rounded-md border border-white/10 pr-8 pl-8 text-sm text-white placeholder:text-white/50 focus:border-white/30 focus:outline-none"}),(0,r.jsx)("kbd",{className:"pointer-events-none absolute top-1/2 right-2 hidden -translate-y-1/2 rounded border border-white/20 px-1.5 text-[10px] text-white/50 sm:block",children:"/"})]})}),(0,r.jsx)(b.hl,{align:"start",sideOffset:6,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{e.target===c.current&&e.preventDefault()},className:"w-[var(--radix-popover-trigger-width)] min-w-72 p-1",children:0===p.length?(0,r.jsxs)("p",{className:"text-muted-foreground px-3 py-6 text-center text-sm",children:["No services match “",t,"”"]}):(0,r.jsxs)("ul",{role:"listbox",children:[!t&&(0,r.jsx)("li",{className:"text-muted-foreground px-2 pt-1 pb-1.5 text-xs font-medium",children:"Services"}),p.map((e,t)=>(0,r.jsx)("li",{role:"option","aria-selected":t===l,children:(0,r.jsxs)("button",{type:"button",onMouseEnter:()=>d(t),onClick:()=>h(e),disabled:e.service.comingSoon,className:(0,C.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm disabled:cursor-not-allowed disabled:opacity-60",t===l&&"bg-accent"),children:[(0,r.jsx)(z,{s:e.service,className:"size-6"}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block truncate",children:e.label}),e.sub&&(0,r.jsx)("span",{className:"text-muted-foreground block truncate text-xs",children:e.sub})]})]})},e.href+e.label))]})})]})}function I(){let{resolvedTheme:e,setTheme:t}=(0,l.D)(),[n,s]=(0,a.useState)(!1);(0,a.useEffect)(()=>s(!0),[]);let o=n&&"dark"===e;return(0,r.jsxs)(w.m_,{children:[(0,r.jsx)(w.k$,{asChild:!0,children:(0,r.jsx)(g.$,{variant:"ghost",size:"icon",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground size-8",onClick:()=>t(o?"light":"dark"),"aria-label":"Toggle dark mode",children:o?(0,r.jsx)(m.A,{}):(0,r.jsx)(p.A,{})})}),(0,r.jsx)(w.ZI,{children:o?"Light mode":"Dark mode"})]})}function _(){let e=(0,y.w)(),t=async()=>{await (0,N.ri)(),window.location.href=N.Ms?"/":"/login/"};return(0,r.jsxs)(v.rI,{children:[(0,r.jsx)(v.ty,{asChild:!0,children:(0,r.jsxs)(g.$,{variant:"ghost",size:"sm",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground data-[state=open]:bg-topbar-muted h-8 max-w-72",children:[(0,r.jsx)("span",{className:"flex size-5 items-center justify-center rounded-full bg-white/15",children:(0,r.jsx)(h.A,{className:"size-3"})}),(0,r.jsxs)("span",{className:"hidden truncate md:inline",children:[e.user.name,(0,r.jsxs)("span",{className:"text-white/50",children:[" @ ",e.account_id]})]})]})}),(0,r.jsxs)(v.SQ,{align:"end",className:"w-72",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 px-2 py-2 text-sm",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"Signed in as"}),(0,r.jsxs)("p",{className:"font-medium",children:[e.user.name,e.user.root&&(0,r.jsx)("span",{className:"bg-muted ml-2 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase",children:"root"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"Account ID"}),(0,r.jsxs)("p",{className:"flex items-center gap-1 font-mono text-[13px]",children:[e.account_id," ",(0,r.jsx)(j.i8,{value:e.account_id,label:"Copy account ID"})]})]}),e.user.arn&&(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-muted-foreground text-xs",children:"ARN"}),(0,r.jsxs)("p",{className:"flex items-center gap-1 font-mono text-xs break-all",children:[(0,r.jsx)("span",{className:"min-w-0",children:e.user.arn})," ",(0,r.jsx)(j.i8,{value:e.user.arn,label:"Copy ARN"})]})]})]}),(0,r.jsx)(v.mB,{}),e.user.name&&(0,r.jsx)(v._2,{asChild:!0,children:(0,r.jsxs)(o(),{href:"/iam/user/?name=".concat(encodeURIComponent(e.user.name)),children:[(0,r.jsx)(h.A,{})," Security credentials"]})}),(0,r.jsxs)(v._2,{onSelect:t,children:[(0,r.jsx)(x.A,{})," Sign out"]})]})]})}function O(e){var t,n;let{onMenu:a,showMenu:s}=e,i=null!=(n=null==(t=(0,k.gf)("/api/v1/health").data)?void 0:t.region)?n:"us-east-1";return(0,r.jsxs)("header",{className:"bg-topbar text-topbar-foreground sticky top-0 z-40 flex h-12 shrink-0 items-center gap-2 border-b border-black/20 px-2 sm:px-3",children:[s&&(0,r.jsx)(g.$,{variant:"ghost",size:"icon",className:"text-topbar-foreground hover:bg-topbar-muted hover:text-topbar-foreground size-8 lg:hidden",onClick:a,"aria-label":"Open navigation",children:(0,r.jsx)(f.A,{})}),(0,r.jsxs)(o(),{href:"/",className:"mr-1 flex items-center rounded-md px-1 py-1 hover:bg-white/5","aria-label":"Console home",children:[(0,r.jsx)(A,{className:"hidden sm:flex"}),(0,r.jsx)(A,{compact:!0,className:"sm:hidden"})]}),(0,r.jsx)(E,{}),(0,r.jsx)("div",{className:"flex min-w-0 flex-1 justify-center px-1",children:(0,r.jsx)(T,{})}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(w.m_,{children:[(0,r.jsx)(w.k$,{asChild:!0,children:(0,r.jsx)("span",{className:"hidden h-6 items-center rounded border border-white/20 px-2 font-mono text-xs text-white/80 sm:inline-flex",children:i})}),(0,r.jsx)(w.ZI,{children:"Region"})]}),(0,r.jsx)(I,{}),(0,r.jsx)(_,{})]})]})}},22927:(e,t,n)=>{n.d(t,{DB:()=>m,Yi:()=>u,bN:()=>x,cB:()=>f,gf:()=>c,pE:()=>h,y3:()=>p});var r=n(29320),a=n(60228),s=n(99935),o=n(78113),i=n(34993),l=n(28971);let d=e=>(0,l.Em)("GET",e);function c(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e?e+(0,l.Zq)(r.query):null,o={refreshInterval:r.refreshInterval,keepPreviousData:null==(t=r.keepPreviousData)||t,revalidateOnFocus:null==(n=r.revalidateOnFocus)||n};return(0,a.u)(s,d,o)}function u(e){return(0,s.k)(t=>"string"==typeof t&&t.startsWith(e))}let m={fetcher:d,dedupingInterval:1500,errorRetryCount:2,shouldRetryOnError:e=>!(e instanceof l.hD)||0===e.status||e.status>=500};function p(){let[e,t]=(0,r.useState)(!1);return{pending:e,run:(0,r.useCallback)(async(e,n)=>{t(!0);try{let t=await e();return n&&i.oR.success("function"==typeof n?n(t):n),t}catch(e){i.oR.error((0,l.gJ)(e));return}finally{t(!1)}},[])}}function h(e){var t;return null!=(t=(0,o.useSearchParams)().get(e))?t:""}function x(){let e=(0,o.useRouter)(),t=(0,o.usePathname)(),n=(0,o.useSearchParams)();return(0,r.useCallback)((r,a)=>{let s=new URLSearchParams(n.toString());null===a||""===a?s.delete(r):s.set(r,a);let o=s.toString();e.replace("".concat(t).concat(o?"?".concat(o):""),{scroll:!1})},[e,t,n])}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,[t,n]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}},28971:(e,t,n)=>{var r;n.d(t,{Em:()=>C,FH:()=>A,GC:()=>j,Ht:()=>p,Ms:()=>i,Se:()=>z,Zq:()=>b,_W:()=>x,aJ:()=>N,gJ:()=>u,hD:()=>c,iD:()=>E,jj:()=>l,o2:()=>o,ri:()=>D,sk:()=>k,tE:()=>a,y0:()=>w,yq:()=>y});let a=(null!=(r=n(36159).env.NEXT_PUBLIC_API_URL)?r:"").replace(/\/+$/,""),s="homecloud.session",o="/demo",i=!0,l="#demo-unavailable",d={token:"demo-token",expires:"2099-01-01T00:00:00Z",account_id:"123456789012",user:{name:"demo-admin",id:"AIDADEMOADMIN000000",arn:"arn:aws:iam::123456789012:user/demo-admin",root:!1,console_access:!0}};class c extends Error{constructor(e,t,n){super(n),this.name="ApiError",this.status=e,this.code=t}}function u(e){return e instanceof c?e.message||e.code:e instanceof Error?e.message:String(e)}let m=new Set;function p(){if(i)return d;try{let e=window.localStorage.getItem(s);if(!e)return null;let t=JSON.parse(e);if(!t.token||t.expires&&new Date(t.expires).getTime()t(e))}function x(e){return m.add(e),()=>m.delete(e)}function f(){var e,t;return null!=(t=null==(e=p())?void 0:e.token)?t:null}let g=!1;function v(){if(h(null),g||window.location.pathname.startsWith("/login"))return;g=!0;let e=window.location.pathname+window.location.search;window.location.href="/login/?next=".concat(encodeURIComponent(e))}function b(e){if(!e)return"";let t=new URLSearchParams;for(let[n,r]of Object.entries(e))null!=r&&""!==r&&t.set(n,String(r));let n=t.toString();return n?"?".concat(n):""}function w(e,t){return"".concat(a).concat(e).concat(b(t))}function j(e,t){var n;return i?l:w(e,{...t,access_token:null!=(n=f())?n:""})}function y(e,t){if(i)throw new c(501,"NotAvailableInDemo","Live connections are not available in the demo.");let n=a||window.location.origin,r=new URL(j(e,t),n);return r.protocol="https:"===r.protocol?"wss:":"ws:",r.toString()}let N=e=>encodeURIComponent(e);function k(){return n.e(8550).then(n.bind(n,78550))}async function S(e,t,n){var r;let a,s=await k(),o=n.body;if(n.body instanceof Blob)o=a=n.body.size<=524288?await n.body.text():void 0;else if("string"==typeof n.body){a=n.body;try{o=JSON.parse(n.body)}catch(e){o=n.body}}let i={};for(let[e,t]of Object.entries(null!=(r=n.query)?r:{}))null!=t&&""!==t&&(i[e]=String(t));try{return await s.demoRequest({method:e,path:t,query:i,body:o,raw:a,headers:n.headers})}catch(e){if(e instanceof s.DemoError)throw new c(e.status,e.code,e.message);throw e}}async function C(e,t){let n,r,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i)return S(e,t,s);let o={Accept:"application/json",...s.headers},l=f();l&&(o.Authorization="Bearer ".concat(l)),void 0!==s.body&&(s.body instanceof Blob||s.body instanceof FormData||"string"==typeof s.body?r=s.body:(o["Content-Type"]="application/json",r=JSON.stringify(s.body)));try{a=await fetch(w(t,s.query),{method:e,headers:o,body:r,signal:s.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw e;throw new c(0,"NetworkError","Cannot reach the HomeCloud API. Is the server running?")}let d=await a.text();if(d)try{n=JSON.parse(d)}catch(e){n=d}if(!a.ok){var u,m;let e=null==n?void 0:n.error,t=new c(a.status,null!=(u=null==e?void 0:e.code)?u:"HTTP".concat(a.status),null!=(m=null==e?void 0:e.message)?m:"string"==typeof n&&n?n:a.statusText);throw 401!==a.status||s.noAuthRedirect||v(),t}return n}let A={get:(e,t,n)=>C("GET",e,{query:t,signal:n}),post:(e,t,n)=>C("POST",e,{body:t,query:n}),put:(e,t,n)=>C("PUT",e,{body:t,query:n}),patch:(e,t,n)=>C("PATCH",e,{body:t,query:n}),del:(e,t)=>C("DELETE",e,{query:t})};function z(e,t,n,r,a){if(i)return{promise:(async()=>{if(n.size>262144)throw new c(501,"NotAvailableInDemo","Uploads larger than 256 KB are not available in the demo.");return await new Promise(e=>setTimeout(e,300)),null==r||r(n.size,n.size),S("PUT",e,{query:t,body:n,headers:{"Content-Type":a||n.type||"application/octet-stream"}})})(),abort:()=>{}};let s=new XMLHttpRequest;return{promise:new Promise((o,i)=>{s.open("PUT",w(e,t));let l=f();l&&s.setRequestHeader("Authorization","Bearer ".concat(l)),s.setRequestHeader("Content-Type",a||n.type||"application/octet-stream"),s.upload.onprogress=e=>{e.lengthComputable&&(null==r||r(e.loaded,e.total))},s.onload=()=>{var e,t;let n;try{n=s.responseText?JSON.parse(s.responseText):void 0}catch(e){n=s.responseText}if(s.status>=200&&s.status<300)return void o(n);let r=null==n?void 0:n.error;401===s.status&&v(),i(new c(s.status,null!=(e=null==r?void 0:r.code)?e:"HTTP".concat(s.status),null!=(t=null==r?void 0:r.message)?t:s.statusText))},s.onerror=()=>i(new c(0,"NetworkError","Upload failed: cannot reach the HomeCloud API")),s.onabort=()=>i(new c(0,"Aborted","Upload cancelled")),s.send(n)}),abort:()=>s.abort()}}async function E(e,t){if(i)return d;let n=await C("POST","/api/v1/auth/login",{body:{username:e,password:t},noAuthRedirect:!0});return h(n),n}async function D(){if(!i){try{await C("POST","/api/v1/auth/logout",{noAuthRedirect:!0})}catch(e){}h(null)}}},47045:(e,t,n)=>{n.d(t,{$:()=>l});var r=n(26276);n(29320);var a=n(18442),s=n(5820),o=n(88674);let i=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:s,asChild:l=!1,...d}=e,c=l?a.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,o.cn)(i({variant:n,size:s,className:t})),...d})}},69844:(e,t,n)=>{n.d(t,{AM:()=>o,Wv:()=>i,dT:()=>d,hl:()=>l});var r=n(26276);n(29320);var a=n(77422),s=n(88674);function o(e){let{...t}=e;return(0,r.jsx)(a.bL,{"data-slot":"popover",...t})}function i(e){let{...t}=e;return(0,r.jsx)(a.l9,{"data-slot":"popover-trigger",...t})}function l(e){let{className:t,align:n="center",sideOffset:o=4,...i}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{"data-slot":"popover-content",align:n,sideOffset:o,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...i})})}function d(e){let{...t}=e;return(0,r.jsx)(a.Mz,{"data-slot":"popover-anchor",...t})}},88674:(e,t,n)=>{n.d(t,{cn:()=>s});var r=n(46138),a=n(93294);function s(){for(var e=arguments.length,t=Array(e),n=0;n{t.d(s,{p:()=>a});var l=t(95155);t(12115);var r=t(25016);function a(e){let{className:s,type:t,...a}=e;return(0,l.jsx)("input",{type:t,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s),...a})}},59516:(e,s,t)=>{t.d(s,{P0:()=>n,Qv:()=>i});var l=t(95155),r=t(68122),a=t(25016);function i(e){let{rows:s=5,cols:t=5}=e;return(0,l.jsx)("div",{className:"divide-y",children:Array.from({length:s},(e,s)=>(0,l.jsx)("div",{className:"flex items-center gap-4 px-4 py-3",children:Array.from({length:t},(e,s)=>(0,l.jsx)(r.E,{className:(0,a.cn)("h-4",0===s?"w-40":"flex-1")},s))},s))})}function n(){return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(r.E,{className:"h-4 w-48"}),(0,l.jsx)(r.E,{className:"h-8 w-72"}),(0,l.jsx)("div",{className:"bg-card grid grid-cols-1 gap-6 rounded-lg border p-4 sm:grid-cols-3",children:Array.from({length:9},(e,s)=>(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(r.E,{className:"h-3 w-24"}),(0,l.jsx)(r.E,{className:"h-4 w-40"})]},s))})]})}},68122:(e,s,t)=>{t.d(s,{E:()=>a});var l=t(95155),r=t(25016);function a(e){let{className:s,...t}=e;return(0,l.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",s),...t})}},82180:(e,s,t)=>{t.d(s,{Bc:()=>i,ZI:()=>o,k$:()=>d,m_:()=>n});var l=t(95155);t(12115);var r=t(79209),a=t(25016);function i(e){let{delayDuration:s=0,...t}=e;return(0,l.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:s,...t})}function n(e){let{...s}=e;return(0,l.jsx)(i,{children:(0,l.jsx)(r.bL,{"data-slot":"tooltip",...s})})}function d(e){let{...s}=e;return(0,l.jsx)(r.l9,{"data-slot":"tooltip-trigger",...s})}function o(e){let{className:s,sideOffset:t=0,children:i,...n}=e;return(0,l.jsx)(r.ZL,{children:(0,l.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:t,className:(0,a.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",s),...n,children:[i,(0,l.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},82523:(e,s,t)=>{t.d(s,{V:()=>k,b:()=>y});var l=t(95155),r=t(12115),a=t(89559),i=t(86651),n=t(65229),d=t(90368),o=t(27937),c=t(8803),m=t(20562),u=t(74054),x=t(97003),h=t(84916),f=t(33789),p=t(82180),g=t(97438),b=t(59516),j=t(25016);let v={sm:"hidden sm:table-cell",md:"hidden md:table-cell",lg:"hidden lg:table-cell"};function N(e){return null==e?"":String(e).toLowerCase()}function y(e){let{title:s,description:t,count:y,data:k,columns:C,rowId:z,loading:A,error:S,onRetry:E,selection:_="none",selected:M,onSelectedChange:L,actions:$,onRefresh:B,refreshing:R,searchPlaceholder:F="Filter resources",filter:P,filters:Z,noSearch:I,empty:Q,pageSize:W=25,defaultSort:q,onRowClick:D,rowClassName:J,expanded:K,className:O}=e,[U,V]=(0,r.useState)(""),[G,H]=(0,r.useState)(q),[T,X]=(0,r.useState)(0),[Y,ee]=(0,r.useState)([]),es=null!=M?M:Y,et=e=>{L&&L(e),void 0===M&&ee(e)},el=(0,r.useMemo)(()=>null!=k?k:[],[k]),er=(0,r.useMemo)(()=>{let e=U.trim().toLowerCase();return e?el.filter(s=>P?P(s,e):C.some(t=>t.value&&N(t.value(s)).includes(e))):el},[el,U,P,C]),ea=(0,r.useMemo)(()=>{if(!G)return er;let e=C.find(e=>e.id===G.id);if(!(null==e?void 0:e.value))return er;let s=[...er];return s.sort((s,t)=>{let l,r=e.value(s),a=e.value(t);return l="number"==typeof r&&"number"==typeof a?r-a:N(r).localeCompare(N(a),void 0,{numeric:!0}),G.desc?-l:l}),s},[er,G,C]),ei=Math.max(1,Math.ceil(ea.length/W));(0,r.useEffect)(()=>{T>=ei&&X(ei-1)},[T,ei]);let en=ea.slice(T*W,T*W+W),ed=(0,r.useMemo)(()=>new Set(el.map(z)),[el,z]);(0,r.useEffect)(()=>{if(!k)return;let e=es.filter(e=>ed.has(e));e.length!==es.length&&et(e)},[ed]);let eo=e=>{"single"===_?et(es[0]===e?[]:[e]):et(es.includes(e)?es.filter(s=>s!==e):[...es,e])},ec=en.map(z),em=ec.length>0&&ec.every(e=>es.includes(e)),eu=ec.some(e=>es.includes(e)),ex=null!=y?y:el.length,eh=s||$||B;return(0,l.jsxs)("div",{className:(0,j.cn)("bg-card text-card-foreground rounded-lg border shadow-xs",O),children:[eh&&(0,l.jsxs)("div",{className:"flex flex-col gap-3 px-4 pt-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[s&&(0,l.jsxs)("h2",{className:"text-base font-semibold",children:[s," ",k&&(0,l.jsxs)("span",{className:"text-muted-foreground font-normal",children:["(",ex,")"]})]}),t&&(0,l.jsx)("p",{className:"text-muted-foreground mt-0.5 text-sm",children:t})]}),(0,l.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[B&&(0,l.jsxs)(p.m_,{children:[(0,l.jsx)(p.k$,{asChild:!0,children:(0,l.jsx)(x.$,{variant:"outline",size:"icon",className:"size-8",onClick:B,"aria-label":"Refresh",children:(0,l.jsx)(a.A,{className:(0,j.cn)(R&&"animate-spin")})})}),(0,l.jsx)(p.ZI,{children:"Refresh"})]}),$]})]}),(!I||Z)&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 px-4 pt-3 pb-3 md:flex-row md:items-center",children:[!I&&(0,l.jsxs)("div",{className:"relative w-full md:max-w-sm",children:[(0,l.jsx)(i.A,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2"}),(0,l.jsx)(f.p,{value:U,onChange:e=>{V(e.target.value),X(0)},placeholder:F,className:"h-8 pr-8 pl-8"}),U&&(0,l.jsx)("button",{type:"button","aria-label":"Clear filter",onClick:()=>V(""),className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-2 -translate-y-1/2",children:(0,l.jsx)(n.A,{className:"size-4"})})]}),Z&&(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Z}),(0,l.jsx)("div",{className:"text-muted-foreground flex items-center gap-1 text-sm md:ml-auto",children:ei>1&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.$,{variant:"ghost",size:"icon",className:"size-7",disabled:0===T,onClick:()=>X(T-1),"aria-label":"Previous page",children:(0,l.jsx)(d.A,{})}),(0,l.jsxs)("span",{className:"tabular-nums",children:[T+1," / ",ei]}),(0,l.jsx)(x.$,{variant:"ghost",size:"icon",className:"size-7",disabled:T>=ei-1,onClick:()=>X(T+1),"aria-label":"Next page",children:(0,l.jsx)(o.A,{})})]})})]}),!eh&&I&&!Z&&(0,l.jsx)("div",{className:"h-1"}),S?(0,l.jsx)("div",{className:"px-4 pb-4",children:(0,l.jsx)(g.W,{error:S,onRetry:null!=E?E:B})}):A&&!k?(0,l.jsx)("div",{className:"border-t",children:(0,l.jsx)(b.Qv,{cols:Math.min(C.length,5)})}):0===el.length?(0,l.jsx)("div",{className:"border-t",children:null!=Q?Q:(0,l.jsx)("p",{className:"text-muted-foreground p-8 text-center text-sm",children:"No resources"})}):(0,l.jsx)("div",{className:"relative w-full overflow-x-auto border-t",children:(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-muted/40 border-b",children:["none"!==_&&(0,l.jsx)("th",{className:"w-10 px-4 py-2 text-left",children:"multi"===_&&(0,l.jsx)(h.S,{"aria-label":"Select all",checked:!!em||!!eu&&"indeterminate",onCheckedChange:e=>et(e?Array.from(new Set([...es,...ec])):es.filter(e=>!ec.includes(e)))})}),C.map(e=>{var s;let t=null!=(s=e.sortable)?s:!!e.value,r=(null==G?void 0:G.id)===e.id;return(0,l.jsx)("th",{className:(0,j.cn)("text-muted-foreground px-3 py-2 text-left text-xs font-semibold tracking-wide whitespace-nowrap first:pl-4 last:pr-4",e.hideBelow&&v[e.hideBelow],e.headerClassName),children:t?(0,l.jsxs)("button",{type:"button",onClick:()=>{var s;(null!=(s=e.sortable)?s:!!e.value)&&H(s=>(null==s?void 0:s.id)===e.id?s.desc?void 0:{id:e.id,desc:!0}:{id:e.id})},className:"hover:text-foreground inline-flex items-center gap-1",children:[e.header,r?(null==G?void 0:G.desc)?(0,l.jsx)(c.A,{className:"size-3"}):(0,l.jsx)(m.A,{className:"size-3"}):(0,l.jsx)(u.A,{className:"size-3 opacity-40"})]}):e.header},e.id)})]})}),(0,l.jsxs)("tbody",{children:[0===en.length&&(0,l.jsx)("tr",{children:(0,l.jsxs)("td",{colSpan:C.length+ +("none"!==_),className:"text-muted-foreground p-8 text-center",children:["No matches for “",U,"”"]})}),en.map(e=>{let s=z(e),t=es.includes(s),r=null==K?void 0:K(e);return(0,l.jsxs)(w,{children:[(0,l.jsxs)("tr",{"data-state":t?"selected":void 0,onClick:()=>{D?D(e):"none"!==_&&eo(s)},className:(0,j.cn)("border-b transition-colors last:border-0",("none"!==_||D)&&"cursor-pointer",t?"bg-primary/5 dark:bg-primary/10":"hover:bg-muted/40",null==J?void 0:J(e)),children:["none"!==_&&(0,l.jsx)("td",{className:"w-10 px-4 py-2",onClick:e=>e.stopPropagation(),children:"multi"===_?(0,l.jsx)(h.S,{"aria-label":"Select ".concat(s),checked:t,onCheckedChange:()=>eo(s)}):(0,l.jsx)("input",{type:"radio","aria-label":"Select ".concat(s),className:"accent-primary size-4 cursor-pointer align-middle",checked:t,onChange:()=>eo(s),onClick:()=>t&&et([])})}),C.map(s=>(0,l.jsx)("td",{className:(0,j.cn)("px-3 py-2 align-middle first:pl-4 last:pr-4 [&_a.font-mono]:whitespace-nowrap",s.hideBelow&&v[s.hideBelow],s.className),children:s.cell(e)},s.id))]}),r&&(0,l.jsx)("tr",{className:"bg-muted/30 border-b",children:(0,l.jsx)("td",{colSpan:C.length+ +("none"!==_),className:"px-4 py-3",children:r})})]},s)})]})]})})]})}function w(e){let{children:s}=e;return(0,l.jsx)(l.Fragment,{children:s})}function k(){return"text-primary font-medium hover:underline"}},84916:(e,s,t)=>{t.d(s,{S:()=>d});var l=t(95155),r=t(12115),a=t(65027),i=t(5917),n=t(25016);let d=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,l.jsx)(a.bL,{ref:s,className:(0,n.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:(0,l.jsx)(a.C1,{className:(0,n.cn)("flex items-center justify-center text-current"),children:(0,l.jsx)(i.A,{className:"h-4 w-4"})})})});d.displayName=a.bL.displayName},97438:(e,s,t)=>{t.d(s,{W:()=>o});var l=t(95155),r=t(6132),a=t(89559),i=t(97003),n=t(37621),d=t(25016);function o(e){let{error:s,onRetry:t,className:o}=e;return(0,l.jsxs)("div",{className:(0,d.cn)("border-destructive/30 bg-destructive/5 text-destructive flex flex-col gap-3 rounded-lg border p-4 text-sm sm:flex-row sm:items-center sm:justify-between",o),children:[(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)(r.A,{className:"mt-0.5 size-4 shrink-0"}),(0,l.jsx)("span",{className:"break-words",children:(0,n.gJ)(s)})]}),t&&(0,l.jsxs)(i.$,{variant:"outline",size:"sm",onClick:t,className:"text-foreground shrink-0",children:[(0,l.jsx)(a.A,{})," Retry"]})]})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js b/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js
deleted file mode 100644
index 72e17aca..00000000
--- a/pages/demo/_next/static/chunks/253-fc32bd1e7cba0add.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{7e3:(e,t,n)=>{n.d(t,{Fl:()=>p,YI:()=>c,Yq:()=>r,ZV:()=>o,a3:()=>h,fF:()=>u,fU:()=>d,qt:()=>i,td:()=>m,z3:()=>s});let a=["B","KB","MB","GB","TB","PB"];function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e||Number.isNaN(e))return"-";if(0===e)return"0 B";let n=Math.abs(e),s=0;for(;n>=1024&&s=100?0:t);return"".concat(e<0?"-":"").concat(i," ").concat(a[s])}function i(e){if(null==e)return"-";if(e<1024)return"".concat(e," MiB");let t=e/1024;return"".concat(Number.isInteger(t)?t:t.toFixed(1)," GiB")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return null==e||Number.isNaN(e)?"-":e.toLocaleString(void 0,{maximumFractionDigits:t})}function c(e,t){if(null==e||Number.isNaN(e))return"-";switch(t){case"Percent":return"".concat(o(e,1),"%");case"Bytes":return s(e);case"Bytes/Second":return"".concat(s(e),"/s");case"Milliseconds":return"".concat(o(e,0)," ms");case"Seconds":return"".concat(o(e,1)," s");default:return o(e)}}function l(e){if(null==e||""===e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())||1971>t.getFullYear()?null:t}function r(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=l(e);return n?n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:t?"2-digit":void 0,hour12:!1}):"-"}function d(e){let t=l(e);return t?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"-"}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=l(e);if(!n)return"-";let a=(n.getTime()-t)/1e3,s=Math.abs(a),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(s<45||a>0&&a<60)return"just now";let o=a;for(let[e,t]of[[60,"second"],[60,"minute"],[24,"hour"],[30,"day"],[12,"month"],[1/0,"year"]]){if(Math.abs(o)2&&void 0!==arguments[2]?arguments[2]:"".concat(t,"s");return"".concat(e," ").concat(1===e?t:n)}function p(e){let t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}},10253:(e,t,n)=>{n.d(t,{$f:()=>d,A4:()=>l,BU:()=>u,HE:()=>z,HO:()=>D,Ic:()=>r,MQ:()=>j,Mf:()=>I,Pk:()=>L,QZ:()=>f,VT:()=>q,WD:()=>m,Wh:()=>h,Xc:()=>b,YW:()=>p,_D:()=>N,a9:()=>g,cW:()=>B,dT:()=>M,dq:()=>v,fz:()=>_,hT:()=>C,jk:()=>S,nu:()=>k,y7:()=>w});var a=n(95155),s=n(47507),i=n(7e3),o=n(73697),c=n(25016);let l="/api/v1/rds",r="/api/v1/rds/instances",d="/api/v1/rds/snapshots",u={rds:{family:"rds",service:"RDS",kinds:["relational","document"],classKind:"db",base:"/rds/",detailPath:"/rds/instance/",createPath:"/rds/create/",snapshotsPath:"/rds/snapshots/",noun:"database",Noun:"Database",nouns:"databases",Nouns:"Databases",snap:"snapshot",Snap:"Snapshot",snaps:"snapshots",Snaps:"Snapshots",idLabel:"DB identifier",namespace:"HC/RDS",dimension:"DBInstanceIdentifier"},elasticache:{family:"elasticache",service:"ElastiCache",kinds:["cache"],classKind:"cache",base:"/elasticache/",detailPath:"/elasticache/cluster/",createPath:"/elasticache/create/",snapshotsPath:"/elasticache/backups/",noun:"cluster",Noun:"Cluster",nouns:"clusters",Nouns:"Clusters",snap:"backup",Snap:"Backup",snaps:"backups",Snaps:"Backups",idLabel:"Cluster ID",namespace:"HC/ElastiCache",dimension:"CacheClusterId"}},h=e=>"cache"===e?"elasticache":"rds",m=(e,t)=>e.kinds.includes(t),p=(e,t,n)=>"".concat(u[h(e)].detailPath,"?id=").concat(encodeURIComponent(t)).concat(n?"&tab=".concat(n):""),f=e=>"cache"===e?"backups":"snapshots",g=e=>"cache"===e?"console":"query",x=["creating","starting","stopping","rebooting","restoring","backing-up","modifying","deleting"],b=e=>x.includes(e);function v(e){return e.some(b)?2e3:15e3}let y=/^[a-z][a-z0-9-]{0,62}$/;function j(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Identifier";return e?y.test(e)?void 0:"".concat(t," must start with a lowercase letter and contain only lowercase letters, digits and hyphens (max 63)"):"Enter ".concat("Identifier"===t?"an identifier":"a ".concat(t.toLowerCase()))}function w(e){return e.length<8?"At least 8 characters":/["'/@\s\\]/.test(e)?"May not contain quotes, slashes, @ or spaces":void 0}let N=e=>"memcached"!==e,k=e=>"memcached"!==e,M=e=>["postgres","mysql","mariadb","mongodb"].includes(e),z=e=>"redis"===e||"valkey"===e;function C(){return(0,o.gf)("".concat(l,"/engines"),{revalidateOnFocus:!1})}function B(e){return"".concat(e," vCPU").concat(1===e?"":"s")}function _(e){return"".concat(B(e.vcpus),", ").concat((0,i.qt)(e.memory_mb))}function D(e){return e.endpoint.address?"".concat(e.endpoint.address,":").concat(e.endpoint.port):""}function S(e){return e.publicly_accessible&&e.endpoint.public_host&&e.endpoint.public_port?"".concat(e.endpoint.public_host,":").concat(e.endpoint.public_port):""}let P={postgres:{mono:"Pg",cls:"bg-sky-700 text-white",label:"PostgreSQL"},mysql:{mono:"My",cls:"bg-orange-500 text-white",label:"MySQL"},mariadb:{mono:"Ma",cls:"bg-amber-800 text-white",label:"MariaDB"},mongodb:{mono:"Mo",cls:"bg-emerald-600 text-white",label:"MongoDB"},redis:{mono:"R",cls:"bg-red-600 text-white",label:"Redis"},valkey:{mono:"Vk",cls:"bg-indigo-600 text-white",label:"Valkey"},memcached:{mono:"Mc",cls:"bg-teal-600 text-white",label:"Memcached"}};function I(e){var t;let{engine:n,size:s="sm",className:i}=e,o=null!=(t=P[n])?t:{mono:n.slice(0,2),cls:"bg-slate-500 text-white"};return(0,a.jsx)("span",{"aria-hidden":!0,className:(0,c.cn)("inline-flex shrink-0 items-center justify-center font-bold tracking-tight select-none",{xs:"size-5 text-[9px] rounded",sm:"size-6 text-[10px] rounded-md",lg:"size-10 text-sm rounded-lg"}[s],o.cls,i),children:o.mono})}function L(e){var t,n,s,i;let{engine:o,version:c,engines:l}=e;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[(0,a.jsx)(I,{engine:o,size:"xs"}),(0,a.jsxs)("span",{children:[(null!=(i=null!=(s=null==l||null==(t=l.find(e=>e.name===o))?void 0:t.label)?s:null==(n=P[o])?void 0:n.label)?i:o).replace(" (DocumentDB compatible)",""),c&&(0,a.jsxs)("span",{className:"text-muted-foreground",children:[" ",c]})]})]})}function q(e){var t;let{value:n,onChange:i,kind:o,id:l,className:r}=e,{data:d,isLoading:u}=C(),h=(null!=(t=null==d?void 0:d.classes)?t:[]).filter(e=>e.kind===o);return(0,a.jsxs)(s.l6,{value:n,onValueChange:i,disabled:u&&!d,children:[(0,a.jsx)(s.bq,{id:l,className:(0,c.cn)("w-full",r),children:(0,a.jsx)(s.yv,{placeholder:u?"Loading classes...":"Choose a class"})}),(0,a.jsx)(s.gC,{children:h.map(e=>(0,a.jsxs)(s.eb,{value:e.name,children:[(0,a.jsx)("span",{className:"font-mono text-[13px]",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:_(e)})]},e.name))})]})}},47507:(e,t,n)=>{n.d(t,{TR:()=>p,bq:()=>h,eb:()=>f,gC:()=>m,l6:()=>r,s3:()=>d,yv:()=>u});var a=n(95155);n(12115);var s=n(95435),i=n(24033),o=n(5917),c=n(12108),l=n(25016);function r(e){let{...t}=e;return(0,a.jsx)(s.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,a.jsx)(s.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,a.jsx)(s.WT,{"data-slot":"select-value",...t})}function h(e){let{className:t,size:n="default",children:o,...c}=e;return(0,a.jsxs)(s.l9,{"data-slot":"select-trigger","data-size":n,className:(0,l.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...c,children:[o,(0,a.jsx)(s.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:n,position:i="popper",...o}=e;return(0,a.jsx)(s.ZL,{children:(0,a.jsxs)(s.UC,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...o,children:[(0,a.jsx)(g,{}),(0,a.jsx)(s.LM,{className:(0,l.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,a.jsx)(x,{})]})})}function p(e){let{className:t,...n}=e;return(0,a.jsx)(s.JU,{"data-slot":"select-label",className:(0,l.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...n})}function f(e){let{className:t,children:n,...i}=e;return(0,a.jsxs)(s.q7,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(s.VF,{children:(0,a.jsx)(o.A,{className:"size-4"})})}),(0,a.jsx)(s.p4,{children:n})]})}function g(e){let{className:t,...n}=e;return(0,a.jsx)(s.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(c.A,{className:"size-4"})})}function x(e){let{className:t,...n}=e;return(0,a.jsx)(s.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,a.jsx)(i.A,{className:"size-4"})})}}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js b/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js
new file mode 100644
index 00000000..d2e587bd
--- /dev/null
+++ b/pages/demo/_next/static/chunks/2585-ec8bd016598d977c.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2585],{1211:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},7489:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},9072:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},10002:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},11202:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},27102:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},29902:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},31935:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},39727:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},42812:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])},46319:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]])},48947:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},56753:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},63240:(e,t,r)=>{r.d(t,{bL:()=>x,zi:()=>w});var l=r(29320),n=r(62315),a=r(36103),i=r(65335),o=r(82275),c=r(79225),d=r(96886),p=r(12377),s=r(26276),u="Switch",[f,h]=(0,i.A)(u),[y,k]=f(u),m=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:c,defaultChecked:d,required:u,disabled:f,value:h="on",onCheckedChange:k,form:m,...b}=e,[v,x]=l.useState(null),w=(0,a.s)(t,e=>x(e)),M=l.useRef(!1),S=!v||m||!!v.closest("form"),[E=!1,C]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,a]=function({defaultProp:e,onChange:t}){let r=l.useState(e),[n]=r,a=l.useRef(n),i=(0,o.c)(t);return l.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}({defaultProp:t,onChange:r}),i=void 0!==e,c=i?e:n,d=(0,o.c)(r);return[c,l.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&d(r)}else a(t)},[i,e,a,d])]}({prop:c,defaultProp:d,onChange:k});return(0,s.jsxs)(y,{scope:r,checked:E,disabled:f,children:[(0,s.jsx)(p.sG.button,{type:"button",role:"switch","aria-checked":E,"aria-required":u,"data-state":A(E),"data-disabled":f?"":void 0,disabled:f,value:h,...b,ref:w,onClick:(0,n.m)(e.onClick,e=>{C(e=>!e),S&&(M.current=e.isPropagationStopped(),M.current||e.stopPropagation())})}),S&&(0,s.jsx)(g,{control:v,bubbles:!M.current,name:i,value:h,checked:E,required:u,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});m.displayName=u;var b="SwitchThumb",v=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...l}=e,n=k(b,r);return(0,s.jsx)(p.sG.span,{"data-state":A(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:t})});v.displayName=b;var g=e=>{let{control:t,checked:r,bubbles:n=!0,...a}=e,i=l.useRef(null),o=(0,c.Z)(r),p=function(e){let[t,r]=l.useState(void 0);return(0,d.N)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let l,n;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;l=t.inlineSize,n=t.blockSize}else l=e.offsetWidth,n=e.offsetHeight;r({width:l,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(t);return l.useEffect(()=>{let e=i.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(o!==r&&t){let l=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(l)}},[o,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e?"checked":"unchecked"}var x=m,w=v},64206:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},64761:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},72474:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(14680).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},95774:(e,t,r)=>{r.d(t,{b:()=>R});var l=r(29320),n=r.t(l,2),a=r(93993),i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function d(...e){return t=>{let r=!1,l=e.map(e=>{let l=c(e,t);return r||"function"!=typeof l||(r=!0),l});if(r)return()=>{for(let t=0;ts(e,"name",{value:t,configurable:!0});function f(e){let t=l.forwardRef((t,r)=>{let{children:n,...a}=t,i=null,o=!1,c=[];g(n)&&"function"==typeof M&&(n=M(n._payload)),l.Children.forEach(n,e=>{if(b(e)){o=!0;let t="child"in e.props?e.props.child:e.props.children;g(t)&&"function"==typeof M&&(t=M(t._payload)),i=y(e,t),c.push(i?.props?.children)}else c.push(e)}),i?i=l.cloneElement(i,void 0,c):!o&&1===l.Children.count(n)&&l.isValidElement(n)&&(i=n);let d=i?m(i):void 0,s=p(r,d);if(!i){if(n||0===n)throw Error(o?w(e):x(e));return n}let u=k(a,i.props??{});return i.type!==l.Fragment&&(u.ref=r?s:d),l.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}u(f,"createSlot");var h=Symbol.for("radix.slottable");u(function(e){let t=u(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=h,t},"createSlottable");var y=u((e,t)=>{if("child"in e.props){let t=e.props.child;return l.isValidElement(t)?l.cloneElement(t,void 0,e.props.children(t.props.children)):null}return l.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function k(e,t){let r={...t};for(let l in t){let n=e[l],a=t[l];/^on[A-Z]/.test(l)?n&&a?r[l]=(...e)=>{let t=a(...e);return n(...e),t}:n&&(r[l]=n):"style"===l?r[l]={...n,...a}:"className"===l&&(r[l]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function b(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}u(k,"mergeProps"),u(m,"getElementRef"),u(b,"isSlottable");var v=Symbol.for("react.lazy");function g(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&A(e._payload)}function A(e){return"object"==typeof e&&null!==e&&"then"in e}u(g,"isLazyComponent"),u(A,"isPromiseLike");var x=u(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),w=u(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),M=n[" use ".trim().toString()],S=r(26276),E=Object.defineProperty,C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=l.forwardRef((e,l)=>{let{asChild:n,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,S.jsx)(n?r:t,{...a,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});E(function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))},"name",{value:"dispatchDiscreteCustomEvent",configurable:!0});var j=Object.defineProperty,R=l.forwardRef(j(function(e,t){return(0,S.jsx)(C.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}}]);
\ No newline at end of file
diff --git a/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js b/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js
new file mode 100644
index 00000000..c0532d0e
--- /dev/null
+++ b/pages/demo/_next/static/chunks/2604-05d83523dc25cd50.js
@@ -0,0 +1 @@
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2604],{427:(t,e,r)=>{"use strict";r.d(e,{QQ:()=>c,VU:()=>l,XC:()=>p,_U:()=>f,j2:()=>s});var n=r(29320),o=r(2346),i=r.n(o);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],u=["points","pathLength"],l={svg:["viewBox","children"],polygon:u,polyline:u},s=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],f=function(t,e){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var r=t;if((0,n.isValidElement)(t)&&(r=t.props),!i()(r))return null;var o={};return Object.keys(r).forEach(function(t){s.includes(t)&&(o[t]=e||function(e){return r[t](r,e)})}),o},p=function(t,e,r){if(!i()(t)||"object"!==a(t))return null;var n=null;return Object.keys(t).forEach(function(o){var i=t[o];s.includes(o)&&"function"==typeof i&&(n||(n={}),n[o]=function(t){return i(e,r,t),null})}),n}},1116:(t,e,r)=>{"use strict";r.d(e,{s0:()=>n6,gH:()=>n0,YB:()=>oo,HQ:()=>or,xi:()=>oi,Hj:()=>og,BX:()=>n3,tA:()=>n2,DW:()=>oh,y2:()=>op,nb:()=>of,PW:()=>n9,Ay:()=>nQ,vf:()=>n4,Mk:()=>od,Ps:()=>n1,Mn:()=>ol,kA:()=>oy,Rh:()=>ot,w7:()=>os,zb:()=>oO,kr:()=>nZ,_L:()=>n8,KC:()=>ox,A1:()=>n7,W7:()=>on,AQ:()=>ob,_f:()=>oa});var n,o,i,a,c,u,l,s={};r.r(s),r.d(s,{scaleBand:()=>f.A,scaleDiverging:()=>function t(){var e=tN(rZ()(tv));return e.copy=function(){return rY(e,t())},tj.K.apply(e,arguments)},scaleDivergingLog:()=>function t(){var e=tX(rZ()).domain([.1,1,10]);return e.copy=function(){return rY(e,t()).base(e.base())},tj.K.apply(e,arguments)},scaleDivergingPow:()=>rQ,scaleDivergingSqrt:()=>r0,scaleDivergingSymlog:()=>function t(){var e=tV(rZ());return e.copy=function(){return rY(e,t()).constant(e.constant())},tj.K.apply(e,arguments)},scaleIdentity:()=>function t(e){var r;function n(t){return null==t||isNaN(t*=1)?r:t}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,ty),n):e.slice()},n.unknown=function(t){return arguments.length?(r=t,n):r},n.copy=function(){return t(e).unknown(r)},e=arguments.length?Array.from(e,ty):[0,1],tN(n)},scaleImplicit:()=>tG.h,scaleLinear:()=>tB,scaleLog:()=>function t(){let e=tX(tO()).domain([1,10]);return e.copy=()=>tx(e,t()).base(e.base()),tj.C.apply(e,arguments),e},scaleOrdinal:()=>tG.A,scalePoint:()=>f.z,scalePow:()=>tQ,scaleQuantile:()=>function t(){var e,r=[],n=[],o=[];function i(){var t=0,e=Math.max(1,n.length);for(o=Array(e-1);++t=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(r(t[i+1],i+1,t)-a)*(o-i)}}(r,t/e);return a}function a(t){return null==t||isNaN(t*=1)?e:n[A(o,t)]}return a.invertExtent=function(t){var e=n.indexOf(t);return e<0?[NaN,NaN]:[e>0?o[e-1]:r[0],efunction t(){var e,r=0,n=1,o=1,i=[.5],a=[0,1];function c(t){return null!=t&&t<=t?a[A(i,t,0,o)]:e}function u(){var t=-1;for(i=Array(o);++t=o?[i[o-1],n]:[i[e-1],i[e]]},c.unknown=function(t){return arguments.length&&(e=t),c},c.thresholds=function(){return i.slice()},c.copy=function(){return t().domain([r,n]).range(a).unknown(e)},tj.C.apply(tN(c),arguments)},scaleRadial:()=>function t(){var e,r=tw(),n=[0,1],o=!1;function i(t){var n,i=Math.sign(n=r(t))*Math.sqrt(Math.abs(n));return isNaN(i)?e:o?Math.round(i):i}return i.invert=function(t){return r.invert(t1(t))},i.domain=function(t){return arguments.length?(r.domain(t),i):r.domain()},i.range=function(t){return arguments.length?(r.range((n=Array.from(t,ty)).map(t1)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(o=!!t,i):o},i.clamp=function(t){return arguments.length?(r.clamp(t),i):r.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(r.domain(),n).round(o).clamp(r.clamp()).unknown(e)},tj.C.apply(i,arguments),tN(i)},scaleSequential:()=>function t(){var e=tN(rG()(tv));return e.copy=function(){return rY(e,t())},tj.K.apply(e,arguments)},scaleSequentialLog:()=>function t(){var e=tX(rG()).domain([1,10]);return e.copy=function(){return rY(e,t()).base(e.base())},tj.K.apply(e,arguments)},scaleSequentialPow:()=>rK,scaleSequentialQuantile:()=>function t(){var e=[],r=tv;function n(t){if(null!=t&&!isNaN(t*=1))return r((A(e,t,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();for(let r of(e=[],t))null==r||isNaN(r*=1)||e.push(r);return e.sort(g),n},n.interpolator=function(t){return arguments.length?(r=t,n):r},n.range=function(){return e.map((t,n)=>r(n/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(r,n)=>(function(t,e,r){if(!(!(n=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e*=1)>=e&&(yield e);else{let r=-1;for(let n of t)null!=(n=e(n,++r,t))&&(n*=1)>=n&&(yield n)}}(t,void 0))).length)||isNaN(e*=1))){if(e<=0||n<2)return t3(t);if(e>=1)return t2(t);var n,o=(n-1)*e,i=Math.floor(o),a=t2((function t(e,r,n=0,o=1/0,i){if(r=Math.floor(r),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(e.length-1,o)),!(n<=r&&r<=o))return e;for(i=void 0===i?t6:function(t=g){if(t===g)return t6;if("function"!=typeof t)throw TypeError("compare is not a function");return(e,r)=>{let n=t(e,r);return n||0===n?n:(0===t(r,r))-(0===t(e,e))}}(i);o>n;){if(o-n>600){let a=o-n+1,c=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),s=.5*Math.sqrt(u*l*(a-l)/a)*(c-a/2<0?-1:1),f=Math.max(n,Math.floor(r-c*l/a+s)),p=Math.min(o,Math.floor(r+(a-c)*l/a+s));t(e,r,f,p,i)}let a=e[r],c=n,u=o;for(t5(e,n,r),i(e[o],a)>0&&t5(e,n,o);ci(e[c],a);)++c;for(;i(e[u],a)>0;)--u}0===i(e[n],a)?t5(e,n,u):t5(e,++u,o),u<=r&&(n=u+1),r<=u&&(o=u-1)}return e})(t,i).subarray(0,i+1));return a+(t3(t.subarray(i+1))-a)*(o-i)}})(e,n/t))},n.copy=function(){return t(r).domain(e)},tj.K.apply(n,arguments)},scaleSequentialSqrt:()=>rJ,scaleSequentialSymlog:()=>function t(){var e=tV(rG());return e.copy=function(){return rY(e,t()).constant(e.constant())},tj.K.apply(e,arguments)},scaleSqrt:()=>t0,scaleSymlog:()=>function t(){var e=tV(tO());return e.copy=function(){return tx(e,t()).constant(e.constant())},tj.C.apply(e,arguments)},scaleThreshold:()=>function t(){var e,r=[.5],n=[0,1],o=1;function i(t){return null!=t&&t<=t?n[A(r,t,0,o)]:e}return i.domain=function(t){return arguments.length?(o=Math.min((r=Array.from(t)).length,n.length-1),i):r.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),o=Math.min(r.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var e=n.indexOf(t);return[r[e-1],r[e]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t().domain(r).range(n).unknown(e)},tj.C.apply(i,arguments)},scaleTime:()=>rH,scaleUtc:()=>rV,tickFormat:()=>tI});var f=r(41662);let p=Math.sqrt(50),h=Math.sqrt(10),y=Math.sqrt(2);function d(t,e,r){let n,o,i,a=(e-t)/Math.max(0,r),c=Math.floor(Math.log10(a)),u=a/Math.pow(10,c),l=u>=p?10:u>=h?5:u>=y?2:1;return(c<0?(n=Math.round(t*(i=Math.pow(10,-c)/l)),o=Math.round(e*i),n/ie&&--o,i=-i):(n=Math.round(t/(i=Math.pow(10,c)*l)),o=Math.round(e/i),n*ie&&--o),o0))return[];if(t===e)return[t];let n=e=o))return[];let c=i-o+1,u=Array(c);if(n)if(a<0)for(let t=0;te?1:t>=e?0:NaN}function x(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function O(t){let e,r,n;function o(t,n,i=0,a=t.length){if(i>>1;0>r(t[e],n)?i=e+1:a=e}while(i g(t(e),r),n=(e,r)=>t(e)-r):(e=t===g||t===x?t:w,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){let a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o>>1;0>=r(t[e],n)?o=e+1:i=e}while(o>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?X(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?X(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=D.exec(t))?new H(e[1],e[2],e[3],1):(e=I.exec(t))?new H(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=N.exec(t))?X(e[1],e[2],e[3],e[4]):(e=B.exec(t))?X(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=R.exec(t))?Z(e[1],e[2]/100,e[3]/100,1):(e=L.exec(t))?Z(e[1],e[2]/100,e[3]/100,e[4]):z.hasOwnProperty(t)?W(z[t]):"transparent"===t?new H(NaN,NaN,NaN,0):null}function W(t){return new H(t>>16&255,t>>8&255,255&t,1)}function X(t,e,r,n){return n<=0&&(t=e=r=NaN),new H(t,e,r,n)}function q(t,e,r,n){var o;return 1==arguments.length?((o=t)instanceof k||(o=$(o)),o)?new H((o=o.rgb()).r,o.g,o.b,o.opacity):new H:new H(t,e,r,null==n?1:n)}function H(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function V(){return`#${J(this.r)}${J(this.g)}${J(this.b)}`}function G(){let t=Y(this.opacity);return`${1===t?"rgb(":"rgba("}${K(this.r)}, ${K(this.g)}, ${K(this.b)}${1===t?")":`, ${t})`}`}function Y(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function K(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function J(t){return((t=K(t))<16?"0":"")+t.toString(16)}function Z(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,r,n)}function Q(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof k||(t=$(t)),!t)return new tt;if(t instanceof tt)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,c=i-o,u=(i+o)/2;return c?(a=e===i?(r-n)/c+(r0&&u<1?0:a,new tt(a,c,u,t.opacity)}function tt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function te(t){return(t=(t||0)%360)<0?t+360:t}function tr(t){return Math.max(0,Math.min(1,t||0))}function tn(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function to(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}P(k,$,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U,formatHex:U,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Q(this).formatHsl()},formatRgb:F,toString:F}),P(H,q,E(k,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new H(K(this.r),K(this.g),K(this.b),Y(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:V,formatHex:V,formatHex8:function(){return`#${J(this.r)}${J(this.g)}${J(this.b)}${J((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:G,toString:G})),P(tt,function(t,e,r,n){return 1==arguments.length?Q(t):new tt(t,e,r,null==n?1:n)},E(k,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new H(tn(t>=240?t-240:t+120,o,n),tn(t,o,n),tn(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new tt(te(this.h),tr(this.s),tr(this.l),Y(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Y(this.opacity);return`${1===t?"hsl(":"hsla("}${te(this.h)}, ${100*tr(this.s)}%, ${100*tr(this.l)}%${1===t?")":`, ${t})`}`}}));let ti=t=>()=>t;function ta(t,e){var r=e-t;return r?function(e){return t+e*r}:ti(isNaN(t)?e:t)}let tc=function t(e){var r,n=1==(r=+e)?ta:function(t,e){var n,o,i;return e-t?(n=t,o=e,n=Math.pow(n,i=r),o=Math.pow(o,i)-n,i=1/i,function(t){return Math.pow(n+t*o,i)}):ti(isNaN(t)?e:t)};function o(t,e){var r=n((t=q(t)).r,(e=q(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ta(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function tu(t){return function(e){var r,n,o=e.length,i=Array(o),a=Array(o),c=Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,c=nc&&(a=e.slice(c,a),l[u]?l[u]+=a:l[++u]=a),(o=o[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,s.push({i:u,x:tl(o,i)})),c=tf.lastIndex;return ce&&(r=t,t=e,e=r),l=function(r){return Math.max(t,Math.min(e,r))}),n=u>2?tg:tb,o=i=null,f}function f(e){return null==e||isNaN(e*=1)?r:(o||(o=n(a.map(t),c,u)))(t(l(e)))}return f.invert=function(r){return l(e((i||(i=n(c,a.map(t),tl)))(r)))},f.domain=function(t){return arguments.length?(a=Array.from(t,ty),s()):a.slice()},f.range=function(t){return arguments.length?(c=Array.from(t),s()):c.slice()},f.rangeRound=function(t){return c=Array.from(t),u=th,s()},f.clamp=function(t){return arguments.length?(l=!!t||tv,s()):l!==tv},f.interpolate=function(t){return arguments.length?(u=t,s()):u},f.unknown=function(t){return arguments.length?(r=t,f):r},function(r,n){return t=r,e=n,s()}}function tw(){return tO()(tv,tv)}var tj=r(75283),tS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tA(t){var e;if(!(e=tS.exec(t)))throw Error("invalid format: "+t);return new tP({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function tP(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function tE(t,e){if(!isFinite(t)||0===t)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function tk(t){return(t=tE(Math.abs(t)))?t[1]:NaN}function tM(t,e){var r=tE(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+Array(o-n.length+2).join("0")}tA.prototype=tP.prototype,tP.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let t_={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tM(100*t,e),r:tM,s:function(t,e){var r=tE(t,e);if(!r)return n=void 0,t.toPrecision(e);var o=r[0],i=r[1],a=i-(n=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,c=o.length;return a===c?o:a>c?o+Array(a-c+1).join("0"):a>0?o.slice(0,a)+"."+o.slice(a):"0."+Array(1-a).join("0")+tE(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tT(t){return t}var tC=Array.prototype.map,tD=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function tI(t,e,r,n){var o,c,u=b(t,e,r);switch((n=tA(null==n?",f":n)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(c=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tk(l)/3)))-tk(Math.abs(u))))||(n.precision=c),a(n,l);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(c=Math.max(0,tk(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=u)))-tk(o))+1)||(n.precision=c-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(c=Math.max(0,-tk(Math.abs(u))))||(n.precision=c-("%"===n.type)*2)}return i(n)}function tN(t){var e=t.domain;return t.ticks=function(t){var r=e();return v(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return tI(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,o,i=e(),a=0,c=i.length-1,u=i[a],l=i[c],s=10;for(l0;){if((o=m(u,l,r))===n)return i[a]=u,i[c]=l,e(i);if(o>0)u=Math.floor(u/o)*o,l=Math.ceil(l/o)*o;else if(o<0)u=Math.ceil(u*o)/o,l=Math.floor(l*o)/o;else break;n=o}return t},t}function tB(){var t=tw();return t.copy=function(){return tx(t,tB())},tj.C.apply(t,arguments),tN(t)}function tR(t,e){t=t.slice();var r,n=0,o=t.length-1,i=t[n],a=t[o];return a-t(-e,r)}function tX(t){let e,r,n=t(tL,tz),o=n.domain,a=10;function c(){var i,c;return e=(i=a)===Math.E?Math.log:10===i&&Math.log10||2===i&&Math.log2||(i=Math.log(i),t=>Math.log(t)/i),r=10===(c=a)?t$:c===Math.E?Math.exp:t=>Math.pow(c,t),o()[0]<0?(e=tW(e),r=tW(r),t(tU,tF)):t(tL,tz),n}return n.base=function(t){return arguments.length?(a=+t,c()):a},n.domain=function(t){return arguments.length?(o(t),c()):o()},n.ticks=t=>{let n,i,c=o(),u=c[0],l=c[c.length-1],s=l0){for(;f<=p;++f)for(n=1;nl)break;y.push(i)}}else for(;f<=p;++f)for(n=a-1;n>=1;--n)if(!((i=f>0?n/r(-f):n*r(f))l)break;y.push(i)}2*y.length{if(null==t&&(t=10),null==o&&(o=10===a?"s":","),"function"!=typeof o&&(a%1||null!=(o=tA(o)).precision||(o.trim=!0),o=i(o)),t===1/0)return o;let c=Math.max(1,a*t/n.ticks().length);return t=>{let n=t/r(Math.round(e(t)));return n*ao(tR(o(),{floor:t=>r(Math.floor(e(t))),ceil:t=>r(Math.ceil(e(t)))})),n}function tq(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tH(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tV(t){var e=1,r=t(tq(1),tH(e));return r.constant=function(r){return arguments.length?t(tq(e=+r),tH(e)):e},tN(r)}i=(o=function(t){var e,r,o,i=void 0===t.grouping||void 0===t.thousands?tT:(e=tC.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,c=e[0],u=0;o>0&&c>0&&(u+c+1>n&&(c=Math.max(1,n-u)),i.push(t.substring(o-=c,o+c)),!((u+=c+1)>n));)c=e[a=(a+1)%e.length];return i.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",u=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?tT:(o=tC.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),s=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",p=void 0===t.nan?"NaN":t.nan+"";function h(t,e){var r=(t=tA(t)).fill,o=t.align,h=t.sign,y=t.symbol,d=t.zero,v=t.width,m=t.comma,b=t.precision,g=t.trim,x=t.type;"n"===x?(m=!0,x="g"):t_[x]||(void 0===b&&(b=12),g=!0,x="g"),(d||"0"===r&&"="===o)&&(d=!0,r="0",o="=");var O=(e&&void 0!==e.prefix?e.prefix:"")+("$"===y?a:"#"===y&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),w=("$"===y?c:/[%p]/.test(x)?s:"")+(e&&void 0!==e.suffix?e.suffix:""),j=t_[x],S=/[defgprs%]/.test(x);function A(t){var e,a,c,s=O,y=w;if("c"===x)y=j(t)+y,t="";else{var A=(t*=1)<0||1/t<0;if(t=isNaN(t)?p:j(Math.abs(t),b),g&&(t=function(t){t:for(var e,r=t.length,n=1,o=-1;n0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==h&&(A=!1),s=(A?"("===h?h:f:"-"===h||"("===h?"":h)+s,y=("s"!==x||isNaN(t)||void 0===n?"":tD[8+n/3])+y+(A&&"("===h?")":""),S){for(e=-1,a=t.length;++e(c=t.charCodeAt(e))||c>57){y=(46===c?u+t.slice(e+1):t.slice(e))+y,t=t.slice(0,e);break}}}m&&!d&&(t=i(t,1/0));var P=s.length+t.length+y.length,E=P>1)+s+t+y+E.slice(P);break;default:t=E+s+t+y}return l(t)}return b=void 0===b?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),A.toString=function(){return t+""},A}return{format:h,formatPrefix:function(t,e){var r=3*Math.max(-8,Math.min(8,Math.floor(tk(e)/3))),n=Math.pow(10,-r),o=h(((t=tA(t)).type="f",t),{suffix:tD[8+r/3]});return function(t){return o(n*t)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,a=o.formatPrefix;var tG=r(76554);function tY(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tK(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function tJ(t){return t<0?-t*t:t*t}function tZ(t){var e=t(tv,tv),r=1;return e.exponent=function(e){return arguments.length?1==(r=+e)?t(tv,tv):.5===r?t(tK,tJ):t(tY(r),tY(1/r)):r},tN(e)}function tQ(){var t=tZ(tO());return t.copy=function(){return tx(t,tQ()).exponent(t.exponent())},tj.C.apply(t,arguments),t}function t0(){return tQ.apply(null,arguments).exponent(.5)}function t1(t){return Math.sign(t)*t*t}function t2(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r=o)&&(r=o)}return r}function t3(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function t6(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te))}function t5(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}let t7=new Date,t4=new Date;function t8(t,e,r,n){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),o.round=t=>{let e=o(t),r=o.ceil(t);return t-e(e(t=new Date(+t),null==r?1:Math.floor(r)),t),o.range=(r,n,i)=>{let a,c=[];if(r=o.ceil(r),i=null==i?1:Math.floor(i),!(r0))return c;do c.push(a=new Date(+r)),e(r,i),t(r);while(at8(e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)},(t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}),r&&(o.count=(e,n)=>(t7.setTime(+e),t4.setTime(+n),t(t7),t(t4),Math.floor(r(t7,t4))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(n?e=>n(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let t9=t8(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);t9.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?t8(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):t9:null,t9.range;let et=t8(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());et.range;let ee=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());ee.range;let er=t8(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());er.range;let en=t8(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());en.range;let eo=t8(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());eo.range;let ei=t8(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);ei.range;let ea=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);ea.range;let ec=t8(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function eu(t){return t8(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}ec.range;let el=eu(0),es=eu(1),ef=eu(2),ep=eu(3),eh=eu(4),ey=eu(5),ed=eu(6);function ev(t){return t8(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}el.range,es.range,ef.range,ep.range,eh.range,ey.range,ed.range;let em=ev(0),eb=ev(1),eg=ev(2),ex=ev(3),eO=ev(4),ew=ev(5),ej=ev(6);em.range,eb.range,eg.range,ex.range,eO.range,ew.range,ej.range;let eS=t8(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());eS.range;let eA=t8(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());eA.range;let eP=t8(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());eP.every=t=>isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}):null,eP.range;let eE=t8(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function ek(t,e,r,n,o,i){let a=[[et,1,1e3],[et,5,5e3],[et,15,15e3],[et,30,3e4],[i,1,6e4],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function c(e,r,n){let o=Math.abs(r-e)/n,i=O(([,,t])=>t).right(a,o);if(i===a.length)return t.every(b(e/31536e6,r/31536e6,n));if(0===i)return t9.every(Math.max(b(e,r,n),1));let[c,u]=a[o/a[i-1][2]isFinite(t=Math.floor(t))&&t>0?t8(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null,eE.range;let[eM,e_]=ek(eE,eA,em,ec,eo,er),[eT,eC]=ek(eP,eS,el,ei,en,ee);function eD(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function eI(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function eN(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var eB={"-":"",_:" ",0:"0"},eR=/^\s*\d+/,eL=/^%/,ez=/[\\^$*+?|[\]().{}]/g;function eU(t,e,r){var n=t<0?"-":"",o=(n?-t:t)+"",i=o.length;return n+(i[t.toLowerCase(),e]))}function eX(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function eq(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function eH(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function eV(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function eG(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function eY(t,e,r){var n=eR.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function eK(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function eJ(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function eZ(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function eQ(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function e0(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function e1(t,e,r){var n=eR.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function e2(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function e3(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function e6(t,e,r){var n=eR.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function e5(t,e,r){var n=eR.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function e7(t,e,r){var n=eR.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function e4(t,e,r){var n=eL.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function e8(t,e,r){var n=eR.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function e9(t,e,r){var n=eR.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rt(t,e){return eU(t.getDate(),e,2)}function re(t,e){return eU(t.getHours(),e,2)}function rr(t,e){return eU(t.getHours()%12||12,e,2)}function rn(t,e){return eU(1+ei.count(eP(t),t),e,3)}function ro(t,e){return eU(t.getMilliseconds(),e,3)}function ri(t,e){return ro(t,e)+"000"}function ra(t,e){return eU(t.getMonth()+1,e,2)}function rc(t,e){return eU(t.getMinutes(),e,2)}function ru(t,e){return eU(t.getSeconds(),e,2)}function rl(t){var e=t.getDay();return 0===e?7:e}function rs(t,e){return eU(el.count(eP(t)-1,t),e,2)}function rf(t){var e=t.getDay();return e>=4||0===e?eh(t):eh.ceil(t)}function rp(t,e){return t=rf(t),eU(eh.count(eP(t),t)+(4===eP(t).getDay()),e,2)}function rh(t){return t.getDay()}function ry(t,e){return eU(es.count(eP(t)-1,t),e,2)}function rd(t,e){return eU(t.getFullYear()%100,e,2)}function rv(t,e){return eU((t=rf(t)).getFullYear()%100,e,2)}function rm(t,e){return eU(t.getFullYear()%1e4,e,4)}function rb(t,e){var r=t.getDay();return eU((t=r>=4||0===r?eh(t):eh.ceil(t)).getFullYear()%1e4,e,4)}function rg(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+eU(e/60|0,"0",2)+eU(e%60,"0",2)}function rx(t,e){return eU(t.getUTCDate(),e,2)}function rO(t,e){return eU(t.getUTCHours(),e,2)}function rw(t,e){return eU(t.getUTCHours()%12||12,e,2)}function rj(t,e){return eU(1+ea.count(eE(t),t),e,3)}function rS(t,e){return eU(t.getUTCMilliseconds(),e,3)}function rA(t,e){return rS(t,e)+"000"}function rP(t,e){return eU(t.getUTCMonth()+1,e,2)}function rE(t,e){return eU(t.getUTCMinutes(),e,2)}function rk(t,e){return eU(t.getUTCSeconds(),e,2)}function rM(t){var e=t.getUTCDay();return 0===e?7:e}function r_(t,e){return eU(em.count(eE(t)-1,t),e,2)}function rT(t){var e=t.getUTCDay();return e>=4||0===e?eO(t):eO.ceil(t)}function rC(t,e){return t=rT(t),eU(eO.count(eE(t),t)+(4===eE(t).getUTCDay()),e,2)}function rD(t){return t.getUTCDay()}function rI(t,e){return eU(eb.count(eE(t)-1,t),e,2)}function rN(t,e){return eU(t.getUTCFullYear()%100,e,2)}function rB(t,e){return eU((t=rT(t)).getUTCFullYear()%100,e,2)}function rR(t,e){return eU(t.getUTCFullYear()%1e4,e,4)}function rL(t,e){var r=t.getUTCDay();return eU((t=r>=4||0===r?eO(t):eO.ceil(t)).getUTCFullYear()%1e4,e,4)}function rz(){return"+0000"}function rU(){return"%"}function rF(t){return+t}function r$(t){return Math.floor(t/1e3)}function rW(t){return new Date(t)}function rX(t){return t instanceof Date?+t:+new Date(+t)}function rq(t,e,r,n,o,i,a,c,u,l){var s=tw(),f=s.invert,p=s.domain,h=l(".%L"),y=l(":%S"),d=l("%I:%M"),v=l("%I %p"),m=l("%a %d"),b=l("%b %d"),g=l("%B"),x=l("%Y");function O(t){return(u(t)1)for(var r,n,o,i=1,a=t[e[0]],c=a.length;i=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:rF,s:r$,S:ru,u:rl,U:rs,V:rp,w:rh,W:ry,x:null,X:null,y:rd,Y:rm,Z:rg,"%":rU},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return c[t.getUTCMonth()]},c:null,d:rx,e:rx,f:rA,g:rB,G:rL,H:rO,I:rw,j:rj,L:rS,m:rP,M:rE,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:rF,s:r$,S:rk,u:rM,U:r_,V:rC,w:rD,W:rI,x:null,X:null,y:rN,Y:rR,Z:rz,"%":rU},O={a:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=y.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){var n=f.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,r,n){return S(t,e,r,n)},d:e0,e:e0,f:e7,g:eK,G:eY,H:e2,I:e2,j:e1,L:e5,m:eQ,M:e3,p:function(t,e,r){var n=l.exec(e.slice(r));return n?(t.p=s.get(n[0].toLowerCase()),r+n[0].length):-1},q:eZ,Q:e8,s:e9,S:e6,u:eq,U:eH,V:eV,w:eX,W:eG,x:function(t,e,n){return S(t,r,e,n)},X:function(t,e,r){return S(t,n,e,r)},y:eK,Y:eY,Z:eJ,"%":e4};function w(t,e){return function(r){var n,o,i,a=[],c=-1,u=0,l=t.length;for(r instanceof Date||(r=new Date(+r));++c53)return null;"w"in i||(i.w=1),"Z"in i?(n=(o=(n=eI(eN(i.y,0,1))).getUTCDay())>4||0===o?eb.ceil(n):eb(n),n=ea.offset(n,(i.V-1)*7),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(n=(o=(n=eD(eN(i.y,0,1))).getDay())>4||0===o?es.ceil(n):es(n),n=ei.offset(n,(i.V-1)*7),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:+("W"in i)),o="Z"in i?eI(eN(i.y,0,1)).getUTCDay():eD(eN(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,eI(i)):eD(i)}}function S(t,e,r,n){for(var o,i,a=0,c=e.length,u=r.length;a=u)return -1;if(37===(o=e.charCodeAt(a++))){if(!(i=O[(o=e.charAt(a++))in eB?e.charAt(a++):o])||(n=i(t,r,n))<0)return -1}else if(o!=r.charCodeAt(n++))return -1}return n}return g.x=w(r,g),g.X=w(n,g),g.c=w(e,g),x.x=w(r,x),x.X=w(n,x),x.c=w(e,x),{format:function(t){var e=w(t+="",g);return e.toString=function(){return t},e},parse:function(t){var e=j(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=j(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,c.parse,l=c.utcFormat,c.utcParse;var r2=r(16981),r3=r(60672);function r6(t){for(var e=t.length,r=Array(e);--e>=0;)r[e]=e;return r}function r5(t,e){return t[e]}function r7(t){let e=[];return e.key=t,e}var r4=r(17601),r8=r.n(r4),r9=r(93783),nt=r.n(r9),ne=r(76152),nr=r.n(ne),nn=r(38581),no=r.n(nn),ni=r(11172),na=r.n(ni),nc=r(71247),nu=r.n(nc),nl=r(71852),ns=r.n(nl),nf=r(97262),np=r.n(nf),nh=r(8827),ny=r.n(nh),nd=r(95903),nv=r.n(nd),nm=r(91696),nb=r.n(nm),ng=r(88700),nx=r.n(ng);function nO(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=e?r.apply(void 0,o):t(e-a,nA(function(){for(var t=arguments.length,e=Array(t),n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);rn&&(o=n,i=r),[o,i]}function nL(t,e,r){if(t.lte(0))return new(nx())(0);var n=nC.getDigitCount(t.toNumber()),o=new(nx())(10).pow(n),i=t.div(o),a=1!==n?.05:.1,c=new(nx())(Math.ceil(i.div(a).toNumber())).add(r).mul(a).mul(o);return e?c:new(nx())(Math.ceil(c))}function nz(t,e,r){var n=1,o=new(nx())(t);if(!o.isint()&&r){var i=Math.abs(t);i<1?(n=new(nx())(10).pow(nC.getDigitCount(t)-1),o=new(nx())(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new(nx())(Math.floor(t)))}else 0===t?o=new(nx())(Math.floor((e-1)/2)):r||(o=new(nx())(Math.floor(t)));var a=Math.floor((e-1)/2);return nM(nk(function(t){return o.add(new(nx())(t-a).mul(n)).toNumber()}),nE)(0,e)}var nU=nT(function(t){var e=nI(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),c=nI(nR([r,n]),2),u=c[0],l=c[1];if(u===-1/0||l===1/0){var s=l===1/0?[u].concat(nD(nE(0,o-1).map(function(){return 1/0}))):[].concat(nD(nE(0,o-1).map(function(){return-1/0})),[l]);return r>n?n_(s):s}if(u===l)return nz(u,o,i);var f=function t(e,r,n,o){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((r-e)/(n-1)))return{step:new(nx())(0),tickMin:new(nx())(0),tickMax:new(nx())(0)};var c=nL(new(nx())(r).sub(e).div(n-1),o,a),u=Math.ceil((i=e<=0&&r>=0?new(nx())(0):(i=new(nx())(e).add(r).div(2)).sub(new(nx())(i).mod(c))).sub(e).div(c).toNumber()),l=Math.ceil(new(nx())(r).sub(i).div(c).toNumber()),s=u+l+1;return s>n?t(e,r,n,o,a+1):(s0?l+(n-s):l,u=r>0?u:u+(n-s)),{step:c,tickMin:i.sub(new(nx())(u).mul(c)),tickMax:i.add(new(nx())(l).mul(c))})}(u,l,a,i),p=f.step,h=f.tickMin,y=f.tickMax,d=nC.rangeStep(h,y.add(new(nx())(.1).mul(p)),p);return r>n?n_(d):d});nT(function(t){var e=nI(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),c=nI(nR([r,n]),2),u=c[0],l=c[1];if(u===-1/0||l===1/0)return[r,n];if(u===l)return nz(u,o,i);var s=nL(new(nx())(l).sub(u).div(a-1),i,0),f=nM(nk(function(t){return new(nx())(u).add(new(nx())(t).mul(s)).toNumber()}),nE)(0,a).filter(function(t){return t>=u&&t<=l});return r>n?n_(f):f});var nF=nT(function(t,e){var r=nI(t,2),n=r[0],o=r[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=nI(nR([n,o]),2),c=a[0],u=a[1];if(c===-1/0||u===1/0)return[n,o];if(c===u)return[c];var l=Math.max(e,2),s=nL(new(nx())(u).sub(c).div(l-1),i,0),f=[].concat(nD(nC.rangeStep(new(nx())(c),new(nx())(u).sub(new(nx())(.99).mul(s)),s)),[u]);return n>o?n_(f):f}),n$=r(78813),nW=r(73127),nX=r(6566),nq=r(51955);function nH(t){return(nH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nV(t){return function(t){if(Array.isArray(t))return nG(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nG(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nG(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nG(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!=(e=null==r?void 0:r.length)?e:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var c=o.range,u=0;u0?n[u-1].coordinate:n[a-1].coordinate,s=n[u].coordinate,f=u>=a-1?n[0].coordinate:n[u+1].coordinate,p=void 0;if((0,nW.sA)(s-l)!==(0,nW.sA)(f-s)){var h=[];if((0,nW.sA)(f-s)===(0,nW.sA)(c[1]-c[0])){p=f;var y=s+c[1]-c[0];h[0]=Math.min(y,(y+l)/2),h[1]=Math.max(y,(y+l)/2)}else{p=l;var d=f+c[1]-c[0];h[0]=Math.min(s,(d+s)/2),h[1]=Math.max(s,(d+s)/2)}var v=[Math.min(s,(p+s)/2),Math.max(s,(p+s)/2)];if(t>v[0]&&t<=v[1]||t>=h[0]&&t<=h[1]){i=n[u].index;break}}else{var m=Math.min(l,f),b=Math.max(l,f);if(t>(m+s)/2&&t<=(b+s)/2){i=n[u].index;break}}}else for(var g=0;g 0&&g(r[g].coordinate+r[g-1].coordinate)/2&&t<=(r[g].coordinate+r[g+1].coordinate)/2||g===a-1&&t>(r[g].coordinate+r[g-1].coordinate)/2){i=r[g].index;break}return i},n1=function(t){var e,r,n=t.type.displayName,o=null!=(e=t.type)&&e.defaultProps?nK(nK({},t.type.defaultProps),t.props):t.props,i=o.stroke,a=o.fill;switch(n){case"Line":r=i;break;case"Area":case"Radar":r=i&&"none"!==i?i:a;break;default:r=a}return r},n2=function(t){var e=t.barSize,r=t.totalSize,n=t.stackGroups,o=void 0===n?{}:n;if(!o)return{};for(var i={},a=Object.keys(o),c=0,u=a.length;c=0});if(v&&v.length){var m=v[0].type.defaultProps,b=void 0!==m?nK(nK({},m),v[0].props):v[0].props,g=b.barSize,x=b[d];i[x]||(i[x]=[]);var O=nr()(g)?e:g;i[x].push({item:v[0],stackList:v.slice(1),barSize:nr()(O)?void 0:(0,nW.F4)(O,r,0)})}}return i},n3=function(t){var e,r=t.barGap,n=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=void 0===i?[]:i,c=t.maxBarSize,u=a.length;if(u<1)return null;var l=(0,nW.F4)(r,o,0,!0),s=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=o/u,h=a.reduce(function(t,e){return t+e.barSize||0},0);(h+=(u-1)*l)>=o&&(h-=(u-1)*l,l=0),h>=o&&p>0&&(f=!0,p*=.9,h=u*p);var y={offset:((o-h)/2|0)-l,size:0};e=a.reduce(function(t,e){var r={item:e.item,position:{offset:y.offset+y.size+l,size:f?p:e.barSize}},n=[].concat(nV(t),[r]);return y=n[n.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:y})}),n},s)}else{var d=(0,nW.F4)(n,o,0,!0);o-2*d-(u-1)*l<=0&&(l=0);var v=(o-2*d-(u-1)*l)/u;v>1&&(v>>=0);var m=c===+c?Math.min(v,c):v;e=a.reduce(function(t,e,r){var n=[].concat(nV(t),[{item:e.item,position:{offset:d+(v+l)*r+(v-m)/2,size:m}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:n[n.length-1].position})}),n},s)}return e},n6=function(t,e,r,n){var o=r.children,i=r.width,a=r.margin,c=i-(a.left||0)-(a.right||0),u=(0,nq.g)({children:o,legendWidth:c});if(u){var l=n||{},s=l.width,f=l.height,p=u.align,h=u.verticalAlign,y=u.layout;if(("vertical"===y||"horizontal"===y&&"middle"===h)&&"center"!==p&&(0,nW.Et)(t[p]))return nK(nK({},t),{},nJ({},p,t[p]+(s||0)));if(("horizontal"===y||"vertical"===y&&"center"===p)&&"middle"!==h&&(0,nW.Et)(t[h]))return nK(nK({},t),{},nJ({},h,t[h]+(f||0)))}return t},n5=function(t,e,r,n,o){var i=e.props.children,a=(0,nX.aS)(i,n$.u).filter(function(t){var e;return e=t.props.direction,!!nr()(o)||("horizontal"===n?"yAxis"===o:"vertical"===n||"x"===e?"xAxis"===o:"y"!==e||"yAxis"===o)});if(a&&a.length){var c=a.map(function(t){return t.props.dataKey});return t.reduce(function(t,e){var n=nZ(e,r);if(nr()(n))return t;var o=Array.isArray(n)?[nt()(n),r8()(n)]:[n,n],i=c.reduce(function(t,r){var n=nZ(e,r,0),i=o[0]-Math.abs(Array.isArray(n)?n[0]:n),a=o[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(i,t[0]),Math.max(a,t[1])]},[1/0,-1/0]);return[Math.min(i[0],t[0]),Math.max(i[1],t[1])]},[1/0,-1/0])}return null},n7=function(t,e,r,n,o){var i=e.map(function(e){return n5(t,e,r,o,n)}).filter(function(t){return!nr()(t)});return i&&i.length?i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]):null},n4=function(t,e,r,n,o){var i=e.map(function(e){var i=e.props.dataKey;return"number"===r&&i&&n5(t,e,i,n)||nQ(t,i,r,o)});if("number"===r)return i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]);var a={};return i.reduce(function(t,e){for(var r=0,n=e.length;r=2?2*(0,nW.sA)(a[0]-a[1])*u:u,e&&(t.ticks||t.niceTicks))?(t.ticks||t.niceTicks).map(function(t){return{coordinate:n(o?o.indexOf(t):t)+u,value:t,offset:u}}).filter(function(t){return!np()(t.coordinate)}):t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(t,e){return{coordinate:n(t)+u,value:t,index:e,offset:u}}):n.ticks&&!r?n.ticks(t.tickCount).map(function(t){return{coordinate:n(t)+u,value:t,offset:u}}):n.domain().map(function(t,e){return{coordinate:n(t)+u,value:o?o[t]:t,index:e,offset:u}})},oe=new WeakMap,or=function(t,e){if("function"!=typeof e)return t;oe.has(t)||oe.set(t,new WeakMap);var r=oe.get(t);if(r.has(e))return r.get(e);var n=function(){t.apply(void 0,arguments),e.apply(void 0,arguments)};return r.set(e,n),n},on=function(t,e,r){var n=t.scale,o=t.type,i=t.layout,a=t.axisType;if("auto"===n)return"radial"===i&&"radiusAxis"===a?{scale:f.A(),realScaleType:"band"}:"radial"===i&&"angleAxis"===a?{scale:tB(),realScaleType:"linear"}:"category"===o&&e&&(e.indexOf("LineChart")>=0||e.indexOf("AreaChart")>=0||e.indexOf("ComposedChart")>=0&&!r)?{scale:f.z(),realScaleType:"point"}:"category"===o?{scale:f.A(),realScaleType:"band"}:{scale:tB(),realScaleType:"linear"};if(na()(n)){var c="scale".concat(ny()(n));return{scale:(s[c]||f.z)(),realScaleType:s[c]?c:"point"}}return no()(n)?{scale:n}:{scale:f.z(),realScaleType:"point"}},oo=function(t){var e=t.domain();if(e&&!(e.length<=2)){var r=e.length,n=t.range(),o=Math.min(n[0],n[1])-1e-4,i=Math.max(n[0],n[1])+1e-4,a=t(e[0]),c=t(e[r-1]);(ai||c