feat(webui): finish redesign dashboard task and secret settings

This commit is contained in:
sam committed 2026-10-13 16:41:35 +11:00
1 parent 858e99ef4c
commit bbbb527721
42 files changed
+1090 -502

No files matched your search

+3 -2
View File
@@ -698,8 +698,9 @@ func (b *boot) publishConfig(ctx context.Context, cfg config.Config) {
func (b *boot) configViewInput() webui.ConfigViewInput {
catalog := b.catalogState()
in := webui.ConfigViewInput{
Config: b.cfgHolder.Get(),
Catalog: catalogView(catalog),
Config: b.cfgHolder.Get(),
Catalog: catalogView(catalog),
SecretEngines: b.secrets.List(),
}
if b.lastReload != nil {
status := b.lastReload()
+1
View File
@@ -17,5 +17,6 @@ func (b *boot) startSecretEngines(ctx context.Context, client *staterpc.Client)
b.applyStatus.Report(ctx, controlplanerpc.ExtensionSettingsKind, version, err)
}
runner := secretengine.Supervise(ctx, b.secrets, source, b.processName, report, b.log)
runner.OnChange(func() { b.publishConfigSnapshot(ctx) })
b.addCleanup(runner.Close)
}
+5 -3
View File
@@ -9,6 +9,7 @@ import (
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/secret"
"github.com/samcharles93/archie-core/internal/skill"
)
@@ -25,9 +26,10 @@ func (b *server) setSkillList(entries []skill.CatalogEntry) {
// channels, so channel reload is left unset and answers Unavailable.
func (b *server) chatCatalog() gatewayrpc.Catalog {
return gatewayrpc.Catalog{
Logs: b.recentLogs,
Skills: b.skillEntries,
Curators: b.curatorStates,
CheckSecret: func(ref secret.SecretRef) bool { _, err := b.secrets.Resolve(ref); return err == nil },
Logs: b.recentLogs,
Skills: b.skillEntries,
Curators: b.curatorStates,
}
}
+1
View File
@@ -151,6 +151,7 @@ func wireCatalog(d deps, srv *webui.Server) {
}
srv.Skills = skillCatalog{client: catalog}
srv.Curators = curatorStatus{client: catalog}
srv.CheckSecret = catalog.CheckSecret
}
// wireTaskLogs attaches the task-log read when the store client carries the
File diff suppressed because it is too large. Load diff
@@ -46,6 +46,7 @@ const (
ChatService_ListSkills_FullMethodName = "/gateway.v1.ChatService/ListSkills"
ChatService_CuratorHealth_FullMethodName = "/gateway.v1.ChatService/CuratorHealth"
ChatService_ReloadChannel_FullMethodName = "/gateway.v1.ChatService/ReloadChannel"
ChatService_CheckSecret_FullMethodName = "/gateway.v1.ChatService/CheckSecret"
)
// ChatServiceClient is the client API for ChatService service.
@@ -79,6 +80,8 @@ type ChatServiceClient interface {
ListSkills(ctx context.Context, in *ListSkillsRequest, opts ...grpc.CallOption) (*ListSkillsResponse, error)
CuratorHealth(ctx context.Context, in *CuratorHealthRequest, opts ...grpc.CallOption) (*CuratorHealthResponse, error)
ReloadChannel(ctx context.Context, in *ReloadChannelRequest, opts ...grpc.CallOption) (*ReloadChannelResponse, error)
// CheckSecret reports resolution in this process without returning a value.
CheckSecret(ctx context.Context, in *CheckSecretRequest, opts ...grpc.CallOption) (*CheckSecretResponse, error)
}
type chatServiceClient struct {
@@ -368,6 +371,16 @@ func (c *chatServiceClient) ReloadChannel(ctx context.Context, in *ReloadChannel
return out, nil
}
func (c *chatServiceClient) CheckSecret(ctx context.Context, in *CheckSecretRequest, opts ...grpc.CallOption) (*CheckSecretResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckSecretResponse)
err := c.cc.Invoke(ctx, ChatService_CheckSecret_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ChatServiceServer is the server API for ChatService service.
// All implementations must embed UnimplementedChatServiceServer
// for forward compatibility.
@@ -399,6 +412,8 @@ type ChatServiceServer interface {
ListSkills(context.Context, *ListSkillsRequest) (*ListSkillsResponse, error)
CuratorHealth(context.Context, *CuratorHealthRequest) (*CuratorHealthResponse, error)
ReloadChannel(context.Context, *ReloadChannelRequest) (*ReloadChannelResponse, error)
// CheckSecret reports resolution in this process without returning a value.
CheckSecret(context.Context, *CheckSecretRequest) (*CheckSecretResponse, error)
mustEmbedUnimplementedChatServiceServer()
}
@@ -490,6 +505,9 @@ func (UnimplementedChatServiceServer) CuratorHealth(context.Context, *CuratorHea
func (UnimplementedChatServiceServer) ReloadChannel(context.Context, *ReloadChannelRequest) (*ReloadChannelResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ReloadChannel not implemented")
}
func (UnimplementedChatServiceServer) CheckSecret(context.Context, *CheckSecretRequest) (*CheckSecretResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CheckSecret not implemented")
}
func (UnimplementedChatServiceServer) mustEmbedUnimplementedChatServiceServer() {}
func (UnimplementedChatServiceServer) testEmbeddedByValue() {}
@@ -990,6 +1008,24 @@ func _ChatService_ReloadChannel_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _ChatService_CheckSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckSecretRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatServiceServer).CheckSecret(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChatService_CheckSecret_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatServiceServer).CheckSecret(ctx, req.(*CheckSecretRequest))
}
return interceptor(ctx, in, info, handler)
}
// ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -1101,6 +1137,10 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ReloadChannel",
Handler: _ChatService_ReloadChannel_Handler,
},
{
MethodName: "CheckSecret",
Handler: _ChatService_CheckSecret_Handler,
},
},
Streams: []grpc.StreamDesc{
{
+1
View File
@@ -45,6 +45,7 @@ var dashboardPages = []DashboardPage{
{Path: "/settings/tools", Label: "Tools & MCP", Description: "The tools agents can call, and the MCP servers that add more."},
{Path: "/settings/history", Label: "History", Description: "Every settings change: who made it, when, and what it was before."},
{Path: "/settings/plugins", Label: "Plugins", Description: "Directories Archie loads extensions from at startup."},
{Path: "/settings/secret-engines", Label: "Secret engines", Description: "Available secret engines."},
{Path: "/settings/container-runtime", Label: "Container runtime", Description: "The containers agents run in."},
{Path: "/settings/harness", Label: "Harness", Description: "OAuth credential bindings and the Kit setup terminal."},
}
@@ -8,7 +8,9 @@ import (
"google.golang.org/grpc/status"
pb "github.com/samcharles93/archie-core/internal/contracts/gateway/v1"
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/secret"
)
// SkillEntry is one catalogued skill as the Skills page shows it: what it does
@@ -44,6 +46,7 @@ type CuratorAction struct {
// ChatService. A zero Catalog answers empty lists and an Unavailable reload,
// which is the honest answer from a process that hosts none of them.
type Catalog struct {
CheckSecret func(secret.SecretRef) bool
Logs func(context.Context, string, logging.Query) (logging.Result, error)
Skills func() []SkillEntry
Curators func(context.Context) []CuratorState
@@ -53,6 +56,7 @@ type Catalog struct {
// CatalogClient is the subset of the Gateway client the dashboard's catalog
// surfaces consume.
type CatalogClient interface {
CheckSecret(context.Context, secret.SecretRef) (bool, error)
ListSkills(ctx context.Context) ([]SkillEntry, error)
CuratorHealth(ctx context.Context) ([]CuratorState, error)
ReloadChannel(ctx context.Context, id string) error
@@ -60,6 +64,27 @@ type CatalogClient interface {
var _ CatalogClient = (*Client)(nil)
func (s *server) CheckSecret(ctx context.Context, r *pb.CheckSecretRequest) (*pb.CheckSecretResponse, error) {
if p, ok := access.PrincipalFromContext(ctx); ok && !p.InstanceAdmin() {
return nil, status.Error(codes.PermissionDenied, "instance administrator required")
}
if r.Engine == "" || r.Key == "" {
return nil, status.Error(codes.InvalidArgument, "engine and key are required")
}
if s.catalog.CheckSecret == nil {
return nil, status.Error(codes.Unavailable, "secret resolution unavailable")
}
return &pb.CheckSecretResponse{Resolved: s.catalog.CheckSecret(secret.SecretRef{Engine: r.Engine, Key: r.Key})}, nil
}
func (c *Client) CheckSecret(ctx context.Context, ref secret.SecretRef) (bool, error) {
result, err := c.client.CheckSecret(ctx, &pb.CheckSecretRequest{Engine: ref.Engine, Key: ref.Key})
if err != nil {
return false, err
}
return result.Resolved, nil
}
func (s *server) ListSkills(_ context.Context, _ *pb.ListSkillsRequest) (*pb.ListSkillsResponse, error) {
if s.catalog.Skills == nil {
return &pb.ListSkillsResponse{}, nil
@@ -0,0 +1,56 @@
package gatewayrpc
import (
"context"
"strings"
"testing"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/encoding/protojson"
pb "github.com/samcharles93/archie-core/internal/contracts/gateway/v1"
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/domain/org"
"github.com/samcharles93/archie-core/internal/secret"
)
func TestSecretCheckBoundary(t *testing.T) {
t.Setenv("ARCHIE_SECRET_CHECK_TEST", "never-return-this-value")
registry := secret.NewRegistry()
s := server{catalog: Catalog{CheckSecret: func(ref secret.SecretRef) bool { _, err := registry.Resolve(ref); return err == nil }}}
owner := access.Principal{Org: org.DefaultOrgID, Memberships: []org.Membership{{OrgID: org.DefaultOrgID, Role: org.RoleOwner}}}
for _, tc := range []struct {
name string
principal access.Principal
engine, key string
code codes.Code
resolved bool
}{
{"resolved", owner, "env", "ARCHIE_SECRET_CHECK_TEST", codes.OK, true},
{"missing", owner, "env", "ARCHIE_SECRET_CHECK_MISSING", codes.OK, false},
{"unknown engine", owner, "uninstalled", "key", codes.OK, false},
{"empty reference", owner, "", "", codes.InvalidArgument, false},
{"member cannot probe", access.Principal{Org: org.DefaultOrgID}, "env", "ARCHIE_SECRET_CHECK_TEST", codes.PermissionDenied, false},
{"other org cannot probe", access.Principal{Org: "other"}, "env", "ARCHIE_SECRET_CHECK_TEST", codes.PermissionDenied, false},
} {
t.Run(tc.name, func(t *testing.T) {
response, err := s.CheckSecret(access.WithPrincipal(context.Background(), tc.principal), &pb.CheckSecretRequest{Engine: tc.engine, Key: tc.key})
if status.Code(err) != tc.code {
t.Fatalf("code = %s, want %s", status.Code(err), tc.code)
}
if err == nil {
if response.Resolved != tc.resolved {
t.Fatalf("resolved = %v, want %v", response.Resolved, tc.resolved)
}
body, err := protojson.Marshal(response)
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(body), "never-return-this-value") {
t.Fatal("secret value leaked")
}
}
})
}
}
@@ -41,11 +41,13 @@ func (*Plugin) GRPCClient(_ context.Context, _ *goplugin.GRPCBroker, c *grpc.Cli
// Engine resolves secrets through a running extension.
type Engine struct {
name string
client secretenginev1.SecretEngineServiceClient
name string
version string
client secretenginev1.SecretEngineServiceClient
}
func (e *Engine) Name() string { return e.name }
func (e *Engine) Name() string { return e.name }
func (e *Engine) Version() string { return e.version }
// Resolve returns the value for key. A key the engine does not hold is an
// error, as it is for every engine.
@@ -180,6 +180,7 @@ func (r *Runner) ensure(ctx context.Context, pkg storepkg.Installed, setting con
if err != nil {
return err
}
engine.version = pkg.Descriptor.Version
r.registry.Register(engine)
r.running[pkg.Name] = runningEngine{digest: pkg.Digest, settings: string(encoded)}
return nil
@@ -249,7 +249,7 @@ func TestRunnerRunsOnlyWhatIsAcceptedAndEnabled(t *testing.T) {
}
source := &fakeSource{pkg: storepkg.Installed{
Name: "echo", Digest: "sha256:" + strings.Repeat("a", 64),
Descriptor: storepkg.Descriptor{Contributes: storepkg.Contributions{
Descriptor: storepkg.Descriptor{Version: "1.2.3", Contributes: storepkg.Contributions{
Extensions: []storepkg.Extension{{Surface: storepkg.SurfaceSecretEngine, Path: "bin/echo"}},
}},
Layer: layerOf(t, "bin/echo", binary),
@@ -296,12 +296,19 @@ func TestRunnerRunsOnlyWhatIsAcceptedAndEnabled(t *testing.T) {
if !changed() {
t.Fatal("starting an engine must report a change, so references resolve again")
}
listed := registry.List()
if len(listed) != 2 || listed[0].Name != "echo" || listed[0].Version != "1.2.3" || listed[0].Source != "extension" || listed[1].Name != "env" || listed[1].Source != "built-in" {
t.Fatalf("registered engines: %+v", listed)
}
source.settings.Extensions[0].Enabled = false
sync()
if registered() || host.Alive("echo") {
t.Fatal("a disabled extension must be unregistered and its process stopped")
}
if listed := registry.List(); len(listed) != 1 || listed[0].Name != "env" {
t.Fatalf("disabled engine remains listed: %+v", listed)
}
if !changed() {
t.Fatal("stopping an engine must report a change")
}
+5 -2
View File
@@ -269,8 +269,11 @@ func walkWindow(data []byte, windowStart, from int64, q Query, step func(e Entry
if len(raw) > 0 && raw[len(raw)-1] == '\r' {
raw = raw[:len(raw)-1] // CRLF
}
if entry, decoded := decode(raw); decoded && q.matches(entry) && !step(entry, windowStart+pos, endOff) {
return endOff
if entry, decoded := decode(raw); decoded && q.matches(entry) {
entry.ID = endOff
if !step(entry, windowStart+pos, endOff) {
return endOff
}
}
if nl < 0 {
return windowStart + int64(len(data))
+41
View File
@@ -0,0 +1,41 @@
package logging
import (
"os"
"path/filepath"
"testing"
)
func TestLogLineIdentity(t *testing.T) {
path := filepath.Join(t.TempDir(), "attempt.jsonl")
first := "{\"level\":\"INFO\",\"msg\":\"started\"}\n"
second := "{\"level\":\"ERROR\",\"msg\":\"failed\"}\n"
if err := os.WriteFile(path, []byte(first+second), 0o600); err != nil {
t.Fatal(err)
}
for _, tc := range []struct {
name string
query Query
before int64
want []int64
}{
{"all", Query{Limit: 10}, 0, []int64{int64(len(first)), int64(len(first + second))}},
{"filtered", Query{Limit: 10, Levels: []string{"ERROR"}}, 0, []int64{int64(len(first + second))}},
{"older", Query{Limit: 10}, int64(len(first)), []int64{int64(len(first))}},
} {
t.Run(tc.name, func(t *testing.T) {
page, err := PageBefore(path, tc.query, tc.before)
if err != nil {
t.Fatal(err)
}
if len(page.Entries) != len(tc.want) {
t.Fatalf("entries = %d, want %d", len(page.Entries), len(tc.want))
}
for i, want := range tc.want {
if page.Entries[i].ID != want {
t.Fatalf("entry ID = %d, want %d", page.Entries[i].ID, want)
}
}
})
}
}
+25
View File
@@ -31,6 +31,31 @@ type Registry struct {
engines map[string]Engine // name → engine
}
// EngineInfo describes an installed engine without exposing credentials.
type EngineInfo struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
Source string `json:"source"`
}
func (r *Registry) List() []EngineInfo {
r.mu.RLock()
defer r.mu.RUnlock()
out := make([]EngineInfo, 0, len(r.engines))
for name, engine := range r.engines {
info := EngineInfo{Name: name, Source: "extension"}
if _, ok := engine.(*envEngine); ok {
info.Source = "built-in"
}
if versioned, ok := engine.(interface{ Version() string }); ok {
info.Version = versioned.Version()
}
out = append(out, info)
}
sort.Slice(out, func(i, j int) bool { return out[i].Name < out[j].Name })
return out
}
// Register adds an engine. If an engine with the same name already
// exists, it is replaced (last-write-wins for overrides).
func (r *Registry) Register(e Engine) {
+4
View File
@@ -13,6 +13,7 @@ import (
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/domain/storecontract"
"github.com/samcharles93/archie-core/internal/infrastructure/configuration"
"github.com/samcharles93/archie-core/internal/secret"
)
// ChannelView is one conversational front-end as shown on the dashboard's
@@ -111,6 +112,7 @@ func channelStateDetail(state status.State, configured bool) string {
// ConfigView is the daemon's secret-free snapshot for dashboard handlers.
// Only catalog, review and reload are exposed by /api/config.
type ConfigView struct {
SecretEngines []secret.EngineInfo `json:"secret_engines"`
Identity IdentityView `json:"identity"`
Repositories []ForgeRepoView `json:"repositories"`
Review ReviewView `json:"review"`
@@ -207,6 +209,7 @@ func (s *Server) handleConfig(w http.ResponseWriter, r *http.Request) {
// owner assembles it: the config snapshot plus the display data it holds
// alongside, already resolved, so building the view is pure and cannot fail.
type ConfigViewInput struct {
SecretEngines []secret.EngineInfo
// Config is one snapshot, read once. Under a Holder a reload swaps the
// whole value, which is what a read-only view always wanted.
Config config.Config
@@ -232,6 +235,7 @@ type CatalogProviderView struct {
func BuildConfigView(in ConfigViewInput) ConfigView {
cfg := in.Config
return ConfigView{
SecretEngines: append([]secret.EngineInfo{}, in.SecretEngines...),
Identity: IdentityView{BotUser: cfg.BotUser, ForgeType: cfg.Forge.Type, ForgeHost: cfg.Forge.Host},
Repositories: reposView(cfg.Repos),
MultiIdentity: len(cfg.Identities) > 0,
+45
View File
@@ -0,0 +1,45 @@
package webui
import (
"net/http"
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/secret"
)
func (s *Server) handleSecretEngines(w http.ResponseWriter, r *http.Request) {
view, found, err := s.configSource()(r.Context())
if err != nil || !found || view.SecretEngines == nil {
http.Error(w, "secret engine report unavailable", http.StatusServiceUnavailable)
return
}
writeJSON(w, map[string]any{"engines": view.SecretEngines})
}
func (s *Server) handleSecretCheck(w http.ResponseWriter, r *http.Request) {
if !s.authorizeTaskMutation(w, r) {
return
}
if p, ok := access.PrincipalFromContext(r.Context()); ok && !p.InstanceAdmin() {
http.Error(w, "instance administrator required", http.StatusForbidden)
return
}
ref, ok := decodeBody[secret.SecretRef](w, r)
if !ok {
return
}
if ref.Engine == "" || ref.Key == "" {
http.Error(w, "engine and key are required", http.StatusBadRequest)
return
}
if s.CheckSecret == nil {
http.Error(w, "secret resolution unavailable", http.StatusServiceUnavailable)
return
}
resolved, err := s.CheckSecret(r.Context(), ref)
if err != nil {
http.Error(w, "secret resolution unavailable", http.StatusServiceUnavailable)
return
}
writeJSON(w, map[string]any{"resolved": resolved, "process": "archie-gateway"})
}
+52
View File
@@ -0,0 +1,52 @@
package webui
import (
"context"
"errors"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/domain/org"
"github.com/samcharles93/archie-core/internal/secret"
)
func TestSecretCheckHTTPBoundary(t *testing.T) {
owner := access.Principal{Org: org.DefaultOrgID, Memberships: []org.Membership{{OrgID: org.DefaultOrgID, Role: org.RoleOwner}}}
for _, tc := range []struct {
name string
principal access.Principal
body string
csrf bool
resolveErr error
want int
}{
{"owner", owner, `{"engine":"env","key":"KEY"}`, true, nil, http.StatusOK},
{"member", access.Principal{Org: org.DefaultOrgID}, `{"engine":"env","key":"KEY"}`, true, nil, http.StatusForbidden},
{"invalid", owner, `{"engine":"env"}`, true, nil, http.StatusBadRequest},
{"cross origin form", owner, `{"engine":"env","key":"KEY"}`, false, nil, http.StatusForbidden},
{"failure is value free", owner, `{"engine":"env","key":"KEY"}`, true, errors.New("never-return-this-value"), http.StatusServiceUnavailable},
} {
t.Run(tc.name, func(t *testing.T) {
s := Server{CheckSecret: func(context.Context, secret.SecretRef) (bool, error) { return true, tc.resolveErr }}
req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/api/secret-references/check", strings.NewReader(tc.body))
req.Header.Set("Content-Type", "application/json")
if tc.csrf {
req.Header.Set("X-Archie-CSRF", "1")
} else {
req.Header.Set("Origin", "https://outside.example")
}
req = req.WithContext(access.WithPrincipal(req.Context(), tc.principal))
out := httptest.NewRecorder()
s.handleSecretCheck(out, req)
if out.Code != tc.want {
t.Fatalf("status = %d, want %d: %s", out.Code, tc.want, out.Body.String())
}
if strings.Contains(out.Body.String(), "never-return-this-value") {
t.Fatal("secret error leaked")
}
})
}
}
+4
View File
@@ -22,6 +22,7 @@ import (
"github.com/samcharles93/archie-core/internal/events"
"github.com/samcharles93/archie-core/internal/infrastructure/captureintake"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/secret"
"github.com/samcharles93/archie-core/ui"
)
@@ -42,6 +43,7 @@ type Server struct {
// only displays configuration; unset means this process builds the view
// from the configuration it holds (LocalConfigView).
ConfigSource ConfigViewSource
CheckSecret func(context.Context, secret.SecretRef) (bool, error)
// LogFeed is the daemon diagnostic stream. It is separate from Events,
// which contains persisted task lifecycle activity only.
@@ -356,6 +358,8 @@ func (s *Server) registerConfigAndLogRoutes(mux *http.ServeMux) {
mux.HandleFunc("POST /api/identities", instanceOnly(s.handleIdentityCreate))
mux.HandleFunc("POST /api/identities/{id}/{command}", instanceOnly(s.handleIdentityCommand))
mux.HandleFunc("GET /api/config", instanceOnly(s.handleConfig))
mux.HandleFunc("GET /api/secret-engines", instanceOnly(s.handleSecretEngines))
mux.HandleFunc("POST /api/secret-references/check", instanceOnly(s.handleSecretCheck))
mux.HandleFunc("GET /api/logs", instanceOnly(s.handleLogs))
}
+8
View File
@@ -34,8 +34,16 @@ service ChatService {
rpc ListSkills(ListSkillsRequest) returns (ListSkillsResponse);
rpc CuratorHealth(CuratorHealthRequest) returns (CuratorHealthResponse);
rpc ReloadChannel(ReloadChannelRequest) returns (ReloadChannelResponse);
// CheckSecret reports resolution in this process without returning a value.
rpc CheckSecret(CheckSecretRequest) returns (CheckSecretResponse);
}
message CheckSecretRequest {
string engine = 1;
string key = 2;
}
message CheckSecretResponse { bool resolved = 1; }
message Session {
string session_id = 1;
string platform = 2;
+1 -1
View File
@@ -1,3 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as _,O as v,Pn as y,Qn as b,R as x,Rn as ee,S as te,Sn as S,St as C,U as w,Un as ne,Ut as T,V as E,Vn as re,Wn as D,Wt as O,Xn as k,Y as ie,Yn as A,Zn as j,_ as M,_n as ae,dn as oe,g as se,ht as N,i as P,ir as ce,jn as le,kn as F,kt as ue,l as de,lt as I,m as fe,mn as pe,mt as me,n as he,nt as ge,on as _e,ot as ve,pt as ye,qn as be,r as xe,rn as Se,s as Ce,tt as we,w as Te,wn as Ee,x as De,xn as Oe,y as ke,yn as Ae,yt as je,z as Me,zn as L}from"./PageHeader.js";var Ne=void 0,Pe=typeof window<`u`&&window.trustedTypes;if(Pe)try{Ne=Pe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Fe=Ne?e=>Ne.createHTML(e):e=>e,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1998/Math/MathML`,R=typeof document<`u`?document:null,Re=R&&R.createElement(`template`),ze={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?R.createElementNS(Ie,e):t===`mathml`?R.createElementNS(Le,e):n?R.createElement(e,{is:n}):R.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>R.createTextNode(e),createComment:e=>R.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>R.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Re.innerHTML=Fe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Re.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},z=`transition`,Be=`animation`,Ve=Symbol(`_vtc`),He={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ue=y({},xe,He),We=(e=>(e.displayName=`Transition`,e.props=Ue,e))((e,{slots:t})=>E(he,qe(e),t)),Ge=(e,t=[])=>{L(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ke=e=>e?L(e)?e.some(e=>e.length>1):e.length>1:!1;function qe(e){let t={};for(let n in e)n in He||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Je(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:b,onLeave:x,onLeaveCancelled:ee,onBeforeAppear:te=_,onAppear:S=v,onAppearCancelled:C=b}=t,w=(e,t,n,r)=>{e._enterCancelled=r,V(e,t?u:s),V(e,t?l:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,V(e,d),V(e,p),V(e,f),t&&t()},T=e=>(t,n)=>{let i=e?S:v,o=()=>w(t,e,n);Ge(i,[t,o]),Xe(()=>{V(t,e?c:a),B(t,e?u:s),Ke(i)||Qe(t,r,h,o)})};return y(t,{onBeforeEnter(e){Ge(_,[e]),B(e,a),B(e,o)},onBeforeAppear(e){Ge(te,[e]),B(e,c),B(e,l)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);B(e,d),e._enterCancelled?(B(e,f),nt(e)):(nt(e),B(e,f)),Xe(()=>{e._isLeaving&&(V(e,d),B(e,p),Ke(x)||Qe(e,r,g,n))}),Ge(x,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),Ge(b,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),Ge(C,[e])},onLeaveCancelled(e){ne(e),Ge(ee,[e])}})}function Je(e){if(e==null)return null;if(u(e))return[Ye(e.enter),Ye(e.leave)];{let t=Ye(e);return[t,t]}}function Ye(e){return ce(e)}function B(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ve]||(e[Ve]=new Set)).add(t)}function V(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ve];n&&(n.delete(t),n.size||(e[Ve]=void 0))}function Xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ze=0;function Qe(e,t,n,r){let i=e._endId=++Ze,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=$e(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function $e(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${z}Delay`),a=r(`${z}Duration`),o=et(i,a),s=r(`${Be}Delay`),c=r(`${Be}Duration`),l=et(s,c),u=null,d=0,f=0;t===z?o>0&&(u=z,d=o,f=a.length):t===Be?l>0&&(u=Be,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?z:Be:null,f=u?u===z?a.length:c.length:0);let p=u===z&&/\b(?:transform|all)(?:,|$)/.test(r(`${z}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function et(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)Line truncated
`))),e[W]=U(i);let a=r||i.props&&i.props.type===`number`;H(e,t?`change`:`input`,t=>{t.target.composing||e[W](on(e.value,n,a))}),(n||a)&&H(e,`change`,()=>{e.value=on(e.value,n,a)}),t||(H(e,`compositionstart`,nn),H(e,`compositionend`,rn),H(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[an];delete e[an],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[W](on(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[W]=U(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?j(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cn={deep:!0,created(e,t,n){e[W]=U(n),H(e,`change`,()=>{let t=e._modelValue,n=mn(e),r=e.checked,i=e[W];if(L(t)){let e=k(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hn(e,r))})},mounted:ln,beforeUpdate(e,t,n){e[W]=U(n),ln(e,t,n)}};function ln(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(L(t))i=k(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=A(t,hn(e,!0))}e.checked!==i&&(e.checked=i)}var un={created(e,{value:t},n){e.checked=A(t,n.props.value),e[W]=U(n),H(e,`change`,()=>{e[W](mn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[W]=U(r),t!==n&&(e.checked=A(t,r.props.value))}},dn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,H(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?j(mn(e)):mn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?L(i)?t.slice():t:i];try{e[W](i)}finally{ge(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[W]=U(r)},mounted(e,{value:t}){pn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[W]=U(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fn(t,n[1],n[0]))&&pn(e,t)}};function fn(e,t,n){if(!n||L(e))return A(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pn(e,t){let n=e.multiple,r=L(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=mn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):k(t,o)>-1}else a.selected=t.has(o)}else if(A(mn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return`_value`in e?e._value:e.value}function hn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gn={created(e,t,n){vn(e,t,n,null,`created`)},mounted(e,t,n){vn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vn(e,t,n,r,`updated`)}};function _n(e,t){switch(e){case`SELECT`:return dn;case`TEXTAREA`:return sn;default:switch(t){case`checkbox`:return cn;case`radio`:return un;default:return sn}}}function vn(e,t,n,r,i){let a=_n(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function yn(){sn.getSSRProps=({value:e})=>({value:e}),un.getSSRProps=({value:e},t)=>{if(t.props&&A(t.props.value,e))return{checked:!0}},cn.getSSRProps=({value:e},t)=>{if(L(e)){if(t.props&&k(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=_n(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var bn=[`ctrl`,`shift`,`alt`,`meta`],xn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>bn.some(n=>e[`${n}Key`]&&!t.includes(n))},Sn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=xn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Cn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},wn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Cn[e]===r))return e(n)}))},Tn=y({patchProp:Ft},ze),En,Dn=!1;function On(){return En||=Te(Tn)}function kn(){return En=Dn?En:te(Tn),Dn=!0,En}var An=((...e)=>{On().render(...e)}),jn=((...e)=>{kn().hydrate(...e)}),Mn=((...e)=>{let t=On().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Fn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Pn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Nn=((...e)=>{let t=kn().createApp(...e),{mount: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ti;function Ei(e){Ti=e}var Di=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Oi(e){let t=e instanceof Di?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function ki(e,t){let n=await fetch(e,t);if(Ti?.(n.status===401),!n.ok)throw new Di(await wi(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ci,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await ki(e,s);return a?await c.json():void 0}var Ai={health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await ki(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ti;function Ei(e){Ti=e}var Di=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Oi(e){let t=e instanceof Di?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function ki(e,t){let n=await fetch(e,t);if(Ti?.(n.status===401),!n.ok)throw new Di(await wi(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ci,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await ki(e,s);return a?await c.json():void 0}var Ai={secretEngines:()=>$(`/api/secret-engines`),checkSecret:e=>$(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await ki(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELLine truncated
+1 -1
View File
@@ -1 +1 @@
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reLine truncated
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reLine truncated
+64 -64
View File
@@ -10,59 +10,59 @@ import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J a
Defaulting to \`null\`.`),null)}function $s(e){return Zs(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Js}\`.`),Js)}var ec=A({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Js},getValueLabel:{type:Function,required:!1,default:(e,t)=>Zs(e)?`${Math.round(e/t*Js)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;p();let i=x(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=x(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=Qs(e,n.max);t!==e&&(await ot(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=$s(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=L(()=>ai(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Xs({modelValue:i,max:a,progressState:o}),(t,n)=>(z(),J(B(Mt),{"as-child":e.asChild,as:e.as,"aria-valuemax":B(a),"aria-valuemin":0,"aria-valuenow":Zs(B(i))?B(i):void 0,"aria-valuetext":e.getValueText?.(B(i),B(a)),"aria-label":e.getValueLabel(B(i),B(a)),role:`progressbar`,"data-state":o.value,"data-value":B(i)??void 0,"data-max":B(a)},{default:M(()=>[F(t.$slots,`default`,{modelValue:B(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),tc=A({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Ys();return p(),(e,r)=>(z(),J(B(Mt),W(t,{"data-state":B(n).progressState.value,"data-value":B(n).modelValue?.value??void 0,"data-max":B(n).max.value}),{default:M(()=>[F(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),nc=`radio.select`;function rc(e,t,n){_(nc,n,{originalEvent:e,value:t})}var ic=A({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=x(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Me(n),{forwardRef:o,currentElement:s}=p(),c=hi(s),l=gi(),u=L(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||rc(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(z(),K(U,null,[N(B(Mt),W({id:e.id,ref:B(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":B(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":B(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:B(a),required:e.required,name:e.name},{...B(l),...t.$attrs},{onClick:St(d,[`stop`])}),{default:M(()=>[F(t.$slots,`default`,{checked:B(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),B(c)&&e.name?(z(),J(B(La),W({key:0,type:`radio`,tabindex:`-1`,value:B(a),checked:!!B(i),name:e.name,disabled:e.disabled,required:e.required},B(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):R(`v-if`,!0)],64))}}),[ac,oc]=O(`RadioGroupRoot`),sc=A({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=p(),s=x(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:c,loop:l,orientation:u,name:d,required:f,dir:m}=Me(n),h=o(m),g=hi(a);return oc({modelValue:s,changeModelValue:e=>{s.value=e},disabled:c,loop:l,orientation:u,name:d?.value,required:f}),(t,n)=>(z(),J(B(xo),{"as-child":``,orientation:B(u),dir:B(h),loop:B(l)},{default:M(()=>[N(B(Mt),{ref:B(i),role:`radiogroup`,"data-disabled":B(c)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":B(u),"aria-required":B(f),dir:B(h)},{default:M(()=>[F(t.$slots,`default`,{modelValue:B(s)}),B(g)&&B(d)?(z(),J(B(La),{key:0,required:B(f),disabled:B(c),value:B(s),name:B(d)},null,8,[`required`,`disabled`,`value`,`name`])):R(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[cc,lc]=O(`RadioGroupItem`),uc=A({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,requirLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Md(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Md(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Pd(c),u=e+1<n.length?Pd(n[e+1]):null;if(l&&u&&Fd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Pd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Md(e)),rows:r.map(e=>e.map(e=>Md(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:Md(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:Md(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Pd(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function Fd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Id={class:`[overflow-wrap:anywhere]`},Ld={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Rd={class:`font-mono text-[0.85em]`},zd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Bd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Vd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Hd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Ud={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Wd={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Gd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Kd={key:8,class:`mb-2.5 last:mb-0`},qd=A({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=L(()=>Nd(t.text));return(e,t)=>(z(),K(`div`,Id,[(z(!0),K(U,null,q(n.value,(e,t)=>(z(),K(U,{key:t},[e.kind===`pre`?(z(),K(`pre`,Ld,[G(`code`,Rd,H(e.code),1)])):e.kind===`table`?(z(),K(`table`,zd,[G(`thead`,null,[G(`tr`,null,[(z(!0),K(U,null,q(e.head,(e,t)=>(z(),K(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])]),G(`tbody`,null,[(z(!0),K(U,null,q(e.rows,(e,t)=>(z(),K(`tr`,{key:t},[(z(!0),K(U,null,q(e,(e,t)=>(z(),K(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[N(Ad,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(z(),K(`blockquote`,Bd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(z(),K(`h1`,Vd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(z(),K(`h2`,Hd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(z(),K(`h3`,Ud,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(z(),K(`ul`,Wd,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(z(),K(`ol`,Gd,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(z(),K(`p`,Kd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):R(``,!0)],64))),128))]))}}),Jd={class:`truncate`},Yd=A({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ae(`RouterLink`);return z(),J(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:M(()=>[N(B(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),G(`span`,Jd,H(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Xd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Zd={class:`font-semibold text-foreground`},Qd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},$d=A({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=L(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=L(()=>t.tool.parameters||t.tool.Parameters||``),i=L(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=L(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(z(),J(Yd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(z(),K(`div`,Xd,[N(B(qn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),G(`span`,Zd,H(n.value),1),r.value?(z(),K(`code`,Qd,H(r.value),1)):R(``,!0),G(`span`,{class:P(B(Q)(`text-fg-muted`,i.value&&`text-danger`))},H(a.value),3)]))}}),ef={key:0,class:`mb-2 grid gap-0.5 text-xs`},tf={key:1,class:`mb-2 flex flex-wrap gap-1.5`},nf={key:3,class:`whitespace-pre-wrap`},rf=A({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(z(),K(`div`,{class:P([`flex`,e.assistant?`justify-start`:`justify-end`])},[G(`div`,{class:P(B(Q)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(z(),K(`div`,ef,[(z(!0),K(U,null,q(e.tools,(t,n)=>(z(),J($d,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):R(``,!0),e.media.length?(z(),K(`div`,tf,[(z(!0),K(U,null,q(e.media,(e,t)=>(z(),J(Cd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):R(``,!0),e.assistant?(z(),J(qd,{key:2,text:e.text},null,8,[`text`])):(z(),K(`div`,nf,H(e.text),1)),F(t.$slots,`default`)],2)],2))}}),af={class:`text-sm`},of={class:`font-medium`},sf={key:0,class:`mt-1 text-fg-muted`},cf={key:1,class:`mt-2 flex flex-wrap gap-2`},lf=A({__name:`ChatChooLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>K_?`${n.slice(0,K_).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var J_=[`title`],Y_=A({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Jg(),a=L(()=>i.taskIDFor(n.event)),o=L(()=>q_(n.event));function s(){a.value>0&&r(`open`,a.value)}let c=L(()=>n.event.at?Dg(n.event.at):`—`);return(e,t)=>(z(),J(B(U_),{class:P(a.value>0?`cursor-pointer`:``),role:a.value>0?`link`:void 0,tabindex:a.value>0?0:void 0,title:a.value>0?`Open task details`:void 0,onClick:s,onKeydown:[vt(St(s,[`prevent`]),[`enter`]),vt(St(s,[`prevent`]),[`space`])]},{default:M(()=>[N(B($),{class:`font-medium`},{default:M(()=>[j(H(n.event.kind||n.event.type||`event`),1)]),_:1}),N(B($),{class:`font-mono`},{default:M(()=>[j(H(a.value>0?`#${a.value}`:`—`),1)]),_:1}),N(B($),{class:`w-[55%] max-w-0`},{default:M(()=>[G(`span`,{class:`block truncate`,title:o.value.truncated?o.value.full:void 0},H(o.value.text),9,J_)]),_:1}),N(B($),null,{default:M(()=>[j(H(c.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),X_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Z_(e){return(Number(e?.task_id)||0)>0}function Q_(e,t){return t===`tasks`?Z_(e):t!==`system`||!Z_(e)}function $_(e,t){return e.filter(e=>Q_(e,t))}function ev(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function tv(e,t){return`${e}:${t??0}`}function nv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=tv(q_(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var rv={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},iv={class:`max-h-[28rem] overflow-y-auto`},av=[`aria-expanded`,`aria-label`,`onClick`],ov=[`title`],sv=A({__name:`LiveActivityCard`,setup(e){let t=cp(),{activity:n}=_e(ue()),r=Y(`all`),i=L(()=>$_(n.value,r.value)),a=L(()=>ev(i.value.length,r.value)),o=Ye(new Set),s=L(()=>nv(i.value));function c(e){o.has(e)?o.delete(e):o.add(e)}function l(e){return o.has(e.key)}function u(e){return q_(e.representative)}function d(e){return e.representative.at?Dg(e.representative.at):`—`}function f(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(z(),J(B(bg),null,{default:M(()=>[N(B(Tg),null,{default:M(()=>[N(B(Eg),null,{default:M(()=>[...t[1]||=[j(`Live activity`,-1)]]),_:1}),N(B(xg),{class:`flex items-center gap-2`},{default:M(()=>[N(B(L_),{type:`single`,variant:`outline`,size:`sm`,"model-value":r.value,"aria-label":`Filter activity`,"onUpdate:modelValue":t[0]||=e=>{e&&(r.value=e)}},{default:M(()=>[(z(!0),K(U,null,q(B(X_),e=>(z(),J(B(z_),{key:e.value,value:e.value},{default:M(()=>[j(H(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])]),_:1})]),_:1}),N(B(Sg),null,{default:M(()=>[G(`div`,rv,[G(`div`,iv,[N(B(V_),null,{default:M(()=>[N(B(G_),{class:`sticky top-0 z-10 bg-card`},{default:M(()=>[N(B(U_),null,{default:M(()=>[N(B(W_),null,{default:M(()=>[...t[2]||=[j(`Event`,-1)]]),_:1}),N(B(W_),null,{default:M(()=>[...t[3]||=[j(`Task`,-1)]]),_:1}),N(B(W_),null,{default:M(()=>[...t[4]||=[j(`Detail`,-1)]]),_:1}),N(B(W_),null,{default:M(()=>[...t[5]||=[j(`When`,-1)]]),_:1})]),_:1})]),_:1}),N(B(H_),null,{default:M(()=>[i.value.length?R(``,!0):(z(),J(B(U_),{key:0},{default:M(()=>[N(B($),{colspan:`4`},{default:M(()=>[N(B(dg),null,{default:M(()=>[N(B(mg),null,{default:M(()=>[N(B(_g),null,{default:M(()=>[j(H(a.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),i.value.length?(z(!0),K(U,{key:1},q(s.value,e=>(z(),K(U,{key:e.key},[e.count===1?(z(),J(Y_,{key:0,event:e.representative,onOpen:f},null,8,[`event`])):(z(),K(U,{key:1},[N(B(U_),{class:P(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&f(e.taskID),onKeydown:[vt(St(t=>e.taskID>0&&f(e.taskID),[`prevent`]),[`enter`]),vt(St(t=>e.taskID>0&&f(e.taskID),[`prevent`]),[`space`])]},{default:M(()=>[N(B($),{class:`font-medium`},{default:M(()=>[G(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":l(e),"aria-label":`${l(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:St(t=>c(e.key),[`stop`])},[l(e)?(z(),J(B(Qt),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(z(),J(B($t),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),j(` `+H(e.label)+` `,1),N(B(kt),{variant:`idle`},{default:M(()=>[j(`×`+H(e.count),1)]),_:2},1024)],8,av)]),_:2},1024),N(B($),{class:`font-mono`},{default:M(()=>[j(H(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),N(B($),{class:`w-[55%] max-w-0`},{default:M(()=>[G(`span`,{class:`block truncate`,title:u(e).truncated?u(e).full:void 0},H(u(e).text),9,ov)]),_:2},1024),N(B($),null,{default:M(()=>[j(H(d(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydowLine truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function py(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function my(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function hy(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function gy(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var _y=Y([]),vy=Y([]),yy=Y(!0),by=Y(null),xy=Y(null),Sy=Y(!1),Cy=Y(null);async function wy(){try{let e=await Z.eventTypes(dy().workspace);yy.value=e.enabled!==!1,_y.value=e.event_types||[],vy.value=e.proposals||[],by.value=null}catch(e){by.value=e.message||String(e)}}function Ty(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Ey(e){Cy.value=null,xy.value=e}function Dy(e){let t=Fy.value.find(t=>String(t.id)===e.sample_id);Ey({mode:`proposal`,id:null,source:e.source,name:``,rule:Ty(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Oy(e=``){Ey({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function ky(e){Ey({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Ty(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Ay(){xy.value=null}async function jy(){let e=xy.value;if(e){Sy.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:gy(e.rule)});else{let t=e.mode===`paste`?fy(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:gy(e.rule),example:{headers:t,body:e.body}})}xy.value=null,await wy()}catch(e){Cy.value=e.message||String(e)}finally{Sy.value=!1}}}var My=Y(null);async function Ny(){let e=My.value;if(My.value=null,e)try{await Z.eventTypeDelete(e.id),await wy()}catch(e){by.value=e.message||String(e)}}var Py=100,Fy=Y([]),Iy=Y(!0),Ly=Y(null),Ry=Y(!0),zy=Y(null);async function By(){try{let e=await Z.captures(Py);Iy.value=e.enabled!==!1,Fy.value=e.captures||[],Ly.value=null}catch(e){Ly.value=e.message||String(e)}finally{Ry.value=!1}}function Vy(e){let t=Fy.value.find(t=>t.id===e);return t&&(zy.value=t),!!t}function Hy(){Fy.value.length&&(zy.value=Fy.value[0])}function Uy(){me(`captures`,()=>{By(),wy()})}var Wy=A({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=Dt(r,`class`),o=t(a,i);return(e,t)=>(z(),J(B(el),W({"data-slot":`tabs`,"data-orientation":B(o).orientation||`horizontal`},B(o),{class:B(Q)(`gap-2 group/tabs flex data-horizontal:flex-col`,r.class)}),{default:M(t=>[F(e.$slots,`default`,nt(Oe(t)))]),_:3},16,[`data-orientation`,`class`]))}}),Gy=A({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Dt(t,`class`);return(e,r)=>(z(),J(B(rl),W({"data-slot":`tabs-content`,class:B(Q)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:M(()=>[F(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ky=A({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Dt(t,`class`,`variant`);return(r,i)=>(z(),J(B(il),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(Q)(B(Jy)({variant:e.variant}),t.class)}),{default:M(()=>[F(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),qy=A({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Dt(t,`class`),r=se(n);return(e,n)=>(z(),J(B(al),W({"data-slot":`tabs-trigger`,class:B(Q)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointerLine truncated
`)}};PL.defaultYaml={explicit:!1,version:`1.2`},PL.defaultTags={"!!":`tag:yaml.org,2002:`};function FL(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function IL(e){let t=new Set;return DL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function LL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function RL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=IL(e);let a=LL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(yL(t.node)||xL(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function zL(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=zL(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=zL(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=zL(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=zL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function BL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>BL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!CL(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var VL=class{constructor(e){Object.defineProperty(this,mL,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!gL(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=BL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?zL(i,{"":o},``,o):o}},HL=class extends VL{constructor(e){super(cL),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],DL(e,{Node:(e,t)=>{(hL(t)||CL(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(BL(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=UL(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(FL(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function UL(e,t,n){if(hL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(xL(t)){let r=0;for(let i of t.items){let t=UL(e,i,n);t>r&&(r=t)}return r}if(vL(t)){let r=UL(e,t.key,n),i=UL(e,t.value,n);return Math.max(r,i)}return 1}var WL=e=>!e||typeof e!=`function`&&typeof e!=`object`,GL=class extends VL{constructor(e){super(fL),this.value=e}toJSON(e,t){return t?.keep?this.value:BL(this.value,e,t)}toString(){return String(this.value)}};GL.BLOCK_FOLDED=`BLOCK_FOLDED`,GL.BLOCK_LITERAL=`BLOCK_LITERAL`,GL.PLAIN=`PLAIN`,GL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,GL.QUOTE_SINGLE=`QUOTE_SINGLE`;var KL=`tag:yaml.org,2002:`;function qL(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function JL(e,t,n){if(gL(e)&&(e=e.contents),SL(e))return e;if(vL(e)){let t=n.schema[uL].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new HL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=KL+t.slice(2));let l=qL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new GL(e);return c&&(c.node=t),t Line truncated
`)?$L(n,t):n.includes(`
`)}),t}function Pd(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function Fd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Id={class:`[overflow-wrap:anywhere]`},Ld={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Rd={class:`font-mono text-[0.85em]`},zd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Bd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Vd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Hd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Ud={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Wd={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Gd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Kd={key:8,class:`mb-2.5 last:mb-0`},qd=A({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=L(()=>Nd(t.text));return(e,t)=>(z(),K(`div`,Id,[(z(!0),K(U,null,q(n.value,(e,t)=>(z(),K(U,{key:t},[e.kind===`pre`?(z(),K(`pre`,Ld,[G(`code`,Rd,H(e.code),1)])):e.kind===`table`?(z(),K(`table`,zd,[G(`thead`,null,[G(`tr`,null,[(z(!0),K(U,null,q(e.head,(e,t)=>(z(),K(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])]),G(`tbody`,null,[(z(!0),K(U,null,q(e.rows,(e,t)=>(z(),K(`tr`,{key:t},[(z(!0),K(U,null,q(e,(e,t)=>(z(),K(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[N(Ad,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(z(),K(`blockquote`,Bd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(z(),K(`h1`,Vd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(z(),K(`h2`,Hd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(z(),K(`h3`,Ud,[N(Ad,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(z(),K(`ul`,Wd,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(z(),K(`ol`,Gd,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(Ad,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(z(),K(`p`,Kd,[N(Ad,{inline:e.inline},null,8,[`inline`])])):R(``,!0)],64))),128))]))}}),Jd={class:`truncate`},Yd=A({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ae(`RouterLink`);return z(),J(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:M(()=>[N(B(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),G(`span`,Jd,H(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Xd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Zd={class:`font-semibold text-foreground`},Qd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},$d=A({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=L(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=L(()=>t.tool.parameters||t.tool.Parameters||``),i=L(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=L(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(z(),J(Yd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(z(),K(`div`,Xd,[N(B(qn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),G(`span`,Zd,H(n.value),1),r.value?(z(),K(`code`,Qd,H(r.value),1)):R(``,!0),G(`span`,{class:P(B(Q)(`text-fg-muted`,i.value&&`text-danger`))},H(a.value),3)]))}}),ef={key:0,class:`mb-2 grid gap-0.5 text-xs`},tf={key:1,class:`mb-2 flex flex-wrap gap-1.5`},nf={key:3,class:`whitespace-pre-wrap`},rf=A({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(z(),K(`div`,{class:P([`flex`,e.assistant?`justify-start`:`justify-end`])},[G(`div`,{class:P(B(Q)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(z(),K(`div`,ef,[(z(!0),K(U,null,q(e.tools,(t,n)=>(z(),J($d,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):R(``,!0),e.media.length?(z(),K(`div`,tf,[(z(!0),K(U,null,q(e.media,(e,t)=>(z(),J(Cd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):R(``,!0),e.assistant?(z(),J(qd,{key:2,text:e.text},null,8,[`text`])):(z(),K(`div`,nf,H(e.text),1)),F(t.$slots,`default`)],2)],2))}}),af={class:`text-sm`},of={class:`font-medium`},sf={key:0,class:`mt-1 text-fg-muted`},cf={key:1,class:`mt-2 flex flex-wrap gap-2`},lf=A({__name:`ChatChooLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Q_?`${n.slice(0,Q_).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}function ev(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function tv(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t<1e3)return`under 1 s`;let n=t/1e3;if(n<60)return`${n.toFixed(+(n<10))} s`;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0?`${i} min`:`${i} min ${a} s`;let o=Math.floor(i/60),s=i-o*60;return s===0?`${o} h`:`${o} h ${s} min`}function nv(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function rv(e){return typeof e==`string`?e:``}function iv(e={}){let t=e.data||{},n=e.stage||`unknown stage`,r=e.workflow?`${e.workflow} workflow`:``;if(e.kind===`stage_start`)return{title:`Started stage: ${n}`,detail:r};if(e.kind===`stage_finish`){let e=tv(t.duration_ms),i=[r,e&&`ran for ${e}`].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[i,rv(t.error),rv(t.when)].filter(Boolean).join(` · `)}}if(e.kind===`task_retried`){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0?`Retry ${n}`:`Retry requested`,detail:[rv(t.previous_stage)&&`after ${rv(t.previous_stage)}`,rv(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=nv(t.iterations),i=nv(t.tokens),a=Number(t.cached_tokens)||0,o=nv((Number(t.prompt_tokens)||0)-a),s=nv(t.completion_tokens),c=nv(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,rv(t.model)].filter(Boolean);return{title:`Agent ${rv(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=rv(t.author);return{title:`Remediation ${rv(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${rv(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=rv(t.pr_number);return{title:`Pull request approved`,detail:[rv(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${rv(t.attempt)} of ${rv(t.of)} failed: ${e.stage||`step`}`,detail:rv(t.error),tone:`warn`};if(e.kind===`config_captured`)return{title:`Configuration captured`,detail:`The effective task-runtime configuration for this run.`};if(e.kind===`binding_started`){let e=rv(t.source),n=rv(t.capture_id),r=[{label:`binding ${rv(t.binding_name)||rv(t.binding_id)}`,to:`/events?tab=bindings`},...n?[{label:`captured event`,to:`/events?tab=inspector&capture=${encodeURIComponent(n)}`}]:[]];return t.unsigned===!0?{title:`Started by an unsigned event`,detail:e?`source ${e}`:``,tone:`warn`,links:r}:{title:`Started by an event`,detail:e?`source ${e}`:``,links:r}}if(e.kind===`changes_captured`){let e=t.totals??{},n=Number(e.files);return{title:`Change capture recorded`,detail:[Number.isFinite(n)&&n>0?`${n} file${n===1?``:`s`} changed`:``,t.captured_after?`captured after ${rv(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:ev(e.kind||e.type),detail:e.detail||``}}var av=[`title`],ov=A({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=e_(),a=L(()=>i.taskIDFor(n.event)),o=L(()=>$_(n.event));function s(){a.value>0&&r(`open`,a.value)}let c=L(()=>n.event.at?Ng(n.event.at):`—`);return(e,t)=>(z(),J(B(Y_),{class:P(a.value>0?`cursor-pointer`:``),role:a.value>0?`link`:void 0,tabindex:a.value>0?0:void 0,title:a.value>0?`Open task details`:void 0,onClick:s,onKeydown:[vt(St(s,[`prevent`]),[`enter`]),vt(St(s,[`prevent`]),[`space`])]},{default:M(()=>[N(B($),{class:`font-medium`},{default:M(()=>[j(H(B(iv)({...n.event,at:void 0,detail:void 0}).title),1)]),_:1}),N(B($),{class:`font-mono`},{default:M(()=>[j(H(a.value>0?`#${a.value}`:`—`),1)]),_:1}),N(B($),{class:`w-[55%] max-w-0`},{default:M(()=>[G(`span`,{class:`block truncate`,title:o.value.truncated?o.value.full:void 0},H(o.value.text),9,av)]),_:1}),N(B($),null,{default:M(()=>[j(H(c.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),sv=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function cv(e){return(Number(e?.task_id)||0)>0}function lv(e,t){return t===`tasks`?cv(e):t!==`system`||!cv(e)}function uv(e,t){return e.filter(e=>lv(e,t))}function dv(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function fv(e,t){return`${e}:${t??0}`}function pv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=fv($_(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var mv={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},hv={class:`max-h-[28rem] overflow-y-auto`},gv=[`aria-expanded`,`aria-Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function wy(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function Ty(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function Ey(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function Dy(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var Oy=Y([]),ky=Y([]),Ay=Y(!0),jy=Y(null),My=Y(null),Ny=Y(!1),Py=Y(null);async function Fy(){try{let e=await Z.eventTypes(Sy().workspace);Ay.value=e.enabled!==!1,Oy.value=e.event_types||[],ky.value=e.proposals||[],jy.value=null}catch(e){jy.value=e.message||String(e)}}function Iy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Ly(e){Py.value=null,My.value=e}function Ry(e){let t=Ky.value.find(t=>String(t.id)===e.sample_id);Ly({mode:`proposal`,id:null,source:e.source,name:``,rule:Iy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function zy(e=``){Ly({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function By(e){Ly({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Iy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Vy(){My.value=null}async function Hy(){let e=My.value;if(e){Ny.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:Dy(e.rule)});else{let t=e.mode===`paste`?Cy(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Dy(e.rule),example:{headers:t,body:e.body}})}My.value=null,await Fy()}catch(e){Py.value=e.message||String(e)}finally{Ny.value=!1}}}var Uy=Y(null);async function Wy(){let e=Uy.value;if(Uy.value=null,e)try{await Z.eventTypeDelete(e.id),await Fy()}catch(e){jy.value=e.message||String(e)}}var Gy=100,Ky=Y([]),qy=Y(!0),Jy=Y(null),Yy=Y(!0),Xy=Y(null);async function Zy(){try{let e=await Z.captures(Gy);qy.value=e.enabled!==!1,Ky.value=e.captures||[],Jy.value=null}catch(e){Jy.value=e.message||String(e)}finally{Yy.value=!1}}function Qy(e){let t=Ky.value.find(t=>t.id===e);return t&&(Xy.value=t),!!t}function $y(){Ky.value.length&&(Xy.value=Ky.value[0])}function eb(){me(`captures`,()=>{Zy(),Fy()})}var tb=A({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=Dt(r,`class`),o=t(a,i);return(e,t)=>(z(),J(B(el),W({"data-slot":`tabs`,"data-orientation":B(o).orientation||`horizontal`},B(o),{class:B(Q)(`gap-2 group/tabs flex data-horizontal:flex-col`,r.class)}),{default:M(t=>[F(e.$slots,`default`,nt(Oe(t)))]),_:3},16,[`data-orientation`,`class`]))}}),nb=A({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Dt(t,`class`);return(e,r)=>(z(),J(B(rl),W({"data-slot":`tabs-content`,class:B(Q)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:M(()=>[F(e.$slots,`default`)]),_:3},16,[`class`]))}}),rb=A({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Dt(t,`class`,`variant`);return(r,i)=>(z(),J(B(il),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(Q)(B(ab)({variant:e.variant}),t.class)}),{default:M(()=>[F(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),ib=A({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Dt(t,`class`),r=se(n);return(e,n)=>(z(),J(B(al),W({"data-slot":`tabs-trigger`,class:B(Q)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointerLine truncated
`)}};HL.defaultYaml={explicit:!1,version:`1.2`},HL.defaultTags={"!!":`tag:yaml.org,2002:`};function UL(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function WL(e){let t=new Set;return FL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function GL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function KL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=WL(e);let a=GL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(DL(t.node)||kL(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function qL(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=qL(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=qL(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=qL(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=qL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function JL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>JL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!jL(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var YL=class{constructor(e){Object.defineProperty(this,SL,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!wL(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=JL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?qL(i,{"":o},``,o):o}},XL=class extends YL{constructor(e){super(gL),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],FL(e,{Node:(e,t)=>{(CL(t)||jL(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(JL(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ZL(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(UL(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ZL(e,t,n){if(CL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(kL(t)){let r=0;for(let i of t.items){let t=ZL(e,i,n);t>r&&(r=t)}return r}if(EL(t)){let r=ZL(e,t.key,n),i=ZL(e,t.value,n);return Math.max(r,i)}return 1}var QL=e=>!e||typeof e!=`function`&&typeof e!=`object`,$L=class extends YL{constructor(e){super(bL),this.value=e}toJSON(e,t){return t?.keep?this.value:JL(this.value,e,t)}toString(){return String(this.value)}};$L.BLOCK_FOLDED=`BLOCK_FOLDED`,$L.BLOCK_LITERAL=`BLOCK_LITERAL`,$L.PLAIN=`PLAIN`,$L.QUOTE_DOUBLE=`QUOTE_DOUBLE`,$L.QUOTE_SINGLE=`QUOTE_SINGLE`;var eR=`tag:yaml.org,2002:`;function tR(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function nR(e,t,n){if(wL(e)&&(e=e.contents),AL(e))return e;if(EL(e)){let t=n.schema[vL].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new XL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=eR+t.slice(2));let l=tR(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new $L(e);return c&&(c.node=t),t Line truncated
`)?sR(n,t):n.includes(`
`)?`
`+$L(n,t):(e.endsWith(` `)?``:` `)+n,tR=`flow`,nR=`block`,rR=`quoted`;function iR(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=aR(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=aR(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+sR(n,t):(e.endsWith(` `)?``:` `)+n,lR=`flow`,uR=`block`,dR=`quoted`;function fR(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=pR(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=pR(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function aR(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var oR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),sR=e=>/^(%|---|\.\.\.)/m.test(e);function cR(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function lR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(sR(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function pR(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var mR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hR=e=>/^(%|---|\.\.\.)/m.test(e);function gR(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function _R(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(hR(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:iR(o,a,rR,oR(t,!1))}function uR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return lR(e,t);let n=t.indent||(sR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:iR(r,n,tR,oR(t,!1))}function dR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=lR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?uR:i&&!t?lR:n?uR:lR}return r(e,t)}var fR;try{fR=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:fR(o,a,dR,mR(t,!1))}function vR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return _R(e,t);let n=t.indent||(hR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:fR(r,n,lR,mR(t,!1))}function yR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=_R;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?vR:i&&!t?_R:n?vR:_R}return r(e,t)}var bR;try{bR=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{fR=/\n+(?!\n|$)/g}function pR({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return dR(n,r);let l=r.indent||(r.forceBlockIndent||sR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===GL.BLOCK_FOLDED?!1:t===GL.BLOCK_LITERAL||!cR(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{bR=/\n+(?!\n|$)/g}function xR({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return yR(n,r);let l=r.indent||(r.forceBlockIndent||hR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===$L.BLOCK_FOLDED?!1:t===$L.BLOCK_LITERAL||!gR(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(fR,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p.replace(bR,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=oR(r,!0);o!==`folded`&&t!==GL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=iR(`${v}${e}${p}`,l,nR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function mR(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return dR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?dR(a,t):pR(e,t,n,r);if(!s&&!u&&i!==GL.PLAIN&&a.includes(`
`))return pR(e,t,n,r);if(sR(a)){if(c===``)return t.forceBlockIndent=!0,pR(e,t,n,r);if(s&&c===l)return dR(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return dR(a,t)}return s?d:iR(d,c,tR,oR(t,!1))}function hR(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==GL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=GL.QUOTE_DOUBLE);let c=e=>{switch(e){case GL.BLOCK_FOLDED:case GL.BLOCK_LITERAL:return i||a?dR(o.value,t):pR(o,t,n,r);case GL.QUOTE_DOUBLE:return lR(o.value,t);case GL.QUOTE_SINGLE:return uR(o.value,t);case GL.PLAIN:return mR(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function gR(e,t){let n=Object.assign({blockQuote:!0,commentString:QL,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function _R(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(yL(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function vR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(yL(e)||xL(e))&&e.anchor;a&&FL(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function yR(e,t,n,r){if(vL(e))return e.toString(t,n,r);if(hL(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=SL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=_R(t.doc.schema.tags,a);let o=vR(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):yL(a)?hR(a,t,n,r):a.toString(t,n,r);return o?yL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function bR({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=SL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(xL(e)||!SL(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||xL(e)||(yL(e)?e.type===GL.BLOCK_FOLDED||e.type===GL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=yR(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=eR(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=eR(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=eR(g,n.indent,l(f))));let _,v,y;SL(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&yL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&bL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=yR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${$L(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=mR(r,!0);o!==`folded`&&t!==$L.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=fR(`${v}${e}${p}`,l,uR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function SR(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return yR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?yR(a,t):xR(e,t,n,r);if(!s&&!u&&i!==$L.PLAIN&&a.includes(`
`))return xR(e,t,n,r);if(hR(a)){if(c===``)return t.forceBlockIndent=!0,xR(e,t,n,r);if(s&&c===l)return yR(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return yR(a,t)}return s?d:fR(d,c,lR,mR(t,!1))}function CR(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==$L.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=$L.QUOTE_DOUBLE);let c=e=>{switch(e){case $L.BLOCK_FOLDED:case $L.BLOCK_LITERAL:return i||a?yR(o.value,t):xR(o,t,n,r);case $L.QUOTE_DOUBLE:return _R(o.value,t);case $L.QUOTE_SINGLE:return vR(o.value,t);case $L.PLAIN:return SR(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function wR(e,t){let n=Object.assign({blockQuote:!0,commentString:oR,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function TR(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(DL(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function ER(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(DL(e)||kL(e))&&e.anchor;a&&UL(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function DR(e,t,n,r){if(EL(e))return e.toString(t,n,r);if(CL(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=AL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=TR(t.doc.schema.tags,a);let o=ER(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):DL(a)?CR(a,t,n,r):a.toString(t,n,r);return o?DL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function OR({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=AL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(kL(e)||!AL(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||kL(e)||(DL(e)?e.type===$L.BLOCK_FOLDED||e.type===$L.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=DR(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=cR(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=cR(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=cR(g,n.indent,l(f))));let _,v,y;AL(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&DL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&OL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=DR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${sR(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&xL(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&kL(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=eR(g,n.indent,l(y)):h&&i&&i(),g}function xR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var SR=`<<`,CR={identify:e=>e===SR||typeof e==`symbol`&&e.description===SR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new GL(Symbol(SR)),{addToJSMap:TR}),stringify:()=>SR},wR=(e,t)=>(CR.identify(t)||yL(t)&&(!t.type||t.type===GL.PLAIN)&&CR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===CR.tag&&e.default);function TR(e,t,n){let r=DR(e,n);if(bL(r))for(let n of r.items)ER(e,t,n);else if(Array.isArray(r))for(let n of r)ER(e,t,n);else ER(e,t,r)}function ER(e,t,n){let r=DR(e,n);if(!_L(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function DR(e,t){return e&&hL(t)?t.resolve(e.doc,e):t}function OR(e,t,{key:n,value:r}){if(SL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(wR(e,n))TR(e,t,r);else{let i=BL(n,``,e);if(t instanceof Map)t.set(i,BL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=kR(n,i,e),o=BL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function kR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(SL(e)&&n?.doc){let t=gR(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),xR(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function AR(e,t,n){return new jR(JL(e,void 0,n),JL(t,void 0,n))}var jR=class e{constructor(e,t=null){Object.defineProperty(this,mL,{value:dL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return SL(n)&&(n=n.clone(t)),SL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return OR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?bR(this,e,t,n):JSON.stringify(this)}};function MR(e,t,n){return(t.inFlow??e.flow?PR:NR)(e,t,n)}function NR({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(SL(i))!d&&i.spaceBefore&&f.push(``),FR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(vL(i)){let e=SL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),FR(n,f,e.commentBefore,d))}d=!1;let s=yR(i,u,()=>o=null,()=>d=!0);o&&(s+=eR(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=cR(g,n.indent,l(y)):h&&i&&i(),g}function kR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var AR=`<<`,jR={identify:e=>e===AR||typeof e==`symbol`&&e.description===AR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new $L(Symbol(AR)),{addToJSMap:NR}),stringify:()=>AR},MR=(e,t)=>(jR.identify(t)||DL(t)&&(!t.type||t.type===$L.PLAIN)&&jR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===jR.tag&&e.default);function NR(e,t,n){let r=FR(e,n);if(OL(r))for(let n of r.items)PR(e,t,n);else if(Array.isArray(r))for(let n of r)PR(e,t,n);else PR(e,t,r)}function PR(e,t,n){let r=FR(e,n);if(!TL(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function FR(e,t){return e&&CL(t)?t.resolve(e.doc,e):t}function IR(e,t,{key:n,value:r}){if(AL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(MR(e,n))NR(e,t,r);else{let i=JL(n,``,e);if(t instanceof Map)t.set(i,JL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=LR(n,i,e),o=JL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function LR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(AL(e)&&n?.doc){let t=wR(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),kR(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function RR(e,t,n){return new zR(nR(e,void 0,n),nR(t,void 0,n))}var zR=class e{constructor(e,t=null){Object.defineProperty(this,SL,{value:yL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return AL(n)&&(n=n.clone(t)),AL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return IR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?OR(this,e,t,n):JSON.stringify(this)}};function BR(e,t,n){return(t.inFlow??e.flow?HR:VR)(e,t,n)}function VR({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(AL(i))!d&&i.spaceBefore&&f.push(``),UR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(EL(i)){let e=AL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),UR(n,f,e.commentBefore,d))}d=!1;let s=DR(i,u,()=>o=null,()=>d=!0);o&&(s+=cR(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+$L(l(e),c),s&&s()):d&&o&&o(),p}function PR({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(SL(i))i.spaceBefore&&d.push(``),FR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(vL(i)){let e=SL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),FR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=SL(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=yR(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=eR(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function FR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=$L(t(r),e);n.push(i.trimStart())}}function IR(e,t){let n=yL(t)?t.value:t;for(let r of e)if(vL(r)&&(r.key===t||r.key===n||yL(r.key)&&r.key.value===n))return r}var LR=class extends ZL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(uL,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(AR(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=vL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new jR(e,e?.value):new jR(e.key,e.value);let r=IR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);yL(r.value)&&WL(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=IR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=IR(this.items,e)?.value;return(!t&&yL(n)?n.value:n)??void 0}has(e){return!!IR(this.items,e)}set(e,t){this.add(new jR(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)OR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!vL(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),MR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},RR={collection:`map`,default:!0,nodeClass:LR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return _L(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>LR.from(e,t,n)},zR=class extends ZL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(pL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=BR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=BR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&yL(r)?r.value:r}has(e){let t=BR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=BR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];yL(r)&&WL(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(BL(e,String(r++),t));return n}toString(e,t,n){return e?MR(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(JL(a,void 0,n))}}return i}};function BR(e){let t=yL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var VR={collection:`seq`,default:!0,nodeClass:zR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return bL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>zR.from(e,t,n)},HR={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),hR(e,t,n,r)}},UR={identify:e=>e==null,createNode:()=>new GL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new GL(null),stringify:({source:e},t)=>typeof e==`string`&&UR.test.test(e)?e:t.options.nullStr},WR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new GL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&WR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function GR({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var KR={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:GR},qR={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return hR({comment:e,type:t,value:s},r,i,a)}};function sz(e,t){if(bL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!vL(r)){if(_L(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new jR(new GL(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=vL(r)?r:new jR(r)}}else t(`Expected a sequence for this tag`);return e}function cz(e,t,n){let{replacer:r}=n,i=new zR(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(AR(o,s,n))}return i}var lz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:sz,createNode:cz},uz=class e extends zR{constructor(){super(),this.add=LR.prototype.add.bind(this),this.delete=LR.prototype.delete.bind(this),this.get=LR.prototype.get.bind(this),this.has=LR.prototype.has.bind(this),this.set=LR.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(vL(e)?(r=BL(e.key,``,t),i=BL(e.value,r,t)):r=BL(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=cz(e,t,n),i=new this;return i.items=r.items,i}};uz.tag=`tag:yaml.org,2002:omap`;var dz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:uz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=sz(e,t),r=[];for(let{key:e}of n.items)yL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new uz,n)},createNode:(e,t,n)=>uz.from(e,t,n)};function fz({value:e,source:t},n){return t&&(e?pz:mz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var pz={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new GL(!0),stringify:fz},mz={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new GL(!1),stringify:fz},hz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:GR},gz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():GR(e)}},_z={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new GL(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:GR},vz=e=>typeof e==`bigint`||Number.isInteger(e);function yz(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function bz(e,t,n){let{value:r}=e;if(vz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return GR(e)}var xz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>yz(e,2,2,n),stringify:e=>bz(e,2,`0b`)},Sz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>yz(e,1,8,n),stringify:e=>bz(e,8,`0`)},Cz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>yz(e,0,10,n),stringify:GR},wz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>yz(e,2,16,n),stringify:e=>bz(e,16,`0x`)},Tz=class e extends LR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=vL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new jR(e.key,null):new jR(e,null),IR(this.items,t.key)||this.items.push(t)}get(e,t){let n=IR(this.items,e);return!t&&vL(n)?yL(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=IR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new jR(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push($L(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push($L(a(t),``)))}return n.join(`
`+sR(l(e),c),s&&s()):d&&o&&o(),p}function HR({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(AL(i))i.spaceBefore&&d.push(``),UR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(EL(i)){let e=AL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),UR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=AL(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=DR(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=cR(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function UR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=sR(t(r),e);n.push(i.trimStart())}}function WR(e,t){let n=DL(t)?t.value:t;for(let r of e)if(EL(r)&&(r.key===t||r.key===n||DL(r.key)&&r.key.value===n))return r}var GR=class extends aR{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(vL,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(RR(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=EL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new zR(e,e?.value):new zR(e.key,e.value);let r=WR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);DL(r.value)&&QL(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=WR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=WR(this.items,e)?.value;return(!t&&DL(n)?n.value:n)??void 0}has(e){return!!WR(this.items,e)}set(e,t){this.add(new zR(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)IR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!EL(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),BR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},KR={collection:`map`,default:!0,nodeClass:GR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return TL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>GR.from(e,t,n)},qR=class extends aR{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(xL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=JR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=JR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&DL(r)?r.value:r}has(e){let t=JR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=JR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];DL(r)&&QL(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(JL(e,String(r++),t));return n}toString(e,t,n){return e?BR(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(nR(a,void 0,n))}}return i}};function JR(e){let t=DL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var YR={collection:`seq`,default:!0,nodeClass:qR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return OL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>qR.from(e,t,n)},XR={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),CR(e,t,n,r)}},ZR={identify:e=>e==null,createNode:()=>new $L(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $L(null),stringify:({source:e},t)=>typeof e==`string`&&ZR.test.test(e)?e:t.options.nullStr},QR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new $L(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&QR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function $R({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var ez={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$R},tz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return CR({comment:e,type:t,value:s},r,i,a)}};function hz(e,t){if(OL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!EL(r)){if(TL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new zR(new $L(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=EL(r)?r:new zR(r)}}else t(`Expected a sequence for this tag`);return e}function gz(e,t,n){let{replacer:r}=n,i=new qR(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(RR(o,s,n))}return i}var _z={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:hz,createNode:gz},vz=class e extends qR{constructor(){super(),this.add=GR.prototype.add.bind(this),this.delete=GR.prototype.delete.bind(this),this.get=GR.prototype.get.bind(this),this.has=GR.prototype.has.bind(this),this.set=GR.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(EL(e)?(r=JL(e.key,``,t),i=JL(e.value,r,t)):r=JL(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=gz(e,t,n),i=new this;return i.items=r.items,i}};vz.tag=`tag:yaml.org,2002:omap`;var yz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:vz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=hz(e,t),r=[];for(let{key:e}of n.items)DL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new vz,n)},createNode:(e,t,n)=>vz.from(e,t,n)};function bz({value:e,source:t},n){return t&&(e?xz:Sz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var xz={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $L(!0),stringify:bz},Sz={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $L(!1),stringify:bz},Cz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$R},wz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$R(e)}},Tz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new $L(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:$R},Ez=e=>typeof e==`bigint`||Number.isInteger(e);function Dz(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Oz(e,t,n){let{value:r}=e;if(Ez(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return $R(e)}var kz={identify:Ez,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Dz(e,2,2,n),stringify:e=>Oz(e,2,`0b`)},Az={identify:Ez,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Dz(e,1,8,n),stringify:e=>Oz(e,8,`0`)},jz={identify:Ez,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Dz(e,0,10,n),stringify:$R},Mz={identify:Ez,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Dz(e,2,16,n),stringify:e=>Oz(e,16,`0x`)},Nz=class e extends GR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=EL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new zR(e.key,null):new zR(e,null),WR(this.items,t.key)||this.items.push(t)}get(e,t){let n=WR(this.items,e);return!t&&EL(n)?DL(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=WR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new zR(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(sR(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(sR(a(t),``)))}return n.join(`
`)+`
`}var Bz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mL,{value:lL});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new PL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[mL]:{value:lL}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=SL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Vz(this.contents)&&this.contents.add(e)}addIn(e,t){Vz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=IL(this);e.anchor=!t||n.has(t)?LL(t||`a`,n):t}return new HL(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=RL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=JL(e,l,p);return o&&xL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new jR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Vz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return XL(e)?this.contents!=null&&(this.contents=null,!0):Vz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return xL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return XL(e)?!t&&yL(this.contents)?this.contents.value:this.contents:xL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return xL(this.contents)?this.contents.has(e):!1}hasIn(e){return XL(e)?this.contents!==void 0:xL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=YL(this.schema,[e],t):Vz(this.contents)&&this.contents.set(e,t)}setIn(e,t){XL(e)?this.contents=t:this.contents==null?this.contents=YL(this.schema,Array.from(e),t):Vz(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new PL({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new PL({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Rz(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=BL(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?zL(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return zz(this,e)}};function Vz(e){if(xL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Hz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Uz=class extends Hz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Wz=class extends Hz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Gz=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function Kz(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function qz(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(qz(t.key)||qz(t.value))return!0}return!1;default:return!0}}function Jz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&qz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Yz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||yL(e)&&yL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Xz=`All mapping items must start at the same column`;function Zz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??LR)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=Kz(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Xz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||qz(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Xz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Jz(r.indent,u,i),n.atKey=!1,Yz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Kz(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&Jz(r.indent,f,i),s=c.range[2];let l=new jR(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new jR(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Qz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??zR)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=Kz(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Jz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function $z(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var eB=`Block collections are not allowed within flow collections`,tB=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function nB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?LR:zR))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=Kz(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&qz(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];vL(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],tB(m)&&i(r.range,`BLOCK_IN_FLOW`,eB)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);tB(f)&&i(g.range,`BLOCK_IN_FLOW`,eB),n.atKey=!1;let _=Kz(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?tB(m)&&i(v.range,`BLOCK_IN_FLOW`,eB):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new jR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Yz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new LR(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=$z(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function rB(e,t,n,r,i,a){let o=n.type===`block-map`?Zz(e,t,n,r,a):n.type===`block-seq`?Qz(e,t,n,r,a):nB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function iB(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===LR.tagName&&s===`map`||o===zR.tagName&&s===`seq`)return rB(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),rB(e,t,n,i,o)}let l=rB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=SL(u)?u:new GL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function aB(e,t,n){let r=t.offset,i=oB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?GL.BLOCK_FOLDED:GL.BLOCK_LITERAL,o=t.source?sB(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var Jz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,SL,{value:_L});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new HL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[SL]:{value:_L}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=AL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Yz(this.contents)&&this.contents.add(e)}addIn(e,t){Yz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=WL(this);e.anchor=!t||n.has(t)?GL(t||`a`,n):t}return new XL(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=KL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=nR(e,l,p);return o&&kL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new zR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Yz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return iR(e)?this.contents!=null&&(this.contents=null,!0):Yz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return kL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return iR(e)?!t&&DL(this.contents)?this.contents.value:this.contents:kL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return kL(this.contents)?this.contents.has(e):!1}hasIn(e){return iR(e)?this.contents!==void 0:kL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=rR(this.schema,[e],t):Yz(this.contents)&&this.contents.set(e,t)}setIn(e,t){iR(e)?this.contents=t:this.contents==null?this.contents=rR(this.schema,Array.from(e),t):Yz(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new HL({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new HL({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Kz(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=JL(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?qL(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return qz(this,e)}};function Yz(e){if(kL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Xz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Zz=class extends Xz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Qz=class extends Xz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},$z=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function eB(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function tB(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(tB(t.key)||tB(t.value))return!0}return!1;default:return!0}}function nB(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&tB(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function rB(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||DL(e)&&DL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var iB=`All mapping items must start at the same column`;function aB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??GR)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=eB(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,iB)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||tB(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,iB);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&nB(r.indent,u,i),n.atKey=!1,rB(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=eB(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&nB(r.indent,f,i),s=c.range[2];let l=new zR(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new zR(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function oB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??qR)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=eB(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&nB(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function sB(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var cB=`Block collections are not allowed within flow collections`,lB=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function uB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?GR:qR))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=eB(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&tB(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];EL(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],lB(m)&&i(r.range,`BLOCK_IN_FLOW`,cB)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);lB(f)&&i(g.range,`BLOCK_IN_FLOW`,cB),n.atKey=!1;let _=eB(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?lB(m)&&i(v.range,`BLOCK_IN_FLOW`,cB):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new zR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;rB(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new GR(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=sB(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function dB(e,t,n,r,i,a){let o=n.type===`block-map`?aB(e,t,n,r,a):n.type===`block-seq`?oB(e,t,n,r,a):uB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function fB(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===GR.tagName&&s===`map`||o===qR.tagName&&s===`seq`)return dB(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),dB(e,t,n,i,o)}let l=dB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=AL(u)?u:new $L(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function pB(e,t,n){let r=t.offset,i=mB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?$L.BLOCK_FOLDED:$L.BLOCK_LITERAL,o=t.source?hB(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===GL.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===$L.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -75,59 +75,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function oB({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function sB(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function cB(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=GL.PLAIN,c=lB(a,l);break;case`single-quoted-scalar`:s=GL.QUOTE_SINGLE,c=uB(a,l);break;case`double-quoted-scalar`:s=GL.QUOTE_DOUBLE,c=fB(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=$z(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function lB(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),dB(e)}function uB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),dB(e.slice(1,-1)).replace(/''/g,`'`)}function dB(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function mB({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function hB(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function gB(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=$L.PLAIN,c=_B(a,l);break;case`single-quoted-scalar`:s=$L.QUOTE_SINGLE,c=vB(a,l);break;case`double-quoted-scalar`:s=$L.QUOTE_DOUBLE,c=bB(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=sB(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function _B(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),yB(e)}function vB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),yB(e.slice(1,-1)).replace(/''/g,`'`)}function yB(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function fB(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function bB(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=pB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=mB[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=xB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=SB[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=hB(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=CB(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function pB(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function xB(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var mB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function hB(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function gB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?aB(e,t,r):cB(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[fL]:c?_B(e.schema,i,c,n,r):t.type===`scalar`?vB(e,i,t,r):e.schema[fL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=yL(a)?a:new GL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new GL(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function _B(e,t,n,r,i){if(n===`!`)return e[fL];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[fL])}function vB({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[fL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[fL];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function yB(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var bB={composeNode:xB,composeEmptyNode:SB};function xB(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=CB(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=gB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=iB(bB,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=SB(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!yL(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function SB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=gB(e,{type:`scalar`,offset:yB(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function CB({options:e},{offset:t,source:n,end:r},i){let a=new HL(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=$z(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function wB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Bz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Kz(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?xB(c,i,l,o):SB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=$z(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function TB(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function EB(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var SB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function CB(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function wB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?pB(e,t,r):gB(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[bL]:c?TB(e.schema,i,c,n,r):t.type===`scalar`?EB(e,i,t,r):e.schema[bL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=DL(a)?a:new $L(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new $L(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function TB(e,t,n,r,i){if(n===`!`)return e[bL];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[bL])}function EB({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[bL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[bL];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function DB(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var OB={composeNode:kB,composeEmptyNode:AB};function kB(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=jB(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=wB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=fB(OB,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=AB(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!DL(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function AB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=wB(e,{type:`scalar`,offset:DB(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function jB({options:e},{offset:t,source:n,end:r},i){let a=new XL(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=sB(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function MB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Jz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=eB(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?kB(c,i,l,o):AB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=sB(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function NB(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function PB(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var DB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=TB(e);r?this.warnings.push(new Wz(i,t,n)):this.errors.push(new Uz(i,t,n))},this.directives=new PL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=EB(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(xL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];vL(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:EB(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=TB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=wB(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Uz(TB(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Uz(TB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=$z(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Uz(TB(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Bz(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},OB=Symbol(`break visit`),kB=Symbol(`skip children`),AB=Symbol(`remove item`);function jB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),MB(Object.freeze([]),e,t)}jB.BREAK=OB,jB.SKIP=kB,jB.REMOVE=AB,jB.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},jB.parentCollection=(e,t)=>{let n=jB.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function MB(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=MB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===OB)return OB;else r===AB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function NB(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var FB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=NB(e);r?this.warnings.push(new Qz(i,t,n)):this.errors.push(new Zz(i,t,n))},this.directives=new HL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=PB(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(kL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];EL(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:PB(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=NB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=MB(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Zz(NB(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Zz(NB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=sB(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Zz(NB(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Jz(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},IB=Symbol(`break visit`),LB=Symbol(`skip children`),RB=Symbol(`remove item`);function zB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),BB(Object.freeze([]),e,t)}zB.BREAK=IB,zB.SKIP=LB,zB.REMOVE=RB,zB.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},zB.parentCollection=(e,t)=>{let n=zB.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function BB(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=BB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===IB)return IB;else r===RB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function VB(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function PB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var FB=new Set(`0123456789ABCDEFabcdef`),IB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),LB=new Set(`,[]{}`),RB=new Set(` ,[]{}
\r `),zB=e=>!e||RB.has(e),BB=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function HB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var UB=new Set(`0123456789ABCDEFabcdef`),WB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),GB=new Set(`,[]{}`),KB=new Set(` ,[]{}
\r `),qB=e=>!e||KB.has(e),JB=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&PB(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&PB(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!PB(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&PB(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(zB),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&PB(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(zB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||PB(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&HB(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&HB(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!HB(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&HB(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(qB),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&HB(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(qB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||HB(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>PB(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>HB(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(PB(r)||e&&LB.has(r))break;t=n}else if(PB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(HB(r)||e&&GB.has(r))break;t=n}else if(HB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&LB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&LB.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(zB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(PB(n)||t&&LB.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!PB(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(IB.has(t))t=this.buffer[++e];else if(t===`%`&&FB.has(this.buffer[e+1])&&FB.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&GB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&GB.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(qB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(HB(n)||t&&GB.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!HB(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(WB.has(t))t=this.buffer[++e];else if(t===`%`&&UB.has(this.buffer[e+1])&&UB.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},VB=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function HB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function UB(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function WB(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function GB(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function KB(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function qB(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function JB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!HB(t.start,`explicit-key-ind`)&&!HB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,WB(t.value)?t.value.end?qB(t.value.end,t.sep):t.value.end=t.sep:qB(t.start,t.sep),delete t.sep)}var YB=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new BB,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=NB(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&JB(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&UB(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},YB=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function XB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ZB(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function QB(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function $B(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function eV(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function tV(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function nV(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!XB(t.start,`explicit-key-ind`)&&!XB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,QB(t.value)?t.value.end?tV(t.value.end,t.sep):t.value.end=t.sep:tV(t.start,t.sep),delete t.sep)}var rV=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new JB,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=VB(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&nV(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&ZB(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){qB(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(HB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=KB(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(HB(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(WB(t.key)&&!HB(t.sep,`newline`)){let e=KB(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):HB(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!HB(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){qB(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||HB(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tV(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(XB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=eV(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(XB(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(QB(t.key)&&!XB(t.sep,`newline`)){let e=eV(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):XB(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!XB(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tV(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||XB(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=KB(GB(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=KB(GB(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function XB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new VB||null,prettyErrors:t}}function ZB(e,t={}){let{lineCounter:n,prettyErrors:r}=XB(t),i=new YB(n?.addNewLine),a=new DB(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Uz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Gz(e,n)),o.warnings.forEach(Gz(e,n))),o}function QB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=ZB(e,n);if(!i)return null;if(i.warnings.forEach(e=>xR(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function $B(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return gL(e)&&!r?e.toString(n):new Bz(e,r,n).toString(n)}var eV=e=>typeof e==`object`&&!!e&&!Array.isArray(e),tV=e=>eV(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function nV(e){if(eV(e)){if(eV(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:tV(e.parallel)};if(eV(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:tV(e.switch.cases)}}}function rV(e){return e.slice(2).includes(`parallel`)}function iV(e,t){let n=ZB(e).getIn(t,!0);if(_L(n))return n.toJSON()}function aV(e,t,n){let r=ZB(e);return r.setIn(t,r.createNode(gV(n))),r.toString()}function oV(e,t,n){let r=ZB(e),i=t.slice(0,-1),a=rV(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(bL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!bL(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function sV(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function cV(e,t){let n=e.getIn(t,!0),r=nV(_L(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!_L(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function lV(e,t,n){let r=ZB(e),{kind:i,branches:a}=cV(r,t);if(sV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function uV(e,t,n,r){let i=ZB(e),{kind:a,branches:o}=cV(i,t);if(sV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>yL(e.key)&&e.key.value===n);if(!s||!yL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function dV(e,t,n){let r=ZB(e),{kind:i,branches:a}=cV(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function AV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(EV)].map(e=>e[1]))]}function jV(e){let t=ZB(e).toJS(),n=DV(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=DV(e)?e:{},p=nV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=DV(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||TV(m),type:m,role:yV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:OV(m,h),summary:kV(h),when:typeof d.when==`string`?d.when:void 0,retry:DV(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of AV([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=nV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*SV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=DV(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*CV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*SV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*SV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*SV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*CV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*SV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*SV,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*SV-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var MV={agent:Jt,command:Rn,repo:fn,gate:Pn,forge:bn,human:Un,review:ln,workflow:Kn},NV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function PV(e){return e===`parallel`?fn:e===`switch`?In:MV[e.split(`.`)[0]]??Kn}function FV(e){return Object.keys(NV).map(t=>({title:NV[t],icon:MV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function IV(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function LV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function RV(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function zV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=RV(e,r.type))}return n}var BV=A({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(z(),J(B(Nl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:M(()=>[N(B(Bl),{"aria-label":e.label},{default:M(()=>[N(B(Vl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),N(B(Pl),null,{default:M(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(z(),J(B(Ll),{key:0,value:e.value,disabled:``},{default:M(()=>[j(H(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):R(``,!0),(z(!0),K(U,null,q(e.workflows,e=>(z(),J(B(Ll),{key:e.id,value:e.id},{default:M(()=>[j(H(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function VV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function HV(e,t=[]){let n=ZB(e),r=n.errors[0];if(r)return{ok:!1,message:nH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!rH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:QV(e)}))}var XV=/^(\s*)(-\s+)?/,ZV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function QV(e){let{code:t,comment:n}=$V(e),r=eH(t);return n&&r.push({text:n,kind:`comment`}),r}function $V(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function eH(e){if(!e)return[];let t=[],n=XV.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=ZV.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...tH(i[4]??``)]):[...t,...tH(r)]}function tH(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function nH(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function rH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function iH(e){return typeof e==`string`&&e.trim()!==``}var aH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},oH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},sH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},cH={class:`min-w-0 flex-1`},lH={class:`truncate font-mono text-[11px] text-fg-subtle`},uH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},dH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},fH={key:1,class:`space-y-3`},pH={key:0,class:`block space-y-1.5`},mH={id:`switch-on`},hH=[`value`],gH={class:`text-xs font-medium text-muted-foreground`},_H={class:`flex items-center gap-2`},vH={key:1,role:`alert`,class:`text-xs text-danger`},yH={key:2,class:`space-y-1.5`},bH=[`title`],xH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},SH={key:3,class:`divide-y divide-border rounded-md border border-border`},CH=[`title`],wH={key:0,class:`space-y-3`},TH={class:`text-[13px]`},EH={key:0,class:`text-danger`},DH={class:`ml-2 text-xs text-fg-subtle`},OH={key:1,class:`space-y-3`},kH={class:`text-[13px]`},AH={class:`ml-2 text-xs text-fg-subtle`},jH=[`title`],MH={key:0,class:`text-xs text-danger`},NH={class:`space-y-2`},PH={class:`divide-y divide-border rounded-md border border-border`},FH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},IH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},LH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},RH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},zH={class:`flex items-center border-t border-border px-4 py-2.5`},BH=A({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=L(()=>iV(n.yaml,n.path)??{}),a=L(()=>nV(i.value)),o=L(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=L(()=>a.value?.branches.map(([e])=>e)??[]),c=L(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,aV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=Y(``),d=Y(``);function f(e,t,i=``){try{let a=e===`add`?lV(n.yaml,n.path,t):e===`rename`?uV(n.yaml,n.path,t,i):dV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=L(()=>n.vocabulary.find(e=>e.name===o.value)),m=L(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=L(()=>hV(n.yaml,n.path)),g=L(()=>p.value?.settings&&i.value.settings?qV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let b=L(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,aV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=L(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=L(()=>Object.entries(_V(T.value?.yaml??``,`inputs`)??{})),E=L(()=>Object.entries(_V(T.value?.yaml??``,`outputs`)??{})),ne=L(()=>Object.entries(_V(n.yaml,`inputs`)??{})),D=L(()=>Object.entries(_V(n.yaml,`outputs`)??{})),re=L(()=>m.value.inputs??{}),O=L(()=>m.value.outputs??{}),ie=e=>typeof e==`string`&&e.startsWith(`inputs.`),ae=e=>re.value[e]===void 0?``:String(re.value[e]);function oe(e,t,n){w(`inputs`,{...re.value,[e]:t===``?void 0:ie(t)?t:RV(t,n??`string`)})}let se=Y(null);function ce(e,t){let n=se.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let le=Y({});function ue(e,t){try{w(e,t.trim()?QB(t):void 0),le.value={...le.value,[e]:``}}catch(t){le.valu Line truncated
`)[0]}}}let de=e=>e===void 0?``:$B(e).trimEnd(),fe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),pe=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(z(),K(`aside`,aH,[G(`header`,oH,[G(`span`,sH,[(z(),J(He(B(PV)(o.value)),{class:`size-4`}))]),G(`div`,cH,[N(B(k),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:B(TV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),G(`div`,lH,H(o.value),1)]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:M(()=>[N(B(Jn))]),_:1})]),G(`div`,uH,[g.value?(z(),K(`p`,dH,H(g.value),1)):R(``,!0),a.value?(z(),K(`section`,fH,[o.value===`switch`?(z(),K(`label`,pH,[n[18]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),N(B(k),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),G(`datalist`,mH,[(z(!0),K(U,null,q(h.value,e=>(z(),K(`option`,{key:e,value:`steps.${e}.result.`},null,8,hH))),128))])])):R(``,!0),G(`div`,gH,H(o.value===`switch`?`Cases`:`Branches`),1),(z(!0),K(U,null,q(s.value,e=>(z(),K(`div`,{key:e,class:`flex items-center gap-2`},[N(B(k),{"model-value":e,class:P(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:M(()=>[N(B(Bn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),G(`div`,_H,[N(B(k),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=vt(St(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),N(B(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:M(()=>[N(B(Dn))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(z(),K(`p`,vH,H(d.value),1)):R(``,!0)])):R(``,!0),b.value.lead?(z(),K(`section`,yH,[G(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[j(H(fe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,bH),b.value.lead.kind===`workflow`?(z(),J(BV,{key:0,value:pe(b.value.lead.key),workflows:e.workflows,label:fe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(z(),J(B(MI),{key:1,size:`sm`,class:`w-full`,"model-value":pe(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:M(()=>[N(B(NI),{value:``},{default:M(()=>[...n[19]||=[j(`Default`,-1)]]),_:1}),(z(!0),K(U,null,q(b.value.lead.options,e=>(z(),J(B(NI),{key:e,value:e},{default:M(()=>[j(H(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(z(),J(B(iu),{key:2,"model-value":pe(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(z(),J(B(k),{key:3,"model-value":pe(b.value.lead.key),onFocus:n[10]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(z(),K(`div`,xH,[n[20]||=G(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(z(!0),K(U,null,q(h.value,e=>(z(),K(U,{key:e},[N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`summary`)},{default:M(()=>[j(H(e),1)]),_:2},1032,[`onClick`]),N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`result`)},{default:M(()=>[j(H(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):R(``,!0)])):R(``,!0),b.value.compact.length?(z(),K(`section`,SH,[(z(!0),K(U,null,q(b.value.compact,t=>(z(),K(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[G(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[j(H(fe(t.key,t.schema))+` `,1),t.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,CH),t.kind===`workflow`?(z(),J(BV,{key:0,class:`max-w-48`,value:pe(t.key),workflows:e.workflows,label:fe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine truncated
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=eV($B(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=eV($B(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function iV(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new YB||null,prettyErrors:t}}function aV(e,t={}){let{lineCounter:n,prettyErrors:r}=iV(t),i=new rV(n?.addNewLine),a=new FB(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Zz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach($z(e,n)),o.warnings.forEach($z(e,n))),o}function oV(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=aV(e,n);if(!i)return null;if(i.warnings.forEach(e=>kR(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function sV(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return wL(e)&&!r?e.toString(n):new Jz(e,r,n).toString(n)}var cV=e=>typeof e==`object`&&!!e&&!Array.isArray(e),lV=e=>cV(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function uV(e){if(cV(e)){if(cV(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:lV(e.parallel)};if(cV(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:lV(e.switch.cases)}}}function dV(e){return e.slice(2).includes(`parallel`)}function fV(e,t){let n=aV(e).getIn(t,!0);if(TL(n))return n.toJSON()}function pV(e,t,n){let r=aV(e);return r.setIn(t,r.createNode(wV(n))),r.toString()}function mV(e,t,n){let r=aV(e),i=t.slice(0,-1),a=dV(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(OL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!OL(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function hV(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function gV(e,t){let n=e.getIn(t,!0),r=uV(TL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!TL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function _V(e,t,n){let r=aV(e),{kind:i,branches:a}=gV(r,t);if(hV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function vV(e,t,n,r){let i=aV(e),{kind:a,branches:o}=gV(i,t);if(hV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>DL(e.key)&&e.key.value===n);if(!s||!DL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function yV(e,t,n){let r=aV(e),{kind:i,branches:a}=gV(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function RV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(PV)].map(e=>e[1]))]}function zV(e){let t=aV(e).toJS(),n=FV(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=FV(e)?e:{},p=uV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=FV(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||NV(m),type:m,role:DV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:IV(m,h),summary:LV(h),when:typeof d.when==`string`?d.when:void 0,retry:FV(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of RV([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=uV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*AV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=FV(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*jV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*AV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*AV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*AV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*jV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*AV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*AV,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*AV-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var BV={agent:Jt,command:Rn,repo:fn,gate:Pn,forge:bn,human:Un,review:ln,workflow:Kn},VV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function HV(e){return e===`parallel`?fn:e===`switch`?In:BV[e.split(`.`)[0]]??Kn}function UV(e){return Object.keys(VV).map(t=>({title:VV[t],icon:BV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function WV(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function GV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function KV(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function qV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=KV(e,r.type))}return n}var JV=A({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(z(),J(B(Nl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:M(()=>[N(B(Bl),{"aria-label":e.label},{default:M(()=>[N(B(Vl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),N(B(Pl),null,{default:M(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(z(),J(B(Ll),{key:0,value:e.value,disabled:``},{default:M(()=>[j(H(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):R(``,!0),(z(!0),K(U,null,q(e.workflows,e=>(z(),J(B(Ll),{key:e.id,value:e.id},{default:M(()=>[j(H(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function YV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function XV(e,t=[]){let n=aV(e),r=n.errors[0];if(r)return{ok:!1,message:uH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!dH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:oH(e)}))}var iH=/^(\s*)(-\s+)?/,aH=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function oH(e){let{code:t,comment:n}=sH(e),r=cH(t);return n&&r.push({text:n,kind:`comment`}),r}function sH(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function cH(e){if(!e)return[];let t=[],n=iH.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=aH.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...lH(i[4]??``)]):[...t,...lH(r)]}function lH(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function uH(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function dH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fH(e){return typeof e==`string`&&e.trim()!==``}var pH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},mH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},hH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},gH={class:`min-w-0 flex-1`},_H={class:`truncate font-mono text-[11px] text-fg-subtle`},vH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},yH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},bH={key:1,class:`space-y-3`},xH={key:0,class:`block space-y-1.5`},SH={id:`switch-on`},CH=[`value`],wH={class:`text-xs font-medium text-muted-foreground`},TH={class:`flex items-center gap-2`},EH={key:1,role:`alert`,class:`text-xs text-danger`},DH={key:2,class:`space-y-1.5`},OH=[`title`],kH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},AH={key:3,class:`divide-y divide-border rounded-md border border-border`},jH=[`title`],MH={key:0,class:`space-y-3`},NH={class:`text-[13px]`},PH={key:0,class:`text-danger`},FH={class:`ml-2 text-xs text-fg-subtle`},IH={key:1,class:`space-y-3`},LH={class:`text-[13px]`},RH={class:`ml-2 text-xs text-fg-subtle`},zH=[`title`],BH={key:0,class:`text-xs text-danger`},VH={class:`space-y-2`},HH={class:`divide-y divide-border rounded-md border border-border`},UH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},WH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},GH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},qH={class:`flex items-center border-t border-border px-4 py-2.5`},JH=A({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=L(()=>fV(n.yaml,n.path)??{}),a=L(()=>uV(i.value)),o=L(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=L(()=>a.value?.branches.map(([e])=>e)??[]),c=L(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,pV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=Y(``),d=Y(``);function f(e,t,i=``){try{let a=e===`add`?_V(n.yaml,n.path,t):e===`rename`?vV(n.yaml,n.path,t,i):yV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=L(()=>n.vocabulary.find(e=>e.name===o.value)),m=L(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=L(()=>CV(n.yaml,n.path)),g=L(()=>p.value?.settings&&i.value.settings?tH(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let b=L(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,pV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=L(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=L(()=>Object.entries(TV(T.value?.yaml??``,`inputs`)??{})),E=L(()=>Object.entries(TV(T.value?.yaml??``,`outputs`)??{})),ne=L(()=>Object.entries(TV(n.yaml,`inputs`)??{})),D=L(()=>Object.entries(TV(n.yaml,`outputs`)??{})),re=L(()=>m.value.inputs??{}),O=L(()=>m.value.outputs??{}),ie=e=>typeof e==`string`&&e.startsWith(`inputs.`),ae=e=>re.value[e]===void 0?``:String(re.value[e]);function oe(e,t,n){w(`inputs`,{...re.value,[e]:t===``?void 0:ie(t)?t:KV(t,n??`string`)})}let se=Y(null);function ce(e,t){let n=se.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let le=Y({});function ue(e,t){try{w(e,t.trim()?oV(t):void 0),le.value={...le.value,[e]:``}}catch(t){le.valu Line truncated
`)[0]}}}let de=e=>e===void 0?``:sV(e).trimEnd(),fe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),pe=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(z(),K(`aside`,pH,[G(`header`,mH,[G(`span`,hH,[(z(),J(He(B(HV)(o.value)),{class:`size-4`}))]),G(`div`,gH,[N(B(k),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:B(NV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),G(`div`,_H,H(o.value),1)]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:M(()=>[N(B(Jn))]),_:1})]),G(`div`,vH,[g.value?(z(),K(`p`,yH,H(g.value),1)):R(``,!0),a.value?(z(),K(`section`,bH,[o.value===`switch`?(z(),K(`label`,xH,[n[18]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),N(B(k),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),G(`datalist`,SH,[(z(!0),K(U,null,q(h.value,e=>(z(),K(`option`,{key:e,value:`steps.${e}.result.`},null,8,CH))),128))])])):R(``,!0),G(`div`,wH,H(o.value===`switch`?`Cases`:`Branches`),1),(z(!0),K(U,null,q(s.value,e=>(z(),K(`div`,{key:e,class:`flex items-center gap-2`},[N(B(k),{"model-value":e,class:P(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:M(()=>[N(B(Bn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),G(`div`,TH,[N(B(k),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=vt(St(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),N(B(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:M(()=>[N(B(Dn))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(z(),K(`p`,EH,H(d.value),1)):R(``,!0)])):R(``,!0),b.value.lead?(z(),K(`section`,DH,[G(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[j(H(fe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,OH),b.value.lead.kind===`workflow`?(z(),J(JV,{key:0,value:pe(b.value.lead.key),workflows:e.workflows,label:fe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(z(),J(B(BI),{key:1,size:`sm`,class:`w-full`,"model-value":pe(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:M(()=>[N(B(VI),{value:``},{default:M(()=>[...n[19]||=[j(`Default`,-1)]]),_:1}),(z(!0),K(U,null,q(b.value.lead.options,e=>(z(),J(B(VI),{key:e,value:e},{default:M(()=>[j(H(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(z(),J(B(iu),{key:2,"model-value":pe(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(z(),J(B(k),{key:3,"model-value":pe(b.value.lead.key),onFocus:n[10]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(z(),K(`div`,kH,[n[20]||=G(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(z(!0),K(U,null,q(h.value,e=>(z(),K(U,{key:e},[N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`summary`)},{default:M(()=>[j(H(e),1)]),_:2},1032,[`onClick`]),N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`result`)},{default:M(()=>[j(H(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):R(``,!0)])):R(``,!0),b.value.compact.length?(z(),K(`section`,AH,[(z(!0),K(U,null,q(b.value.compact,t=>(z(),K(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[G(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[j(H(fe(t.key,t.schema))+` `,1),t.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,jH),t.kind===`workflow`?(z(),J(JV,{key:0,class:`max-w-48`,value:pe(t.key),workflows:e.workflows,label:fe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>w(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(z(),K(U,{key:2},[N(B(iu),{"model-value":de(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ue(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),le.value[e.key]?(z(),K(`span`,MH,H(le.value[e.key]),1)):R(``,!0)],64))]))),128)),G(`section`,NH,[n[37]||=G(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),G(`div`,PH,[G(`label`,FH,[n[31]||=G(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),N(B(k),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),G(`label`,IH,[n[34]||=G(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),N(B(MI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:M(()=>[N(B(NI),{value:``},{default:M(()=>[...n[32]||=[j(`Park the task`,-1)]]),_:1}),N(B(NI),{value:`continue`},{default:M(()=>[...n[33]||=[j(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),G(`label`,LH,[n[35]||=G(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),N(B(k),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),G(`label`,RH,[n[36]||=G(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),N(B(wh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),G(`footer`,zH,[N(B(X),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:M(()=>[N(B(Bn)),n[38]||=j(`Delete step`,-1)]),_:1}),N(B(X),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:M(()=>[...n[39]||=[j(`Done`,-1)]]),_:1})])]))}}),VH=`repository_path`;function HH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:VH,path:n.trim(),type:`string`,required:!0}),r}function UH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function WH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=UH(ob(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function GH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:ob(e.value,i.type??`string`)})}return n}function KH(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function qH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...qH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...qH(n,r)]}):[]}function JH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function YH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function XH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var ZH={class:`flex h-full flex-col`},QH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},$H={class:`min-w-0 flex-1 truncate text-sm font-medium`},eU={key:0,class:`flex flex-1 items-center justify-center`},tU={class:`space-y-1.5`},nU={key:1,class:`space-y-1.5`},rU=[`title`],iU={class:`space-y-1.5`},aU={id:`bind-paths`},oU=[`value`],sU={class:`divide-y divide-border rounded-md border border-border`},cU={class:`flex items-center gap-1.5 text-xs`},lU={class:`font-mono`},uU={class:`text-fg-subtle`},dU={key:0,class:`text-danger`,title:`Required`},fU={key:2,class:`text-xs text-danger`},pU=[`title`],mU={key:0,class:`space-y-1 px-3 py-2`},hU={key:0,class:`text-xs text-danger`},gU={key:1,class:`truncate font-mono text-xs text-success`},_U={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},vU={class:`space-y-2`},yU={key:0,role:`alert`,class:`text-xs text-danger`},bU={key:1,class:`text-xs text-fg-subtle`},xU={class:`flex gap-2`},SU=`__new__`,CU=A({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(z(),K(U,{key:2},[N(B(iu),{"model-value":de(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ue(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),le.value[e.key]?(z(),K(`span`,BH,H(le.value[e.key]),1)):R(``,!0)],64))]))),128)),G(`section`,VH,[n[37]||=G(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),G(`div`,HH,[G(`label`,UH,[n[31]||=G(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),N(B(k),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),G(`label`,WH,[n[34]||=G(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),N(B(BI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:M(()=>[N(B(VI),{value:``},{default:M(()=>[...n[32]||=[j(`Park the task`,-1)]]),_:1}),N(B(VI),{value:`continue`},{default:M(()=>[...n[33]||=[j(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),G(`label`,GH,[n[35]||=G(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),N(B(k),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),G(`label`,KH,[n[36]||=G(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),N(B(wh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),G(`footer`,qH,[N(B(X),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:M(()=>[N(B(Bn)),n[38]||=j(`Delete step`,-1)]),_:1}),N(B(X),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:M(()=>[...n[39]||=[j(`Done`,-1)]]),_:1})])]))}}),YH=`repository_path`;function XH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:YH,path:n.trim(),type:`string`,required:!0}),r}function ZH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function QH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=ZH(_b(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function $H(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:_b(e.value,i.type??`string`)})}return n}function eU(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function tU(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...tU(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...tU(n,r)]}):[]}function nU(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function rU(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function iU(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var aU={class:`flex h-full flex-col`},oU={class:`flex items-center gap-2 border-b border-border px-4 py-3`},sU={class:`min-w-0 flex-1 truncate text-sm font-medium`},cU={key:0,class:`flex flex-1 items-center justify-center`},lU={class:`space-y-1.5`},uU={key:1,class:`space-y-1.5`},dU=[`title`],fU={class:`space-y-1.5`},pU={id:`bind-paths`},mU=[`value`],hU={class:`divide-y divide-border rounded-md border border-border`},gU={class:`flex items-center gap-1.5 text-xs`},_U={class:`font-mono`},vU={class:`text-fg-subtle`},yU={key:0,class:`text-danger`,title:`Required`},bU={key:2,class:`text-xs text-danger`},xU=[`title`],SU={key:0,class:`space-y-1 px-3 py-2`},CU={key:0,class:`text-xs text-danger`},wU={key:1,class:`truncate font-mono text-xs text-success`},TU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},EU={class:`space-y-2`},DU={key:0,role:`alert`,class:`text-xs text-danger`},OU={key:1,class:`text-xs text-fg-subtle`},kU={class:`flex gap-2`},AU=`__new__`,jU=A({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function $X(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=eZ(n.code,e);return Array.isArray(e)?e.some(e=>QX(n[r],e,t,n.type===`keyup`)):QX(n[r],e,t,n.type===`keyup`)}}function eZ(e,t){return t.includes(e)?`code`:`key`}function tZ(e,t){let n=L(()=>je(t?.target)??YX),r=Be(je(e)===!0),i=!1,a=new Set,o=c(je(e));I(()=>je(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),qW([`blur`,`contextmenu`],s),YW((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0,a=je(t?.preventDefault)??!1;if(i=ZX(e),(!i||i&&!n)&&XX(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),YW((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&XX(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=je(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?$X(e,a):e}return r}var nZ=`vue-flow__node-desc`,rZ=`vue-flow__edge-desc`,iZ=`vue-flow__aria-live`,aZ=[`Enter`,` `,`Escape`],oZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function sZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function cZ(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function lZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function uZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function dZ(e,t){return{x:uZ(e.x,t[0][0],t[1][0]),y:uZ(e.y,t[0][1],t[1][1])}}function fZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function pZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function mZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!pZ(e)}function hZ(e){return mZ(e)&&`computedPosition`in e}function gZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function _Z(e){return gZ(e.width)&&gZ(e.height)&&gZ(e.x)&&gZ(e.y)}function vZ(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:ct({width:0,height:0}),computedPosition:ct({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:FQ(e.data)?e.data:{},events:ct(FQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function yZ(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:FQ(e.data)?e.data:{},events:ct(FQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function bZ(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function xZ(...e){if(e.length===3){let[t,n,r]=e;return bZ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>pZ(e)&&e.source===r).map(e=>n.find(t=>mZ(t)&&t.id===e.target))}function SZ(...e){if(e.length===3){let[t,n,r]=e;return bZ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>pZ(e)&&e.target===r).map(e=>n.find(t=>mZ(t)&&t.id===e.source))}function CZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function wZ(e,t){return t.some(t=>pZ(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function TZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function EZ({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?vQ(s,o):s}function DZ(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function OZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function kZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function AZ(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=DZ(t,OZ({...r.computedPosition,...r.dimensions}))}return kZ(t)}function jZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...EZ(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function sZ(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=cZ(n.code,e);return Array.isArray(e)?e.some(e=>oZ(n[r],e,t,n.type===`keyup`)):oZ(n[r],e,t,n.type===`keyup`)}}function cZ(e,t){return t.includes(e)?`code`:`key`}function lZ(e,t){let n=L(()=>je(t?.target)??rZ),r=Be(je(e)===!0),i=!1,a=new Set,o=c(je(e));I(()=>je(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),tG([`blur`,`contextmenu`],s),rG((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0,a=je(t?.preventDefault)??!1;if(i=aZ(e),(!i||i&&!n)&&iZ(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),rG((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&iZ(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=je(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?sZ(e,a):e}return r}var uZ=`vue-flow__node-desc`,dZ=`vue-flow__edge-desc`,fZ=`vue-flow__aria-live`,pZ=[`Enter`,` `,`Escape`],mZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function hZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function gZ(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function _Z(e){return{width:e.offsetWidth,height:e.offsetHeight}}function vZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function yZ(e,t){return{x:vZ(e.x,t[0][0],t[1][0]),y:vZ(e.y,t[0][1],t[1][1])}}function bZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function xZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function SZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!xZ(e)}function CZ(e){return SZ(e)&&`computedPosition`in e}function wZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function TZ(e){return wZ(e.width)&&wZ(e.height)&&wZ(e.x)&&wZ(e.y)}function EZ(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:ct({width:0,height:0}),computedPosition:ct({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:UQ(e.data)?e.data:{},events:ct(UQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function DZ(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:UQ(e.data)?e.data:{},events:ct(UQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function OZ(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function kZ(...e){if(e.length===3){let[t,n,r]=e;return OZ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>xZ(e)&&e.source===r).map(e=>n.find(t=>SZ(t)&&t.id===e.target))}function AZ(...e){if(e.length===3){let[t,n,r]=e;return OZ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>xZ(e)&&e.target===r).map(e=>n.find(t=>SZ(t)&&t.id===e.source))}function jZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function MZ(e,t){return t.some(t=>xZ(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function NZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function PZ({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?EQ(s,o):s}function FZ(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function IZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function LZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function RZ(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=FZ(t,IZ({...r.computedPosition,...r.dimensions}))}return LZ(t)}function zZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...PZ(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -147,6 +147,6 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},fQ=class extends Error{constructor(e,...t){super(dQ[e]?.call(dQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function pQ(e){return`clientX`in e}function mQ(e){return`sourceEvent`in e}function hQ(e,t){let n=pQ(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var gQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function _Q(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function vQ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var yQ=()=>!0;function bQ(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function xQ(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())cZ(i,sZ(e))>0&&r.push(e);return r}var SQ=250;function CQ(e,t,n,r){let i=[],a=1/0,o=xQ(e,n,t+SQ);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=oQ(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function wQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=yQ},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=hQ(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=TQ(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===WX.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=OQ(t,e,a,p,n,!0)}return b}function TQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function EQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function DQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function OQ(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===WX.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...oQ(o,c,c.position,!0)}:c}var kQ={[VX.Left]:VX.Right,[VX.Right]:VX.Left,[VX.Top]:VX.Bottom,[VX.Bottom]:VX.Top},AQ=[`production`,`prod`];function jQ(e,...t){MQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function MQ(){return!AQ.includes(`production`)}function NQ(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...lZ(t)}}):null}function PQ(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ot(()=>{o.blur()})):n([e])}function FQ(e){return B(e)!==void 0}function IQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new fQ(uQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=pZ(e)?e:{...e,id:CZ(e)},i=yZ(i,void 0,r),!wZ(i,t)&&i}function LQ(e,t,n,r,i){if(!t.source||!t.target)return i(new fQ(uQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new fQ(uQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?CZ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function RQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!mZ(o)){n(new fQ(uQ.NODE_INVALID,o?.id));continue}let s=vZ(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new fQ(uQ.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function zQ(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function BQ(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;zQ(`source`,o,`${r}-${a}--Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},bQ=class extends Error{constructor(e,...t){super(yQ[e]?.call(yQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function xQ(e){return`clientX`in e}function SQ(e){return`sourceEvent`in e}function CQ(e,t){let n=xQ(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var wQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function TQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function EQ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var DQ=()=>!0;function OQ(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function kQ(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())gZ(i,hZ(e))>0&&r.push(e);return r}var AQ=250;function jQ(e,t,n,r){let i=[],a=1/0,o=kQ(e,n,t+AQ);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=mQ(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function MQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=DQ},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=CQ(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=NQ(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===QX.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=IQ(t,e,a,p,n,!0)}return b}function NQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function PQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function FQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function IQ(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===QX.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...mQ(o,c,c.position,!0)}:c}var LQ={[YX.Left]:YX.Right,[YX.Right]:YX.Left,[YX.Top]:YX.Bottom,[YX.Bottom]:YX.Top},RQ=[`production`,`prod`];function zQ(e,...t){BQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function BQ(){return!RQ.includes(`production`)}function VQ(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,..._Z(t)}}):null}function HQ(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ot(()=>{o.blur()})):n([e])}function UQ(e){return B(e)!==void 0}function WQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new bQ(vQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=xZ(e)?e:{...e,id:jZ(e)},i=DZ(i,void 0,r),!MZ(i,t)&&i}function GQ(e,t,n,r,i){if(!t.source||!t.target)return i(new bQ(vQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new bQ(vQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?jZ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function KQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!SZ(o)){n(new bQ(vQ.NODE_INVALID,o?.id));continue}let s=EZ(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new bQ(vQ.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function qQ(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function JQ(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;qQ(`source`,o,`${r}-${a}--Line truncated
`),r=t.split(`
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function r2(e){let t=ZB(e).toJS(),n=new Map;for(let r of jV(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function i2(e,t,n){let r=r2(e),i=r2(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var a2={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},o2={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},s2=[`aria-current`,`onClick`],c2={class:`flex items-center gap-2 text-sm`},l2={class:`font-mono text-xs text-fg-subtle`},u2=[`title`],d2={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},f2={key:0,class:`flex min-h-0 flex-col gap-2`},p2={class:`flex items-center gap-2`},m2={class:`text-xs text-muted-foreground`},h2={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},g2={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},_2={class:`inline-block w-4 select-none text-fg-subtle`},v2={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},y2={class:`flex min-h-0 flex-col gap-1`},b2={class:`text-xs font-medium text-muted-foreground`},x2={class:`min-h-0 flex-1`},S2={class:`flex min-h-0 flex-col gap-1`},C2={class:`min-h-0 flex-1`},w2=A({__name:`WorkflowHistory`,props:rt({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:rt([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Pe(e,`selected`),a=Pe(e,`mode`);I(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=L(()=>n.revisions.find(e=>e.version===i.value)),s=L(()=>o.value?.yaml??null),c=L(()=>s.value===null?[]:n2(s.value,n.current)),l=L(()=>s.value!==null&&s.value===n.current),u=L(()=>s.value===null?{}:i2(s.value,n.current,`removed`)),d=L(()=>s.value===null?{}:i2(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(z(),K(`div`,a2,[G(`ol`,o2,[(z(!0),K(U,null,q(e.revisions,e=>(z(),K(`li`,{key:e.version},[G(`button`,{type:`button`,class:P([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[G(`span`,c2,[G(`span`,l2,`v`+H(e.version),1),N(B(kt),{variant:f[e.change]},{default:M(()=>[j(H(e.change),1)]),_:2},1032,[`variant`])]),G(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},H(e.actor||`unknown`)+` · `+H(e.source||`unknown`)+` · `+H(B(Dg)(e.at)),9,u2)],10,s2)]))),128)),e.revisions.length?R(``,!0):(z(),K(`li`,d2,H(e.error||`No recorded changes`),1))]),o.value?(z(),K(`div`,f2,[G(`div`,p2,[N(B(Wy),{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{default:M(()=>[N(B(Ky),null,{default:M(()=>[N(B(qy),{value:`yaml`},{default:M(()=>[...n[2]||=[j(`YAML`,-1)]]),_:1}),N(B(qy),{value:`canvas`},{default:M(()=>[...n[3]||=[j(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),G(`span`,m2,H(l.value?`Same as the current definition`:`Compared with the current definition`),1),N(B(X),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`This revision removed the workflow`:void 0,onClick:n[1]||=e=>r(`restore`,s.value)},{default:M(()=>[N(B(An),{"data-icon":`inline-start`}),n[4]||=j(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(z(),K(`p`,h2,`This revision removed the workflow.`)):a.value===`yaml`?(z(),K(`pre`,g2,[G(`code`,null,[(z(!0),K(U,null,q(c.value,(e,t)=>(z(),K(`span`,{key:t,class:P([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[G(`span`,_2,H(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),j(H(e.text),1)],2))),128))])])):(z(),K(`div`,v2,[G(`div`,y2,[G(`span`,b2,`v`+H(o.value.version),1),G(`div`,x2,[N(Q0,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),G(`div`,S2,[n[5]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),G(`div`,C2,[N(Q0,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):R(``,!0)]))}}),T2=`workflow-definitions`;function E2(e){let t=pe(),n=Y([]),r=Y(``);async function i(){try{n.value=await t.hist Line truncated
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function d2(e){let t=aV(e).toJS(),n=new Map;for(let r of zV(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function f2(e,t,n){let r=d2(e),i=d2(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var p2={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},m2={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},h2=[`aria-current`,`onClick`],g2={class:`flex items-center gap-2 text-sm`},_2={class:`font-mono text-xs text-fg-subtle`},v2=[`title`],y2={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},b2={key:0,class:`flex min-h-0 flex-col gap-2`},x2={class:`flex items-center gap-2`},S2={class:`text-xs text-muted-foreground`},C2={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},w2={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},T2={class:`inline-block w-4 select-none text-fg-subtle`},E2={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},D2={class:`flex min-h-0 flex-col gap-1`},O2={class:`text-xs font-medium text-muted-foreground`},k2={class:`min-h-0 flex-1`},A2={class:`flex min-h-0 flex-col gap-1`},j2={class:`min-h-0 flex-1`},M2=A({__name:`WorkflowHistory`,props:rt({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:rt([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Pe(e,`selected`),a=Pe(e,`mode`);I(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=L(()=>n.revisions.find(e=>e.version===i.value)),s=L(()=>o.value?.yaml??null),c=L(()=>s.value===null?[]:u2(s.value,n.current)),l=L(()=>s.value!==null&&s.value===n.current),u=L(()=>s.value===null?{}:f2(s.value,n.current,`removed`)),d=L(()=>s.value===null?{}:f2(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(z(),K(`div`,p2,[G(`ol`,m2,[(z(!0),K(U,null,q(e.revisions,e=>(z(),K(`li`,{key:e.version},[G(`button`,{type:`button`,class:P([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[G(`span`,g2,[G(`span`,_2,`v`+H(e.version),1),N(B(kt),{variant:f[e.change]},{default:M(()=>[j(H(e.change),1)]),_:2},1032,[`variant`])]),G(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},H(e.actor||`unknown`)+` · `+H(e.source||`unknown`)+` · `+H(B(Ng)(e.at)),9,v2)],10,h2)]))),128)),e.revisions.length?R(``,!0):(z(),K(`li`,y2,H(e.error||`No recorded changes`),1))]),o.value?(z(),K(`div`,b2,[G(`div`,x2,[N(B(tb),{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{default:M(()=>[N(B(rb),null,{default:M(()=>[N(B(ib),{value:`yaml`},{default:M(()=>[...n[2]||=[j(`YAML`,-1)]]),_:1}),N(B(ib),{value:`canvas`},{default:M(()=>[...n[3]||=[j(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),G(`span`,S2,H(l.value?`Same as the current definition`:`Compared with the current definition`),1),N(B(X),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`This revision removed the workflow`:void 0,onClick:n[1]||=e=>r(`restore`,s.value)},{default:M(()=>[N(B(An),{"data-icon":`inline-start`}),n[4]||=j(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(z(),K(`p`,C2,`This revision removed the workflow.`)):a.value===`yaml`?(z(),K(`pre`,w2,[G(`code`,null,[(z(!0),K(U,null,q(c.value,(e,t)=>(z(),K(`span`,{key:t,class:P([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[G(`span`,T2,H(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),j(H(e.text),1)],2))),128))])])):(z(),K(`div`,E2,[G(`div`,D2,[G(`span`,O2,`v`+H(o.value.version),1),G(`div`,k2,[N(o2,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),G(`div`,A2,[n[5]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),G(`div`,j2,[N(o2,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):R(``,!0)]))}}),N2=`workflow-definitions`;function P2(e){let t=pe(),n=Y([]),r=Y(``);async function i(){try{n.value=await t.hist Line truncated
+1 -1
View File
@@ -33,7 +33,7 @@ const fields = () => Object.entries(props.entry.fields ?? {});
{{ (props.entry.level || "info").toUpperCase() }}
</span>
<span class="flex min-w-0 flex-wrap items-baseline gap-2">
<span class="break-words text-foreground">{{
<span class="break-words font-mono text-foreground">{{
props.entry.message || props.entry.msg || ""
}}</span>
<span
@@ -23,6 +23,7 @@ import { statusLabel } from "@/lib/task-meta";
* read when the palette opens, so it never shows a stale list for long.
*/
const props = defineProps<{ hidden: string[] }>();
const emit = defineEmits<{ newTask: [] }>();
const router = useRouter();
const open = ref(false);
@@ -61,6 +62,11 @@ function go(path: string): void {
void router.push(path);
}
function newTask(): void {
open.value = false;
emit("newTask");
}
// '/' opens only when the keystroke was not meant for a field.
function isEditableTarget(event: KeyboardEvent): boolean {
const el = event.target;
@@ -100,6 +106,9 @@ onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
<CommandInput placeholder="Find a page, task or workflow" />
<CommandList>
<CommandEmpty>No matches.</CommandEmpty>
<CommandGroup v-if="showWorkflows" heading="Actions">
<CommandItem value="New task" @select="newTask">New task</CommandItem>
</CommandGroup>
<CommandGroup heading="Pages">
<CommandItem
v-for="entry in pages"
+4 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { ref } from "vue";
import AlertsBell from "@/alerts/AlertsBell.vue";
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
import NewTaskButton from "@/tasks/NewTaskButton.vue";
@@ -8,6 +9,7 @@ import Nav from "./Nav.vue";
import ProfileDropdown from "./ProfileDropdown.vue";
const props = defineProps<{ hidden: string[] }>();
const newTaskOpen = ref(false);
</script>
<template>
@@ -18,8 +20,8 @@ const props = defineProps<{ hidden: string[] }>();
<Nav :hidden="props.hidden" />
<div class="flex shrink-0 items-center gap-2">
<ConnectionPill />
<CommandPalette :hidden="props.hidden" />
<NewTaskButton v-if="!props.hidden.includes('/workflows')" />
<CommandPalette :hidden="props.hidden" @new-task="newTaskOpen = true" />
<NewTaskButton v-if="!props.hidden.includes('/workflows')" v-model:open="newTaskOpen" />
<AlertsBell />
<ProfileDropdown />
</div>
+2 -1
View File
@@ -4,6 +4,7 @@ import { computed } from "vue";
import { TableCell, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { activityDetail } from "./activity-detail";
import { describeTimelineEvent } from "@/tasks/timeline-event";
import { useTasksStore, type ActivityEvent } from "@/stores/tasks";
/**
@@ -42,7 +43,7 @@ const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2014"));
@keydown.space.prevent="open"
>
<TableCell class="font-medium">{{
props.event.kind || props.event.type || "event"
describeTimelineEvent({ ...props.event, at: undefined, detail: undefined }).title
}}</TableCell>
<TableCell class="font-mono">{{
taskID > 0 ? `#${taskID}` : "—"
+2 -1
View File
@@ -33,6 +33,7 @@ import {
type ActivityFilter,
} from "./activity-filter";
import { groupActivity, type ActivityGroup } from "./activity-group";
import { describeTimelineEvent } from "@/tasks/timeline-event";
/**
* The last 50 events, newest first, with the stream's own state on the card and
@@ -177,7 +178,7 @@ function openTask(taskID: number) {
v-else
class="size-3.5 shrink-0 text-fg-subtle"
/>
{{ group.label }}
{{ describeTimelineEvent({ ...group.representative, at: undefined, detail: undefined }).title }}
<Badge variant="idle">×{{ group.count }}</Badge>
</button>
</TableCell>
+2 -2
View File
@@ -14,7 +14,7 @@ const { tasks } = storeToRefs(useTasksStore());
const loadDashboard = useTasksStore().load;
/** Tasks waiting on a human, each with the reason and the next action. */
type AttentionTask = Task & { park_reason?: string };
type AttentionTask = Task & { park_reason?: string; plan?: string };
const waiting = computed(() => {
const ids = attentionStatusIds();
@@ -23,7 +23,7 @@ const waiting = computed(() => {
function meta(task: AttentionTask): string {
const where = task.owner && task.repo ? `${task.owner}/${task.repo}${task.issue_number && task.source !== "chat" ? ` #${task.issue_number}` : ""}` : "";
return [where, task.workflow, task.park_reason].filter(Boolean).join(" · ");
return [where, task.workflow, task.park_reason || task.plan].filter(Boolean).join(" · ");
}
</script>
+23 -32
View File
@@ -2,26 +2,25 @@
import { storeToRefs } from "pinia";
import { computed } from "vue";
import SegmentBar from "@/base/SegmentBar.vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { compact } from "@/lib/format";
import { useTasksStore } from "@/stores/tasks";
const { summary } = storeToRefs(useTasksStore());
/** What the current rate projects to over the next 30 days. */
const days = computed(() => summary.value?.tokens_by_day ?? []);
const used = computed(() =>
days.value.reduce((a, d) => a + (d.tokens || 0), 0),
);
const recent = computed(() =>
days.value.slice(-7).reduce((a, d) => a + (d.tokens || 0), 0),
);
const perDay = computed(() =>
days.value.length ? used.value / days.value.length : 0,
);
const projected = computed(() => Math.round(perDay.value * 30));
// The API returns usage days newest first and omits days without usage.
const week = computed(() => {
const today = new Date().toISOString().slice(0, 10);
return Array.from({ length: 7 }, (_, i) => {
const day = new Date(Date.parse(today) - (6 - i) * 86_400_000).toISOString().slice(0, 10);
return { day, tokens: days.value.find((d) => d.day === day)?.tokens ?? 0 };
});
});
const recent = computed(() => week.value.reduce((sum, day) => sum + day.tokens, 0));
const maximum = computed(() => Math.max(1, ...week.value.map((day) => day.tokens)));
const recorded = computed(() => week.value.filter((day) => days.value.some((d) => d.day === day.day)).length);
const projected = computed(() => Math.round(recent.value / 7 * 30));
</script>
<template>
@@ -30,25 +29,17 @@ const projected = computed(() => Math.round(perDay.value * 30));
<CardTitle>Token outlook</CardTitle>
</CardHeader>
<CardContent>
<div class="mb-1 text-3xl font-semibold tracking-[-0.03em]">
{{ compact(projected) }}
</div>
<div class="mb-4 text-xs text-fg-subtle">Based on {{ compact(Math.round(perDay)) }} per day over
{{ days.length }} days</div>
<SegmentBar
:segments="[
{
label: `Last 7 days (${compact(recent)})`,
value: recent,
kind: 'info',
},
{
label: `Earlier (${compact(used - recent)})`,
value: Math.max(used - recent, 0),
kind: 'idle',
},
]"
/>
<p class="text-xs text-fg-subtle">Today · UTC</p>
<p class="mb-3 font-mono text-3xl font-semibold">{{ compact(week[6]?.tokens ?? 0) }}</p>
<p class="text-sm">{{ compact(projected) }} over the next 30 days</p>
<p class="mb-4 text-xs text-fg-subtle">At the last seven calendar days’ rate</p>
<ul class="flex h-28 items-end gap-2" aria-label="Token usage over the last seven UTC days">
<li v-for="day in week" :key="day.day" class="flex h-full min-w-0 flex-1 flex-col justify-end gap-1" :aria-label="`${day.day}: ${day.tokens} tokens`" :title="`${day.day}: ${day.tokens} tokens`">
<span class="min-h-px rounded-sm bg-primary" :style="{ height: `${day.tokens / maximum * 80}%` }" aria-hidden="true" />
<span class="text-center font-mono text-[10px] text-fg-subtle">{{ day.day.slice(5) }}</span>
</li>
</ul>
<p v-if="recorded < 7" class="mt-3 text-xs text-fg-subtle">Usage recorded on {{ recorded }} of the last seven days; missing days count as zero.</p>
</CardContent>
</Card>
</template>
+2
View File
@@ -138,6 +138,8 @@ async function request<T = unknown>(
}
export const api = {
secretEngines: <T = unknown>() => request<T>("/api/secret-engines"),
checkSecret: (ref: { engine: string; key: string }) => request<{ resolved: boolean; process: string }>("/api/secret-references/check", { method: "POST", body: ref }),
health: <T = unknown>() => request<T>("/health/detailed"),
services: <T = unknown>() => request<T>("/api/services"),
policies: <T = unknown>() => request<T>("/api/access/policies"),
+1
View File
@@ -23,6 +23,7 @@ export type LevelKind = Exclude<StatusKind, "ok">;
/** One entry as internal/logging serialises it. */
export interface LogEntry {
id?: number;
time: string | number | Date;
level?: string | null;
message?: string;
+1
View File
@@ -69,6 +69,7 @@ const settings: NavSpec = {
"/settings/tools",
"/settings/extensions",
"/settings/plugins",
"/settings/secret-engines",
],
},
{
+7
View File
@@ -21,6 +21,7 @@ import SoulPage from "@/settings/SoulPage.vue";
import SchedulesPage from "@/settings/SchedulesPage.vue";
import ExtensionsPage from "@/settings/ExtensionsPage.vue";
import PluginsPage from "@/settings/PluginsPage.vue";
import SecretEnginesPage from "@/settings/SecretEnginesPage.vue";
import ContainerRuntimePage from "@/settings/ContainerRuntimePage.vue";
import SystemAppearancePage from "@/settings/SystemAppearancePage.vue";
import SystemModelsPage from "@/settings/SystemModelsPage.vue";
@@ -338,6 +339,12 @@ const routes = [
section: "settings",
},
},
{
path: "/settings/secret-engines",
name: "settings-secret-engines",
component: SecretEnginesPage,
meta: { navPath: "/settings", settings: true, label: "Secret engines", description: "Available secret engines.", section: "settings" },
},
{
path: "/settings/container-runtime",
name: "settings-container-runtime",
+4 -4
View File
@@ -63,13 +63,13 @@ const pullPolicy = computed({
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">{{ catalogError || error }}</p>
<template v-if="runtime">
<SettingRow label="Image" for="cr-image">
<SettingRow label="Image" for="cr-image" hint="Container image used for agent runs.">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-image" v-model="runtime.image" class="font-mono" />
<DraftHint :kind="KIND" path="image" />
</div>
</SettingRow>
<SettingRow label="Pull policy">
<SettingRow label="Pull policy" hint="When to refresh the agent image.">
<div class="flex flex-wrap items-center gap-3">
<ToggleGroup type="single" variant="outline" size="sm" :model-value="pullPolicy" aria-label="Pull policy" @update:model-value="(value) => { if (value) pullPolicy = value as typeof pullPolicy; }">
<ToggleGroupItem v-for="option in pullPolicies" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
@@ -89,13 +89,13 @@ const pullPolicy = computed({
<DraftHint :kind="KIND" path="max_concurrency" />
</div>
</SettingRow>
<SettingRow label="Max uptime" for="cr-uptime">
<SettingRow label="Max uptime" for="cr-uptime" hint="Maximum time an agent container may run.">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-uptime" v-model="runtime.max_uptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="max_uptime" />
</div>
</SettingRow>
<SettingRow label="Volume retention" for="cr-ttl">
<SettingRow label="Volume retention" for="cr-ttl" hint="How long to retain volumes after a run.">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-ttl" v-model="runtime.volume_ttl" :units="['h']" />
<DraftHint :kind="KIND" path="volume_ttl" />
+25
View File
@@ -0,0 +1,25 @@
<script setup lang="ts">
import { onMounted } from "vue";
import { useIntervalFn } from "@vueuse/core";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { useSecretEnginesStore } from "@/stores/secret-engines";
const store = useSecretEnginesStore();
onMounted(store.load);
useIntervalFn(store.load, 15_000);
</script>
<template>
<PageHeader title="Secret engines">
<Button variant="outline" size="sm" @click="store.load">Refresh</Button>
</PageHeader>
<p class="mb-4 text-sm text-fg-muted">Engines registered by archied. Manage extension engines under <RouterLink to="/settings/extensions" class="underline">Extensions</RouterLink>.</p>
<p v-if="store.error" class="text-sm text-danger" role="alert">{{ store.error }}</p>
<Table v-else-if="store.engines">
<TableHeader><TableRow><TableHead>Engine</TableHead><TableHead>Version</TableHead><TableHead>Source</TableHead></TableRow></TableHeader>
<TableBody><TableRow v-for="engine in store.engines" :key="engine.name"><TableCell class="font-mono">{{ engine.name }}</TableCell><TableCell class="font-mono">{{ engine.version || '—' }}</TableCell><TableCell>{{ engine.source }}</TableCell></TableRow></TableBody>
</Table>
<p v-else class="text-sm text-fg-subtle" role="status">Loading engine report…</p>
</template>
+40 -3
View File
@@ -1,9 +1,13 @@
<script setup lang="ts">
import { ref } from "vue";
import { computed, ref, watch } from "vue";
import { useIntervalFn } from "@vueuse/core";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SecretReference } from "@/components/ui/secret-reference";
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { api } from "@/lib/api";
import { useSecretEnginesStore } from "@/stores/secret-engines";
/** Where a secret lives. Archie resolves it; the value never reaches the UI. */
interface SecretRef {
@@ -21,6 +25,26 @@ withDefaults(
);
const model = defineModel<SecretRef>({ required: true });
const editing = ref(false);
const engines = useSecretEnginesStore();
const missing = computed(() => !!engines.engines && !!model.value.engine && !engines.engines.some((engine) => engine.name === model.value.engine));
watch(editing, (open) => { if (open) void engines.load(); });
useIntervalFn(() => { if (editing.value) void engines.load(); }, 15_000);
const checked = ref<boolean>();
const checking = ref(false);
const checkError = ref("");
watch(() => `${model.value.engine}\n${model.value.key}`, () => { checked.value = undefined; checkError.value = ""; });
async function check() {
const ref = { ...model.value };
checking.value = true;
checked.value = undefined;
checkError.value = "";
try {
const result = await api.checkSecret(ref);
if (ref.engine === model.value.engine && ref.key === model.value.key) checked.value = result.resolved;
} catch (cause) {
if (ref.engine === model.value.engine && ref.key === model.value.key) checkError.value = String((cause as Error).message || cause);
} finally { checking.value = false; }
}
</script>
<template>
@@ -39,11 +63,24 @@ const editing = ref(false);
</div>
<div v-else class="flex flex-wrap items-end gap-2">
<label class="grid gap-1 text-xs text-fg-subtle">Engine
<Input :id="`${idPrefix}-engine`" v-model="model.engine" class="w-28 font-mono" />
<Select v-model="model.engine" :disabled="disabled">
<SelectTrigger :id="`${idPrefix}-engine`" class="font-mono"><SelectValue placeholder="Choose engine" /></SelectTrigger>
<SelectContent><SelectGroup>
<SelectItem v-for="engine in engines.engines ?? []" :key="engine.name" :value="engine.name">{{ engine.name }}</SelectItem>
<SelectItem v-if="model.engine && (missing || engines.engines === null)" :value="model.engine">{{ model.engine }}{{ missing ? ' · not installed' : '' }}</SelectItem>
</SelectGroup></SelectContent>
</Select>
</label>
<label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">Key
<Input :id="`${idPrefix}-key`" v-model="model.key" class="font-mono" />
<Input :id="`${idPrefix}-key`" v-model="model.key" class="font-mono" :disabled="disabled" />
</label>
<Button variant="ghost" size="sm" @click="editing = false">Done</Button>
</div>
<p v-if="editing && engines.error" class="mt-1 text-xs text-danger" role="alert">{{ engines.error }}</p>
<div v-if="model.engine && model.key" class="mt-1 flex flex-wrap items-center gap-2 text-xs">
<Button variant="ghost" size="sm" :disabled="disabled || checking" @click="check">Check reference</Button>
<span v-if="checking" role="status">Checking…</span>
<span v-else-if="checked !== undefined" role="status">{{ checked ? 'Resolved by archie-gateway' : 'Not resolved by archie-gateway' }}</span>
<span v-if="checkError" class="text-danger" role="alert">{{ checkError }}</span>
</div>
</template>
+20
View File
@@ -0,0 +1,20 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import { api } from "@/lib/api";
export interface SecretEngine { name: string; version?: string; source: string }
export const useSecretEnginesStore = defineStore("secret-engines", () => {
const engines = ref<SecretEngine[] | null>(null);
const error = ref("");
async function load() {
try {
engines.value = (await api.secretEngines<{ engines: SecretEngine[] }>()).engines;
error.value = "";
} catch (cause) {
engines.value = null;
error.value = String((cause as Error).message || cause);
}
}
return { engines, error, load };
});
+1 -1
View File
@@ -7,7 +7,7 @@ import { api } from "../lib/api.ts";
export interface Summary {
statuses?: Record<string, number>;
tokens_by_day?: Array<{ tokens?: number }>;
tokens_by_day?: Array<{ day: string; tokens?: number }>;
}
export interface WorkflowStat {
+1 -2
View File
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
import { Plus } from "@lucide/vue";
@@ -14,7 +13,7 @@ import {
import NewTaskForm from "./NewTaskForm.vue";
const router = useRouter();
const open = ref(false);
const open = defineModel<boolean>("open", { default: false });
function started(taskId: number) {
open.value = false;
+60 -12
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed } from "vue";
import { computed, nextTick, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { ArrowUpRight, CircleAlert } from "@lucide/vue";
import {
@@ -11,7 +12,12 @@ import {
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { Badge } from "@/components/ui/badge";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { api } from "@/lib/api";
import { runQuery, type LogState } from "./task-run";
import { statusKind, statusLabel } from "@/lib/task-meta";
import { cn } from "@/lib/utils";
import DispatchLinks from "@/bindings/DispatchLinks.vue";
import StartNewRun from "./StartNewRun.vue";
import TaskRowActions from "./TaskRowActions.vue";
@@ -28,7 +34,45 @@ const run = useTaskRun();
const title = computed(() => run.task?.title || `Task #${props.id}`);
const status = computed(() => run.task?.status ?? "");
const parked = computed(() => status.value === "parked" && !!run.task?.park_reason);
const router = useRouter();
const attempt = computed(() => run.attempts?.attempts?.find((a) => a.attempt === run.attemptNumber));
const failure = computed(() => {
const stage = attempt.value?.stages?.find((s) => s.error);
const current = run.attemptNumber === run.currentAttempt;
if (current && status.value === "parked") return { title: "Parked: this run needs your attention", detail: run.task?.park_reason || stage?.error || "", parked: true };
if (attempt.value?.status === "failed" || (current && status.value === "dead")) return { title: `Attempt ${run.attemptNumber} failed${stage?.name ? ` during ${stage.name}` : ""}`, detail: stage?.error || run.task?.park_reason || "", parked: false };
return null;
});
const jumping = ref(false);
const jumpError = ref("");
watch(() => run.attemptNumber, () => { jumpError.value = ""; });
async function jumpToLog(): Promise<void> {
const selected = run.attemptNumber;
if (selected == null) return;
jumping.value = true;
jumpError.value = "";
try {
const logs = await api.taskLogs<LogState>(props.id, { attempt: selected, level: "ERROR", limit: 1 });
if (selected !== run.attemptNumber) return;
const entry = logs.entries?.[0];
if (!entry?.id) {
jumpError.value = "No error log line was recorded for this attempt.";
return;
}
run.setFilters({ level: "ERROR", stage: "" });
run.setTab("log");
await nextTick();
await router.replace({ query: runQuery("log", selected), hash: `#log-line-${entry.id}` });
const line = document.querySelector<HTMLElement>(`[data-log-id="${entry.id}"]`);
line?.scrollIntoView({ block: "center" });
line?.focus({ preventScroll: true });
} catch {
if (selected === run.attemptNumber) jumpError.value = "Could not read this attempt’s error log.";
} finally {
jumping.value = false;
}
}
// The head has room for one control: the reap an operator reaches for once a
// task is finished with. Whether this task offers it at all is the server's
@@ -112,16 +156,20 @@ const headerActions = computed(() =>
</template>
</dl>
<div
v-if="parked"
role="status"
class="mt-4 flex items-start gap-3 rounded-md border border-warn/40 bg-warn-soft px-4 py-3"
<Alert
v-if="failure"
:variant="failure.parked ? 'default' : 'destructive'"
:class="cn('mt-4', failure.parked && 'border-warn/40 bg-warn-soft')"
>
<CircleAlert class="mt-0.5 size-4 shrink-0 text-warn" aria-hidden="true" />
<div class="min-w-0">
<p class="text-sm font-medium text-warn">Parked</p>
<p class="mt-0.5 font-mono text-xs break-words text-fg-muted">{{ run.task?.park_reason }}</p>
</div>
</div>
<CircleAlert aria-hidden="true" />
<AlertTitle class="flex flex-wrap items-center justify-between gap-2">
<span>{{ failure.title }}</span>
<Button variant="ghost" size="sm" :disabled="jumping || run.attemptNumber == null" @click="jumpToLog">Jump to log line</Button>
</AlertTitle>
<AlertDescription>
<p v-if="failure.detail" class="mt-0.5 font-mono text-xs break-words text-fg-muted">{{ failure.detail }}</p>
<p v-if="jumpError" class="mt-1 text-xs" role="alert">{{ jumpError }}</p>
</AlertDescription>
</Alert>
</div>
</template>
+21 -2
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { computed, nextTick, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import LogRow from "@/base/LogRow.vue";
import { Button } from "@/components/ui/button";
@@ -121,6 +122,7 @@ async function loadOlder(): Promise<void> {
if (!shown?.more_available || before <= 0) return;
const older = await fetchPage(before);
if (!older) return;
await router.replace({ hash: "" });
newerPages.value.push({ before: page.value?.before ?? 0, state: shown });
page.value = { before, state: older };
}
@@ -183,6 +185,22 @@ const download = computed(() =>
)
: null,
);
const route = useRoute();
const router = useRouter();
const logFrame = ref<HTMLElement>();
let focusedHash = "";
watch([() => route.hash, current], async () => {
const match = /^#log-line-(\d+)$/.exec(route.hash);
if (!match) { focusedHash = ""; return; }
if (focusedHash === route.hash) return;
if (page.value) { page.value = null; newerPages.value = []; }
await nextTick();
const line = logFrame.value?.querySelector<HTMLElement>(`[data-log-id="${match[1]}"]`);
if (!line) return;
focusedHash = route.hash;
line?.scrollIntoView({ block: "center" });
line?.focus({ preventScroll: true });
}, { immediate: true, flush: "post" });
</script>
<template>
@@ -242,9 +260,10 @@ const download = computed(() =>
<!-- The detail page's log is the primary content, so it takes a framed
read surface of its own and the tallest one on the page. -->
<div
ref="logFrame"
class="max-h-[62vh] overflow-y-auto rounded-sm border border-border bg-card px-2"
>
<LogRow v-for="(entry, i) in view.entries" :key="i" :entry="entry" />
<LogRow v-for="(entry, i) in view.entries" :key="entry.id ?? i" :entry="entry" :data-log-id="entry.id" tabindex="-1" />
</div>
<!-- Below the frame, not inside it: the log scrolls, and where an attempt
ended is the one line that must stay put while it does. -->