From 469f5cf0c6ecd23c8bf7ac437b7fa40e72a6c1c1 Mon Sep 17 00:00:00 2001 From: David Brackbill Date: Wed, 8 Jul 2026 16:19:56 -0700 Subject: [PATCH 1/6] feat(dev-server): get variation values from streaming instead of REST fetchAvailableVariations used to require a slow paginated REST call (GET /api/v2/flags/{projKey}) just to get variation values. Those values are already present in the same streaming connection dev-server opens for AllFlagsState - a custom DataStore decorator now captures them off that connection instead, so CreateProject/UpdateProject no longer make any REST call on the sync path at all. Known gap, not yet addressed: variation name/description only exist in the REST representation, never in the streaming payload (verified against a live account). This commit does not resolve names - flags will show raw values in the override picker instead of friendly names until a follow-up adds that back (still deciding between a background bulk resync vs. per-page lookups - see PR discussion). Measured against the real staging default project: time to healthcheck-ready dropped from ~10s (parallel REST pagination) to ~1-3s. --- internal/dev_server/adapters/api.go | 28 +--- .../dev_server/adapters/internal/api_util.go | 60 -------- .../adapters/internal/api_util_test.go | 141 ------------------ internal/dev_server/adapters/mocks/api.go | 14 +- internal/dev_server/adapters/mocks/sdk.go | 8 +- internal/dev_server/adapters/sdk.go | 65 +++++++- internal/dev_server/model/project.go | 109 ++++++++------ internal/dev_server/model/project_test.go | 88 +++++------ internal/dev_server/model/sync_test.go | 50 +------ internal/dev_server/sdk/go_sdk_test.go | 7 +- 10 files changed, 190 insertions(+), 380 deletions(-) diff --git a/internal/dev_server/adapters/api.go b/internal/dev_server/adapters/api.go index c968b3ac..68d5bf86 100644 --- a/internal/dev_server/adapters/api.go +++ b/internal/dev_server/adapters/api.go @@ -24,7 +24,7 @@ func GetApi(ctx context.Context) Api { //go:generate go run go.uber.org/mock/mockgen -destination mocks/api.go -package mocks . Api type Api interface { GetSdkKey(ctx context.Context, projectKey, environmentKey string) (string, error) - GetAllFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error) + GetFlag(ctx context.Context, projectKey, flagKey string) (ldapi.FeatureFlag, error) GetProjectEnvironments(ctx context.Context, projectKey string, query string, limit *int) ([]ldapi.Environment, error) } @@ -45,13 +45,12 @@ func (a apiClientApi) GetSdkKey(ctx context.Context, projectKey, environmentKey return environment.ApiKey, nil } -func (a apiClientApi) GetAllFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error) { - log.Printf("Fetching all flags for project '%s'", projectKey) - flags, err := a.getFlags(ctx, projectKey, nil) +func (a apiClientApi) GetFlag(ctx context.Context, projectKey, flagKey string) (ldapi.FeatureFlag, error) { + flag, err := internal.Retry429s(a.apiClient.FeatureFlagsApi.GetFeatureFlag(ctx, projectKey, flagKey).Execute) if err != nil { - err = errors.Wrap(err, "unable to get all flags from LD API") + return ldapi.FeatureFlag{}, errors.Wrapf(err, "unable to get flag '%s' from LD API", flagKey) } - return flags, err + return *flag, nil } func (a apiClientApi) GetProjectEnvironments(ctx context.Context, projectKey string, query string, limit *int) ([]ldapi.Environment, error) { @@ -63,23 +62,6 @@ func (a apiClientApi) GetProjectEnvironments(ctx context.Context, projectKey str return environments, err } -func (a apiClientApi) getFlags(ctx context.Context, projectKey string, href *string) ([]ldapi.FeatureFlag, error) { - return internal.GetPaginatedItems(ctx, projectKey, href, func(ctx context.Context, projectKey string, limit, offset *int64) (flags *ldapi.FeatureFlags, err error) { - // loop until we do not get rate limited - query := a.apiClient.FeatureFlagsApi.GetFeatureFlags(ctx, projectKey).Limit(100) - query = query.Filter("purpose:all+!(holdout)") - - if limit != nil { - query = query.Limit(*limit) - } - - if offset != nil { - query = query.Offset(*offset) - } - return internal.Retry429s(query.Execute) - }) -} - func (a apiClientApi) getEnvironments(ctx context.Context, projectKey string, href *string, query string, limit *int) ([]ldapi.Environment, error) { request := a.apiClient.EnvironmentsApi.GetEnvironmentsByProject(ctx, projectKey) diff --git a/internal/dev_server/adapters/internal/api_util.go b/internal/dev_server/adapters/internal/api_util.go index 8a2b3d33..ec5ef8d7 100644 --- a/internal/dev_server/adapters/internal/api_util.go +++ b/internal/dev_server/adapters/internal/api_util.go @@ -1,74 +1,14 @@ package internal import ( - "context" "log" "net/http" - "net/url" "strconv" "time" - "github.com/launchdarkly/api-client-go/v14" "github.com/pkg/errors" ) -func GetPaginatedItems[T any, R interface { - GetItems() []T - GetLinks() map[string]ldapi.Link -}](ctx context.Context, projectKey string, href *string, fetchFunc func(context.Context, string, *int64, *int64) (R, error)) ([]T, error) { - var result R - var err error - - if href == nil { - result, err = fetchFunc(ctx, projectKey, nil, nil) - if err != nil { - return nil, err - } - } else { - limit, offset, err := parseHref(*href) - if err != nil { - return nil, errors.Wrapf(err, "unable to parse href for next link: %s", *href) - } - result, err = fetchFunc(ctx, projectKey, &limit, &offset) - if err != nil { - return nil, err - } - } - - items := result.GetItems() - - if links := result.GetLinks(); links != nil { - if next, ok := links["next"]; ok && next.Href != nil { - newItems, err := GetPaginatedItems(ctx, projectKey, next.Href, fetchFunc) - if err != nil { - return nil, err - } - items = append(items, newItems...) - } - } - - return items, nil -} - -func parseHref(href string) (limit, offset int64, err error) { - parsedUrl, err := url.Parse(href) - if err != nil { - return - } - l, err := strconv.Atoi(parsedUrl.Query().Get("limit")) - if err != nil { - return - } - o, err := strconv.Atoi(parsedUrl.Query().Get("offset")) - if err != nil { - return - } - - limit = int64(l) - offset = int64(o) - return -} - //go:generate go run go.uber.org/mock/mockgen -destination mocks.go -package internal . MockableTime type MockableTime interface { Sleep(duration time.Duration) diff --git a/internal/dev_server/adapters/internal/api_util_test.go b/internal/dev_server/adapters/internal/api_util_test.go index 28d388d0..696448eb 100644 --- a/internal/dev_server/adapters/internal/api_util_test.go +++ b/internal/dev_server/adapters/internal/api_util_test.go @@ -1,151 +1,14 @@ package internal import ( - "context" "net/http" "testing" "time" - ldapi "github.com/launchdarkly/api-client-go/v14" "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" ) -type testItem struct { - ID string -} - -type testResult struct { - items []testItem - links map[string]ldapi.Link -} - -func (r testResult) GetItems() []testItem { - return r.items -} - -func (r testResult) GetLinks() map[string]ldapi.Link { - return r.links -} - -func TestGetPaginatedItems(t *testing.T) { - ctx := context.Background() - projectKey := "test-project" - - testCases := []struct { - name string - fetchResponses []testResult - expectedItems []testItem - expectedError bool - }{ - { - name: "Single page", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}}, - }, - { - name: "Multiple pages", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=2&offset=2")}, - }, - }, - { - items: []testItem{{ID: "3"}, {ID: "4"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}, {ID: "4"}}, - }, - { - name: "Error on second page", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=2&offset=2")}, - }, - }, - }, - expectedError: true, - }, - { - name: "Empty response", - fetchResponses: []testResult{ - { - items: []testItem{}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{}, - }, - { - name: "Multiple pages with varying item counts", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=3&offset=3")}, - }, - }, - { - items: []testItem{{ID: "4"}, {ID: "5"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("http://example.com?limit=3&offset=5")}, - }, - }, - { - items: []testItem{{ID: "6"}}, - links: map[string]ldapi.Link{}, - }, - }, - expectedItems: []testItem{{ID: "1"}, {ID: "2"}, {ID: "3"}, {ID: "4"}, {ID: "5"}, {ID: "6"}}, - }, - { - name: "Invalid next link", - fetchResponses: []testResult{ - { - items: []testItem{{ID: "1"}, {ID: "2"}}, - links: map[string]ldapi.Link{ - "next": {Href: strPtr("invalid-url")}, - }, - }, - }, - expectedError: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - callCount := 0 - fetchFunc := func(ctx context.Context, projectKey string, limit, offset *int64) (testResult, error) { - if callCount >= len(tc.fetchResponses) { - return testResult{}, assert.AnError - } - result := tc.fetchResponses[callCount] - callCount++ - return result, nil - } - - items, err := GetPaginatedItems(ctx, projectKey, nil, fetchFunc) - - if tc.expectedError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tc.expectedItems, items) - } - }) - } -} - func TestRetry429s(t *testing.T) { t.Run("it should call exactly once if not a 429", func(t *testing.T) { called := 0 @@ -183,7 +46,3 @@ func TestRetry429s(t *testing.T) { assert.Equal(t, 2, called) }) } - -func strPtr(s string) *string { - return &s -} diff --git a/internal/dev_server/adapters/mocks/api.go b/internal/dev_server/adapters/mocks/api.go index 0aa788ec..ad81d503 100644 --- a/internal/dev_server/adapters/mocks/api.go +++ b/internal/dev_server/adapters/mocks/api.go @@ -41,19 +41,19 @@ func (m *MockApi) EXPECT() *MockApiMockRecorder { return m.recorder } -// GetAllFlags mocks base method. -func (m *MockApi) GetAllFlags(ctx context.Context, projectKey string) ([]ldapi.FeatureFlag, error) { +// GetFlag mocks base method. +func (m *MockApi) GetFlag(ctx context.Context, projectKey, flagKey string) (ldapi.FeatureFlag, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAllFlags", ctx, projectKey) - ret0, _ := ret[0].([]ldapi.FeatureFlag) + ret := m.ctrl.Call(m, "GetFlag", ctx, projectKey, flagKey) + ret0, _ := ret[0].(ldapi.FeatureFlag) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAllFlags indicates an expected call of GetAllFlags. -func (mr *MockApiMockRecorder) GetAllFlags(ctx, projectKey any) *gomock.Call { +// GetFlag indicates an expected call of GetFlag. +func (mr *MockApiMockRecorder) GetFlag(ctx, projectKey, flagKey any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllFlags", reflect.TypeOf((*MockApi)(nil).GetAllFlags), ctx, projectKey) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlag", reflect.TypeOf((*MockApi)(nil).GetFlag), ctx, projectKey, flagKey) } // GetProjectEnvironments mocks base method. diff --git a/internal/dev_server/adapters/mocks/sdk.go b/internal/dev_server/adapters/mocks/sdk.go index 80c84dd8..c556f29c 100644 --- a/internal/dev_server/adapters/mocks/sdk.go +++ b/internal/dev_server/adapters/mocks/sdk.go @@ -14,6 +14,7 @@ import ( reflect "reflect" ldcontext "github.com/launchdarkly/go-sdk-common/v3/ldcontext" + ldvalue "github.com/launchdarkly/go-sdk-common/v3/ldvalue" flagstate "github.com/launchdarkly/go-server-sdk/v7/interfaces/flagstate" gomock "go.uber.org/mock/gomock" ) @@ -43,12 +44,13 @@ func (m *MockSdk) EXPECT() *MockSdkMockRecorder { } // GetAllFlagsState mocks base method. -func (m *MockSdk) GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, error) { +func (m *MockSdk) GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, map[string][]ldvalue.Value, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllFlagsState", ctx, ldContext, sdkKey) ret0, _ := ret[0].(flagstate.AllFlags) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret1, _ := ret[1].(map[string][]ldvalue.Value) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // GetAllFlagsState indicates an expected call of GetAllFlagsState. diff --git a/internal/dev_server/adapters/sdk.go b/internal/dev_server/adapters/sdk.go index 1d64bfb6..9193e9d6 100644 --- a/internal/dev_server/adapters/sdk.go +++ b/internal/dev_server/adapters/sdk.go @@ -7,10 +7,16 @@ import ( "github.com/launchdarkly/go-sdk-common/v3/ldcontext" "github.com/launchdarkly/go-sdk-common/v3/ldlog" + "github.com/launchdarkly/go-sdk-common/v3/ldvalue" ldsdk "github.com/launchdarkly/go-server-sdk/v7" "github.com/launchdarkly/go-server-sdk/v7/interfaces/flagstate" "github.com/launchdarkly/go-server-sdk/v7/ldcomponents" + "github.com/launchdarkly/go-server-sdk/v7/subsystems" + "github.com/launchdarkly/go-server-sdk/v7/subsystems/ldstoreimpl" + "github.com/launchdarkly/go-server-sdk/v7/subsystems/ldstoretypes" "github.com/pkg/errors" + + "github.com/launchdarkly/go-server-sdk-evaluation/v3/ldmodel" ) const ctxKeySdk = ctxKey("adapters.sdk") @@ -25,7 +31,14 @@ func GetSdk(ctx context.Context) Sdk { //go:generate go run go.uber.org/mock/mockgen -destination mocks/sdk.go -package mocks . Sdk type Sdk interface { - GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, error) + // GetAllFlagsState connects to the source environment's streaming + // endpoint and returns both the evaluated flag state for ldContext, and + // the raw list of variation values for every flag (keyed by flag key) — + // both come off the same single connection, at no extra cost. The raw + // values do not include a variation's display name/description; those + // only exist in the REST API's representation of a flag, never in the + // flag-delivery/streaming wire format. + GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, map[string][]ldvalue.Value, error) } type streamingSdk struct { @@ -38,18 +51,62 @@ func newSdk(streamingUrl string) Sdk { } } -func (s streamingSdk) GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, error) { +// variationCapturingStore wraps the SDK's real in-memory DataStore and only +// overrides Init, to snapshot the raw flag data (including every variation +// value, not just the one resolved for a given context) the moment it +// arrives over the streaming connection. Everything else is delegated +// unchanged to the real store via embedding. +type variationCapturingStore struct { + subsystems.DataStore + variationsByFlagKey map[string][]ldvalue.Value +} + +func (s *variationCapturingStore) Init(allData []ldstoretypes.Collection) error { + for _, collection := range allData { + if collection.Kind != ldstoreimpl.Features() { + continue + } + for _, item := range collection.Items { + if item.Item.Item == nil { + continue + } + flag, ok := item.Item.Item.(*ldmodel.FeatureFlag) + if !ok { + continue + } + s.variationsByFlagKey[item.Key] = flag.Variations + } + } + return s.DataStore.Init(allData) +} + +type variationCapturingStoreConfigurer struct { + store *variationCapturingStore +} + +func (c variationCapturingStoreConfigurer) Build(clientContext subsystems.ClientContext) (subsystems.DataStore, error) { + real, err := ldcomponents.InMemoryDataStore().Build(clientContext) + if err != nil { + return nil, err + } + c.store.DataStore = real + return c.store, nil +} + +func (s streamingSdk) GetAllFlagsState(ctx context.Context, ldContext ldcontext.Context, sdkKey string) (flagstate.AllFlags, map[string][]ldvalue.Value, error) { + capturingStore := &variationCapturingStore{variationsByFlagKey: make(map[string][]ldvalue.Value)} config := ldsdk.Config{ DiagnosticOptOut: true, Events: ldcomponents.NoEvents(), Logging: ldcomponents.Logging().MinLevel(ldlog.Debug), + DataStore: variationCapturingStoreConfigurer{store: capturingStore}, } if s.streamingUrl != "" { config.ServiceEndpoints.Streaming = s.streamingUrl } ldClient, err := ldsdk.MakeCustomClient(sdkKey, config, 5*time.Second) if err != nil { - return flagstate.AllFlags{}, errors.Wrap(err, "unable to get source flags from LD SDK") + return flagstate.AllFlags{}, nil, errors.Wrap(err, "unable to get source flags from LD SDK") } defer func() { err := ldClient.Close() @@ -58,5 +115,5 @@ func (s streamingSdk) GetAllFlagsState(ctx context.Context, ldContext ldcontext. } }() flags := ldClient.AllFlagsState(ldContext) - return flags, nil + return flags, capturingStore.variationsByFlagKey, nil } diff --git a/internal/dev_server/model/project.go b/internal/dev_server/model/project.go index 778bd96b..176a669b 100644 --- a/internal/dev_server/model/project.go +++ b/internal/dev_server/model/project.go @@ -2,12 +2,12 @@ package model import ( "context" + "fmt" "time" "github.com/pkg/errors" "github.com/launchdarkly/go-sdk-common/v3/ldcontext" - "github.com/launchdarkly/go-sdk-common/v3/ldvalue" "github.com/launchdarkly/ldcli/internal/dev_server/adapters" ) @@ -34,10 +34,14 @@ func CreateProject(ctx context.Context, projectKey, sourceEnvironmentKey string, } else { project.Context = *ldCtx } - err := project.refreshExternalState(ctx) + flagsState, variations, err := project.fetchFlagStateAndVariations(ctx) if err != nil { return Project{}, err } + project.AllFlagsState = flagsState + project.AvailableVariations = variations + project.LastSyncTime = time.Now() + store := StoreFromContext(ctx) err = store.InsertProject(ctx, project) if err != nil { @@ -46,22 +50,6 @@ func CreateProject(ctx context.Context, projectKey, sourceEnvironmentKey string, return project, nil } -func (project *Project) refreshExternalState(ctx context.Context) error { - flagsState, err := project.fetchFlagState(ctx) - if err != nil { - return err - } - project.AllFlagsState = flagsState - project.LastSyncTime = time.Now() - - availableVariations, err := project.fetchAvailableVariations(ctx) - if err != nil { - return err - } - project.AvailableVariations = availableVariations - return nil -} - func UpdateProject(ctx context.Context, projectKey string, context *ldcontext.Context, sourceEnvironmentKey *string) (Project, error) { store := StoreFromContext(ctx) project, err := store.GetDevProject(ctx, projectKey) @@ -76,10 +64,20 @@ func UpdateProject(ctx context.Context, projectKey string, context *ldcontext.Co project.SourceEnvironmentKey = *sourceEnvironmentKey } - err = project.refreshExternalState(ctx) + flagsState, variations, err := project.fetchFlagStateAndVariations(ctx) if err != nil { return Project{}, err } + project.AllFlagsState = flagsState + project.LastSyncTime = time.Now() + + // Streaming never carries names, so keep any names already resolved for + // a variation instead of wiping them out on every resync. + existing, err := store.GetAvailableVariationsForProject(ctx, projectKey) + if err != nil { + return Project{}, err + } + project.AvailableVariations = mergeVariationNames(variations, existing) updated, err := store.UpdateProject(ctx, *project) if err != nil { @@ -124,44 +122,61 @@ func (project Project) GetFlagStateWithOverridesForProject(ctx context.Context) return withOverrides, nil } -func (project Project) fetchAvailableVariations(ctx context.Context) ([]FlagVariation, error) { +// fetchFlagStateAndVariations gets flag state and variation values off one +// streaming connection. Values only, no name/description - that only comes +// from the REST API, resolved lazily elsewhere (see ResolveVariationNames). +func (project Project) fetchFlagStateAndVariations(ctx context.Context) (FlagsState, []FlagVariation, error) { apiAdapter := adapters.GetApi(ctx) - flags, err := apiAdapter.GetAllFlags(ctx, project.Key) + sdkKey, err := apiAdapter.GetSdkKey(ctx, project.Key, project.SourceEnvironmentKey) + flagsState := make(FlagsState) + if err != nil { + return flagsState, nil, err + } + + sdkAdapter := adapters.GetSdk(ctx) + sdkFlags, variationsByFlagKey, err := sdkAdapter.GetAllFlagsState(ctx, project.Context, sdkKey) if err != nil { - return nil, err + return flagsState, nil, err } - var allVariations []FlagVariation - for _, flag := range flags { - flagKey := flag.Key - for _, variation := range flag.Variations { - allVariations = append(allVariations, FlagVariation{ + + flagsState = FromAllFlags(sdkFlags) + + var variations []FlagVariation + for flagKey, values := range variationsByFlagKey { + for i, value := range values { + variations = append(variations, FlagVariation{ FlagKey: flagKey, Variation: Variation{ - Id: *variation.Id, - Description: variation.Description, - Name: variation.Name, - Value: ldvalue.CopyArbitraryValue(variation.Value), + // Placeholder id, unique per flag+index. Storage requires + // a non-empty, per-flag-unique id (UNIQUE(project_key, + // flag_key, id) ON CONFLICT REPLACE) - two real empty ids + // would silently overwrite each other. ResolveVariationNames + // replaces this with the real REST id once resolved. + Id: fmt.Sprintf("pending-%d", i), + Value: value, }, }) } } - return allVariations, nil + return flagsState, variations, nil } -func (project Project) fetchFlagState(ctx context.Context) (FlagsState, error) { - apiAdapter := adapters.GetApi(ctx) - sdkKey, err := apiAdapter.GetSdkKey(ctx, project.Key, project.SourceEnvironmentKey) - flagsState := make(FlagsState) - if err != nil { - return flagsState, err - } - - sdkAdapter := adapters.GetSdk(ctx) - sdkFlags, err := sdkAdapter.GetAllFlagsState(ctx, project.Context, sdkKey) - if err != nil { - return flagsState, err +// mergeVariationNames carries over name/description from existing into +// fresh wherever a flag+value match, so a resync doesn't wipe out names +// resolved by an earlier lazy lookup (streaming never has names, so fresh +// always comes in nameless). +func mergeVariationNames(fresh []FlagVariation, existingByFlagKey map[string][]Variation) []FlagVariation { + merged := make([]FlagVariation, len(fresh)) + for i, fv := range fresh { + merged[i] = fv + for _, existing := range existingByFlagKey[fv.FlagKey] { + if existing.Value.Equal(fv.Value) { + merged[i].Id = existing.Id + merged[i].Name = existing.Name + merged[i].Description = existing.Description + break + } + } } - - flagsState = FromAllFlags(sdkFlags) - return flagsState, nil + return merged } diff --git a/internal/dev_server/model/project_test.go b/internal/dev_server/model/project_test.go index 2b15f55d..23800441 100644 --- a/internal/dev_server/model/project_test.go +++ b/internal/dev_server/model/project_test.go @@ -5,12 +5,10 @@ import ( "errors" "testing" - "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" - ldapi "github.com/launchdarkly/api-client-go/v14" "github.com/launchdarkly/go-sdk-common/v3/ldcontext" "github.com/launchdarkly/go-sdk-common/v3/ldvalue" "github.com/launchdarkly/go-server-sdk/v7/interfaces/flagstate" @@ -33,22 +31,9 @@ func TestCreateProject(t *testing.T) { AddFlag("boolFlag", flagstate.FlagState{Value: ldvalue.Bool(true)}). Build() - trueVariationId, falseVariationId := "true", "false" - allFlags := []ldapi.FeatureFlag{{ - Name: "bool flag", - Kind: "bool", - Key: "boolFlag", - Variations: []ldapi.Variation{ - { - Id: &trueVariationId, - Value: true, - }, - { - Id: &falseVariationId, - Value: false, - }, - }, - }} + variationsByFlagKey := map[string][]ldvalue.Value{ + "boolFlag": {ldvalue.Bool(true), ldvalue.Bool(false)}, + } t.Run("Returns error if it cant fetch flag state", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return("", errors.New("fetch flag state fails")) @@ -57,19 +42,18 @@ func TestCreateProject(t *testing.T) { assert.Equal(t, "fetch flag state fails", err.Error()) }) - t.Run("Returns error if it can't fetch flags", func(t *testing.T) { + t.Run("Returns error if GetAllFlagsState fails", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(nil, errors.New("fetch flags failed")) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey). + Return(flagstate.AllFlags{}, nil, errors.New("stream failed")) _, err := model.CreateProject(ctx, projKey, sourceEnvKey, nil) assert.NotNil(t, err) - assert.Equal(t, "fetch flags failed", err.Error()) + assert.Equal(t, "stream failed", err.Error()) }) t.Run("Returns error if it fails to insert the project", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(errors.New("insert fails")) _, err := model.CreateProject(ctx, projKey, sourceEnvKey, nil) @@ -77,10 +61,9 @@ func TestCreateProject(t *testing.T) { assert.Equal(t, "insert fails", err.Error()) }) - t.Run("Successfully creates project", func(t *testing.T) { + t.Run("Successfully creates project, with values-only variations from streaming", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(nil) p, err := model.CreateProject(ctx, projKey, sourceEnvKey, nil) @@ -97,7 +80,16 @@ func TestCreateProject(t *testing.T) { assert.Equal(t, expectedProj.SourceEnvironmentKey, p.SourceEnvironmentKey) assert.Equal(t, expectedProj.Context, p.Context) assert.Equal(t, expectedProj.AllFlagsState, p.AllFlagsState) - //TODO add assertion on AvailableVariations + + require.Len(t, p.AvailableVariations, 2) + seenIds := map[string]bool{} + for _, v := range p.AvailableVariations { + assert.Equal(t, "boolFlag", v.FlagKey) + assert.NotEmpty(t, v.Id, "needs a unique placeholder id until a real one is resolved") + assert.False(t, seenIds[v.Id], "placeholder ids must be unique per flag") + seenIds[v.Id] = true + assert.Nil(t, v.Name, "no REST call was made, so no name is known yet") + } }) } @@ -125,17 +117,9 @@ func TestUpdateProject(t *testing.T) { AddFlag("stringFlag", flagstate.FlagState{Value: ldvalue.String("cool")}). Build() - allFlags := []ldapi.FeatureFlag{{ - Name: "string flag", - Kind: "multivariate", - Key: "stringFlag", - Variations: []ldapi.Variation{ - { - Id: lo.ToPtr("string"), - Value: "cool", - }, - }, - }} + variationsByFlagKey := map[string][]ldvalue.Value{ + "stringFlag": {ldvalue.String("cool")}, + } t.Run("Returns error if GetDevProject fails", func(t *testing.T) { store.EXPECT().GetDevProject(gomock.Any(), proj.Key).Return(&model.Project{}, errors.New("GetDevProject fails")) @@ -156,8 +140,8 @@ func TestUpdateProject(t *testing.T) { t.Run("Returns error if UpdateProject fails", func(t *testing.T) { store.EXPECT().GetDevProject(gomock.Any(), proj.Key).Return(&proj, nil) api.EXPECT().GetSdkKey(gomock.Any(), proj.Key, newSrcEnv).Return("sdkKey", nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), proj.Key).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, variationsByFlagKey, nil) + store.EXPECT().GetAvailableVariationsForProject(gomock.Any(), proj.Key).Return(map[string][]model.Variation{}, nil) store.EXPECT().UpdateProject(gomock.Any(), gomock.Any()).Return(false, errors.New("UpdateProject fails")) _, err := model.UpdateProject(ctx, proj.Key, nil, &newSrcEnv) @@ -168,8 +152,8 @@ func TestUpdateProject(t *testing.T) { t.Run("Returns error if project was not actually updated", func(t *testing.T) { store.EXPECT().GetDevProject(gomock.Any(), proj.Key).Return(&proj, nil) api.EXPECT().GetSdkKey(gomock.Any(), proj.Key, proj.SourceEnvironmentKey).Return("sdkKey", nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), proj.Key).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, variationsByFlagKey, nil) + store.EXPECT().GetAvailableVariationsForProject(gomock.Any(), proj.Key).Return(map[string][]model.Variation{}, nil) store.EXPECT().UpdateProject(gomock.Any(), gomock.Any()).Return(false, nil) _, err := model.UpdateProject(ctx, proj.Key, nil, nil) @@ -177,12 +161,21 @@ func TestUpdateProject(t *testing.T) { assert.Equal(t, "Project not updated", err.Error()) }) - t.Run("Return successfully", func(t *testing.T) { + t.Run("Return successfully, carrying over a previously resolved name", func(t *testing.T) { + existingName := "Cool" store.EXPECT().GetDevProject(gomock.Any(), proj.Key).Return(&proj, nil) api.EXPECT().GetSdkKey(gomock.Any(), proj.Key, proj.SourceEnvironmentKey).Return("sdkKey", nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), proj.Key).Return(allFlags, nil) - store.EXPECT().UpdateProject(gomock.Any(), gomock.Any()).Return(true, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), "sdkKey").Return(allFlagsState, variationsByFlagKey, nil) + store.EXPECT().GetAvailableVariationsForProject(gomock.Any(), proj.Key).Return(map[string][]model.Variation{ + "stringFlag": {{Id: "abc", Name: &existingName, Value: ldvalue.String("cool")}}, + }, nil) + store.EXPECT().UpdateProject(gomock.Any(), gomock.Any()). + DoAndReturn(func(_ context.Context, p model.Project) (bool, error) { + require.Len(t, p.AvailableVariations, 1) + assert.Equal(t, "abc", p.AvailableVariations[0].Id) + assert.Equal(t, &existingName, p.AvailableVariations[0].Name) + return true, nil + }) store.EXPECT().IncrementProjectPayloadVersion(gomock.Any(), proj.Key).Return(2, nil) store.EXPECT().GetOverridesForProject(gomock.Any(), proj.Key).Return(model.Overrides{}, nil) observer. @@ -197,6 +190,7 @@ func TestUpdateProject(t *testing.T) { require.Nil(t, err) expectedProj := proj expectedProj.PayloadVersion = 2 + expectedProj.AvailableVariations = project.AvailableVariations // asserted above via DoAndReturn assert.Equal(t, expectedProj, project) }) } diff --git a/internal/dev_server/model/sync_test.go b/internal/dev_server/model/sync_test.go index ed508135..1ea2f8b8 100644 --- a/internal/dev_server/model/sync_test.go +++ b/internal/dev_server/model/sync_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" - ldapi "github.com/launchdarkly/api-client-go/v14" "github.com/launchdarkly/go-sdk-common/v3/ldcontext" "github.com/launchdarkly/go-sdk-common/v3/ldvalue" "github.com/launchdarkly/go-server-sdk/v7/interfaces/flagstate" @@ -18,7 +17,6 @@ import ( ) func TestInitialSync(t *testing.T) { - ctx := context.Background() mockController := gomock.NewController(t) observers := model.NewObservers() @@ -34,22 +32,9 @@ func TestInitialSync(t *testing.T) { AddFlag("boolFlag", flagstate.FlagState{Value: ldvalue.Bool(true)}). Build() - trueVariationId, falseVariationId := "true", "false" - allFlags := []ldapi.FeatureFlag{{ - Name: "bool flag", - Kind: "bool", - Key: "boolFlag", - Variations: []ldapi.Variation{ - { - Id: &trueVariationId, - Value: true, - }, - { - Id: &falseVariationId, - Value: false, - }, - }, - }} + variationsByFlagKey := map[string][]ldvalue.Value{ + "boolFlag": {ldvalue.Bool(true), ldvalue.Bool(false)}, + } t.Run("Returns no error if disabled", func(t *testing.T) { input := model.InitialProjectSettings{ @@ -77,26 +62,9 @@ func TestInitialSync(t *testing.T) { assert.Equal(t, "fetch flag state fails", err.Error()) }) - t.Run("Returns error if it can't fetch flags", func(t *testing.T) { - api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(nil, errors.New("fetch flags failed")) - input := model.InitialProjectSettings{ - Enabled: true, - ProjectKey: projKey, - EnvKey: sourceEnvKey, - Context: nil, - Overrides: nil, - } - err := model.CreateOrSyncProject(ctx, input) - assert.NotNil(t, err) - assert.Equal(t, "fetch flags failed", err.Error()) - }) - t.Run("Returns error if it fails to insert the project", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(errors.New("insert fails")) input := model.InitialProjectSettings{ @@ -113,8 +81,7 @@ func TestInitialSync(t *testing.T) { t.Run("Successfully creates project", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(nil) input := model.InitialProjectSettings{ @@ -150,8 +117,7 @@ func TestInitialSync(t *testing.T) { } api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(nil) store.EXPECT().GetDevProject(gomock.Any(), projKey).Return(&proj, nil) store.EXPECT().UpsertOverride(gomock.Any(), override).Return(override, nil) @@ -173,8 +139,7 @@ func TestInitialSync(t *testing.T) { t.Run("If SyncOnce is set and the project already exists, return early", func(t *testing.T) { api.EXPECT().GetSdkKey(gomock.Any(), projKey, sourceEnvKey).Return(sdkKey, nil) - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, nil) - api.EXPECT().GetAllFlags(gomock.Any(), projKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), sdkKey).Return(allFlagsState, variationsByFlagKey, nil) store.EXPECT().InsertProject(gomock.Any(), gomock.Any()).Return(model.NewErrAlreadyExists("project", projKey)) input := model.InitialProjectSettings{ @@ -188,5 +153,4 @@ func TestInitialSync(t *testing.T) { assert.NoError(t, err) }) - } diff --git a/internal/dev_server/sdk/go_sdk_test.go b/internal/dev_server/sdk/go_sdk_test.go index 594e0db0..98aec32c 100644 --- a/internal/dev_server/sdk/go_sdk_test.go +++ b/internal/dev_server/sdk/go_sdk_test.go @@ -46,9 +46,6 @@ func TestSDKRoutesViaGoSDK(t *testing.T) { ctx, api, sdk := mocks.WithMockApiAndSdk(ctx, mockController) api.EXPECT().GetSdkKey(gomock.Any(), projectKey, environmentKey).Return(testSdkKey, nil).AnyTimes() - api.EXPECT().GetAllFlags(gomock.Any(), projectKey). - Return(nil, nil). // Available variations are not used for evaluation - AnyTimes() // Wire up sdk routes in test server router := mux.NewRouter() @@ -67,7 +64,7 @@ func TestSDKRoutesViaGoSDK(t *testing.T) { AddFlag("jsonFlag", flagstate.FlagState{Value: ldvalue.CopyArbitraryValue(map[string]any{"cat": "hat"})}). Build() - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), testSdkKey).Return(allFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), testSdkKey).Return(allFlags, nil, nil) _, err = model.CreateProject(ctx, projectKey, environmentKey, nil) require.NoError(t, err) @@ -121,7 +118,7 @@ func TestSDKRoutesViaGoSDK(t *testing.T) { Build() valuesMap := updatedFlags.ToValuesMap() - sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), testSdkKey).Return(updatedFlags, nil) + sdk.EXPECT().GetAllFlagsState(gomock.Any(), gomock.Any(), testSdkKey).Return(updatedFlags, nil, nil) // This test is testing the "put" payload in a roundabout way by verifying each of the flags are in there. t.Run("Sync sends full flag payload for project", func(t *testing.T) { From de8c942cb4f69682f90e80916b664cd0a3dd6328 Mon Sep 17 00:00:00 2001 From: David Brackbill Date: Thu, 9 Jul 2026 07:50:08 -0700 Subject: [PATCH 2/6] feat(dev-server): fill variation names in the background after sync Values come off the streaming connection (fast, unchanged). Names, which only exist in the REST flag representation, are now filled in the background: paginate GET /flags 6 pages concurrently and upsert each page's names as it returns, so the override picker's raw values pick up friendly names shortly after sync without any REST on the sync path. Kicked off (detached from the request context) from the add-project and patch handlers and from startup sync via FillVariationNamesAsync, a var so tests can stub the background work. The UI re-polls availableVariations until no pending- placeholder ids remain. Claude --- internal/dev_server/adapters/api.go | 14 ++++ internal/dev_server/adapters/mocks/api.go | 16 ++++ internal/dev_server/api/patch_project.go | 2 + internal/dev_server/api/post_add_project.go | 2 + internal/dev_server/db/sqlite.go | 39 +++++++++ .../dev_server/model/fill_variation_names.go | 84 +++++++++++++++++++ .../model/fill_variation_names_test.go | 75 +++++++++++++++++ internal/dev_server/model/mocks/store.go | 14 ++++ internal/dev_server/model/project.go | 6 +- internal/dev_server/model/store.go | 2 + internal/dev_server/model/sync.go | 2 + internal/dev_server/model/sync_test.go | 5 ++ internal/dev_server/ui/dist/index.html | 30 +++---- internal/dev_server/ui/src/FlagsPage.tsx | 47 +++++++++++ 14 files changed, 320 insertions(+), 18 deletions(-) create mode 100644 internal/dev_server/model/fill_variation_names.go create mode 100644 internal/dev_server/model/fill_variation_names_test.go diff --git a/internal/dev_server/adapters/api.go b/internal/dev_server/adapters/api.go index 68d5bf86..7574a4c3 100644 --- a/internal/dev_server/adapters/api.go +++ b/internal/dev_server/adapters/api.go @@ -25,6 +25,8 @@ func GetApi(ctx context.Context) Api { type Api interface { GetSdkKey(ctx context.Context, projectKey, environmentKey string) (string, error) GetFlag(ctx context.Context, projectKey, flagKey string) (ldapi.FeatureFlag, error) + // GetFlagsPage returns one page of flags plus the project's total flag count. + GetFlagsPage(ctx context.Context, projectKey string, limit, offset int64) (flags []ldapi.FeatureFlag, total int, err error) GetProjectEnvironments(ctx context.Context, projectKey string, query string, limit *int) ([]ldapi.Environment, error) } @@ -53,6 +55,18 @@ func (a apiClientApi) GetFlag(ctx context.Context, projectKey, flagKey string) ( return *flag, nil } +func (a apiClientApi) GetFlagsPage(ctx context.Context, projectKey string, limit, offset int64) ([]ldapi.FeatureFlag, int, error) { + query := a.apiClient.FeatureFlagsApi.GetFeatureFlags(ctx, projectKey). + Filter("purpose:all+!(holdout)"). + Limit(limit). + Offset(offset) + flags, err := internal.Retry429s(query.Execute) + if err != nil { + return nil, 0, errors.Wrapf(err, "unable to get flags page (offset %d) from LD API", offset) + } + return flags.Items, int(flags.GetTotalCount()), nil +} + func (a apiClientApi) GetProjectEnvironments(ctx context.Context, projectKey string, query string, limit *int) ([]ldapi.Environment, error) { log.Printf("Fetching all environments for project '%s'", projectKey) environments, err := a.getEnvironments(ctx, projectKey, nil, query, limit) diff --git a/internal/dev_server/adapters/mocks/api.go b/internal/dev_server/adapters/mocks/api.go index ad81d503..6ce480e5 100644 --- a/internal/dev_server/adapters/mocks/api.go +++ b/internal/dev_server/adapters/mocks/api.go @@ -56,6 +56,22 @@ func (mr *MockApiMockRecorder) GetFlag(ctx, projectKey, flagKey any) *gomock.Cal return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlag", reflect.TypeOf((*MockApi)(nil).GetFlag), ctx, projectKey, flagKey) } +// GetFlagsPage mocks base method. +func (m *MockApi) GetFlagsPage(ctx context.Context, projectKey string, limit, offset int64) ([]ldapi.FeatureFlag, int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFlagsPage", ctx, projectKey, limit, offset) + ret0, _ := ret[0].([]ldapi.FeatureFlag) + ret1, _ := ret[1].(int) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetFlagsPage indicates an expected call of GetFlagsPage. +func (mr *MockApiMockRecorder) GetFlagsPage(ctx, projectKey, limit, offset any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlagsPage", reflect.TypeOf((*MockApi)(nil).GetFlagsPage), ctx, projectKey, limit, offset) +} + // GetProjectEnvironments mocks base method. func (m *MockApi) GetProjectEnvironments(ctx context.Context, projectKey, query string, limit *int) ([]ldapi.Environment, error) { m.ctrl.T.Helper() diff --git a/internal/dev_server/api/patch_project.go b/internal/dev_server/api/patch_project.go index c7fcd4a6..7bd6606c 100644 --- a/internal/dev_server/api/patch_project.go +++ b/internal/dev_server/api/patch_project.go @@ -16,6 +16,8 @@ func (s server) PatchProject(ctx context.Context, request PatchProjectRequestObj return PatchProject404Response{}, nil } + model.FillVariationNamesAsync(ctx, request.ProjectKey) + response := ProjectJSONResponse{ LastSyncedFromSource: project.LastSyncTime.Unix(), Context: project.Context, diff --git a/internal/dev_server/api/post_add_project.go b/internal/dev_server/api/post_add_project.go index 3933252b..5dec3f54 100644 --- a/internal/dev_server/api/post_add_project.go +++ b/internal/dev_server/api/post_add_project.go @@ -30,6 +30,8 @@ func (s server) PostAddProject(ctx context.Context, request PostAddProjectReques return nil, err } + model.FillVariationNamesAsync(ctx, request.ProjectKey) + response := ProjectJSONResponse{ LastSyncedFromSource: project.LastSyncTime.Unix(), Context: project.Context, diff --git a/internal/dev_server/db/sqlite.go b/internal/dev_server/db/sqlite.go index 5bd66ec7..2d809bd4 100644 --- a/internal/dev_server/db/sqlite.go +++ b/internal/dev_server/db/sqlite.go @@ -174,6 +174,45 @@ func InsertAvailableVariations(ctx context.Context, tx *sql.Tx, project model.Pr return nil } +// UpsertAvailableVariationsForFlags replaces the stored variations for just the +// given flags (delete then re-insert each), leaving every other flag untouched. +func (s *Sqlite) UpsertAvailableVariationsForFlags(ctx context.Context, projectKey string, variationsByFlagKey map[string][]model.Variation) (err error) { + tx, err := s.database.BeginTx(ctx, nil) + if err != nil { + return err + } + defer func() { + if err != nil { + _ = tx.Rollback() + } + }() + + for flagKey, variations := range variationsByFlagKey { + _, err = tx.ExecContext(ctx, ` + DELETE FROM available_variations WHERE project_key = ? AND flag_key = ? + `, projectKey, flagKey) + if err != nil { + return err + } + for _, variation := range variations { + var jsonValue []byte + jsonValue, err = variation.Value.MarshalJSON() + if err != nil { + return err + } + _, err = tx.ExecContext(ctx, ` + INSERT INTO available_variations + (project_key, flag_key, id, value, description, name) + VALUES (?, ?, ?, ?, ?, ?) + `, projectKey, flagKey, variation.Id, string(jsonValue), variation.Description, variation.Name) + if err != nil { + return err + } + } + } + return tx.Commit() +} + func (s *Sqlite) InsertProject(ctx context.Context, project model.Project) (err error) { flagsStateJson, err := json.Marshal(project.AllFlagsState) if err != nil { diff --git a/internal/dev_server/model/fill_variation_names.go b/internal/dev_server/model/fill_variation_names.go new file mode 100644 index 00000000..54175f37 --- /dev/null +++ b/internal/dev_server/model/fill_variation_names.go @@ -0,0 +1,84 @@ +package model + +import ( + "context" + "log" + + ldapi "github.com/launchdarkly/api-client-go/v14" + "github.com/launchdarkly/go-sdk-common/v3/ldvalue" + "github.com/launchdarkly/ldcli/internal/dev_server/adapters" + "golang.org/x/sync/errgroup" +) + +const ( + fillPageSize = 100 + maxConcurrentPages = 6 +) + +// FillVariationNamesAsync runs FillVariationNames in the background on a context +// detached from the caller's, so it outlives the request/sync that started it. +// It's a var so tests can stub out the background work. +var FillVariationNamesAsync = func(ctx context.Context, projectKey string) { + go FillVariationNames(context.WithoutCancel(ctx), projectKey) +} + +// FillVariationNames fetches every flag's variation names from REST and upserts +// them a page at a time as each page returns, so the override picker's raw +// streaming values pick up friendly names shortly after sync. It does no work +// on the sync path itself - callers run it in a goroutine on a detached context. +func FillVariationNames(ctx context.Context, projectKey string) { + api := adapters.GetApi(ctx) + store := StoreFromContext(ctx) + + first, total, err := api.GetFlagsPage(ctx, projectKey, fillPageSize, 0) + if err != nil { + log.Printf("variation name fill: initial page failed for %q: %v", projectKey, err) + return + } + if err := upsertPageNames(ctx, store, projectKey, first); err != nil { + log.Printf("variation name fill: upsert page 0 failed for %q: %v", projectKey, err) + } + + g, ctx := errgroup.WithContext(ctx) + g.SetLimit(maxConcurrentPages) + for offset := int64(fillPageSize); offset < int64(total); offset += fillPageSize { + offset := offset + g.Go(func() error { + page, _, err := api.GetFlagsPage(ctx, projectKey, fillPageSize, offset) + if err != nil { + // Skip the failed page; the rest still fill in. + log.Printf("variation name fill: page at offset %d failed for %q: %v", offset, projectKey, err) + return nil + } + if err := upsertPageNames(ctx, store, projectKey, page); err != nil { + log.Printf("variation name fill: upsert at offset %d failed for %q: %v", offset, projectKey, err) + } + return nil + }) + } + _ = g.Wait() +} + +func upsertPageNames(ctx context.Context, store Store, projectKey string, flags []ldapi.FeatureFlag) error { + byFlagKey := make(map[string][]Variation, len(flags)) + for _, flag := range flags { + byFlagKey[flag.Key] = variationsFromFlag(flag) + } + if len(byFlagKey) == 0 { + return nil + } + return store.UpsertAvailableVariationsForFlags(ctx, projectKey, byFlagKey) +} + +func variationsFromFlag(flag ldapi.FeatureFlag) []Variation { + variations := make([]Variation, 0, len(flag.Variations)) + for _, v := range flag.Variations { + variations = append(variations, Variation{ + Id: *v.Id, + Description: v.Description, + Name: v.Name, + Value: ldvalue.CopyArbitraryValue(v.Value), + }) + } + return variations +} diff --git a/internal/dev_server/model/fill_variation_names_test.go b/internal/dev_server/model/fill_variation_names_test.go new file mode 100644 index 00000000..69d20517 --- /dev/null +++ b/internal/dev_server/model/fill_variation_names_test.go @@ -0,0 +1,75 @@ +package model_test + +import ( + "context" + "sync" + "testing" + + ldapi "github.com/launchdarkly/api-client-go/v14" + "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + + adapters_mocks "github.com/launchdarkly/ldcli/internal/dev_server/adapters/mocks" + "github.com/launchdarkly/ldcli/internal/dev_server/model" + "github.com/launchdarkly/ldcli/internal/dev_server/model/mocks" +) + +func TestFillVariationNames(t *testing.T) { + ctx := context.Background() + ctrl := gomock.NewController(t) + ctx, api, _ := adapters_mocks.WithMockApiAndSdk(ctx, ctrl) + store := mocks.NewMockStore(ctrl) + ctx = model.ContextWithStore(ctx, store) + + projKey := "proj" + strPtr := func(s string) *string { return &s } + flag := func(key string) ldapi.FeatureFlag { + return ldapi.FeatureFlag{ + Key: key, + Variations: []ldapi.Variation{ + {Id: strPtr(key + "-0"), Name: strPtr("On"), Value: true}, + {Id: strPtr(key + "-1"), Name: strPtr("Off"), Value: false}, + }, + } + } + + // total 250 with page size 100 => pages at offsets 0, 100, 200. + api.EXPECT().GetFlagsPage(gomock.Any(), projKey, int64(100), int64(0)). + Return([]ldapi.FeatureFlag{flag("a")}, 250, nil) + api.EXPECT().GetFlagsPage(gomock.Any(), projKey, int64(100), int64(100)). + Return([]ldapi.FeatureFlag{flag("b")}, 250, nil) + api.EXPECT().GetFlagsPage(gomock.Any(), projKey, int64(100), int64(200)). + Return([]ldapi.FeatureFlag{flag("c")}, 250, nil) + + var mu sync.Mutex + upserted := map[string]bool{} + store.EXPECT().UpsertAvailableVariationsForFlags(gomock.Any(), projKey, gomock.Any()). + DoAndReturn(func(_ context.Context, _ string, byFlagKey map[string][]model.Variation) error { + mu.Lock() + defer mu.Unlock() + for key, variations := range byFlagKey { + assert.Len(t, variations, 2) + assert.Equal(t, "On", *variations[0].Name) + upserted[key] = true + } + return nil + }).Times(3) + + model.FillVariationNames(ctx, projKey) + + assert.Equal(t, map[string]bool{"a": true, "b": true, "c": true}, upserted) +} + +func TestFillVariationNamesInitialPageError(t *testing.T) { + ctx := context.Background() + ctrl := gomock.NewController(t) + ctx, api, _ := adapters_mocks.WithMockApiAndSdk(ctx, ctrl) + store := mocks.NewMockStore(ctrl) + ctx = model.ContextWithStore(ctx, store) + + // A failed first page bails out entirely - no upserts, no panic. + api.EXPECT().GetFlagsPage(gomock.Any(), "proj", int64(100), int64(0)). + Return(nil, 0, assert.AnError) + + model.FillVariationNames(ctx, "proj") +} diff --git a/internal/dev_server/model/mocks/store.go b/internal/dev_server/model/mocks/store.go index dd037c2e..48c0824e 100644 --- a/internal/dev_server/model/mocks/store.go +++ b/internal/dev_server/model/mocks/store.go @@ -103,6 +103,20 @@ func (mr *MockStoreMockRecorder) GetAvailableVariationsForProject(ctx, projectKe return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAvailableVariationsForProject", reflect.TypeOf((*MockStore)(nil).GetAvailableVariationsForProject), ctx, projectKey) } +// UpsertAvailableVariationsForFlags mocks base method. +func (m *MockStore) UpsertAvailableVariationsForFlags(ctx context.Context, projectKey string, variationsByFlagKey map[string][]model.Variation) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpsertAvailableVariationsForFlags", ctx, projectKey, variationsByFlagKey) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertAvailableVariationsForFlags indicates an expected call of UpsertAvailableVariationsForFlags. +func (mr *MockStoreMockRecorder) UpsertAvailableVariationsForFlags(ctx, projectKey, variationsByFlagKey any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertAvailableVariationsForFlags", reflect.TypeOf((*MockStore)(nil).UpsertAvailableVariationsForFlags), ctx, projectKey, variationsByFlagKey) +} + // GetDevProject mocks base method. func (m *MockStore) GetDevProject(ctx context.Context, projectKey string) (*model.Project, error) { m.ctrl.T.Helper() diff --git a/internal/dev_server/model/project.go b/internal/dev_server/model/project.go index 176a669b..7b12fb8a 100644 --- a/internal/dev_server/model/project.go +++ b/internal/dev_server/model/project.go @@ -50,14 +50,14 @@ func CreateProject(ctx context.Context, projectKey, sourceEnvironmentKey string, return project, nil } -func UpdateProject(ctx context.Context, projectKey string, context *ldcontext.Context, sourceEnvironmentKey *string) (Project, error) { +func UpdateProject(ctx context.Context, projectKey string, ldCtx *ldcontext.Context, sourceEnvironmentKey *string) (Project, error) { store := StoreFromContext(ctx) project, err := store.GetDevProject(ctx, projectKey) if err != nil { return Project{}, err } - if context != nil { - project.Context = *context + if ldCtx != nil { + project.Context = *ldCtx } if sourceEnvironmentKey != nil { diff --git a/internal/dev_server/model/store.go b/internal/dev_server/model/store.go index 7a3b3883..b8eae5fc 100644 --- a/internal/dev_server/model/store.go +++ b/internal/dev_server/model/store.go @@ -28,6 +28,8 @@ type Store interface { UpsertOverride(ctx context.Context, override Override) (Override, error) GetOverridesForProject(ctx context.Context, projectKey string) (Overrides, error) GetAvailableVariationsForProject(ctx context.Context, projectKey string) (map[string][]Variation, error) + // UpsertAvailableVariationsForFlags replaces the stored variations for just the given flags. + UpsertAvailableVariationsForFlags(ctx context.Context, projectKey string, variationsByFlagKey map[string][]Variation) error // IncrementProjectPayloadVersion atomically increments the payload version for the project and returns the new version. IncrementProjectPayloadVersion(ctx context.Context, projectKey string) (int, error) diff --git a/internal/dev_server/model/sync.go b/internal/dev_server/model/sync.go index 6def0ba5..3acdeb0d 100644 --- a/internal/dev_server/model/sync.go +++ b/internal/dev_server/model/sync.go @@ -55,6 +55,8 @@ func CreateOrSyncProject(ctx context.Context, settings InitialProjectSettings) e } } + FillVariationNamesAsync(ctx, settings.ProjectKey) + log.Printf("Successfully synced Initial project [%s]", project.Key) return nil } diff --git a/internal/dev_server/model/sync_test.go b/internal/dev_server/model/sync_test.go index 1ea2f8b8..c9fce3cd 100644 --- a/internal/dev_server/model/sync_test.go +++ b/internal/dev_server/model/sync_test.go @@ -17,6 +17,11 @@ import ( ) func TestInitialSync(t *testing.T) { + // Stub out the background name fill so it doesn't race the mock controller. + original := model.FillVariationNamesAsync + model.FillVariationNamesAsync = func(context.Context, string) {} + defer func() { model.FillVariationNamesAsync = original }() + ctx := context.Background() mockController := gomock.NewController(t) observers := model.NewObservers() diff --git a/internal/dev_server/ui/dist/index.html b/internal/dev_server/ui/dist/index.html index de0479fd..10789a9e 100644 --- a/internal/dev_server/ui/dist/index.html +++ b/internal/dev_server/ui/dist/index.html @@ -13,7 +13,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lm;function n_(){if(lm)return ut;lm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function w(W){return W===null||typeof W!="object"?null:(W=y&&W[y]||W["@@iterator"],typeof W=="function"?W:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function _(W,ne,le){this.props=W,this.context=ne,this.refs=k,this.updater=le||$}_.prototype.isReactComponent={},_.prototype.setState=function(W,ne){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,ne,"setState")},_.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function A(){}A.prototype=_.prototype;function B(W,ne,le){this.props=W,this.context=ne,this.refs=k,this.updater=le||$}var M=B.prototype=new A;M.constructor=B,E(M,_.prototype),M.isPureReactComponent=!0;var V=Array.isArray,I=Object.prototype.hasOwnProperty,O={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function L(W,ne,le){var q,ce={},Ce=null,ke=null;if(ne!=null)for(q in ne.ref!==void 0&&(ke=ne.ref),ne.key!==void 0&&(Ce=""+ne.key),ne)I.call(ne,q)&&!ee.hasOwnProperty(q)&&(ce[q]=ne[q]);var Se=arguments.length-2;if(Se===1)ce.children=le;else if(1>>1,ne=fe[W];if(0>>1;Wl(ce,ue))Cel(ke,ce)?(fe[W]=ke,fe[Ce]=ue,W=Ce):(fe[W]=ce,fe[q]=ue,W=q);else if(Cel(ke,ue))fe[W]=ke,fe[Ce]=ue,W=Ce;else break e}}return Pe}function l(fe,Pe){var ue=fe.sortIndex-Pe.sortIndex;return ue!==0?ue:fe.id-Pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],h=[],m=1,y=null,w=3,$=!1,E=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(fe){for(var Pe=n(h);Pe!==null;){if(Pe.callback===null)r(h);else if(Pe.startTime<=fe)r(h),Pe.sortIndex=Pe.expirationTime,t(p,Pe);else break;Pe=n(h)}}function V(fe){if(k=!1,M(fe),!E)if(n(p)!==null)E=!0,$e(I);else{var Pe=n(h);Pe!==null&&se(V,Pe.startTime-fe)}}function I(fe,Pe){E=!1,k&&(k=!1,A(L),L=-1),$=!0;var ue=w;try{for(M(Pe),y=n(p);y!==null&&(!(y.expirationTime>Pe)||fe&&!X());){var W=y.callback;if(typeof W=="function"){y.callback=null,w=y.priorityLevel;var ne=W(y.expirationTime<=Pe);Pe=e.unstable_now(),typeof ne=="function"?y.callback=ne:y===n(p)&&r(p),M(Pe)}else r(p);y=n(p)}if(y!==null)var le=!0;else{var q=n(h);q!==null&&se(V,q.startTime-Pe),le=!1}return le}finally{y=null,w=ue,$=!1}}var O=!1,ee=null,L=-1,re=5,Z=-1;function X(){return!(e.unstable_now()-Zfe||125W?(fe.sortIndex=ue,t(h,fe),n(p)===null&&fe===n(h)&&(k?(A(L),L=-1):k=!0,se(V,ue-W))):(fe.sortIndex=ne,t(p,fe),E||$||(E=!0,$e(I))),fe},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(fe){var Pe=w;return function(){var ue=w;w=Pe;try{return fe.apply(this,arguments)}finally{w=ue}}}}(I7)),I7}var cm;function o_(){return cm||(cm=1,F7.exports=l_()),F7.exports}/** + */var um;function l_(){return um||(um=1,function(e){function t(fe,Pe){var ue=fe.length;fe.push(Pe);e:for(;0>>1,ne=fe[W];if(0>>1;Wl(ce,ue))Cel(ke,ce)?(fe[W]=ke,fe[Ce]=ue,W=Ce):(fe[W]=ce,fe[q]=ue,W=q);else if(Cel(ke,ue))fe[W]=ke,fe[Ce]=ue,W=Ce;else break e}}return Pe}function l(fe,Pe){var ue=fe.sortIndex-Pe.sortIndex;return ue!==0?ue:fe.id-Pe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],h=[],m=1,y=null,w=3,$=!1,E=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(fe){for(var Pe=n(h);Pe!==null;){if(Pe.callback===null)r(h);else if(Pe.startTime<=fe)r(h),Pe.sortIndex=Pe.expirationTime,t(p,Pe);else break;Pe=n(h)}}function V(fe){if(k=!1,M(fe),!E)if(n(p)!==null)E=!0,$e(I);else{var Pe=n(h);Pe!==null&&se(V,Pe.startTime-fe)}}function I(fe,Pe){E=!1,k&&(k=!1,A(L),L=-1),$=!0;var ue=w;try{for(M(Pe),y=n(p);y!==null&&(!(y.expirationTime>Pe)||fe&&!Y());){var W=y.callback;if(typeof W=="function"){y.callback=null,w=y.priorityLevel;var ne=W(y.expirationTime<=Pe);Pe=e.unstable_now(),typeof ne=="function"?y.callback=ne:y===n(p)&&r(p),M(Pe)}else r(p);y=n(p)}if(y!==null)var le=!0;else{var q=n(h);q!==null&&se(V,q.startTime-Pe),le=!1}return le}finally{y=null,w=ue,$=!1}}var O=!1,ee=null,L=-1,re=5,Z=-1;function Y(){return!(e.unstable_now()-Zfe||125W?(fe.sortIndex=ue,t(h,fe),n(p)===null&&fe===n(h)&&(k?(A(L),L=-1):k=!0,se(V,ue-W))):(fe.sortIndex=ne,t(p,fe),E||$||(E=!0,$e(I))),fe},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(fe){var Pe=w;return function(){var ue=w;w=Pe;try{return fe.apply(this,arguments)}finally{w=ue}}}}(I7)),I7}var cm;function o_(){return cm||(cm=1,F7.exports=l_()),F7.exports}/** * @license React * react-dom.production.min.js * @@ -37,14 +37,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var dm;function a_(){if(dm)return On;dm=1;var e=O5(),t=o_();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function w(i){return p.call(y,i)?!0:p.call(m,i)?!1:h.test(i)?y[i]=!0:(m[i]=!0,!1)}function $(i,o,d,v){if(d!==null&&d.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return v?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,o,d,v){if(o===null||typeof o>"u"||$(i,o,d,v))return!0;if(v)return!1;if(d!==null)switch(d.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function k(i,o,d,v,x,S,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=v,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=i,this.type=o,this.sanitizeURL=S,this.removeEmptyString=T}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){_[i]=new k(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];_[o]=new k(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){_[i]=new k(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){_[i]=new k(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){_[i]=new k(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){_[i]=new k(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){_[i]=new k(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){_[i]=new k(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){_[i]=new k(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function B(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!1,!1)}),_.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!0,!0)});function M(i,o,d,v){var x=_.hasOwnProperty(o)?_[o]:null;(x!==null?x.type!==0:v||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function w(i){return p.call(y,i)?!0:p.call(m,i)?!1:h.test(i)?y[i]=!0:(m[i]=!0,!1)}function $(i,o,d,v){if(d!==null&&d.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return v?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function E(i,o,d,v){if(o===null||typeof o>"u"||$(i,o,d,v))return!0;if(v)return!1;if(d!==null)switch(d.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function k(i,o,d,v,x,S,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=v,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=i,this.type=o,this.sanitizeURL=S,this.removeEmptyString=T}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){_[i]=new k(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];_[o]=new k(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){_[i]=new k(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){_[i]=new k(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){_[i]=new k(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){_[i]=new k(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){_[i]=new k(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){_[i]=new k(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){_[i]=new k(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function B(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(A,B);_[o]=new k(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!1,!1)}),_.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){_[i]=new k(i,1,!1,i.toLowerCase(),null,!0,!0)});function M(i,o,d,v){var x=_.hasOwnProperty(o)?_[o]:null;(x!==null?x.type!==0:v||!(2N||x[T]!==S[N]){var K=` -`+x[T].replace(" at new "," at ");return i.displayName&&K.includes("")&&(K=K.replace("",i.displayName)),K}while(1<=T&&0<=N);break}}}finally{le=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ne(i):""}function ce(i){switch(i.tag){case 5:return ne(i.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return i=q(i.type,!1),i;case 11:return i=q(i.type.render,!1),i;case 1:return i=q(i.type,!0),i;default:return""}}function Ce(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ee:return"Fragment";case O:return"Portal";case re:return"Profiler";case L:return"StrictMode";case G:return"Suspense";case Q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case X:return(i.displayName||"Context")+".Consumer";case Z:return(i._context.displayName||"Context")+".Provider";case ve:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case pe:return o=i.displayName||null,o!==null?o:Ce(i.type)||"Memo";case $e:o=i._payload,i=i._init;try{return Ce(i(o))}catch{}}return null}function ke(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(o);case 8:return o===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Se(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Le(i){var o=ge(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),v=""+i[o];if(!i.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,S=d.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return x.call(this)},set:function(T){v=""+T,S.call(this,T)}}),Object.defineProperty(i,o,{enumerable:d.enumerable}),{getValue:function(){return v},setValue:function(T){v=""+T},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function _e(i){i._valueTracker||(i._valueTracker=Le(i))}function Ke(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var d=o.getValue(),v="";return i&&(v=ge(i)?i.checked?"true":"false":i.value),i=v,i!==d?(o.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function wt(i,o){var d=o.checked;return ue({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function Rt(i,o){var d=o.defaultValue==null?"":o.defaultValue,v=o.checked!=null?o.checked:o.defaultChecked;d=Se(o.value!=null?o.value:d),i._wrapperState={initialChecked:v,initialValue:d,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function at(i,o){o=o.checked,o!=null&&M(i,"checked",o,!1)}function _t(i,o){at(i,o);var d=Se(o.value),v=o.type;if(d!=null)v==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?st(i,o.type,d):o.hasOwnProperty("defaultValue")&&st(i,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function it(i,o,d){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var v=o.type;if(!(v!=="submit"&&v!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,d||o===i.value||(i.value=o),i.defaultValue=o}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function st(i,o,d){(o!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var l0=Array.isArray;function $t(i,o,d,v){if(i=i.options,o){o={};for(var x=0;x"+o.valueOf().toString()+"",o=qt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function tn(i,o){if(o){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=o;return}}i.textContent=o}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(i){pt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),tt[o]=tt[i]})});function fr(i,o,d){return o==null||typeof o=="boolean"||o===""?"":d||typeof o!="number"||o===0||tt.hasOwnProperty(i)&&tt[i]?(""+o).trim():o+"px"}function T0(i,o){i=i.style;for(var d in o)if(o.hasOwnProperty(d)){var v=d.indexOf("--")===0,x=fr(d,o[d],v);d==="float"&&(d="cssFloat"),v?i.setProperty(d,x):i[d]=x}}var ai=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function En(i,o){if(o){if(ai[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function si(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cu=null;function Su(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Eu=null,Gi=null,qi=null;function ud(i){if(i=B0(i)){if(typeof Eu!="function")throw Error(n(280));var o=i.stateNode;o&&(o=O2(o),Eu(i.stateNode,i.type,o))}}function cd(i){Gi?qi?qi.push(i):qi=[i]:Gi=i}function dd(){if(Gi){var i=Gi,o=qi;if(qi=Gi=null,ud(i),o)for(i=0;i>>=0,i===0?32:31-(wd(i)/$d|0)|0}var Hl=64,v2=4194304;function Wl(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Xi(i,o){var d=i.pendingLanes;if(d===0)return 0;var v=0,x=i.suspendedLanes,S=i.pingedLanes,T=d&268435455;if(T!==0){var N=T&~x;N!==0?v=Wl(N):(S&=T,S!==0&&(v=Wl(S)))}else T=d&~x,T!==0?v=Wl(T):S!==0&&(v=Wl(S));if(v===0)return 0;if(o!==0&&o!==v&&(o&x)===0&&(x=v&-v,S=o&-o,x>=S||x===16&&(S&4194240)!==0))return o;if((v&4)!==0&&(v|=d&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=v;0d;d++)o.push(i);return o}function ra(i,o,d){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-Gn(o),i[o]=d}function Ed(i,o){var d=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=Or),Nd=" ",zd=!1;function Od(i,o){switch(i){case"keyup":return mn.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zd(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ql=!1;function Jl(i,o){switch(i){case"compositionend":return Zd(o);case"keypress":return o.which!==32?null:(zd=!0,Nd);case"textInput":return i=o.data,i===Nd&&zd?null:i;default:return null}}function U3(i,o){if(Ql)return i==="compositionend"||!sa&&Od(i,o)?(i=Vu(),hr=aa=Ot=null,Ql=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:d,offset:o-i};i=v}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=qe(d)}}function o0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?o0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function At(){for(var i=window,o=Xe();o instanceof i.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)i=o.contentWindow;else break;o=Xe(i.document)}return o}function ua(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function J3(i){var o=At(),d=i.focusedElem,v=i.selectionRange;if(o!==d&&d&&d.ownerDocument&&o0(d.ownerDocument.documentElement,d)){if(v!==null&&ua(d)){if(o=v.start,i=v.end,i===void 0&&(i=o),"selectionStart"in d)d.selectionStart=o,d.selectionEnd=Math.min(i,d.value.length);else if(i=(o=d.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var x=d.textContent.length,S=Math.min(v.start,x);v=v.end===void 0?S:Math.min(v.end,x),!i.extend&&S>v&&(x=v,v=S,S=x),x=yt(d,S);var T=yt(d,v);x&&T&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==T.node||i.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(x.node,x.offset),i.removeAllRanges(),S>v?(i.addRange(o),i.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),i.addRange(o)))}}for(o=[],i=d;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Zr=null,Xu=null,vr=null,to=!1;function ca(i,o,d){var v=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;to||Zr==null||Zr!==Xe(v)||(v=Zr,"selectionStart"in v&&ua(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),vr&&Te(vr,v)||(vr=v,v=I2(Xu,"onSelect"),0uo||(i.current=nc[uo],nc[uo]=null,uo--)}function Ft(i,o){uo++,nc[uo]=i.current,i.current=o}var xi={},R0=rn(xi),ln=rn(!1),j0=xi;function co(i,o){var d=i.type.contextTypes;if(!d)return xi;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===o)return v.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in d)x[S]=o[S];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=x),x}function on(i){return i=i.childContextTypes,i!=null}function Z2(){Vt(ln),Vt(R0)}function Qd(i,o,d){if(R0.current!==xi)throw Error(n(168));Ft(R0,o),Ft(ln,d)}function Jd(i,o,d){var v=i.stateNode;if(o=o.childContextTypes,typeof v.getChildContext!="function")return d;v=v.getChildContext();for(var x in v)if(!(x in o))throw Error(n(108,ke(i)||"Unknown",x));return ue({},d,v)}function _n(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||xi,j0=R0.current,Ft(R0,i),Ft(ln,ln.current),!0}function ef(i,o,d){var v=i.stateNode;if(!v)throw Error(n(169));d?(i=Jd(i,o,j0),v.__reactInternalMemoizedMergedChildContext=i,Vt(ln),Vt(R0),Ft(R0,i)):Vt(ln),Ft(ln,d)}var Hr=null,j2=!1,rc=!1;function tf(i){Hr===null?Hr=[i]:Hr.push(i)}function ll(i){j2=!0,tf(i)}function wi(){if(!rc&&Hr!==null){rc=!0;var i=0,o=Ct;try{var d=Hr;for(Ct=1;i>=T,x-=T,yr=1<<32-Gn(o)+x|d<We?(y0=Oe,Oe=null):y0=Oe.sibling;var bt=ye(te,Oe,ie[We],Ee);if(bt===null){Oe===null&&(Oe=y0);break}i&&Oe&&bt.alternate===null&&o(te,Oe),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt,Oe=y0}if(We===ie.length)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;WeWe?(y0=Oe,Oe=null):y0=Oe.sibling;var Bi=ye(te,Oe,bt.value,Ee);if(Bi===null){Oe===null&&(Oe=y0);break}i&&Oe&&Bi.alternate===null&&o(te,Oe),U=S(Bi,U,We),Ze===null?Ve=Bi:Ze.sibling=Bi,Ze=Bi,Oe=y0}if(bt.done)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;!bt.done;We++,bt=ie.next())bt=we(te,bt.value,Ee),bt!==null&&(U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return Nt&&al(te,We),Ve}for(Oe=v(te,Oe);!bt.done;We++,bt=ie.next())bt=Ae(Oe,te,We,bt.value,Ee),bt!==null&&(i&&bt.alternate!==null&&Oe.delete(bt.key===null?We:bt.key),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return i&&Oe.forEach(function(w7){return o(te,w7)}),Nt&&al(te,We),Ve}function n0(te,U,ie,Ee){if(typeof ie=="object"&&ie!==null&&ie.type===ee&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case I:e:{for(var Ve=ie.key,Ze=U;Ze!==null;){if(Ze.key===Ve){if(Ve=ie.type,Ve===ee){if(Ze.tag===7){d(te,Ze.sibling),U=x(Ze,ie.props.children),U.return=te,te=U;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===$e&&of(Ve)===Ze.type){d(te,Ze.sibling),U=x(Ze,ie.props),U.ref=wa(te,Ze,ie),U.return=te,te=U;break e}d(te,Ze);break}else o(te,Ze);Ze=Ze.sibling}ie.type===ee?(U=xl(ie.props.children,te.mode,Ee,ie.key),U.return=te,te=U):(Ee=ks(ie.type,ie.key,ie.props,null,te.mode,Ee),Ee.ref=wa(te,U,ie),Ee.return=te,te=Ee)}return T(te);case O:e:{for(Ze=ie.key;U!==null;){if(U.key===Ze)if(U.tag===4&&U.stateNode.containerInfo===ie.containerInfo&&U.stateNode.implementation===ie.implementation){d(te,U.sibling),U=x(U,ie.children||[]),U.return=te,te=U;break e}else{d(te,U);break}else o(te,U);U=U.sibling}U=Wc(ie,te.mode,Ee),U.return=te,te=U}return T(te);case $e:return Ze=ie._init,n0(te,U,Ze(ie._payload),Ee)}if(l0(ie))return Re(te,U,ie,Ee);if(Pe(ie))return Ie(te,U,ie,Ee);ul(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,U!==null&&U.tag===6?(d(te,U.sibling),U=x(U,ie),U.return=te,te=U):(d(te,U),U=Hc(ie,te.mode,Ee),U.return=te,te=U),T(te)):d(te,U)}return n0}var Yt=lc(!0),U2=lc(!1),$a=rn(null),xn=null,$i=null,po=null;function Ur(){po=$i=xn=null}function G2(i){var o=$a.current;Vt($a),i._currentValue=o}function C0(i,o,d){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===d)break;i=i.return}}function Ci(i,o){xn=i,po=$i=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(H0=!0),i.firstContext=null)}function An(i){var o=i._currentValue;if(po!==i)if(i={context:i,memoizedValue:o,next:null},$i===null){if(xn===null)throw Error(n(308));$i=i,xn.dependencies={lanes:0,firstContext:i}}else $i=$i.next=i;return o}var cl=null;function oc(i){cl===null?cl=[i]:cl.push(i)}function q2(i,o,d,v){var x=o.interleaved;return x===null?(d.next=d,oc(o)):(d.next=x.next,x.next=d),o.interleaved=d,Gr(i,v)}function Gr(i,o){i.lanes|=o;var d=i.alternate;for(d!==null&&(d.lanes|=o),d=i,i=i.return;i!==null;)i.childLanes|=o,d=i.alternate,d!==null&&(d.childLanes|=o),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Mn=!1;function Y2(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function af(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Bn(i,o,d){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(mt&2)!==0){var x=v.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),v.pending=o,Gr(i,d)}return x=v.interleaved,x===null?(o.next=o,oc(v)):(o.next=x.next,x.next=o),v.interleaved=o,Gr(i,d)}function X2(i,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194240)!==0)){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ia(i,d)}}function sf(i,o){var d=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var x=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var T={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?x=S=T:S=S.next=T,d=d.next}while(d!==null);S===null?x=S=o:S=S.next=o}else x=S=o;d={baseState:v.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:v.shared,effects:v.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=o:i.next=o,d.lastBaseUpdate=o}function ho(i,o,d,v){var x=i.updateQueue;Mn=!1;var S=x.firstBaseUpdate,T=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var K=N,ae=K.next;K.next=null,T===null?S=ae:T.next=ae,T=K;var be=i.alternate;be!==null&&(be=be.updateQueue,N=be.lastBaseUpdate,N!==T&&(N===null?be.firstBaseUpdate=ae:N.next=ae,be.lastBaseUpdate=K))}if(S!==null){var we=x.baseState;T=0,be=ae=K=null,N=S;do{var ye=N.lane,Ae=N.eventTime;if((v&ye)===ye){be!==null&&(be=be.next={eventTime:Ae,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Re=i,Ie=N;switch(ye=o,Ae=d,Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){we=Re.call(Ae,we,ye);break e}we=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,ye=typeof Re=="function"?Re.call(Ae,we,ye):Re,ye==null)break e;we=ue({},we,ye);break e;case 2:Mn=!0}}N.callback!==null&&N.lane!==0&&(i.flags|=64,ye=x.effects,ye===null?x.effects=[N]:ye.push(N))}else Ae={eventTime:Ae,lane:ye,tag:N.tag,payload:N.payload,callback:N.callback,next:null},be===null?(ae=be=Ae,K=we):be=be.next=Ae,T|=ye;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ye=N,N=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(be===null&&(K=we),x.baseState=K,x.firstBaseUpdate=ae,x.lastBaseUpdate=be,o=x.shared.interleaved,o!==null){x=o;do T|=x.lane,x=x.next;while(x!==o)}else S===null&&(x.shared.lanes=0);_i|=T,i.lanes=T,i.memoizedState=we}}function ac(i,o,d){if(i=o.effects,o.effects=null,i!==null)for(o=0;od?d:4,i(!0);var v=dc.transition;dc.transition={};try{i(!1),o()}finally{Ct=d,dc.transition=v}}function bc(){return Rn().memoizedState}function t7(i,o,d){var v=Ai(i);if(d={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null},xc(i))K0(o,d);else if(d=q2(i,o,d,v),d!==null){var x=G0();nr(d,i,v,x),Xn(d,o,v)}}function hf(i,o,d){var v=Ai(i),x={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null};if(xc(i))K0(o,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var T=o.lastRenderedState,N=S(T,d);if(x.hasEagerState=!0,x.eagerState=N,oe(N,T)){var K=o.interleaved;K===null?(x.next=x,oc(o)):(x.next=K.next,K.next=x),o.interleaved=x;return}}catch{}finally{}d=q2(i,o,x,v),d!==null&&(x=G0(),nr(d,i,v,x),Xn(d,o,v))}}function xc(i){var o=i.alternate;return i===Ht||o!==null&&o===Ht}function K0(i,o){Pa=mo=!0;var d=i.pending;d===null?o.next=o:(o.next=d.next,d.next=o),i.pending=o}function Xn(i,o,d){if((d&4194240)!==0){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ia(i,d)}}var ls={readContext:An,useCallback:I0,useContext:I0,useEffect:I0,useImperativeHandle:I0,useInsertionEffect:I0,useLayoutEffect:I0,useMemo:I0,useReducer:I0,useRef:I0,useState:I0,useDebugValue:I0,useDeferredValue:I0,useTransition:I0,useMutableSource:I0,useSyncExternalStore:I0,useId:I0,unstable_isNewReconciler:!1},n7={readContext:An,useCallback:function(i,o){return Sr().memoizedState=[i,o===void 0?null:o],i},useContext:An,useEffect:is,useImperativeHandle:function(i,o,d){return d=d!=null?d.concat([i]):null,_a(4194308,4,gc.bind(null,o,i),d)},useLayoutEffect:function(i,o){return _a(4194308,4,i,o)},useInsertionEffect:function(i,o){return _a(4,2,i,o)},useMemo:function(i,o){var d=Sr();return o=o===void 0?null:o,i=i(),d.memoizedState=[i,o],i},useReducer:function(i,o,d){var v=Sr();return o=d!==void 0?d(o):o,v.memoizedState=v.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},v.queue=i,i=i.dispatch=t7.bind(null,Ht,i),[v.memoizedState,i]},useRef:function(i){var o=Sr();return i={current:i},o.memoizedState=i},useState:ka,useDebugValue:Da,useDeferredValue:function(i){return Sr().memoizedState=i},useTransition:function(){var i=ka(!1),o=i[0];return i=pf.bind(null,i[1]),Sr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,d){var v=Ht,x=Sr();if(Nt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=o(),g0===null)throw Error(n(349));(Ei&30)!==0||vc(v,o,d)}x.memoizedState=d;var S={value:d,getSnapshot:o};return x.queue=S,is(Xr.bind(null,v,S,i),[i]),v.flags|=2048,yo(9,sn.bind(null,v,S,d,o),void 0,null),d},useId:function(){var i=Sr(),o=g0.identifierPrefix;if(Nt){var d=br,v=yr;d=(v&~(1<<32-Gn(v)-1)).toString(32)+d,o=":"+o+"R"+d,d=fl++,0")&&(K=K.replace("",i.displayName)),K}while(1<=T&&0<=N);break}}}finally{le=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ne(i):""}function ce(i){switch(i.tag){case 5:return ne(i.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return i=q(i.type,!1),i;case 11:return i=q(i.type.render,!1),i;case 1:return i=q(i.type,!0),i;default:return""}}function Ce(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ee:return"Fragment";case O:return"Portal";case re:return"Profiler";case L:return"StrictMode";case G:return"Suspense";case Q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Y:return(i.displayName||"Context")+".Consumer";case Z:return(i._context.displayName||"Context")+".Provider";case ve:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case pe:return o=i.displayName||null,o!==null?o:Ce(i.type)||"Memo";case $e:o=i._payload,i=i._init;try{return Ce(i(o))}catch{}}return null}function ke(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(o);case 8:return o===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Se(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Le(i){var o=ge(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),v=""+i[o];if(!i.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,S=d.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return x.call(this)},set:function(T){v=""+T,S.call(this,T)}}),Object.defineProperty(i,o,{enumerable:d.enumerable}),{getValue:function(){return v},setValue:function(T){v=""+T},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function _e(i){i._valueTracker||(i._valueTracker=Le(i))}function Ke(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var d=o.getValue(),v="";return i&&(v=ge(i)?i.checked?"true":"false":i.value),i=v,i!==d?(o.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function wt(i,o){var d=o.checked;return ue({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function Rt(i,o){var d=o.defaultValue==null?"":o.defaultValue,v=o.checked!=null?o.checked:o.defaultChecked;d=Se(o.value!=null?o.value:d),i._wrapperState={initialChecked:v,initialValue:d,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function at(i,o){o=o.checked,o!=null&&M(i,"checked",o,!1)}function _t(i,o){at(i,o);var d=Se(o.value),v=o.type;if(d!=null)v==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?st(i,o.type,d):o.hasOwnProperty("defaultValue")&&st(i,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function it(i,o,d){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var v=o.type;if(!(v!=="submit"&&v!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,d||o===i.value||(i.value=o),i.defaultValue=o}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function st(i,o,d){(o!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var l0=Array.isArray;function $t(i,o,d,v){if(i=i.options,o){o={};for(var x=0;x"+o.valueOf().toString()+"",o=qt.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function tn(i,o){if(o){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=o;return}}i.textContent=o}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(i){pt.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),tt[o]=tt[i]})});function fr(i,o,d){return o==null||typeof o=="boolean"||o===""?"":d||typeof o!="number"||o===0||tt.hasOwnProperty(i)&&tt[i]?(""+o).trim():o+"px"}function T0(i,o){i=i.style;for(var d in o)if(o.hasOwnProperty(d)){var v=d.indexOf("--")===0,x=fr(d,o[d],v);d==="float"&&(d="cssFloat"),v?i.setProperty(d,x):i[d]=x}}var ai=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function En(i,o){if(o){if(ai[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function si(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cu=null;function Su(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Eu=null,Gi=null,qi=null;function ud(i){if(i=B0(i)){if(typeof Eu!="function")throw Error(n(280));var o=i.stateNode;o&&(o=O2(o),Eu(i.stateNode,i.type,o))}}function cd(i){Gi?qi?qi.push(i):qi=[i]:Gi=i}function dd(){if(Gi){var i=Gi,o=qi;if(qi=Gi=null,ud(i),o)for(i=0;i>>=0,i===0?32:31-(wd(i)/$d|0)|0}var Hl=64,v2=4194304;function Wl(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Xi(i,o){var d=i.pendingLanes;if(d===0)return 0;var v=0,x=i.suspendedLanes,S=i.pingedLanes,T=d&268435455;if(T!==0){var N=T&~x;N!==0?v=Wl(N):(S&=T,S!==0&&(v=Wl(S)))}else T=d&~x,T!==0?v=Wl(T):S!==0&&(v=Wl(S));if(v===0)return 0;if(o!==0&&o!==v&&(o&x)===0&&(x=v&-v,S=o&-o,x>=S||x===16&&(S&4194240)!==0))return o;if((v&4)!==0&&(v|=d&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=v;0d;d++)o.push(i);return o}function ra(i,o,d){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-qn(o),i[o]=d}function Ed(i,o){var d=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=Or),Nd=" ",zd=!1;function Od(i,o){switch(i){case"keyup":return mn.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zd(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ql=!1;function Jl(i,o){switch(i){case"compositionend":return Zd(o);case"keypress":return o.which!==32?null:(zd=!0,Nd);case"textInput":return i=o.data,i===Nd&&zd?null:i;default:return null}}function U3(i,o){if(Ql)return i==="compositionend"||!sa&&Od(i,o)?(i=Vu(),hr=aa=Ot=null,Ql=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:d,offset:o-i};i=v}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=qe(d)}}function o0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?o0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function At(){for(var i=window,o=Xe();o instanceof i.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)i=o.contentWindow;else break;o=Xe(i.document)}return o}function ua(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function J3(i){var o=At(),d=i.focusedElem,v=i.selectionRange;if(o!==d&&d&&d.ownerDocument&&o0(d.ownerDocument.documentElement,d)){if(v!==null&&ua(d)){if(o=v.start,i=v.end,i===void 0&&(i=o),"selectionStart"in d)d.selectionStart=o,d.selectionEnd=Math.min(i,d.value.length);else if(i=(o=d.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var x=d.textContent.length,S=Math.min(v.start,x);v=v.end===void 0?S:Math.min(v.end,x),!i.extend&&S>v&&(x=v,v=S,S=x),x=yt(d,S);var T=yt(d,v);x&&T&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==T.node||i.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(x.node,x.offset),i.removeAllRanges(),S>v?(i.addRange(o),i.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),i.addRange(o)))}}for(o=[],i=d;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Zr=null,Xu=null,vr=null,to=!1;function ca(i,o,d){var v=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;to||Zr==null||Zr!==Xe(v)||(v=Zr,"selectionStart"in v&&ua(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),vr&&Te(vr,v)||(vr=v,v=I2(Xu,"onSelect"),0uo||(i.current=nc[uo],nc[uo]=null,uo--)}function Ft(i,o){uo++,nc[uo]=i.current,i.current=o}var xi={},R0=rn(xi),ln=rn(!1),j0=xi;function co(i,o){var d=i.type.contextTypes;if(!d)return xi;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===o)return v.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in d)x[S]=o[S];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=x),x}function on(i){return i=i.childContextTypes,i!=null}function Z2(){Vt(ln),Vt(R0)}function Qd(i,o,d){if(R0.current!==xi)throw Error(n(168));Ft(R0,o),Ft(ln,d)}function Jd(i,o,d){var v=i.stateNode;if(o=o.childContextTypes,typeof v.getChildContext!="function")return d;v=v.getChildContext();for(var x in v)if(!(x in o))throw Error(n(108,ke(i)||"Unknown",x));return ue({},d,v)}function _n(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||xi,j0=R0.current,Ft(R0,i),Ft(ln,ln.current),!0}function ef(i,o,d){var v=i.stateNode;if(!v)throw Error(n(169));d?(i=Jd(i,o,j0),v.__reactInternalMemoizedMergedChildContext=i,Vt(ln),Vt(R0),Ft(R0,i)):Vt(ln),Ft(ln,d)}var Hr=null,j2=!1,rc=!1;function tf(i){Hr===null?Hr=[i]:Hr.push(i)}function ll(i){j2=!0,tf(i)}function wi(){if(!rc&&Hr!==null){rc=!0;var i=0,o=Ct;try{var d=Hr;for(Ct=1;i>=T,x-=T,yr=1<<32-qn(o)+x|d<We?(y0=Oe,Oe=null):y0=Oe.sibling;var bt=ye(te,Oe,ie[We],Ee);if(bt===null){Oe===null&&(Oe=y0);break}i&&Oe&&bt.alternate===null&&o(te,Oe),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt,Oe=y0}if(We===ie.length)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;WeWe?(y0=Oe,Oe=null):y0=Oe.sibling;var Bi=ye(te,Oe,bt.value,Ee);if(Bi===null){Oe===null&&(Oe=y0);break}i&&Oe&&Bi.alternate===null&&o(te,Oe),U=S(Bi,U,We),Ze===null?Ve=Bi:Ze.sibling=Bi,Ze=Bi,Oe=y0}if(bt.done)return d(te,Oe),Nt&&al(te,We),Ve;if(Oe===null){for(;!bt.done;We++,bt=ie.next())bt=we(te,bt.value,Ee),bt!==null&&(U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return Nt&&al(te,We),Ve}for(Oe=v(te,Oe);!bt.done;We++,bt=ie.next())bt=Ae(Oe,te,We,bt.value,Ee),bt!==null&&(i&&bt.alternate!==null&&Oe.delete(bt.key===null?We:bt.key),U=S(bt,U,We),Ze===null?Ve=bt:Ze.sibling=bt,Ze=bt);return i&&Oe.forEach(function(w7){return o(te,w7)}),Nt&&al(te,We),Ve}function n0(te,U,ie,Ee){if(typeof ie=="object"&&ie!==null&&ie.type===ee&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case I:e:{for(var Ve=ie.key,Ze=U;Ze!==null;){if(Ze.key===Ve){if(Ve=ie.type,Ve===ee){if(Ze.tag===7){d(te,Ze.sibling),U=x(Ze,ie.props.children),U.return=te,te=U;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===$e&&of(Ve)===Ze.type){d(te,Ze.sibling),U=x(Ze,ie.props),U.ref=wa(te,Ze,ie),U.return=te,te=U;break e}d(te,Ze);break}else o(te,Ze);Ze=Ze.sibling}ie.type===ee?(U=xl(ie.props.children,te.mode,Ee,ie.key),U.return=te,te=U):(Ee=ks(ie.type,ie.key,ie.props,null,te.mode,Ee),Ee.ref=wa(te,U,ie),Ee.return=te,te=Ee)}return T(te);case O:e:{for(Ze=ie.key;U!==null;){if(U.key===Ze)if(U.tag===4&&U.stateNode.containerInfo===ie.containerInfo&&U.stateNode.implementation===ie.implementation){d(te,U.sibling),U=x(U,ie.children||[]),U.return=te,te=U;break e}else{d(te,U);break}else o(te,U);U=U.sibling}U=Wc(ie,te.mode,Ee),U.return=te,te=U}return T(te);case $e:return Ze=ie._init,n0(te,U,Ze(ie._payload),Ee)}if(l0(ie))return Re(te,U,ie,Ee);if(Pe(ie))return Ie(te,U,ie,Ee);ul(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,U!==null&&U.tag===6?(d(te,U.sibling),U=x(U,ie),U.return=te,te=U):(d(te,U),U=Hc(ie,te.mode,Ee),U.return=te,te=U),T(te)):d(te,U)}return n0}var Yt=lc(!0),U2=lc(!1),$a=rn(null),xn=null,$i=null,po=null;function Ur(){po=$i=xn=null}function G2(i){var o=$a.current;Vt($a),i._currentValue=o}function C0(i,o,d){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===d)break;i=i.return}}function Ci(i,o){xn=i,po=$i=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(H0=!0),i.firstContext=null)}function An(i){var o=i._currentValue;if(po!==i)if(i={context:i,memoizedValue:o,next:null},$i===null){if(xn===null)throw Error(n(308));$i=i,xn.dependencies={lanes:0,firstContext:i}}else $i=$i.next=i;return o}var cl=null;function oc(i){cl===null?cl=[i]:cl.push(i)}function q2(i,o,d,v){var x=o.interleaved;return x===null?(d.next=d,oc(o)):(d.next=x.next,x.next=d),o.interleaved=d,Gr(i,v)}function Gr(i,o){i.lanes|=o;var d=i.alternate;for(d!==null&&(d.lanes|=o),d=i,i=i.return;i!==null;)i.childLanes|=o,d=i.alternate,d!==null&&(d.childLanes|=o),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Mn=!1;function Y2(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function af(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Bn(i,o,d){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(mt&2)!==0){var x=v.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),v.pending=o,Gr(i,d)}return x=v.interleaved,x===null?(o.next=o,oc(v)):(o.next=x.next,x.next=o),v.interleaved=o,Gr(i,d)}function X2(i,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194240)!==0)){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ia(i,d)}}function sf(i,o){var d=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var x=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var T={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?x=S=T:S=S.next=T,d=d.next}while(d!==null);S===null?x=S=o:S=S.next=o}else x=S=o;d={baseState:v.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:v.shared,effects:v.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=o:i.next=o,d.lastBaseUpdate=o}function ho(i,o,d,v){var x=i.updateQueue;Mn=!1;var S=x.firstBaseUpdate,T=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var K=N,ae=K.next;K.next=null,T===null?S=ae:T.next=ae,T=K;var be=i.alternate;be!==null&&(be=be.updateQueue,N=be.lastBaseUpdate,N!==T&&(N===null?be.firstBaseUpdate=ae:N.next=ae,be.lastBaseUpdate=K))}if(S!==null){var we=x.baseState;T=0,be=ae=K=null,N=S;do{var ye=N.lane,Ae=N.eventTime;if((v&ye)===ye){be!==null&&(be=be.next={eventTime:Ae,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Re=i,Ie=N;switch(ye=o,Ae=d,Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){we=Re.call(Ae,we,ye);break e}we=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,ye=typeof Re=="function"?Re.call(Ae,we,ye):Re,ye==null)break e;we=ue({},we,ye);break e;case 2:Mn=!0}}N.callback!==null&&N.lane!==0&&(i.flags|=64,ye=x.effects,ye===null?x.effects=[N]:ye.push(N))}else Ae={eventTime:Ae,lane:ye,tag:N.tag,payload:N.payload,callback:N.callback,next:null},be===null?(ae=be=Ae,K=we):be=be.next=Ae,T|=ye;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ye=N,N=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(be===null&&(K=we),x.baseState=K,x.firstBaseUpdate=ae,x.lastBaseUpdate=be,o=x.shared.interleaved,o!==null){x=o;do T|=x.lane,x=x.next;while(x!==o)}else S===null&&(x.shared.lanes=0);_i|=T,i.lanes=T,i.memoizedState=we}}function ac(i,o,d){if(i=o.effects,o.effects=null,i!==null)for(o=0;od?d:4,i(!0);var v=dc.transition;dc.transition={};try{i(!1),o()}finally{Ct=d,dc.transition=v}}function bc(){return Rn().memoizedState}function t7(i,o,d){var v=Ai(i);if(d={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null},xc(i))K0(o,d);else if(d=q2(i,o,d,v),d!==null){var x=G0();rr(d,i,v,x),Qn(d,o,v)}}function hf(i,o,d){var v=Ai(i),x={lane:v,action:d,hasEagerState:!1,eagerState:null,next:null};if(xc(i))K0(o,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var T=o.lastRenderedState,N=S(T,d);if(x.hasEagerState=!0,x.eagerState=N,oe(N,T)){var K=o.interleaved;K===null?(x.next=x,oc(o)):(x.next=K.next,K.next=x),o.interleaved=x;return}}catch{}finally{}d=q2(i,o,x,v),d!==null&&(x=G0(),rr(d,i,v,x),Qn(d,o,v))}}function xc(i){var o=i.alternate;return i===Ht||o!==null&&o===Ht}function K0(i,o){Pa=mo=!0;var d=i.pending;d===null?o.next=o:(o.next=d.next,d.next=o),i.pending=o}function Qn(i,o,d){if((d&4194240)!==0){var v=o.lanes;v&=i.pendingLanes,d|=v,o.lanes=d,ia(i,d)}}var ls={readContext:An,useCallback:I0,useContext:I0,useEffect:I0,useImperativeHandle:I0,useInsertionEffect:I0,useLayoutEffect:I0,useMemo:I0,useReducer:I0,useRef:I0,useState:I0,useDebugValue:I0,useDeferredValue:I0,useTransition:I0,useMutableSource:I0,useSyncExternalStore:I0,useId:I0,unstable_isNewReconciler:!1},n7={readContext:An,useCallback:function(i,o){return Sr().memoizedState=[i,o===void 0?null:o],i},useContext:An,useEffect:is,useImperativeHandle:function(i,o,d){return d=d!=null?d.concat([i]):null,_a(4194308,4,gc.bind(null,o,i),d)},useLayoutEffect:function(i,o){return _a(4194308,4,i,o)},useInsertionEffect:function(i,o){return _a(4,2,i,o)},useMemo:function(i,o){var d=Sr();return o=o===void 0?null:o,i=i(),d.memoizedState=[i,o],i},useReducer:function(i,o,d){var v=Sr();return o=d!==void 0?d(o):o,v.memoizedState=v.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},v.queue=i,i=i.dispatch=t7.bind(null,Ht,i),[v.memoizedState,i]},useRef:function(i){var o=Sr();return i={current:i},o.memoizedState=i},useState:ka,useDebugValue:Da,useDeferredValue:function(i){return Sr().memoizedState=i},useTransition:function(){var i=ka(!1),o=i[0];return i=pf.bind(null,i[1]),Sr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,d){var v=Ht,x=Sr();if(Nt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=o(),g0===null)throw Error(n(349));(Ei&30)!==0||vc(v,o,d)}x.memoizedState=d;var S={value:d,getSnapshot:o};return x.queue=S,is(Xr.bind(null,v,S,i),[i]),v.flags|=2048,yo(9,sn.bind(null,v,S,d,o),void 0,null),d},useId:function(){var i=Sr(),o=g0.identifierPrefix;if(Nt){var d=br,v=yr;d=(v&~(1<<32-qn(v)-1)).toString(32)+d,o=":"+o+"R"+d,d=fl++,0<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=T.createElement(d,{is:v.is}):(i=T.createElement(d),d==="select"&&(T=i,v.multiple?T.multiple=!0:v.size&&(T.size=v.size))):i=T.createElementNS(i,d),i[mr]=o,i[bi]=v,E0(i,o,!1,!1),o.stateNode=i;e:{switch(T=si(d,v),d){case"dialog":It("cancel",i),It("close",i),x=v;break;case"iframe":case"object":case"embed":It("load",i),x=v;break;case"video":case"audio":for(x=0;xml&&(o.flags|=128,v=!0,Fa(S,!1),o.lanes=4194304)}else{if(!v)if(i=dl(T),i!==null){if(o.flags|=128,v=!0,d=i.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),Fa(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!Nt)return P0(o),null}else 2*zt()-S.renderingStartTime>ml&&d!==1073741824&&(o.flags|=128,v=!0,Fa(S,!1),o.lanes=4194304);S.isBackwards?(T.sibling=o.child,o.child=T):(d=S.last,d!==null?d.sibling=T:o.child=T,S.last=T)}return S.tail!==null?(o=S.tail,S.rendering=o,S.tail=o.sibling,S.renderingStartTime=zt(),o.sibling=null,d=Zt.current,Ft(Zt,v?d&1|2:d&1),o):(P0(o),null);case 22:case 23:return jc(),v=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(o.flags|=8192),v&&(o.mode&1)!==0?($n&1073741824)!==0&&(P0(o),o.subtreeFlags&6&&(o.flags|=8192)):P0(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function i7(i,o){switch(sl(o),o.tag){case 1:return on(o.type)&&Z2(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Si(),Vt(ln),Vt(R0),J2(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Q2(o),null;case 13:if(Vt(Zt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));wr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Vt(Zt),null;case 4:return Si(),null;case 10:return G2(o.type._context),null;case 22:case 23:return jc(),null;case 24:return null;default:return null}}var hs=!1,jt=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Me=null;function So(i,o){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(v){Wt(i,o,v)}else d.current=null}function Ia(i,o,d){try{d()}catch(v){Wt(i,o,v)}}var wf=!1;function l7(i,o){if(ma=x2,i=At(),ua(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var v=d.getSelection&&d.getSelection();if(v&&v.rangeCount!==0){d=v.anchorNode;var x=v.anchorOffset,S=v.focusNode;v=v.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var T=0,N=-1,K=-1,ae=0,be=0,we=i,ye=null;t:for(;;){for(var Ae;we!==d||x!==0&&we.nodeType!==3||(N=T+x),we!==S||v!==0&&we.nodeType!==3||(K=T+v),we.nodeType===3&&(T+=we.nodeValue.length),(Ae=we.firstChild)!==null;)ye=we,we=Ae;for(;;){if(we===i)break t;if(ye===d&&++ae===x&&(N=T),ye===S&&++be===v&&(K=T),(Ae=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Ae}d=N===-1||K===-1?null:{start:N,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(il={focusedElem:i,selectionRange:d},x2=!1,Me=o;Me!==null;)if(o=Me,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Me=i;else for(;Me!==null;){o=Me;try{var Re=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ie=Re.memoizedProps,n0=Re.memoizedState,te=o.stateNode,U=te.getSnapshotBeforeUpdate(o.elementType===o.type?Ie:Ln(o.type,Ie),n0);te.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var ie=o.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){Wt(o,o.return,Ee)}if(i=o.sibling,i!==null){i.return=o.return,Me=i;break}Me=o.return}return Re=wf,wf=!1,Re}function ei(i,o,d){var v=o.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var x=v=v.next;do{if((x.tag&i)===i){var S=x.destroy;x.destroy=void 0,S!==void 0&&Ia(o,d,S)}x=x.next}while(x!==v)}}function Va(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&i)===i){var v=d.create;d.destroy=v()}d=d.next}while(d!==o)}}function vs(i){var o=i.ref;if(o!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof o=="function"?o(i):o.current=i}}function $f(i){var o=i.alternate;o!==null&&(i.alternate=null,$f(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[mr],delete o[bi],delete o[z2],delete o[R],delete o[so])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Cf(i){return i.tag===5||i.tag===3||i.tag===4}function Sf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Cf(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Mc(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.nodeType===8?d.parentNode.insertBefore(i,o):d.insertBefore(i,o):(d.nodeType===8?(o=d.parentNode,o.insertBefore(i,d)):(o=d,o.appendChild(i)),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=V2));else if(v!==4&&(i=i.child,i!==null))for(Mc(i,o,d),i=i.sibling;i!==null;)Mc(i,o,d),i=i.sibling}function ms(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.insertBefore(i,o):d.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for(ms(i,o,d),i=i.sibling;i!==null;)ms(i,o,d),i=i.sibling}var m0=null,Jn=!1;function _r(i,o,d){for(d=d.child;d!==null;)Bc(i,o,d),d=d.sibling}function Bc(i,o,d){if(pr&&typeof pr.onCommitFiberUnmount=="function")try{pr.onCommitFiberUnmount(h2,d)}catch{}switch(d.tag){case 5:jt||So(d,o);case 6:var v=m0,x=Jn;m0=null,_r(i,o,d),m0=v,Jn=x,m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):m0.removeChild(d.stateNode));break;case 18:m0!==null&&(Jn?(i=m0,d=d.stateNode,i.nodeType===8?tc(i.parentNode,d):i.nodeType===1&&tc(i,d),Et(i)):tc(m0,d.stateNode));break;case 4:v=m0,x=Jn,m0=d.stateNode.containerInfo,Jn=!0,_r(i,o,d),m0=v,Jn=x;break;case 0:case 11:case 14:case 15:if(!jt&&(v=d.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){x=v=v.next;do{var S=x,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&Ia(d,o,T),x=x.next}while(x!==v)}_r(i,o,d);break;case 1:if(!jt&&(So(d,o),v=d.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=d.memoizedProps,v.state=d.memoizedState,v.componentWillUnmount()}catch(N){Wt(d,o,N)}_r(i,o,d);break;case 21:_r(i,o,d);break;case 22:d.mode&1?(jt=(v=jt)||d.memoizedState!==null,_r(i,o,d),jt=v):_r(i,o,d);break;default:_r(i,o,d)}}function Eo(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new W0),o.forEach(function(v){var x=f7.bind(null,i,v);d.has(v)||(d.add(v),v.then(x,x))})}}function wn(i,o){var d=o.deletions;if(d!==null)for(var v=0;vx&&(x=T),v&=~S}if(v=x,v=zt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Pf(v/1960))-v,10i?16:i,Ti===null)var v=!1;else{if(i=Ti,Ti=null,U0=0,(mt&6)!==0)throw Error(n(331));var x=mt;for(mt|=4,Me=i.current;Me!==null;){var S=Me,T=S.child;if((Me.flags&16)!==0){var N=S.deletions;if(N!==null){for(var K=0;Kzt()-Ic?yl(i,0):bs|=d),cn(i,o)}function Mf(i,o){o===0&&((i.mode&1)===0?o=1:(o=v2,v2<<=1,(v2&130023424)===0&&(v2=4194304)));var d=G0();i=Gr(i,o),i!==null&&(ra(i,o,d),cn(i,d))}function d7(i){var o=i.memoizedState,d=0;o!==null&&(d=o.retryLane),Mf(i,d)}function f7(i,o){var d=0;switch(i.tag){case 13:var v=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(o),Mf(i,d)}var Bf;Bf=function(i,o,d){if(i!==null)if(i.memoizedProps!==o.pendingProps||ln.current)H0=!0;else{if((i.lanes&d)===0&&(o.flags&128)===0)return H0=!1,bf(i,o,d);H0=(i.flags&131072)!==0}else H0=!1,Nt&&(o.flags&1048576)!==0&&nf(o,H2,o.index);switch(o.lanes=0,o.tag){case 2:var v=o.type;ps(i,o),i=o.pendingProps;var x=co(o,R0.current);Ci(o,d),x=pl(null,o,v,i,x,d);var S=es();return o.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,on(v)?(S=!0,_n(o)):S=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Y2(o),x.updater=ss,o.stateNode=x,x._reactInternals=o,$c(o,v,i,d),o=Dc(null,o,v,!0,S,d)):(o.tag=0,Nt&&S&&ba(o),S0(null,o,x,d),o=o.child),o;case 16:v=o.elementType;e:{switch(ps(i,o),i=o.pendingProps,x=v._init,v=x(v._payload),o.type=v,x=o.tag=h7(v),i=Ln(v,i),x){case 0:o=kc(null,o,v,i,d);break e;case 1:o=_c(null,o,v,i,d);break e;case 11:o=gf(null,o,v,i,d);break e;case 14:o=Sc(null,o,v,Ln(v.type,i),d);break e}throw Error(n(306,v,""))}return o;case 0:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),kc(i,o,v,x,d);case 1:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),_c(i,o,v,x,d);case 3:e:{if(yf(o),i===null)throw Error(n(387));v=o.pendingProps,S=o.memoizedState,x=S.element,af(i,o),ho(o,v,null,d);var T=o.memoizedState;if(v=T.element,S.isDehydrated)if(S={element:v,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){x=vl(Error(n(423)),o),o=kr(i,o,v,d,x);break e}else if(v!==x){x=vl(Error(n(424)),o),o=kr(i,o,v,d,x);break e}else for(bn=yi(o.stateNode.containerInfo.firstChild),F0=o,Nt=!0,Yn=null,d=U2(o,null,v,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(wr(),v===x){o=Qn(i,o,d);break e}S0(i,o,v,d)}o=o.child}return o;case 5:return uc(o),i===null&&an(o),v=o.type,x=o.pendingProps,S=i!==null?i.memoizedProps:null,T=x.children,ga(v,x)?T=null:S!==null&&ga(v,S)&&(o.flags|=32),Pc(i,o),S0(i,o,T,d),o.child;case 6:return i===null&&an(o),null;case 13:return fs(i,o,d);case 4:return sc(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=Yt(o,null,v,d):S0(i,o,v,d),o.child;case 11:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),gf(i,o,v,x,d);case 7:return S0(i,o,o.pendingProps,d),o.child;case 8:return S0(i,o,o.pendingProps.children,d),o.child;case 12:return S0(i,o,o.pendingProps.children,d),o.child;case 10:e:{if(v=o.type._context,x=o.pendingProps,S=o.memoizedProps,T=x.value,Ft($a,v._currentValue),v._currentValue=T,S!==null)if(oe(S.value,T)){if(S.children===x.children&&!ln.current){o=Qn(i,o,d);break e}}else for(S=o.child,S!==null&&(S.return=o);S!==null;){var N=S.dependencies;if(N!==null){T=S.child;for(var K=N.firstContext;K!==null;){if(K.context===v){if(S.tag===1){K=qr(-1,d&-d),K.tag=2;var ae=S.updateQueue;if(ae!==null){ae=ae.shared;var be=ae.pending;be===null?K.next=K:(K.next=be.next,be.next=K),ae.pending=K}}S.lanes|=d,K=S.alternate,K!==null&&(K.lanes|=d),C0(S.return,d,o),N.lanes|=d;break}K=K.next}}else if(S.tag===10)T=S.type===o.type?null:S.child;else if(S.tag===18){if(T=S.return,T===null)throw Error(n(341));T.lanes|=d,N=T.alternate,N!==null&&(N.lanes|=d),C0(T,d,o),T=S.sibling}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}S0(i,o,x.children,d),o=o.child}return o;case 9:return x=o.type,v=o.pendingProps.children,Ci(o,d),x=An(x),v=v(x),o.flags|=1,S0(i,o,v,d),o.child;case 14:return v=o.type,x=Ln(v,o.pendingProps),x=Ln(v.type,x),Sc(i,o,v,x,d);case 15:return Pr(i,o,o.type,o.pendingProps,d);case 17:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),ps(i,o),o.tag=1,on(v)?(i=!0,_n(o)):i=!1,Ci(o,d),hl(o,v,x),$c(o,v,x,d),Dc(null,o,v,!0,i,d);case 19:return Pi(i,o,d);case 22:return Ec(i,o,d)}throw Error(n(156,o.tag))};function Rf(i,o){return gd(i,o)}function p7(i,o,d,v){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(i,o,d,v){return new p7(i,o,d,v)}function Ps(i){return i=i.prototype,!(!i||!i.isReactComponent)}function h7(i){if(typeof i=="function")return Ps(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ve)return 11;if(i===pe)return 14}return 2}function rr(i,o){var d=i.alternate;return d===null?(d=In(i.tag,o,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=o,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,o=i.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function ks(i,o,d,v,x,S){var T=2;if(v=i,typeof i=="function")Ps(i)&&(T=1);else if(typeof i=="string")T=5;else e:switch(i){case ee:return xl(d.children,x,S,o);case L:T=8,x|=8;break;case re:return i=In(12,d,o,x|2),i.elementType=re,i.lanes=S,i;case G:return i=In(13,d,o,x),i.elementType=G,i.lanes=S,i;case Q:return i=In(19,d,o,x),i.elementType=Q,i.lanes=S,i;case se:return _s(d,x,S,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Z:T=10;break e;case X:T=9;break e;case ve:T=11;break e;case pe:T=14;break e;case $e:T=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=In(T,d,o,x),o.elementType=i,o.type=v,o.lanes=S,o}function xl(i,o,d,v){return i=In(7,i,v,o),i.lanes=d,i}function _s(i,o,d,v){return i=In(22,i,v,o),i.elementType=se,i.lanes=d,i.stateNode={isHidden:!1},i}function Hc(i,o,d){return i=In(6,i,null,o),i.lanes=d,i}function Wc(i,o,d){return o=In(4,i.children!==null?i.children:[],i.key,o),o.lanes=d,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function v7(i,o,d,v,x){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=na(0),this.expirationTimes=na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.identifierPrefix=v,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Uc(i,o,d,v,x,S,T,N,K){return i=new v7(i,o,d,N,K),o===1?(o=1,S===!0&&(o|=8)):o=0,S=In(3,null,null,o),i.current=S,S.stateNode=i,S.memoizedState={element:v,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Y2(S),i}function m7(i,o,d){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),L7.exports=a_(),L7.exports}var pm;function s_(){if(pm)return jf;pm=1;var e=ag();return jf.createRoot=e.createRoot,jf.hydrateRoot=e.hydrateRoot,jf}var u_=s_();const c_=V1(u_);/** +`+S.stack}return{value:i,source:o,stack:x,digest:null}}function us(i,o,d){return{value:i,source:null,stack:d??null,digest:o??null}}function $o(i,o){try{console.error(o.value)}catch(d){setTimeout(function(){throw d})}}var vf=typeof WeakMap=="function"?WeakMap:Map;function Ta(i,o,d){d=qr(-1,d),d.tag=3,d.payload={element:null};var v=o.value;return d.callback=function(){xs||(xs=!0,Vc=v),$o(i,o)},d}function cs(i,o,d){d=qr(-1,d),d.tag=3;var v=i.type.getDerivedStateFromError;if(typeof v=="function"){var x=o.value;d.payload=function(){return v(x)},d.callback=function(){$o(i,o)}}var S=i.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(d.callback=function(){$o(i,o),typeof v!="function"&&(Di===null?Di=new Set([this]):Di.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),d}function Aa(i,o,d){var v=i.pingCache;if(v===null){v=i.pingCache=new vf;var x=new Set;v.set(o,x)}else x=v.get(o),x===void 0&&(x=new Set,v.set(o,x));x.has(d)||(x.add(d),i=c7.bind(null,i,o,d),o.then(i,i))}function mf(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function Cc(i,o,d,v,x){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(o=qr(-1,1),o.tag=2,Bn(d,o,1))),d.lanes|=1),i):(i.flags|=65536,i.lanes=x,i)}var ds=V.ReactCurrentOwner,H0=!1;function S0(i,o,d,v){o.child=i===null?U2(o,null,d,v):Yt(o,i.child,d,v)}function gf(i,o,d,v,x){d=d.render;var S=o.ref;return Ci(o,x),v=pl(i,o,d,v,S,x),d=es(),i!==null&&!H0?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Jn(i,o,x)):(Nt&&d&&ba(o),o.flags|=1,S0(i,o,v,x),o.child)}function Sc(i,o,d,v,x){if(i===null){var S=d.type;return typeof S=="function"&&!Ps(S)&&S.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(o.tag=15,o.type=S,Pr(i,o,S,v,x)):(i=ks(d.type,null,v,o,o.mode,x),i.ref=o.ref,i.return=o,o.child=i)}if(S=i.child,(i.lanes&x)===0){var T=S.memoizedProps;if(d=d.compare,d=d!==null?d:Te,d(T,v)&&i.ref===o.ref)return Jn(i,o,x)}return o.flags|=1,i=ir(S,v),i.ref=o.ref,i.return=o,o.child=i}function Pr(i,o,d,v,x){if(i!==null){var S=i.memoizedProps;if(Te(S,v)&&i.ref===o.ref)if(H0=!1,o.pendingProps=v=S,(i.lanes&x)!==0)(i.flags&131072)!==0&&(H0=!0);else return o.lanes=i.lanes,Jn(i,o,x)}return kc(i,o,d,v,x)}function Ec(i,o,d){var v=o.pendingProps,x=v.children,S=i!==null?i.memoizedState:null;if(v.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(Po,$n),$n|=d;else{if((d&1073741824)===0)return i=S!==null?S.baseLanes|d:d,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,Ft(Po,$n),$n|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=S!==null?S.baseLanes:d,Ft(Po,$n),$n|=v}else S!==null?(v=S.baseLanes|d,o.memoizedState=null):v=d,Ft(Po,$n),$n|=v;return S0(i,o,x,d),o.child}function Pc(i,o){var d=o.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(o.flags|=512,o.flags|=2097152)}function kc(i,o,d,v,x){var S=on(d)?j0:R0.current;return S=co(o,S),Ci(o,x),d=pl(i,o,d,v,S,x),v=es(),i!==null&&!H0?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~x,Jn(i,o,x)):(Nt&&v&&ba(o),o.flags|=1,S0(i,o,d,x),o.child)}function _c(i,o,d,v,x){if(on(d)){var S=!0;_n(o)}else S=!1;if(Ci(o,x),o.stateNode===null)ps(i,o),hl(o,d,v),$c(o,d,v,x),v=!0;else if(i===null){var T=o.stateNode,N=o.memoizedProps;T.props=N;var K=T.context,ae=d.contextType;typeof ae=="object"&&ae!==null?ae=An(ae):(ae=on(d)?j0:R0.current,ae=co(o,ae));var be=d.getDerivedStateFromProps,we=typeof be=="function"||typeof T.getSnapshotBeforeUpdate=="function";we||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(N!==v||K!==ae)&&wo(o,T,v,ae),Mn=!1;var ye=o.memoizedState;T.state=ye,ho(o,v,T,x),K=o.memoizedState,N!==v||ye!==K||ln.current||Mn?(typeof be=="function"&&(as(o,d,be,v),K=o.memoizedState),(N=Mn||wc(o,d,N,v,ye,K,ae))?(we||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=K),T.props=v,T.state=K,T.context=ae,v=N):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{T=o.stateNode,af(i,o),N=o.memoizedProps,ae=o.type===o.elementType?N:Ln(o.type,N),T.props=ae,we=o.pendingProps,ye=T.context,K=d.contextType,typeof K=="object"&&K!==null?K=An(K):(K=on(d)?j0:R0.current,K=co(o,K));var Ae=d.getDerivedStateFromProps;(be=typeof Ae=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(N!==we||ye!==K)&&wo(o,T,v,K),Mn=!1,ye=o.memoizedState,T.state=ye,ho(o,v,T,x);var Re=o.memoizedState;N!==we||ye!==Re||ln.current||Mn?(typeof Ae=="function"&&(as(o,d,Ae,v),Re=o.memoizedState),(ae=Mn||wc(o,d,ae,v,ye,Re,K)||!1)?(be||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(v,Re,K),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(v,Re,K)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=Re),T.props=v,T.state=Re,T.context=K,v=ae):(typeof T.componentDidUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||N===i.memoizedProps&&ye===i.memoizedState||(o.flags|=1024),v=!1)}return Dc(i,o,d,v,S,x)}function Dc(i,o,d,v,x,S){Pc(i,o);var T=(o.flags&128)!==0;if(!v&&!T)return x&&ef(o,d,!1),Jn(i,o,S);v=o.stateNode,ds.current=o;var N=T&&typeof d.getDerivedStateFromError!="function"?null:v.render();return o.flags|=1,i!==null&&T?(o.child=Yt(o,i.child,null,S),o.child=Yt(o,null,N,S)):S0(i,o,N,S),o.memoizedState=v.state,x&&ef(o,d,!0),o.child}function yf(i){var o=i.stateNode;o.pendingContext?Qd(i,o.pendingContext,o.pendingContext!==o.context):o.context&&Qd(i,o.context,!1),sc(i,o.containerInfo)}function kr(i,o,d,v,x){return wr(),$r(x),o.flags|=256,S0(i,o,d,v),o.child}var Ma={dehydrated:null,treeContext:null,retryLane:0};function Ba(i){return{baseLanes:i,cachePool:null,transitions:null}}function fs(i,o,d){var v=o.pendingProps,x=Zt.current,S=!1,T=(o.flags&128)!==0,N;if((N=T)||(N=i!==null&&i.memoizedState===null?!1:(x&2)!==0),N?(S=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(x|=1),Ft(Zt,x&1),i===null)return an(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=v.children,i=v.fallback,S?(v=o.mode,S=o.child,T={mode:"hidden",children:T},(v&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=T):S=_s(T,v,0,null),i=xl(i,v,d,null),S.return=o,i.return=o,S.sibling=i,o.child=S,o.child.memoizedState=Ba(d),o.memoizedState=Ma,i):Co(o,T));if(x=i.memoizedState,x!==null&&(N=x.dehydrated,N!==null))return je(i,o,T,v,N,x,d);if(S){S=v.fallback,T=o.mode,x=i.child,N=x.sibling;var K={mode:"hidden",children:v.children};return(T&1)===0&&o.child!==x?(v=o.child,v.childLanes=0,v.pendingProps=K,o.deletions=null):(v=ir(x,K),v.subtreeFlags=x.subtreeFlags&14680064),N!==null?S=ir(N,S):(S=xl(S,T,d,null),S.flags|=2),S.return=o,v.return=o,v.sibling=S,o.child=v,v=S,S=o.child,T=i.child.memoizedState,T=T===null?Ba(d):{baseLanes:T.baseLanes|d,cachePool:null,transitions:T.transitions},S.memoizedState=T,S.childLanes=i.childLanes&~d,o.memoizedState=Ma,v}return S=i.child,i=S.sibling,v=ir(S,{mode:"visible",children:v.children}),(o.mode&1)===0&&(v.lanes=d),v.return=o,v.sibling=null,i!==null&&(d=o.deletions,d===null?(o.deletions=[i],o.flags|=16):d.push(i)),o.child=v,o.memoizedState=null,v}function Co(i,o){return o=_s({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Jr(i,o,d,v){return v!==null&&$r(v),Yt(o,i.child,null,d),i=Co(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function je(i,o,d,v,x,S,T){if(d)return o.flags&256?(o.flags&=-257,v=us(Error(n(422))),Jr(i,o,T,v)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(S=v.fallback,x=o.mode,v=_s({mode:"visible",children:v.children},x,0,null),S=xl(S,x,T,null),S.flags|=2,v.return=o,S.return=o,v.sibling=S,o.child=v,(o.mode&1)!==0&&Yt(o,i.child,null,T),o.child.memoizedState=Ba(T),o.memoizedState=Ma,S);if((o.mode&1)===0)return Jr(i,o,T,null);if(x.data==="$!"){if(v=x.nextSibling&&x.nextSibling.dataset,v)var N=v.dgst;return v=N,S=Error(n(419)),v=us(S,v,void 0),Jr(i,o,T,v)}if(N=(T&i.childLanes)!==0,H0||N){if(v=g0,v!==null){switch(T&-T){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(v.suspendedLanes|T))!==0?0:x,x!==0&&x!==S.retryLane&&(S.retryLane=x,Gr(i,x),rr(v,i,x,-1))}return Kc(),v=us(Error(n(421))),Jr(i,o,T,v)}return x.data==="$?"?(o.flags|=128,o.child=i.child,o=d7.bind(null,i),x._reactRetry=o,null):(i=S.treeContext,bn=yi(x.nextSibling),F0=o,Nt=!0,Xn=null,i!==null&&(Dn[Tn++]=yr,Dn[Tn++]=br,Dn[Tn++]=ol,yr=i.id,br=i.overflow,ol=o),o=Co(o,v.children),o.flags|=4096,o)}function Ra(i,o,d){i.lanes|=o;var v=i.alternate;v!==null&&(v.lanes|=o),C0(i.return,o,d)}function La(i,o,d,v,x){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:d,tailMode:x}:(S.isBackwards=o,S.rendering=null,S.renderingStartTime=0,S.last=v,S.tail=d,S.tailMode=x)}function Pi(i,o,d){var v=o.pendingProps,x=v.revealOrder,S=v.tail;if(S0(i,o,v.children,d),v=Zt.current,(v&2)!==0)v=v&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ra(i,d,o);else if(i.tag===19)Ra(i,d,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}v&=1}if(Ft(Zt,v),(o.mode&1)===0)o.memoizedState=null;else switch(x){case"forwards":for(d=o.child,x=null;d!==null;)i=d.alternate,i!==null&&dl(i)===null&&(x=d),d=d.sibling;d=x,d===null?(x=o.child,o.child=null):(x=d.sibling,d.sibling=null),La(o,!1,x,d,S);break;case"backwards":for(d=null,x=o.child,o.child=null;x!==null;){if(i=x.alternate,i!==null&&dl(i)===null){o.child=x;break}i=x.sibling,x.sibling=d,d=x,x=i}La(o,!0,d,null,S);break;case"together":La(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function ps(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function Jn(i,o,d){if(i!==null&&(o.dependencies=i.dependencies),_i|=o.lanes,(d&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,d=ir(i,i.pendingProps),o.child=d,d.return=o;i.sibling!==null;)i=i.sibling,d=d.sibling=ir(i,i.pendingProps),d.return=o;d.sibling=null}return o.child}function bf(i,o,d){switch(o.tag){case 3:yf(o),wr();break;case 5:uc(o);break;case 1:on(o.type)&&_n(o);break;case 4:sc(o,o.stateNode.containerInfo);break;case 10:var v=o.type._context,x=o.memoizedProps.value;Ft($a,v._currentValue),v._currentValue=x;break;case 13:if(v=o.memoizedState,v!==null)return v.dehydrated!==null?(Ft(Zt,Zt.current&1),o.flags|=128,null):(d&o.child.childLanes)!==0?fs(i,o,d):(Ft(Zt,Zt.current&1),i=Jn(i,o,d),i!==null?i.sibling:null);Ft(Zt,Zt.current&1);break;case 19:if(v=(d&o.childLanes)!==0,(i.flags&128)!==0){if(v)return Pi(i,o,d);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Ft(Zt,Zt.current),v)break;return null;case 22:case 23:return o.lanes=0,Ec(i,o,d)}return Jn(i,o,d)}var E0,Tc,xf,Ac;E0=function(i,o){for(var d=o.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Tc=function(){},xf=function(i,o,d,v){var x=i.memoizedProps;if(x!==v){i=o.stateNode,Yr(Cr.current);var S=null;switch(d){case"input":x=wt(i,x),v=wt(i,v),S=[];break;case"select":x=ue({},x,{value:void 0}),v=ue({},v,{value:void 0}),S=[];break;case"textarea":x=ht(i,x),v=ht(i,v),S=[];break;default:typeof x.onClick!="function"&&typeof v.onClick=="function"&&(i.onclick=V2)}En(d,v);var T;d=null;for(ae in x)if(!v.hasOwnProperty(ae)&&x.hasOwnProperty(ae)&&x[ae]!=null)if(ae==="style"){var N=x[ae];for(T in N)N.hasOwnProperty(T)&&(d||(d={}),d[T]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(l.hasOwnProperty(ae)?S||(S=[]):(S=S||[]).push(ae,null));for(ae in v){var K=v[ae];if(N=x!=null?x[ae]:void 0,v.hasOwnProperty(ae)&&K!==N&&(K!=null||N!=null))if(ae==="style")if(N){for(T in N)!N.hasOwnProperty(T)||K&&K.hasOwnProperty(T)||(d||(d={}),d[T]="");for(T in K)K.hasOwnProperty(T)&&N[T]!==K[T]&&(d||(d={}),d[T]=K[T])}else d||(S||(S=[]),S.push(ae,d)),d=K;else ae==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,N=N?N.__html:void 0,K!=null&&N!==K&&(S=S||[]).push(ae,K)):ae==="children"?typeof K!="string"&&typeof K!="number"||(S=S||[]).push(ae,""+K):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(l.hasOwnProperty(ae)?(K!=null&&ae==="onScroll"&&It("scroll",i),S||N===K||(S=[])):(S=S||[]).push(ae,K))}d&&(S=S||[]).push("style",d);var ae=S;(o.updateQueue=ae)&&(o.flags|=4)}},Ac=function(i,o,d,v){d!==v&&(o.flags|=4)};function Fa(i,o){if(!Nt)switch(i.tailMode){case"hidden":o=i.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:v.sibling=null}}function P0(i){var o=i.alternate!==null&&i.alternate.child===i.child,d=0,v=0;if(o)for(var x=i.child;x!==null;)d|=x.lanes|x.childLanes,v|=x.subtreeFlags&14680064,v|=x.flags&14680064,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)d|=x.lanes|x.childLanes,v|=x.subtreeFlags,v|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=v,i.childLanes=d,o}function r7(i,o,d){var v=o.pendingProps;switch(sl(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return P0(o),null;case 1:return on(o.type)&&Z2(),P0(o),null;case 3:return v=o.stateNode,Si(),Vt(ln),Vt(R0),J2(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(i===null||i.child===null)&&(xa(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Xn!==null&&(Oc(Xn),Xn=null))),Tc(i,o),P0(o),null;case 5:Q2(o);var x=Yr(vo.current);if(d=o.type,i!==null&&o.stateNode!=null)xf(i,o,d,v,x),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!v){if(o.stateNode===null)throw Error(n(166));return P0(o),null}if(i=Yr(Cr.current),xa(o)){v=o.stateNode,d=o.type;var S=o.memoizedProps;switch(v[mr]=o,v[bi]=S,i=(o.mode&1)!==0,d){case"dialog":It("cancel",v),It("close",v);break;case"iframe":case"object":case"embed":It("load",v);break;case"video":case"audio":for(x=0;x<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=T.createElement(d,{is:v.is}):(i=T.createElement(d),d==="select"&&(T=i,v.multiple?T.multiple=!0:v.size&&(T.size=v.size))):i=T.createElementNS(i,d),i[mr]=o,i[bi]=v,E0(i,o,!1,!1),o.stateNode=i;e:{switch(T=si(d,v),d){case"dialog":It("cancel",i),It("close",i),x=v;break;case"iframe":case"object":case"embed":It("load",i),x=v;break;case"video":case"audio":for(x=0;xml&&(o.flags|=128,v=!0,Fa(S,!1),o.lanes=4194304)}else{if(!v)if(i=dl(T),i!==null){if(o.flags|=128,v=!0,d=i.updateQueue,d!==null&&(o.updateQueue=d,o.flags|=4),Fa(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!Nt)return P0(o),null}else 2*zt()-S.renderingStartTime>ml&&d!==1073741824&&(o.flags|=128,v=!0,Fa(S,!1),o.lanes=4194304);S.isBackwards?(T.sibling=o.child,o.child=T):(d=S.last,d!==null?d.sibling=T:o.child=T,S.last=T)}return S.tail!==null?(o=S.tail,S.rendering=o,S.tail=o.sibling,S.renderingStartTime=zt(),o.sibling=null,d=Zt.current,Ft(Zt,v?d&1|2:d&1),o):(P0(o),null);case 22:case 23:return jc(),v=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(o.flags|=8192),v&&(o.mode&1)!==0?($n&1073741824)!==0&&(P0(o),o.subtreeFlags&6&&(o.flags|=8192)):P0(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function i7(i,o){switch(sl(o),o.tag){case 1:return on(o.type)&&Z2(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Si(),Vt(ln),Vt(R0),J2(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Q2(o),null;case 13:if(Vt(Zt),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));wr()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Vt(Zt),null;case 4:return Si(),null;case 10:return G2(o.type._context),null;case 22:case 23:return jc(),null;case 24:return null;default:return null}}var hs=!1,jt=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Me=null;function So(i,o){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(v){Wt(i,o,v)}else d.current=null}function Ia(i,o,d){try{d()}catch(v){Wt(i,o,v)}}var wf=!1;function l7(i,o){if(ma=x2,i=At(),ua(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var v=d.getSelection&&d.getSelection();if(v&&v.rangeCount!==0){d=v.anchorNode;var x=v.anchorOffset,S=v.focusNode;v=v.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var T=0,N=-1,K=-1,ae=0,be=0,we=i,ye=null;t:for(;;){for(var Ae;we!==d||x!==0&&we.nodeType!==3||(N=T+x),we!==S||v!==0&&we.nodeType!==3||(K=T+v),we.nodeType===3&&(T+=we.nodeValue.length),(Ae=we.firstChild)!==null;)ye=we,we=Ae;for(;;){if(we===i)break t;if(ye===d&&++ae===x&&(N=T),ye===S&&++be===v&&(K=T),(Ae=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Ae}d=N===-1||K===-1?null:{start:N,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(il={focusedElem:i,selectionRange:d},x2=!1,Me=o;Me!==null;)if(o=Me,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Me=i;else for(;Me!==null;){o=Me;try{var Re=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ie=Re.memoizedProps,n0=Re.memoizedState,te=o.stateNode,U=te.getSnapshotBeforeUpdate(o.elementType===o.type?Ie:Ln(o.type,Ie),n0);te.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var ie=o.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){Wt(o,o.return,Ee)}if(i=o.sibling,i!==null){i.return=o.return,Me=i;break}Me=o.return}return Re=wf,wf=!1,Re}function ei(i,o,d){var v=o.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var x=v=v.next;do{if((x.tag&i)===i){var S=x.destroy;x.destroy=void 0,S!==void 0&&Ia(o,d,S)}x=x.next}while(x!==v)}}function Va(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&i)===i){var v=d.create;d.destroy=v()}d=d.next}while(d!==o)}}function vs(i){var o=i.ref;if(o!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof o=="function"?o(i):o.current=i}}function $f(i){var o=i.alternate;o!==null&&(i.alternate=null,$f(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[mr],delete o[bi],delete o[z2],delete o[R],delete o[so])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Cf(i){return i.tag===5||i.tag===3||i.tag===4}function Sf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Cf(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Mc(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.nodeType===8?d.parentNode.insertBefore(i,o):d.insertBefore(i,o):(d.nodeType===8?(o=d.parentNode,o.insertBefore(i,d)):(o=d,o.appendChild(i)),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=V2));else if(v!==4&&(i=i.child,i!==null))for(Mc(i,o,d),i=i.sibling;i!==null;)Mc(i,o,d),i=i.sibling}function ms(i,o,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?d.insertBefore(i,o):d.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for(ms(i,o,d),i=i.sibling;i!==null;)ms(i,o,d),i=i.sibling}var m0=null,er=!1;function _r(i,o,d){for(d=d.child;d!==null;)Bc(i,o,d),d=d.sibling}function Bc(i,o,d){if(pr&&typeof pr.onCommitFiberUnmount=="function")try{pr.onCommitFiberUnmount(h2,d)}catch{}switch(d.tag){case 5:jt||So(d,o);case 6:var v=m0,x=er;m0=null,_r(i,o,d),m0=v,er=x,m0!==null&&(er?(i=m0,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):m0.removeChild(d.stateNode));break;case 18:m0!==null&&(er?(i=m0,d=d.stateNode,i.nodeType===8?tc(i.parentNode,d):i.nodeType===1&&tc(i,d),Et(i)):tc(m0,d.stateNode));break;case 4:v=m0,x=er,m0=d.stateNode.containerInfo,er=!0,_r(i,o,d),m0=v,er=x;break;case 0:case 11:case 14:case 15:if(!jt&&(v=d.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){x=v=v.next;do{var S=x,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&Ia(d,o,T),x=x.next}while(x!==v)}_r(i,o,d);break;case 1:if(!jt&&(So(d,o),v=d.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=d.memoizedProps,v.state=d.memoizedState,v.componentWillUnmount()}catch(N){Wt(d,o,N)}_r(i,o,d);break;case 21:_r(i,o,d);break;case 22:d.mode&1?(jt=(v=jt)||d.memoizedState!==null,_r(i,o,d),jt=v):_r(i,o,d);break;default:_r(i,o,d)}}function Eo(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new W0),o.forEach(function(v){var x=f7.bind(null,i,v);d.has(v)||(d.add(v),v.then(x,x))})}}function wn(i,o){var d=o.deletions;if(d!==null)for(var v=0;vx&&(x=T),v&=~S}if(v=x,v=zt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Pf(v/1960))-v,10i?16:i,Ti===null)var v=!1;else{if(i=Ti,Ti=null,U0=0,(mt&6)!==0)throw Error(n(331));var x=mt;for(mt|=4,Me=i.current;Me!==null;){var S=Me,T=S.child;if((Me.flags&16)!==0){var N=S.deletions;if(N!==null){for(var K=0;Kzt()-Ic?yl(i,0):bs|=d),cn(i,o)}function Mf(i,o){o===0&&((i.mode&1)===0?o=1:(o=v2,v2<<=1,(v2&130023424)===0&&(v2=4194304)));var d=G0();i=Gr(i,o),i!==null&&(ra(i,o,d),cn(i,d))}function d7(i){var o=i.memoizedState,d=0;o!==null&&(d=o.retryLane),Mf(i,d)}function f7(i,o){var d=0;switch(i.tag){case 13:var v=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(o),Mf(i,d)}var Bf;Bf=function(i,o,d){if(i!==null)if(i.memoizedProps!==o.pendingProps||ln.current)H0=!0;else{if((i.lanes&d)===0&&(o.flags&128)===0)return H0=!1,bf(i,o,d);H0=(i.flags&131072)!==0}else H0=!1,Nt&&(o.flags&1048576)!==0&&nf(o,H2,o.index);switch(o.lanes=0,o.tag){case 2:var v=o.type;ps(i,o),i=o.pendingProps;var x=co(o,R0.current);Ci(o,d),x=pl(null,o,v,i,x,d);var S=es();return o.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,on(v)?(S=!0,_n(o)):S=!1,o.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Y2(o),x.updater=ss,o.stateNode=x,x._reactInternals=o,$c(o,v,i,d),o=Dc(null,o,v,!0,S,d)):(o.tag=0,Nt&&S&&ba(o),S0(null,o,x,d),o=o.child),o;case 16:v=o.elementType;e:{switch(ps(i,o),i=o.pendingProps,x=v._init,v=x(v._payload),o.type=v,x=o.tag=h7(v),i=Ln(v,i),x){case 0:o=kc(null,o,v,i,d);break e;case 1:o=_c(null,o,v,i,d);break e;case 11:o=gf(null,o,v,i,d);break e;case 14:o=Sc(null,o,v,Ln(v.type,i),d);break e}throw Error(n(306,v,""))}return o;case 0:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),kc(i,o,v,x,d);case 1:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),_c(i,o,v,x,d);case 3:e:{if(yf(o),i===null)throw Error(n(387));v=o.pendingProps,S=o.memoizedState,x=S.element,af(i,o),ho(o,v,null,d);var T=o.memoizedState;if(v=T.element,S.isDehydrated)if(S={element:v,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){x=vl(Error(n(423)),o),o=kr(i,o,v,d,x);break e}else if(v!==x){x=vl(Error(n(424)),o),o=kr(i,o,v,d,x);break e}else for(bn=yi(o.stateNode.containerInfo.firstChild),F0=o,Nt=!0,Xn=null,d=U2(o,null,v,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(wr(),v===x){o=Jn(i,o,d);break e}S0(i,o,v,d)}o=o.child}return o;case 5:return uc(o),i===null&&an(o),v=o.type,x=o.pendingProps,S=i!==null?i.memoizedProps:null,T=x.children,ga(v,x)?T=null:S!==null&&ga(v,S)&&(o.flags|=32),Pc(i,o),S0(i,o,T,d),o.child;case 6:return i===null&&an(o),null;case 13:return fs(i,o,d);case 4:return sc(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=Yt(o,null,v,d):S0(i,o,v,d),o.child;case 11:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),gf(i,o,v,x,d);case 7:return S0(i,o,o.pendingProps,d),o.child;case 8:return S0(i,o,o.pendingProps.children,d),o.child;case 12:return S0(i,o,o.pendingProps.children,d),o.child;case 10:e:{if(v=o.type._context,x=o.pendingProps,S=o.memoizedProps,T=x.value,Ft($a,v._currentValue),v._currentValue=T,S!==null)if(oe(S.value,T)){if(S.children===x.children&&!ln.current){o=Jn(i,o,d);break e}}else for(S=o.child,S!==null&&(S.return=o);S!==null;){var N=S.dependencies;if(N!==null){T=S.child;for(var K=N.firstContext;K!==null;){if(K.context===v){if(S.tag===1){K=qr(-1,d&-d),K.tag=2;var ae=S.updateQueue;if(ae!==null){ae=ae.shared;var be=ae.pending;be===null?K.next=K:(K.next=be.next,be.next=K),ae.pending=K}}S.lanes|=d,K=S.alternate,K!==null&&(K.lanes|=d),C0(S.return,d,o),N.lanes|=d;break}K=K.next}}else if(S.tag===10)T=S.type===o.type?null:S.child;else if(S.tag===18){if(T=S.return,T===null)throw Error(n(341));T.lanes|=d,N=T.alternate,N!==null&&(N.lanes|=d),C0(T,d,o),T=S.sibling}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}S0(i,o,x.children,d),o=o.child}return o;case 9:return x=o.type,v=o.pendingProps.children,Ci(o,d),x=An(x),v=v(x),o.flags|=1,S0(i,o,v,d),o.child;case 14:return v=o.type,x=Ln(v,o.pendingProps),x=Ln(v.type,x),Sc(i,o,v,x,d);case 15:return Pr(i,o,o.type,o.pendingProps,d);case 17:return v=o.type,x=o.pendingProps,x=o.elementType===v?x:Ln(v,x),ps(i,o),o.tag=1,on(v)?(i=!0,_n(o)):i=!1,Ci(o,d),hl(o,v,x),$c(o,v,x,d),Dc(null,o,v,!0,i,d);case 19:return Pi(i,o,d);case 22:return Ec(i,o,d)}throw Error(n(156,o.tag))};function Rf(i,o){return gd(i,o)}function p7(i,o,d,v){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function In(i,o,d,v){return new p7(i,o,d,v)}function Ps(i){return i=i.prototype,!(!i||!i.isReactComponent)}function h7(i){if(typeof i=="function")return Ps(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ve)return 11;if(i===pe)return 14}return 2}function ir(i,o){var d=i.alternate;return d===null?(d=In(i.tag,o,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=o,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,o=i.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function ks(i,o,d,v,x,S){var T=2;if(v=i,typeof i=="function")Ps(i)&&(T=1);else if(typeof i=="string")T=5;else e:switch(i){case ee:return xl(d.children,x,S,o);case L:T=8,x|=8;break;case re:return i=In(12,d,o,x|2),i.elementType=re,i.lanes=S,i;case G:return i=In(13,d,o,x),i.elementType=G,i.lanes=S,i;case Q:return i=In(19,d,o,x),i.elementType=Q,i.lanes=S,i;case se:return _s(d,x,S,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Z:T=10;break e;case Y:T=9;break e;case ve:T=11;break e;case pe:T=14;break e;case $e:T=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=In(T,d,o,x),o.elementType=i,o.type=v,o.lanes=S,o}function xl(i,o,d,v){return i=In(7,i,v,o),i.lanes=d,i}function _s(i,o,d,v){return i=In(22,i,v,o),i.elementType=se,i.lanes=d,i.stateNode={isHidden:!1},i}function Hc(i,o,d){return i=In(6,i,null,o),i.lanes=d,i}function Wc(i,o,d){return o=In(4,i.children!==null?i.children:[],i.key,o),o.lanes=d,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function v7(i,o,d,v,x){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=na(0),this.expirationTimes=na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.identifierPrefix=v,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Uc(i,o,d,v,x,S,T,N,K){return i=new v7(i,o,d,N,K),o===1?(o=1,S===!0&&(o|=8)):o=0,S=In(3,null,null,o),i.current=S,S.stateNode=i,S.memoizedState={element:v,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Y2(S),i}function m7(i,o,d){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),L7.exports=a_(),L7.exports}var pm;function s_(){if(pm)return jf;pm=1;var e=ag();return jf.createRoot=e.createRoot,jf.hydrateRoot=e.hydrateRoot,jf}var u_=s_();const c_=V1(u_);/** * react-router v7.12.0 * * Copyright (c) Remix Software Inc. @@ -55,9 +55,9 @@ * @license MIT */var hm="popstate";function d_(e={}){function t(r,l){let{pathname:s,search:u,hash:f}=r.location;return Op("",{pathname:s,search:u,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:x1(l)}return p_(t,n,null,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Vr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function f_(){return Math.random().toString(36).substring(2,10)}function vm(e,t){return{usr:e.state,key:e.key,idx:t}}function Op(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?su(t):t,state:n,key:t&&t.key||r||f_()}}function x1({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function su(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function p_(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:s=!1}=r,u=l.history,f="POP",p=null,h=m();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function m(){return(u.state||{idx:null}).idx}function y(){f="POP";let _=m(),A=_==null?null:_-h;h=_,p&&p({action:f,location:k.location,delta:A})}function w(_,A){f="PUSH";let B=Op(k.location,_,A);h=m()+1;let M=vm(B,h),V=k.createHref(B);try{u.pushState(M,"",V)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;l.location.assign(V)}s&&p&&p({action:f,location:k.location,delta:1})}function $(_,A){f="REPLACE";let B=Op(k.location,_,A);h=m();let M=vm(B,h),V=k.createHref(B);u.replaceState(M,"",V),s&&p&&p({action:f,location:k.location,delta:0})}function E(_){return h_(_)}let k={get action(){return f},get location(){return e(l,u)},listen(_){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(hm,y),p=_,()=>{l.removeEventListener(hm,y),p=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let A=E(_);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:w,replace:$,go(_){return u.go(_)}};return k}function h_(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:x1(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function sg(e,t,n="/"){return v_(e,t,n,!1)}function v_(e,t,n,r){let l=typeof t=="string"?su(t):t,s=Rl(l.pathname||"/",n);if(s==null)return null;let u=ug(e);m_(u);let f=null;for(let p=0;f==null&&p{let m={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&p)return;Qt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let y=Al([r,m.relativePath]),w=n.concat(m);u.children&&u.children.length>0&&(Qt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),ug(u.children,t,w,y,p)),!(u.path==null&&!u.index)&&t.push({path:y,score:C_(y,u.index),routesMeta:w})};return e.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,f);else for(let h of cg(u.path))s(u,f,!0,h)}),t}function cg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return l?[s,""]:[s];let u=cg(r.join("/")),f=[];return f.push(...u.map(p=>p===""?s:[s,p].join("/"))),l&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function m_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:S_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var g_=/^:[\w-]+$/,y_=3,b_=2,x_=1,w_=10,$_=-2,mm=e=>e==="*";function C_(e,t){let n=e.split("/"),r=n.length;return n.some(mm)&&(r+=$_),t&&(r+=b_),n.filter(l=>!mm(l)).reduce((l,s)=>l+(g_.test(s)?y_:s===""?x_:w_),r)}function S_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function E_(e,t,n=!1){let{routesMeta:r}=e,l={},s="/",u=[];for(let f=0;f{if(m==="*"){let E=f[w]||"";u=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const $=f[w];return y&&!$?h[m]=void 0:h[m]=($||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:u,pattern:e}}function P_(e,t=!1,n=!0){Vr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,p)=>(r.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function k_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Rl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,__=e=>dg.test(e);function D_(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?su(e):e,s;if(n)if(__(n))s=n;else{if(n.includes("//")){let u=n;n=n.replace(/\/\/+/g,"/"),Vr(!1,`Pathnames cannot have embedded double slashes - normalizing ${u} -> ${n}`)}n.startsWith("/")?s=gm(n.substring(1),"/"):s=gm(n,t)}else s=t;return{pathname:s,search:M_(r),hash:B_(l)}}function gm(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function V7(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function T_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zh(e){let t=T_(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Oh(e,t,n,r=!1){let l;typeof e=="string"?l=su(e):(l={...e},Qt(!l.pathname||!l.pathname.includes("?"),V7("?","pathname","search",l)),Qt(!l.pathname||!l.pathname.includes("#"),V7("#","pathname","hash",l)),Qt(!l.search||!l.search.includes("#"),V7("#","search","hash",l)));let s=e===""||l.pathname==="",u=s?"/":l.pathname,f;if(u==null)f=n;else{let y=t.length-1;if(!r&&u.startsWith("..")){let w=u.split("/");for(;w[0]==="..";)w.shift(),y-=1;l.pathname=w.join("/")}f=y>=0?t[y]:"/"}let p=D_(l,f),h=u&&u!=="/"&&u.endsWith("/"),m=(s||u===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(h||m)&&(p.pathname+="/"),p}var Al=e=>e.join("/").replace(/\/\/+/g,"/"),A_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),M_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,R_=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function L_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function F_(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var fg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pg(e,t){let n=e;if(typeof n!="string"||!dg.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(fg)try{let s=new URL(window.location.href),u=n.startsWith("//")?new URL(s.protocol+n):new URL(n),f=Rl(u.pathname,t);u.origin===s.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{Vr(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var hg=["POST","PUT","PATCH","DELETE"];new Set(hg);var I_=["GET",...hg];new Set(I_);var uu=b.createContext(null);uu.displayName="DataRouter";var Z5=b.createContext(null);Z5.displayName="DataRouterState";var V_=b.createContext(!1),vg=b.createContext({isTransitioning:!1});vg.displayName="ViewTransition";var N_=b.createContext(new Map);N_.displayName="Fetchers";var z_=b.createContext(null);z_.displayName="Await";var dr=b.createContext(null);dr.displayName="Navigation";var N1=b.createContext(null);N1.displayName="Location";var oi=b.createContext({outlet:null,matches:[],isDataRoute:!1});oi.displayName="Route";var Zh=b.createContext(null);Zh.displayName="RouteError";var mg="REACT_ROUTER_ERROR",O_="REDIRECT",Z_="ROUTE_ERROR_RESPONSE";function j_(e){if(e.startsWith(`${mg}:${O_}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function K_(e){if(e.startsWith(`${mg}:${Z_}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new R_(t.status,t.statusText,t.data)}catch{}}function H_(e,{relative:t}={}){Qt(cu(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=b.useContext(dr),{hash:l,pathname:s,search:u}=z1(e,{relative:t}),f=s;return n!=="/"&&(f=s==="/"?n:Al([n,s])),r.createHref({pathname:f,search:u,hash:l})}function cu(){return b.useContext(N1)!=null}function Ol(){return Qt(cu(),"useLocation() may be used only in the context of a component."),b.useContext(N1).location}var gg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yg(e){b.useContext(dr).static||b.useLayoutEffect(e)}function bg(){let{isDataRoute:e}=b.useContext(oi);return e?lD():W_()}function W_(){Qt(cu(),"useNavigate() may be used only in the context of a component.");let e=b.useContext(uu),{basename:t,navigator:n}=b.useContext(dr),{matches:r}=b.useContext(oi),{pathname:l}=Ol(),s=JSON.stringify(zh(r)),u=b.useRef(!1);return yg(()=>{u.current=!0}),b.useCallback((p,h={})=>{if(Vr(u.current,gg),!u.current)return;if(typeof p=="number"){n.go(p);return}let m=Oh(p,JSON.parse(s),l,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Al([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,l,e])}b.createContext(null);function U_(){let{matches:e}=b.useContext(oi),t=e[e.length-1];return t?t.params:{}}function z1(e,{relative:t}={}){let{matches:n}=b.useContext(oi),{pathname:r}=Ol(),l=JSON.stringify(zh(n));return b.useMemo(()=>Oh(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function G_(e,t){return xg(e,t)}function xg(e,t,n,r,l){var B;Qt(cu(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=b.useContext(dr),{matches:u}=b.useContext(oi),f=u[u.length-1],p=f?f.params:{},h=f?f.pathname:"/",m=f?f.pathnameBase:"/",y=f&&f.route;{let M=y&&y.path||"";$g(h,!y||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let w=Ol(),$;if(t){let M=typeof t=="string"?su(t):t;Qt(m==="/"||((B=M.pathname)==null?void 0:B.startsWith(m)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${M.pathname}" was given in the \`location\` prop.`),$=M}else $=w;let E=$.pathname||"/",k=E;if(m!=="/"){let M=m.replace(/^\//,"").split("/");k="/"+E.replace(/^\//,"").split("/").slice(M.length).join("/")}let _=sg(e,{pathname:k});Vr(y||_!=null,`No routes matched location "${$.pathname}${$.search}${$.hash}" `),Vr(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${$.pathname}${$.search}${$.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let A=J_(_&&_.map(M=>Object.assign({},M,{params:Object.assign({},p,M.params),pathname:Al([m,s.encodeLocation?s.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?m:Al([m,s.encodeLocation?s.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),u,n,r,l);return t&&A?b.createElement(N1.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...$},navigationType:"POP"}},A):A}function q_(){let e=iD(),t=L_(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:l},n):null,u)}var Y_=b.createElement(q_,null),wg=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=K_(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(oi.Provider,{value:this.props.routeContext},b.createElement(Zh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(X_,{error:e},t):t}};wg.contextType=V_;var N7=new WeakMap;function X_({children:e,error:t}){let{basename:n}=b.useContext(dr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=j_(t.digest);if(r){let l=N7.get(t);if(l)throw l;let s=pg(r.location,n);if(fg&&!N7.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw N7.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function Q_({routeContext:e,match:t,children:n}){let r=b.useContext(uu);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(oi.Provider,{value:e},n)}function J_(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,u=n==null?void 0:n.errors;if(u!=null){let m=s.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Qt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let f=!1,p=-1;if(n)for(let m=0;m=0?s=s.slice(0,p+1):s=[s[0]];break}}}let h=n&&r?(m,y)=>{var w,$;r(m,{location:n.location,params:(($=(w=n.matches)==null?void 0:w[0])==null?void 0:$.params)??{},unstable_pattern:F_(n.matches),errorInfo:y})}:void 0;return s.reduceRight((m,y,w)=>{let $,E=!1,k=null,_=null;n&&($=u&&y.route.id?u[y.route.id]:void 0,k=y.route.errorElement||Y_,f&&(p<0&&w===0?($g("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):p===w&&(E=!0,_=y.route.hydrateFallbackElement||null)));let A=t.concat(s.slice(0,w+1)),B=()=>{let M;return $?M=k:E?M=_:y.route.Component?M=b.createElement(y.route.Component,null):y.route.element?M=y.route.element:M=m,b.createElement(Q_,{match:y,routeContext:{outlet:m,matches:A,isDataRoute:n!=null},children:M})};return n&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?b.createElement(wg,{location:n.location,revalidation:n.revalidation,component:k,error:$,children:B(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):B()},null)}function jh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eD(e){let t=b.useContext(uu);return Qt(t,jh(e)),t}function tD(e){let t=b.useContext(Z5);return Qt(t,jh(e)),t}function nD(e){let t=b.useContext(oi);return Qt(t,jh(e)),t}function Kh(e){let t=nD(e),n=t.matches[t.matches.length-1];return Qt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function rD(){return Kh("useRouteId")}function iD(){var r;let e=b.useContext(Zh),t=tD("useRouteError"),n=Kh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function lD(){let{router:e}=eD("useNavigate"),t=Kh("useNavigate"),n=b.useRef(!1);return yg(()=>{n.current=!0}),b.useCallback(async(l,s={})=>{Vr(n.current,gg),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...s}))},[e,t])}var ym={};function $g(e,t,n){!t&&!ym[e]&&(ym[e]=!0,Vr(!1,n))}b.memo(oD);function oD({routes:e,future:t,state:n,onError:r}){return xg(e,void 0,n,r,t)}function bm({to:e,replace:t,state:n,relative:r}){Qt(cu()," may be used only in the context of a component.");let{static:l}=b.useContext(dr);Vr(!l," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:s}=b.useContext(oi),{pathname:u}=Ol(),f=bg(),p=Oh(e,zh(s),u,r==="path"),h=JSON.stringify(p);return b.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:r})},[f,h,r,t,n]),null}function Ya(e){Qt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function aD({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:s=!1,unstable_useTransitions:u}){Qt(!cu(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:f,navigator:l,static:s,unstable_useTransitions:u,future:{}}),[f,l,s,u]);typeof n=="string"&&(n=su(n));let{pathname:h="/",search:m="",hash:y="",state:w=null,key:$="default"}=n,E=b.useMemo(()=>{let k=Rl(h,f);return k==null?null:{location:{pathname:k,search:m,hash:y,state:w,key:$},navigationType:r}},[f,h,m,y,w,$,r]);return Vr(E!=null,` is not able to match the URL "${h}${m}${y}" because it does not start with the basename, so the won't render anything.`),E==null?null:b.createElement(dr.Provider,{value:p},b.createElement(N1.Provider,{children:t,value:E}))}function sD({children:e,location:t}){return G_(Zp(e),t)}function Zp(e,t=[]){let n=[];return b.Children.forEach(e,(r,l)=>{if(!b.isValidElement(r))return;let s=[...t,l];if(r.type===b.Fragment){n.push.apply(n,Zp(r.props.children,s));return}Qt(r.type===Ya,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Qt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Zp(r.props.children,s)),n.push(u)}),n}var r5="get",i5="application/x-www-form-urlencoded";function j5(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uD(e){return j5(e)&&e.tagName.toLowerCase()==="button"}function cD(e){return j5(e)&&e.tagName.toLowerCase()==="form"}function dD(e){return j5(e)&&e.tagName.toLowerCase()==="input"}function fD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pD(e,t){return e.button===0&&(!t||t==="_self")&&!fD(e)}var Kf=null;function hD(){if(Kf===null)try{new FormData(document.createElement("form"),0),Kf=!1}catch{Kf=!0}return Kf}var vD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function z7(e){return e!=null&&!vD.has(e)?(Vr(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${i5}"`),null):e}function mD(e,t){let n,r,l,s,u;if(cD(e)){let f=e.getAttribute("action");r=f?Rl(f,t):null,n=e.getAttribute("method")||r5,l=z7(e.getAttribute("enctype"))||i5,s=new FormData(e)}else if(uD(e)||dD(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a